Tuesday, February 2, 2016

Skipping along with upd7810

I'm fascinated by the ap2000 driver in mess and was trying to wrap my head around the "skippy" nature of the cpu. If the skip flag is set, skip the current instruction.

So let's trace in the mess debugger.

trace mytrace.tr,0,{tracelog "PSW_SKIP= %02X ",psw&0x20}

creates this trace log:

PSW_SKIP= 00 2C4F: CALT ($00B2)
PSW_SKIP= 00 0050: CALB
PSW_SKIP= 00 0FE4: CALL $0FBF
PSW_SKIP= 00 0FBF: MOV A,PA
PSW_SKIP= 00 0FC1: MOV B,A
PSW_SKIP= 00 0FC2: MOV A,PA
PSW_SKIP= 00 0FC4: EQA A,B
PSW_SKIP= 20 0FC6: JR $0FBF
PSW_SKIP= 00 0FC7: RET
PSW_SKIP= 00 0FE7: ONI A,$40
PSW_SKIP= 20 0FE9: RETS
PSW_SKIP= 00 0FEA: RET
PSW_SKIP= 00 0052: RETS
PSW_SKIP= 20 2C50: CALL $2C79
PSW_SKIP= 00 2C53: LXI BC,$0FEB
PSW_SKIP= 00 2C56: CALT ($00B2)
PSW_SKIP= 00 0050: CALB
PSW_SKIP= 00 0FEB: CALL $0FBF

(loops for 6 instructions)


Ah. Much better.

No comments:

Post a Comment