From 7b77f1218624ea26dbb2efd85a19f795f5d4e02e Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 17 Dec 2007 15:19:59 +0000 Subject: Initial checkin of MAME 0.121. --- src/emu/cpu/v60/am.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/emu/cpu/v60/am.c (limited to 'src/emu/cpu/v60/am.c') 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](); +} + + -- cgit v1.2.3-70-g09d2