summaryrefslogtreecommitdiff
path: root/opcode.h
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 /opcode.h
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 'opcode.h')
-rw-r--r--opcode.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/opcode.h b/opcode.h
index 1e5d820..5f952b3 100644
--- a/opcode.h
+++ b/opcode.h
@@ -13,11 +13,11 @@
#define EXT_OPNUM 49
#define ORTHO_OPNUM 16
-#define C (1 << 0) /* Carry flag. */
-#define Z (1 << 1) /* Zero flag. */
-#define I (1 << 2) /* Interrupt flag. */
-#define V (1 << 6) /* oVerflow flag. */
-#define N (1 << 7) /* Negative flag. */
+#define C (1 << 0) /* Carry flag. */
+#define Z (1 << 1) /* Zero flag. */
+#define I (1 << 2) /* Interrupt flag. */
+#define V (1 << 6) /* oVerflow flag. */
+#define N (1 << 7) /* Negative flag. */
/*extern uint8_t get_addrsize(uint8_t prefix, uint8_t addrmode);*/
extern char *showbits(uint64_t value, uint8_t bitnum, uint8_t dbg);
@@ -74,6 +74,7 @@ struct op {
uint8_t rind[2]; /* Register(s) used for register indirect. */
uint8_t scale; /* Scale used for SIB. */
int is_ind : 1; /* Flag used to determine if this operand is an indirect mode. */
+ uint8_t cc; /* Condition code. 3 bits. */
uint64_t value; /* Value of operand (used only by memory operands). */
};