Appvars
In the last tutorial we pointed out that you can not create permanent self modifying code.
This is bugging me because you definitely can do this. The OS leaves the name of the executing program in OP1, so you can do something like:
bcall(_ChkFindSym)
ld hl,smc_num-9D95h+4 ;+4 because DE points tot he size bytes and 2 bytes are the header BB6Dh
add hl,de
ld e,(hl)
inc hl
ld d,(hl)
inc de
ld (hl),d
dec hl
ld (hl),e
ex de,hl
bcall(_DispHL)
ret
smc_num:
.dw 0Note that this won't work on the uncompressed hex codes, so you need to either make sure to use AsmComp() or have it compiled by some compiler.
Z80 Assembly>English>TI-BASIC>Python>French>C>0





