First of all I needed a disassembler to translate the machine code into (somewhat) human readable format. Long story short: I found a nice one bundled with MAME (that's right, NEC 7810 was used in a rather obscure handheld console: Hartung Game Master): unidasm. It woked like a charm leaving me with a ton of mnemonics I didn't quite understand:
00000028: 54 1B 04 JMP $041B
0000002B: 69 0F MVI A,$0F
0000002D: 4D D0 MOV MM,A
0000002F: 04 00 00 LXI SP,$0000
00000032: 69 00 MVI A,$00
00000034: 70 79 00 40 MOV ($4000),A
00000038: 40 5D 00 CALL $005D
0000003B: 68 27 MVI V,$27
0000003D: 75 C5 00 EQIW VV:C5,$00
00000040: 54 7F 0A JMP $0A7F
00000043: 55 EF 10 OFFIW VV:EF,$10
00000046: 54 2C 09 JMP $092C
00000049: 55 EF 08 OFFIW VV:EF,$08
0000004C: 54 11 08 JMP $0811
0000004F: 55 F4 02 OFFIW VV:F4,$02
00000052: C6 JR $0059
00000053: 75 C2 00 EQIW VV:C2,$00
00000056: 54 C5 04 JMP $04C5
00000059: 40 34 0E CALL $0E34
0000005C: E0 JR $003D
I tried to figure out what happens inside of this little chip using its datasheet. There was a memory map, instruction set, but still it was a little bit cryptic to me. After some more googling I found a better one on www.cpcwiki.eu along with some hints about memory configuration and a sentence saying that "The assembler syntax is rather confusing". You bet it is. Nevertheless I managed to "decrypt" some code, starting from the reset vector. I was basically looking for some read/write operations on ports PA and PB to find out where the switch presses are handled. Looking at the source code I saw a few places that worried me - especially "illegal" mnemonics and some hard coded numbers used to (probably) access memory. Long way to go. Wish me luck!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.