diff options
Diffstat (limited to 'headers/instructions.h')
-rw-r--r-- | headers/instructions.h | 23 |
1 files changed, 13 insertions, 10 deletions
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); } |