mirror of
https://github.com/hsoft/collapseos.git
synced 2024-09-06 23:48:44 +10:00
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.
16 lines
363 B
Plaintext
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
|