Browse Source

z80 asm: document the 0x8000 limitation better

When I get bitten by it myself, it's because it's clearly
underdocumented!
master
Virgil Dupras 3 years ago
parent
commit
63d2c97386
2 changed files with 7 additions and 3 deletions
  1. +4
    -3
      blk.fs
  2. +3
    -0
      doc/asm.txt

+ 4
- 3
blk.fs View File

@@ -291,10 +291,11 @@ CREATE lblnext 0 , ( stable ABI until set in B300 )
( ----- 026 )
( 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 ! ;
: BEGIN,
PC DUP 0x8000 AND IF ABORT" PC must be < 0x8000" THEN ;
: BSET BEGIN, SWAP ! ;
( same as BSET, but we need to write a placeholder )
: FJR, PC 0 C, ;
: FJR, BEGIN, 0 C, ;
: IFZ, JRNZ, FJR, ;
: IFNZ, JRZ, FJR, ;
: IFC, JRNC, FJR, ;


+ 3
- 0
doc/asm.txt View File

@@ -60,6 +60,9 @@ labels, write happen before set. The write operation writes a
dummy placeholder, and then the set operation writes the offset
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
front of them. Examples:



Loading…
Cancel
Save