mirror of
https://github.com/JorjBauer/aiie.git
synced 2025-01-14 13:33:08 +00:00
show bytes in disassembly
This commit is contained in:
parent
12d4f7bdf2
commit
579e7e9f79
@ -133,6 +133,7 @@ uint8_t Disassembler::instructionToMnemonic(uint16_t addr, uint8_t *p, char *out
|
|||||||
addrmode amode = opcodes[*p].mode;
|
addrmode amode = opcodes[*p].mode;
|
||||||
uint16_t target = 0;
|
uint16_t target = 0;
|
||||||
char arg[40] = "\0";
|
char arg[40] = "\0";
|
||||||
|
char bytes[10] = "\0";
|
||||||
|
|
||||||
switch (amode) {
|
switch (amode) {
|
||||||
case A_REL:
|
case A_REL:
|
||||||
@ -153,14 +154,19 @@ uint8_t Disassembler::instructionToMnemonic(uint16_t addr, uint8_t *p, char *out
|
|||||||
switch (instructionBytes(*p)) {
|
switch (instructionBytes(*p)) {
|
||||||
case 1:
|
case 1:
|
||||||
// no arguments
|
// no arguments
|
||||||
|
sprintf(bytes, " %.2X ", *(uint8_t *)p);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
sprintf(arg, "%s$%X%s", om.prefix, target, om.suffix);
|
||||||
|
sprintf(bytes, " %.2X %.2X ", *(uint8_t *)p, *(uint8_t *)(p+1));
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sprintf(arg, "%s$%X%s", om.prefix, target, om.suffix);
|
sprintf(arg, "%s$%X%s", om.prefix, target, om.suffix);
|
||||||
|
sprintf(bytes, "%.2X %.2X %.2X ", *(uint8_t *)p, *(uint8_t *)(p+1), *(uint8_t *)(p+2));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(outp, "$%.4X %s %s", addr, mn, arg);
|
sprintf(outp, "$%.4X %s %s %s", addr, bytes, mn, arg);
|
||||||
|
|
||||||
return instructionBytes(*p);
|
return instructionBytes(*p);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user