summaryrefslogtreecommitdiff
path: root/sux.h
diff options
context:
space:
mode:
Diffstat (limited to 'sux.h')
-rw-r--r--sux.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/sux.h b/sux.h
index 2b608f1..84cc3a6 100644
--- a/sux.h
+++ b/sux.h
@@ -25,37 +25,9 @@ extern uint8_t subdbg;
extern uint8_t step;
extern uint8_t esc;
-static inline uint8_t get_addrsize(uint8_t prefix, uint8_t addrmode);
-
-enum sw_type {RS, AM, BYTE};
-
#define setflag(flag, bit) ((flag)) ? (cpu->ps.u8[thread] |= bit) : (cpu->ps.u8[thread] &= ~bit)
#define getflag(bit) (cpu->ps.u8[thread] & bit)
-/* reg_expr, and val_expr are the arithmetic expressions
- * that will be used for either the value, or register, such as '+', or '-'.
- */
-#define setreg(reg, reg_expr, reg_idx, val, val_expr, val_idx, size) {\
- switch (size) {\
- case 7: reg[(reg_idx) reg_expr 7] = val[(val_idx) val_expr 7];\
- case 6: reg[(reg_idx) reg_expr 6] = val[(val_idx) val_expr 6];\
- case 5: reg[(reg_idx) reg_expr 5] = val[(val_idx) val_expr 5];\
- case 4: reg[(reg_idx) reg_expr 4] = val[(val_idx) val_expr 4];\
- case 3: reg[(reg_idx) reg_expr 3] = val[(val_idx) val_expr 3];\
- case 2: reg[(reg_idx) reg_expr 2] = val[(val_idx) val_expr 2];\
- case 1: reg[(reg_idx) reg_expr 1] = val[(val_idx) val_expr 1];\
- case 0: reg[(reg_idx) reg_expr 0] = val[(val_idx) val_expr 0];\
- }\
-}
-
-#define setreg_sw(reg, reg_idx, val, val_idx, prefix, addrmode, type) {\
- switch (type) {\
- case RS: setreg(reg, +, reg_idx, val, +, val_idx, (1 << (prefix >> 4))-1); break;\
- case AM: setreg(reg, +, reg_idx, val, +, val_idx, get_addrsize(prefix, addrmode)); break;\
- }\
-}
-
-
extern pthread_mutex_t mutex;
extern pthread_mutex_t main_mutex;
extern pthread_cond_t cond;
@@ -67,29 +39,6 @@ extern void disasm(struct sux *cpu, uint64_t *operands, uint8_t lines, uint8_t o
extern void io(uint64_t address, uint8_t rw);
-static inline uint8_t get_addrsize(uint8_t prefix, uint8_t addrmode) {
- uint8_t id = (prefix & 0x0C) >> 2;
- switch (addrmode) {
- case ZM:
- switch (id) {
- case 2: return 5;
- case 3: return 3;
- case 1: return 2;
- case 0: return 0;
- }
- break;
- case ABS:
- switch (id) {
- case 3: return 7;
- case 2: return 6;
- case 1: return 4;
- case 0: return 1;
- }
- break;
- }
- return 0;
-}
-
static inline uint64_t get_addr(struct sux *cpu, uint64_t *tmpaddr, uint8_t opcode, uint8_t prefix, uint8_t thread) {
union reg address;
union reg value;