summaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h64
1 files changed, 28 insertions, 36 deletions
diff --git a/opcode.h b/opcode.h
index 1a7ae53..47fe125 100644
--- a/opcode.h
+++ b/opcode.h
@@ -211,8 +211,6 @@ struct sux {
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. */
-
};
typedef struct {
@@ -231,6 +229,34 @@ typedef struct {
opent opcodes[OPNUM];
enum {IMPL, IMM, ZM, ZMX, ZMY, ABS, IND, INDX, INDY};
+enum {
+ DIR_ORG,
+ DIR_BYTE,
+ DIR_WORD,
+ DIR_DWORD,
+ DIR_QWORD
+};
+
+enum {
+ TOK_DIR,
+ TOK_LABEL,
+ TOK_SYM,
+ TOK_STRING,
+ TOK_CHAR,
+ TOK_OPCODE,
+ TOK_RS,
+ TOK_COMMENT,
+ TOK_HEX,
+ TOK_DEC,
+ TOK_BIN
+};
+
+enum {
+ BASE_HEX,
+ BASE_DEC,
+ BASE_BIN
+};
+
static const char *adrmode[9] = {
[0] = "IMPL",
[1] = "IMM",
@@ -806,37 +832,3 @@ static const char *opname[0x100] = {
};
extern int asmmon();
-extern void adc(struct sux *cpu, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern void sbc(struct sux *cpu, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern void mul(struct sux *cpu, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern void divd(struct sux *cpu, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern uint64_t and(struct sux *cpu, uint64_t value, uint8_t thread);
-extern void and_addr(struct sux *cpu, uint64_t* const reg, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern uint64_t or(struct sux *cpu, uint64_t value, uint8_t thread);
-extern void or_addr(struct sux *cpu, uint64_t* const reg, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern uint64_t xor(struct sux *cpu, uint64_t value, uint8_t thread);
-extern void xor_addr(struct sux *cpu, uint64_t* const reg, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern void rol(struct sux *cpu, uint64_t adr, uint8_t thread);
-extern void ror(struct sux *cpu, uint64_t adr, uint8_t thread);
-extern void lsl(struct sux *cpu, uint64_t adr, uint8_t thread);
-extern void lsr(struct sux *cpu, uint64_t adr, uint8_t thread);
-extern void inc(struct sux *cpu, uint64_t *reg, uint8_t thread);
-extern void inc_addr(struct sux *cpu, uint64_t adr, uint8_t thread);
-extern void dec(struct sux *cpu, uint64_t *reg, uint8_t thread);
-extern void dec_addr(struct sux *cpu, uint64_t adr, uint8_t thread);
-extern void stt(struct sux *cpu, uint8_t value);
-extern void ent(struct sux *cpu, uint8_t value);
-extern void ld(struct sux *cpu, uint64_t *reg, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern void st(struct sux *cpu, uint64_t *reg, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern void push(struct sux *cpu, uint8_t value);
-extern uint8_t pull(struct sux *cpu);
-extern void cmp_addr(struct sux *cpu, uint64_t reg, uint64_t adr, uint8_t thread, uint8_t regsize);
-extern void cmp(struct sux *cpu, uint64_t reg1, uint64_t reg2, uint8_t thread);
-extern void bfs(struct sux *cpu, uint8_t flag, uint64_t adr, uint8_t thread);
-extern void bfc(struct sux *cpu, uint8_t flag, uint64_t adr, uint8_t thread);
-extern void setps(struct sux *cpu, uint8_t thread);
-extern uint64_t immaddr(struct sux *cpu, uint8_t thread, uint8_t size);
-extern uint64_t absaddr(struct sux *cpu, uint8_t thread);
-extern uint32_t zeromtx(struct sux *cpu, uint8_t thread);
-extern uint32_t zeromx(struct sux *cpu, uint8_t thread);
-extern uint32_t zeromy(struct sux *cpu, uint8_t thread);