From f86d973b2f5318b5e761e2f682c2aa57d61eb0d6 Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Thu, 27 Apr 2023 11:19:33 +1000 Subject: Major progress on interpreter --- headers/addressing.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'headers/addressing.h') diff --git a/headers/addressing.h b/headers/addressing.h index 58df3f5..d1b8371 100644 --- a/headers/addressing.h +++ b/headers/addressing.h @@ -33,7 +33,7 @@ typedef struct AddData AddData; //Holds address of current instruction. void* current_instruction; -Addressing fAddressGetLength(Addressing addr){ +int fAddressGetLength(Addressing addr){ switch(addr){ case eAbsolute: case eAbsoluteIndexedX: case eAbsoluteIndexedY: return 3; @@ -44,6 +44,20 @@ Addressing fAddressGetLength(Addressing addr){ } } +int fAddressGetLengthPrempt(int i){ //Check the functions to make sure that there isnt some incorrect values being given for length. + switch(i){ + case 0x6D: case 0x7D: case 0x79: case 0x2D: case 0x3D: case 0x39: case 0x0E: case 0x1E: case 0x2C: case 0xCD: case 0xD0: case 0xD9: case 0xEC: + case 0xCC: case 0xCE: case 0xDE: case 0x4D: case 0x5D: case 0x59: case 0xEE: case 0xFE: case 0x4C: case 0x20: case 0xAD: case 0xBD: case 0xB9: + case 0xAE: case 0xBE: case 0xAC: case 0xBC: case 0x4E: case 0x5E: case 0x0D: case 0x1D: case 0x19: case 0x2E: case 0x3E: case 0x6E: case 0x7E: + case 0xED: case 0xFD: case 0xF9: case 0x8D: case 0x9D: case 0x99: case 0x8E: case 0x8C: + return 3; + case 0x0A: case 0x2A: case 0x4A: case 0x6A: + return 1; + default: + return 2; + } +} + AddData fAddress(Addressing addr, short x) { AddData ret; -- cgit v1.2.3