collapseos/blk/286
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
542 B
Plaintext

lblnext BSET PC ORG @ 0x1b + ! ( next )
( This routine is jumped to at the end of every word. In it,
we jump to current IP, but we also take care of increasing
it by 2 before jumping. )
( Before we continue: are stacks within bounds? )
( PS ) HL PS_ADDR LDdn,
SP SUBHLd,
JRC, lblofl BWR ( abortUnderflow-B285 )
( RS ) IX PUSH, HL POP,
DE RS_ADDR LDdn,
DE SUBHLd,
JRC, lblofl BWR ( IX < RS_ADDR? abortUnderflow-B285 )
LDA(BC), E A LDrr, BC INCd,
LDA(BC), D A LDrr, BC INCd,
( continue to execute )