summaryrefslogtreecommitdiff
path: root/sux.c
diff options
context:
space:
mode:
Diffstat (limited to 'sux.c')
-rw-r--r--sux.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sux.c b/sux.c
index 9ae05f5..49ec881 100644
--- a/sux.c
+++ b/sux.c
@@ -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;