Closed myon98 closed 2 months ago
https://evoecu.logic.net/mirror/cpudocs/h8539f/H8%205XX%20Programming.pdf#page=83
MOV:G.W #imm, <EAd>
seems to share the same structure of EA and opcode being able to specify operand width independently. And in the case of MOV the manual explicitly says that the 8-bit immediate gets sign extended in case the target is a word.
Also I found out that binutils up to 2.30 also supports H8/500 that results in a working h8500-coff-objdump
, but fails to decode CMP:G.W #imm8, <EAd>
as well.
I wasn't able to find documentation on what happenes when the operand size and immediate size of
CMP:G.W
mismatches. (The disassembler DASMH85 that I was using also choked on such opcode.)However in the ROM code handling DRUM SysEx parameters, there was an instruction that was comparing a word sized memory containing 0xFFFF with a byte sized immediate 0xFF. When I changed the H8/500 emulation to sign extend the immediate byte in such cases, the "DT1 Data Error" (#20, #21) disappeared.