Bug found in encoding the instruction "MOV direct, direct".
SDCC Version : 4.5.0
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/r800/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02/f8 TD- 4.5.0 #15242 (MINGW64)
published under GNU General Public License (GPL)
Wrong Hex CODING
0030 756AAE MOV 0x6A,#0xAE ; Initialize address location 0x6A with data 0xAE
0033 856A7A MOV 0x7A, 0x6A ; copy data from address 0x6A to 0x7A
0036 E57A MOV A,0x7A ; Get data into ACC from address 0x7A
Note 1: ACC should have data 0xAE after executing this code, but ACC will
Correct Hex coding :6A and 7A positions should be correct; 7A first and 6A next in the coding
0033 857A6A MOV 0x7A, 0x6A ; address direct to direct
Note 2: This is a simple code, I think it is enough to reproduce at your end.
The hex coding is correct. Refer to the intel MCS-51 programmer's guide.
Gabriele. Yes, I agree with you. There are huge differences in documentation which confused a lot.
What I understand is,
Assembly Instruction:
MOV dst_addr, src_addr;
Hex code:
OPCODE, src_addr, dst_addr; (Resersing of address bytes), it is to facilitate read fist and write next;
Thank you for the response.
Ramesh Maddara