mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 06:08:06 +11:00
91f79d1131
The idea is to consider assemblers as "runtime" apps instead of placing them in the "bootstrap" section of the blocks. These apps will be used for much more than bootstrapping. Moved its documentation to doc/asm.txt and made its code blocks more compact.
17 lines
464 B
Plaintext
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! ;
|