diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2020-06-13 19:18:49 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2020-06-13 19:18:49 -0400 |
commit | da19d2f59353ade607c715ed9ab7b81ba1407411 (patch) | |
tree | 53d717414101477c1bb6939d5915fab3880e84f8 /sux.c | |
parent | f0d11f5dfad5dc19d5a274024933bb4c998d38a9 (diff) |
Optimized, and cleaned up the codebase.
Diffstat (limited to 'sux.c')
-rw-r--r-- | sux.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -47,6 +47,29 @@ double ipc; struct timeval str[THREADS], en[THREADS]; #endif +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; +} + void *run(void *args) { struct suxthr *thr = (void *)args; struct sux *cpu = &thr->sx; |