summaryrefslogtreecommitdiff
path: root/headers/instructions.h
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-04-21 16:12:16 +1000
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-04-21 16:12:16 +1000
commit83e8a4494741e6257b18267a58fe8ae342e3229f (patch)
tree001d5094f713118834e9a0fb5313df4cf40ecc7a /headers/instructions.h
parentae800796cdcce21c561bcbfbc96b29efe4d39a0b (diff)
changed dirs, now testing instructions.
Diffstat (limited to 'headers/instructions.h')
-rw-r--r--headers/instructions.h23
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);
}