1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-06 01:30:55 +11:00
collapseos/blk/328
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
363 B
Plaintext

CODE S= EXX, ( protect BC )
DE POP, HL POP, chkPS,
LDA(DE),
(HL) CPr,
IFZ, ( same size? )
B A LDrr, ( loop A times )
BEGIN,
HL INCd, DE INCd,
LDA(DE),
(HL) CPr,
JRNZ, BREAK, ( not equal? break early. NZ is set. )
DJNZ, AGAIN,
THEN,
PUSHZ,
EXX, ( unprotect BC ) ;CODE