Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
536B

  1. ( L1 LBL! .. L1 ' RJMP LBL, )
  2. : LBL! ( l -- ) PC SWAP ! ;
  3. : LBL, ( l op -- ) SWAP @ 1- SWAP EXECUTE A,, ;
  4. : SKIP, PC 0 A,, ;
  5. : TO, ( opw pc )
  6. ( warning: pc is a PC offset, not a mem addr! )
  7. 2 * ORG @ + PC 1- H@ ( opw addr tgt hbkp )
  8. ROT HERE ! ( opw tgt hbkp ) SWAP ROT EXECUTE H@ ! ( hbkp )
  9. HERE ! ;
  10. ( L1 FLBL, .. L1 ' RJMP FLBL! )
  11. : FLBL, ( l -- ) LBL! 0 A,, ;
  12. : FLBL! ( l opw -- ) SWAP @ TO, ;
  13. : BEGIN, PC ; : AGAIN?, ( op ) SWAP 1- SWAP EXECUTE A,, ;
  14. : AGAIN, ['] RJMP AGAIN?, ;
  15. : IF, ['] BREQ SKIP, ; : THEN, TO, ;