From 83e8a4494741e6257b18267a58fe8ae342e3229f Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Fri, 21 Apr 2023 16:12:16 +1000 Subject: changed dirs, now testing instructions. --- headers/instructions.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'headers/instructions.h') diff --git a/headers/instructions.h b/headers/instructions.h index 96f5719..bdcd442 100644 --- a/headers/instructions.h +++ b/headers/instructions.h @@ -1,13 +1,16 @@ -// instruction.h +// instructions.h // Definition of all instruction functions, handling effect of instruction and flags. -// array/map of pointers which all point -// to the functions which the index corresponds to. -// use that like a sort of map +AddData idata; -//Instruction Data -AddData idata; +/* TO DO + +!!!!!!!! CHECK THAT idata.value IS USED ACROSS ALL FUNCTIONS, NOT VAL !!!!!!!!!!!!!! + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Fix all functions before performing testing + +*/ // Load and Store Instructions @@ -206,15 +209,15 @@ void fBIT(Addressing addr, address val){ idata = fAddress(addr, val); // Shift and Rotate Instructions void fASL(Addressing addr, address val){ idata = fAddress(addr, val); - setFlag(flag_C, (val & 0x80)); - acc = (val << 1); + setFlag(flag_C, (idata.value & 0x80)); + acc = (idata.value << 1); setFlagN(acc); setFlagZ(acc); } void fLSR(Addressing addr, address val){ idata = fAddress(addr, val); - setFlag(flag_C, (val & 0x01)); - acc = (val >> 1); + setFlag(flag_C, (idata.value & 0x01)); + acc = (idata.value >> 1); setFlagN(acc); setFlagZ(acc); } -- cgit v1.2.3