Closed FrengerH closed 3 years ago
Are you sure this is valid STM8 code and not data?
The PM0044 STM8 CPU Programming Manual (page 106) shows INC for "shortmem" (single byte) is the 3C opcode and the INC for "longmem" (two bytes) has prefix 72 and opcode 5C. No opcode or prefix is shown in the manual for 71, therefore the unknown instruction.
I did a search through the manual also for 71 and there's only 3 instances.. none of them are for an instruction...
You're right. I've been mistaken between the inc instruction with direct addressing and the inc instruction with pointers which also have the 3c opcode, but those both have a prefix. I'll close the issue since it's not an issue with the disassembler.
Cool... if you see anything else, please bring it up so it can be looked into. I'd like the assembler / disassembler to be as bug-free as possible.
This piece of stm8 binary
Disassembles to the following instructions.
As you see there is an unknown instruction. I expect the issue is that the 3c op-code is a two byte inc, instead of a one byte inc to which it's disassembled now. I did look into the code a bit, but I'm not sure how this can be detected since there is no prefix and both the 1 byte inc and two byte inc have the 3c op-code.