2020-05-19 12:28:58 +10:00
|
|
|
( L1 LBL! .. L1 ' RJMP LBL, )
|
|
|
|
: LBL! ( l -- ) PC SWAP ! ;
|
|
|
|
: LBL, ( l op -- ) SWAP @ 1- SWAP EXECUTE A,, ;
|
2020-05-20 00:19:37 +10:00
|
|
|
: SKIP, PC 0 A,, ;
|
2020-05-20 00:26:57 +10:00
|
|
|
: TO, ( opw pc )
|
2020-05-20 00:19:37 +10:00
|
|
|
( warning: pc is a PC offset, not a mem addr! )
|
|
|
|
2 * ORG @ + PC 1- H@ ( opw addr tgt hbkp )
|
2020-05-19 12:28:58 +10:00
|
|
|
ROT HERE ! ( opw tgt hbkp ) SWAP ROT EXECUTE H@ ! ( hbkp )
|
|
|
|
HERE ! ;
|
2020-05-20 00:19:37 +10:00
|
|
|
( L1 FLBL, .. L1 ' RJMP FLBL! )
|
|
|
|
: FLBL, ( l -- ) LBL! 0 A,, ;
|
2020-05-20 00:26:57 +10:00
|
|
|
: FLBL! ( l opw -- ) SWAP @ TO, ;
|
2020-05-19 21:39:34 +10:00
|
|
|
: BEGIN, PC ;
|
|
|
|
: AGAIN, ( op ) SWAP 1- SWAP EXECUTE A,, ;
|
2020-05-20 00:26:57 +10:00
|
|
|
: IF, ['] BREQ SKIP, ; : THEN, TO, ;
|