mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-06 00:50:55 +11:00
f6ded7712e
This is the first commit I do entirely in VE. It's a habit I'm planning on taking as it helps a lot to find usability issues.
17 lines
537 B
Plaintext
17 lines
537 B
Plaintext
( L1 LBL! .. L1 ' RJMP LBL, )
|
|
: LBL! ( l -- ) PC SWAP ! ;
|
|
: LBL, ( l op -- ) SWAP @ 1- SWAP EXECUTE A,, ;
|
|
: SKIP, PC 0 A,, ;
|
|
: TO, ( opw pc )
|
|
( warning: pc is a PC offset, not a mem addr! )
|
|
2 * ORG @ + PC 1- H@ ( opw addr tgt hbkp )
|
|
ROT HERE ! ( opw tgt hbkp ) SWAP ROT EXECUTE H@ ! ( hbkp )
|
|
HERE ! ;
|
|
( L1 FLBL, .. L1 ' RJMP FLBL! )
|
|
: FLBL, ( l -- ) LBL! 0 A,, ;
|
|
: FLBL! ( l opw -- ) SWAP @ TO, ;
|
|
: BEGIN, PC ; : AGAIN?, ( op ) SWAP 1- SWAP EXECUTE A,, ;
|
|
: AGAIN, ['] RJMP AGAIN?, ;
|
|
: IF, ['] BREQ SKIP, ; : THEN, TO, ;
|
|
|