summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/v60/am.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2007-12-17 15:19:59 +0000
committer Aaron Giles <aaron@aarongiles.com>2007-12-17 15:19:59 +0000
commit7b77f1218624ea26dbb2efd85a19f795f5d4e02e (patch)
tree19209304095572b4fd61c2a2d6a5aa75c4e471ad /src/emu/cpu/v60/am.c
parent3da7f476068b3ffef713218ba2fc1bd5030f2c38 (diff)
Initial checkin of MAME 0.121.mame0121
Diffstat (limited to 'src/emu/cpu/v60/am.c')
-rw-r--r--src/emu/cpu/v60/am.c102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/emu/cpu/v60/am.c b/src/emu/cpu/v60/am.c
new file mode 100644
index 00000000000..d386e25d8a3
--- /dev/null
+++ b/src/emu/cpu/v60/am.c
@@ -0,0 +1,102 @@
+
+// NOTE for bit string/field addressing
+// ************************************
+// modDim must be passed as 10 for bit string instructions,
+// and as 11 for bit field instructions
+
+
+
+// Output variables for ReadAMAddress()
+static UINT8 amFlag;
+static UINT32 amOut;
+static UINT32 bamOffset;
+
+// Appo temp var
+static UINT32 amLength1,amLength2;
+
+
+// Global vars used by AM functions
+static UINT32 modAdd;
+static UINT8 modM;
+static UINT8 modVal;
+static UINT8 modVal2;
+static UINT8 modWriteValB;
+static UINT16 modWriteValH;
+static UINT32 modWriteValW;
+static UINT8 modDim;
+
+// Addressing mode functions and tables
+#include "am1.c" // ReadAM
+#include "am2.c" // ReadAMAddress
+#include "am3.c" // WriteAM
+
+/*
+ Input:
+ modAdd
+ modDim
+
+ Output:
+ amOut
+ amLength
+*/
+
+static UINT32 ReadAM(void)
+{
+ modM=modM?1:0;
+ modVal=OpRead8(modAdd);
+ return AMTable1[modM][modVal>>5]();
+}
+
+static UINT32 BitReadAM(void)
+{
+ modM=modM?1:0;
+ modVal=OpRead8(modAdd);
+ return BAMTable1[modM][modVal>>5]();
+}
+
+
+
+/*
+ Input:
+ modAdd
+ modDim
+
+ Output:
+ amOut
+ amFlag
+ amLength
+*/
+
+static UINT32 ReadAMAddress(void)
+{
+ modM=modM?1:0;
+ modVal=OpRead8(modAdd);
+ return AMTable2[modM][modVal>>5]();
+}
+
+static UINT32 BitReadAMAddress(void)
+{
+ modM=modM?1:0;
+ modVal=OpRead8(modAdd);
+ return BAMTable2[modM][modVal>>5]();
+}
+
+/*
+ Input:
+ modAdd
+ modDim
+ modWriteValB/H/W
+
+ Output:
+ amOut
+ amLength
+*/
+
+static UINT32 WriteAM(void)
+{
+ modM=modM?1:0;
+ modVal=OpRead8(modAdd);
+ return AMTable3[modM][modVal>>5]();
+}
+
+