From 093e29e4544f16f7058b6e8cf824ef789f864410 Mon Sep 17 00:00:00 2001
From: alekseiplusplus <alekseijeaves@protonmail.com>
Date: Mon, 1 May 2023 14:38:18 +1000
Subject: Removed fAddressGetLengthPrempt()

---
 src/cpu/addressing.h | 14 --------------
 src/interpreter.c    |  2 +-
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/cpu/addressing.h b/src/cpu/addressing.h
index 7a72ff5..0969025 100644
--- a/src/cpu/addressing.h
+++ b/src/cpu/addressing.h
@@ -44,20 +44,6 @@ int 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;
 
diff --git a/src/interpreter.c b/src/interpreter.c
index ed6aaee..96c4617 100644
--- a/src/interpreter.c
+++ b/src/interpreter.c
@@ -106,7 +106,7 @@ int main(int argc, char *argv[]){
         c += dCharToNum(getc(stdin));
         address x = 0x0000;
         char z = 0x00;
-        for(int i = ((fAddressGetLengthPrempt(c) * 2) - 2); i > 0; i--) {
+        for(int i = ((fAddressGetLength(*getInstructionTableAddressing(c)) * 2) - 2); i > 0; i--) {
             do {
                 z = getc(stdin);
             } while (z == ' ' || z == '\t');
-- 
cgit v1.2.3