mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 15:48:05 +11:00
z80 asm: document the 0x8000 limitation better
When I get bitten by it myself, it's because it's clearly underdocumented!
This commit is contained in:
parent
8c89fc147c
commit
63d2c97386
7
blk.fs
7
blk.fs
@ -291,10 +291,11 @@ CREATE lblnext 0 , ( stable ABI until set in B300 )
|
|||||||
( ----- 026 )
|
( ----- 026 )
|
||||||
( Place BEGIN, where you want to jump back and AGAIN after
|
( Place BEGIN, where you want to jump back and AGAIN after
|
||||||
a relative jump operator. Just like BSET and BWR. )
|
a relative jump operator. Just like BSET and BWR. )
|
||||||
: BEGIN, PC ;
|
: BEGIN,
|
||||||
: BSET PC SWAP ! ;
|
PC DUP 0x8000 AND IF ABORT" PC must be < 0x8000" THEN ;
|
||||||
|
: BSET BEGIN, SWAP ! ;
|
||||||
( same as BSET, but we need to write a placeholder )
|
( same as BSET, but we need to write a placeholder )
|
||||||
: FJR, PC 0 C, ;
|
: FJR, BEGIN, 0 C, ;
|
||||||
: IFZ, JRNZ, FJR, ;
|
: IFZ, JRNZ, FJR, ;
|
||||||
: IFNZ, JRZ, FJR, ;
|
: IFNZ, JRZ, FJR, ;
|
||||||
: IFC, JRNC, FJR, ;
|
: IFC, JRNC, FJR, ;
|
||||||
|
@ -60,6 +60,9 @@ labels, write happen before set. The write operation writes a
|
|||||||
dummy placeholder, and then the set operation writes the offset
|
dummy placeholder, and then the set operation writes the offset
|
||||||
at that placeholder's address.
|
at that placeholder's address.
|
||||||
|
|
||||||
|
Important limitation: Flow words are broken when PC reaches
|
||||||
|
0x8000. The BREAK, word relies on that 15th bit as a flag.
|
||||||
|
|
||||||
Variable actions are expected to be called with labels in
|
Variable actions are expected to be called with labels in
|
||||||
front of them. Examples:
|
front of them. Examples:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user