From 3029d54edf8baabb2841f9a6f3d88bfc993ae3e8 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Thu, 19 Dec 2019 01:02:09 -0500 Subject: Added the B register, which is used for storing the remainder during a DIV instruction. I also added the TAB, and TBA instructions, for transfering between the Accumulator, and the B register. --- opcode.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'opcode.h') diff --git a/opcode.h b/opcode.h index a759ff8..a3775db 100644 --- a/opcode.h +++ b/opcode.h @@ -29,6 +29,7 @@ #define ANX 0x24 /* bitwise ANd with X register. */ #define AAX 0x25 /* bitwise And with Accumulator, and X register. */ #define STT 0x28 /* STart Threads. */ +#define TAB 0x2C /* Transfer Accumulator to B. */ #define TSX 0x2E /* Transfer Stack pointer to X. */ #define BPO 0x30 /* Branch if POsitive. */ #define ORA 0x31 /* bitwise OR with Accumulator. */ @@ -37,6 +38,7 @@ #define ORX 0x34 /* bitwise OR with X register. */ #define OAX 0x35 /* bitwise Or with Accumulator, and X register. */ #define SEI 0x38 /* SEt Interupt flag. */ +#define TBA 0x3C /* Transfer B to Accumulator. */ #define TXS 0x3E /* Transfer X to Stack pointer. */ #define BNG 0x40 /* Branch if NeGative. */ #define XOR 0x41 /* bitwise XOR with accumulator. */ @@ -108,7 +110,7 @@ uint8_t ibcount; /* Number of bytes taken up by instruction. */ struct sux { uint64_t ps; /* The processor status register. */ - uint64_t a[8], y[8], x[8]; /* Registers A, X, and Y. */ + uint64_t a[8], b[8], y[8], x[8]; /* Registers A, B, X, and Y. */ uint64_t pc[8]; /* Program counter. */ uint16_t sp[8]; /* Stack pointer. */ uint16_t stk_st[8]; /* Starting address of each threads stack. */ @@ -160,6 +162,7 @@ static const char *opname[0x100] = { OPNAME(TSX), [0x29] = "AND a", [0x2B] = "AND zm", + OPNAME(TAB), OPNAME(BPO), [ORA] = "ORA #", [ORY] = "ORY #", @@ -170,6 +173,7 @@ static const char *opname[0x100] = { OPNAME(TXS), [0x39] = "ORA a", [0x3B] = "ORA zm", + OPNAME(TBA), OPNAME(BNG), [XOR] = "XOR #", [XRY] = "XRY #", -- cgit v1.2.3-13-gbd6f