1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-26 15:38:05 +11:00
collapseos/blk/297
Virgil Dupras e4a4a9800d z80: Use BC as IP register instead of IY
It's a bit more inconvenient in terms of register protection (BC
is much more generally useful than IY), but it makes tight spots
such as next and execute much faster, so I think it's worth it.
2020-07-06 23:31:00 -04:00

16 lines
356 B
Plaintext

CODE (br)
L1 BSET ( used in ?br and loop )
PC ORG @ 0x3d + ! ( stable ABI JP )
LDA(BC), H 0 LDri, L A LDrr,
RLA, IFC, H DECr, THEN,
BC ADDHLd, B H LDrr, C L LDrr,
;CODE
CODE (?br)
PC ORG @ 0x41 + ! ( stable ABI JP )
HL POP,
HLZ,
JRZ, L1 BWR ( br + 1. False, branch )
( True, skip next byte and don't branch )
BC INCd,
;CODE