Hi. This sounds like an ambitious project! Will be interesting to see how it progresses.
alexi wrote:
.db $c9
which I assume is EQUIB &C9 in electron assembler, am I right? and what does it do?
Yep, that should be an EQUB instruction on the Electron. It's basically an optimisation to reduce the byte count of the code. C9 is the opcode for an immediate CMP instruction. The first time through the loop, the TYA following it is consumed as the operand of the CMP and as a side effect, the carry is cleared. Subsequent iterations branch back to the TYA instruction with the carry already in the required state.