Elektrine lite

← Feed

@Hundstrasse@retro.pizza

Post #164362

2026-01-28 19:43 UTC

Long shot, but does anyone know what system variable on the #ZX81 defines if a BASIC program is currently running? Like, if you want a BASIC program to autorun, you can add a SAVE and GOTO 1, then just run from the SAVE and the running state and current line is saved so it just continues to run after load. Essentially I want a machine language program to autorun after load and as I'm planning on editing it elsewhere by creating a .p file,no just want to have one USR line and set the program as running from that point. I'm sure there's a simple answer, but searching isn't turning up anything and the ZX81 manual doesn't make it clear (I tried a few things by poking values in an emulator, but no luck) #RetroComputing

Replies (4)

  • @Hundstrasse@retro.pizza 2026-01-28 19:45

    I feel like maybe it's one of the flags, but there's no detail about what they are

    Open ##1572078

  • @tsturm@famichiki.jp 2026-01-28 22:45

    @Hundstrasse The ZX Basic returns to Basic after load, so I'm not sure you can load machine code directly to autorun.

    Open ##1572079

  • @Hundstrasse I think that bit has to be in basic, so you probably need to return to basic, save and return to asm. Easy enough. You just need a save and rand usr 16514 or similar.

    Open ##1572083

  • @drj@typo.social 2026-02-06 14:23

    @Hundstrasse So i am using the z88dk and that saves .P files that are exactly like that, they autorun and don't include the SAVE line in their BASIC program. Specifically i use the command z88dk-z80asm -l -no-synth +zx81 demo.asm So, you could either do that, or poke out with a file made by z88dk and see if you can work it out. (also, the .P files are made from an intermediate .bin file with a separate tool, so you could also use that directly)

    Open ##1572086