1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-10-04 13:56:02 +00:00

Fix little-endian issue with IND output

Also change the ADDR label to emit a hex code, not a decimal code.
This commit is contained in:
Peter Evans 2018-01-08 23:36:11 -06:00
parent 1abf0223c8
commit 3c46a41351

View File

@ -106,8 +106,8 @@ mos6502_dis_operand(mos6502 *cpu,
case IMP:
break;
case IND:
ind_address = vm_segment_get(cpu->memory, value) << 8;
ind_address |= vm_segment_get(cpu->memory, value + 1);
ind_address = vm_segment_get(cpu->memory, value + 1) << 8;
ind_address |= vm_segment_get(cpu->memory, value);
if (jump_table[ind_address]) {
mos6502_dis_label(stream, ind_address);
} else {
@ -388,7 +388,7 @@ mos6502_dis_jump_label(mos6502 *cpu,
inline void
mos6502_dis_label(FILE *stream, int address)
{
fprintf(stream, "ADDR_%d", address);
fprintf(stream, "ADDR_%x", address);
}
/*