1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-05 21:30:56 +11:00
collapseos/blk/246
Virgil Dupras 0f2d14ad8a z80a: add BREAK, instruction
This allows us to remove a lot of labels usage in boot code. This
commit has no effect on forth.bin.
2020-05-16 21:02:50 -04:00

17 lines
464 B
Plaintext

( Place BEGIN, where you want to jump back and AGAIN after
a relative jump operator. Just like BSET and BWR. )
: BEGIN, PC ;
: BSET PC SWAP ! ;
( same as BSET, but we need to write a placeholder )
: FJR, PC 0 A, ;
: IFZ, JRNZ, FJR, ;
: IFNZ, JRZ, FJR, ;
: IFC, JRNC, FJR, ;
: IFNC, JRC, FJR, ;
: THEN,
DUP PC ( l l pc )
-^ 1- ( l off )
( warning: l is a PC offset, not a mem addr! )
SWAP ORG @ + BIN( @ - ( off addr )
C! ;