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.

17 lines
460B

  1. ( Place BEGIN, where you want to jump back and AGAIN after
  2. a relative jump operator. Just like BSET and BWR. )
  3. : BEGIN, PC ;
  4. : BSET PC SWAP ! ;
  5. ( same as BSET, but we need to write a placeholder )
  6. : FJR, PC 0 A, ;
  7. : IFZ, JNZ, FJR, ;
  8. : IFNZ, JZ, FJR, ;
  9. : IFC, JNC, FJR, ;
  10. : IFNC, JC, FJR, ;
  11. : THEN,
  12. DUP PC ( l l pc )
  13. -^ 1- ( l off )
  14. ( warning: l is a PC offset, not a mem addr! )
  15. SWAP ORG @ + BIN( @ - ( off addr )
  16. C! ;