summaryrefslogtreecommitdiff
path: root/disasm.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-12-09 11:28:59 -0500
committermrb0nk500 <b0nk@b0nk.xyz>2020-12-09 11:28:59 -0500
commitb1cf9d8a524edab9363bb53c0fd70457a8bdbd76 (patch)
treedb1c1f9eeb95d112ec4a7337bd53b4c7dad8880e /disasm.c
parent464130cf4b19578f45fc51a6a37453261bdf37f9 (diff)
- Implemented support for the `set` instruction in the
assembler. The main thing I had to do was implement the parsing of the condition code token, but that wasn't hard to do, since I had already done the lexing part already. The next thing to do, will be to design a calling convention for Sux.
Diffstat (limited to 'disasm.c')
-rw-r--r--disasm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/disasm.c b/disasm.c
index 18d84bd..e0f4fbc 100644
--- a/disasm.c
+++ b/disasm.c
@@ -252,7 +252,7 @@ static void disasm_ortho(struct sux *cpu, uint8_t opcode, uint8_t prefix, uint8_
case 4: sprintf(opr[i], "%s", reg[i]); break;
}
}
- char *cc = "";
+ const char *cc = "";
char *op2 = "";
int op_count;
char *os = ""; /* Ortho Suffix. */
@@ -265,7 +265,8 @@ static void disasm_ortho(struct sux *cpu, uint8_t opcode, uint8_t prefix, uint8_
op_count = 1;
}
if (is_1cc(opcode)) {
- switch (opcode) {
+ cc = set_cc[opcode >> 5];
+ /*switch (opcode) {
case ORTHO_1CC(SET, NG): cc = "NG"; break;
case ORTHO_1CC(SET, PO): cc = "PO"; break;
case ORTHO_1CC(SET, CS): cc = "CS"; break;
@@ -274,8 +275,8 @@ static void disasm_ortho(struct sux *cpu, uint8_t opcode, uint8_t prefix, uint8_
case ORTHO_1CC(SET, NE): cc = "NE"; break;
case ORTHO_1CC(SET, VS): cc = "VS"; break;
case ORTHO_1CC(SET, VC): cc = "VC"; break;
- }
- op2 = cc;
+ }*/
+ op2 = (char *)cc;
} else if (is_2op(opcode)) {
op2 = opr[1];
}