From 3dfde833082fc66cededd0206ae5fc76162867b6 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 8 Dec 2019 20:45:55 -0500 Subject: Added support for resolving fixup labels. AKA, referencing a label before it has been declared yet. --- opcode.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'opcode.h') diff --git a/opcode.h b/opcode.h index ae637d4..990df5a 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 TSX 0x2E /* Transfer Stack pointer to X. */ #define BPO 0x30 /* Branch if POsitive. */ #define ORA 0x31 /* bitwise OR with Accumulator. */ #define ORY 0x32 /* bitwise OR with Y register. */ @@ -36,6 +37,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 TXS 0x3E /* Transfer X to Stack pointer. */ #define BNG 0x40 /* Branch if NeGative. */ #define XOR 0x41 /* bitwise XOR with accumulator. */ #define XRY 0x42 /* bitwise XoR with Y register. */ @@ -97,8 +99,6 @@ #define V ((uint64_t)1 << 6) #define N ((uint64_t)1 << 7) -#define STK_STADDR 0x010000 /* Starting address of the stack. */ - struct sux; uint8_t *addr; /* Address Space. */ @@ -108,7 +108,8 @@ struct sux { uint64_t ps; /* The processor status register. */ uint64_t a[8], y[8], x[8]; /* Registers A, X, and Y. */ uint64_t pc[8]; /* Program counter. */ - uint16_t sp; /* Stack pointer. */ + uint16_t sp[8]; /* Stack pointer. */ + uint16_t stk_st[8]; /* Starting address of each threads stack. */ uint8_t crt; /* Current running threads. */ uint8_t c[8], z[8], i[8], s[8], v[8], n[8]; /* Processor Status Flags. */ @@ -154,6 +155,7 @@ static const char *opname[0x100] = { [ANX] = "ANX #", OPNAME(AAX), OPNAME(STT), + OPNAME(TSX), [0x29] = "AND a", [0x2B] = "AND zm", OPNAME(BPO), @@ -163,6 +165,7 @@ static const char *opname[0x100] = { [ORX] = "ORX #", OPNAME(OAX), OPNAME(SEI), + OPNAME(TXS), [0x39] = "ORA a", [0x3B] = "ORA zm", OPNAME(BNG), -- cgit v1.2.3-13-gbd6f