1: //======================================================================================== 2: // MC68000.java 3: // en:MC68010 core 4: // ja:MC68010コア 5: // Copyright (C) 2003-2024 Makoto Kamada 6: // 7: // This file is part of the XEiJ (X68000 Emulator in Java). 8: // You can use, modify and redistribute the XEiJ if the conditions are met. 9: // Read the XEiJ License for more details. 10: // https://stdkmd.net/xeij/ 11: //======================================================================================== 12: 13: package xeij; 14: 15: import java.lang.*; //Boolean,Character,Class,Comparable,Double,Exception,Float,IllegalArgumentException,Integer,Long,Math,Number,Object,Runnable,SecurityException,String,StringBuilder,System 16: 17: public class MC68010 { 18: 19: public static void mpuCore () { 20: 21: //例外ループ 22: // 別のメソッドで検出された例外を命令ループの外側でcatchすることで命令ループを高速化する 23: errorLoop: 24: while (XEiJ.mpuClockTime < XEiJ.mpuClockLimit) { 25: try { 26: //命令ループ 27: while (XEiJ.mpuClockTime < XEiJ.mpuClockLimit) { 28: int t; 29: //命令を実行する 30: XEiJ.mpuTraceFlag = XEiJ.regSRT1; //命令実行前のsrT1 31: XEiJ.mpuCycleCount = 0; //第1オペコードからROMのアクセスウエイトを有効にする。命令のサイクル数はすべてXEiJ.mpuCycleCount+=~で加えること 32: XEiJ.regPC0 = t = XEiJ.regPC; //命令の先頭アドレス 33: XEiJ.regPC = t + 2; 34: XEiJ.regOC = (InstructionBreakPoint.IBP_ON ? InstructionBreakPoint.ibpOp1MemoryMap : DataBreakPoint.DBP_ON ? XEiJ.regSRS != 0 ? XEiJ.busSuperMap : XEiJ.busUserMap : XEiJ.busMemoryMap)[t >>> XEiJ.BUS_PAGE_BITS].mmdRwz (t); //第1オペコード。必ずゼロ拡張すること。pcに奇数が入っていることはないのでアドレスエラーのチェックを省略する 35: 36: //命令の処理 37: // 第1オペコードの上位10bitで分岐する 38: // 分岐方法 39: // XEiJ.IRP_STATIC 40: // 手順 41: // 命令の処理をstaticメソッドに書く 42: // switch(XEiJ.regOC>>>6)で分岐してirpXXX()で呼び出す 43: // Javaはメソッドのサイズに制限があるためswitch(XEiJ.regOC>>>6)の中にすべての命令の処理を書くことができない 44: // C言語のときはswitchの中にすべての命令の処理を書くことができる 45: // 利点 46: // 速い 47: // XEiJ.IRP_ENUM_DIRECT 48: // 手順 49: // 命令の処理をenum bodyのメソッドに書く 50: // switch(XEiJ.regOC>>>6)で分岐してIRP.XXX.exec()で呼び出す 51: // 欠点 52: // XEiJ.IRP_STATICよりも遅い 53: // staticなメソッドを直接呼び出せることに変わりないはずだが、インライン展開などの最適化が弱くなるのかも知れない 54: // XEiJ.IRP_STATICと共存させようとすると命令の処理を2回書かなければならず管理が面倒になる 55: // XEiJ.IRP_ENUM_INDIRECT 56: // 手順 57: // 命令の処理をenum bodyのメソッドに書く 58: // XEiJ.regOCの上位10bit→enum値の配列を用意する 59: // IRPMAP.IRPMAP0[XEiJ.regOC>>>6].exec()で呼び出す 60: // C言語のときは関数を指すポインタの配列が使えるのでIRPMAP0[XEiJ.regOC>>>6]()で済む 61: // 利点 62: // 命令の処理を動的に組み替えることができる 63: // 欠点 64: // XEiJ.IRP_ENUM_DIRECTよりも遅い 65: // 配列参照による多分岐とenum bodyのメソッドの動的呼び出しによる多分岐の2段階になる 66: // XEiJ.IRP_STATICと共存させようとすると命令の処理を2回書かなければならず管理が面倒になる 67: // enum値の配列の初期化コードが大きくなるのでクラスを分ける必要がある 68: irpSwitch: 69: switch (XEiJ.regOC >>> 6) { //第1オペコードの上位10ビット。XEiJ.regOCはゼロ拡張されているので0b1111_111_111&を省略 70: 71: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 72: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 73: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 74: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 75: //ORI.B #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_000_000_mmm_rrr-{data} 76: //OR.B #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_000_000_mmm_rrr-{data} [ORI.B #<data>,<ea>] 77: //ORI.B #<data>,CCR |-|012346|-|*****|*****| |0000_000_000_111_100-{data} 78: case 0b0000_000_000: 79: irpOriByte (); 80: break irpSwitch; 81: 82: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 83: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 84: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 85: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 86: //ORI.W #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_000_001_mmm_rrr-{data} 87: //OR.W #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_000_001_mmm_rrr-{data} [ORI.W #<data>,<ea>] 88: //ORI.W #<data>,SR |-|012346|P|*****|*****| |0000_000_001_111_100-{data} 89: case 0b0000_000_001: 90: irpOriWord (); 91: break irpSwitch; 92: 93: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 94: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 95: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 96: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 97: //ORI.L #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_000_010_mmm_rrr-{data} 98: //OR.L #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_000_010_mmm_rrr-{data} [ORI.L #<data>,<ea>] 99: case 0b0000_000_010: 100: irpOriLong (); 101: break irpSwitch; 102: 103: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 104: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 105: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 106: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 107: //BITREV.L Dr |-|------|-|-----|-----|D |0000_000_011_000_rrr (ISA_C) 108: case 0b0000_000_011: 109: irpCmp2Chk2Byte (); 110: break irpSwitch; 111: 112: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 113: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 114: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 115: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 116: //BTST.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_100_000_rrr 117: //MOVEP.W (d16,Ar),Dq |-|01234S|-|-----|-----| |0000_qqq_100_001_rrr-{data} 118: //BTST.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZPI|0000_qqq_100_mmm_rrr 119: case 0b0000_000_100: 120: case 0b0000_001_100: 121: case 0b0000_010_100: 122: case 0b0000_011_100: 123: case 0b0000_100_100: 124: case 0b0000_101_100: 125: case 0b0000_110_100: 126: case 0b0000_111_100: 127: irpBtstReg (); 128: break irpSwitch; 129: 130: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 131: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 132: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 133: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 134: //BCHG.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_101_000_rrr 135: //MOVEP.L (d16,Ar),Dq |-|01234S|-|-----|-----| |0000_qqq_101_001_rrr-{data} 136: //BCHG.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_qqq_101_mmm_rrr 137: case 0b0000_000_101: 138: case 0b0000_001_101: 139: case 0b0000_010_101: 140: case 0b0000_011_101: 141: case 0b0000_100_101: 142: case 0b0000_101_101: 143: case 0b0000_110_101: 144: case 0b0000_111_101: 145: irpBchgReg (); 146: break irpSwitch; 147: 148: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 149: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 150: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 151: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 152: //BCLR.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_110_000_rrr 153: //MOVEP.W Dq,(d16,Ar) |-|01234S|-|-----|-----| |0000_qqq_110_001_rrr-{data} 154: //BCLR.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_qqq_110_mmm_rrr 155: case 0b0000_000_110: 156: case 0b0000_001_110: 157: case 0b0000_010_110: 158: case 0b0000_011_110: 159: case 0b0000_100_110: 160: case 0b0000_101_110: 161: case 0b0000_110_110: 162: case 0b0000_111_110: 163: irpBclrReg (); 164: break irpSwitch; 165: 166: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 167: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 168: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 169: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 170: //BSET.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_111_000_rrr 171: //MOVEP.L Dq,(d16,Ar) |-|01234S|-|-----|-----| |0000_qqq_111_001_rrr-{data} 172: //BSET.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_qqq_111_mmm_rrr 173: case 0b0000_000_111: 174: case 0b0000_001_111: 175: case 0b0000_010_111: 176: case 0b0000_011_111: 177: case 0b0000_100_111: 178: case 0b0000_101_111: 179: case 0b0000_110_111: 180: case 0b0000_111_111: 181: irpBsetReg (); 182: break irpSwitch; 183: 184: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 185: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 186: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 187: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 188: //ANDI.B #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_001_000_mmm_rrr-{data} 189: //AND.B #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_001_000_mmm_rrr-{data} [ANDI.B #<data>,<ea>] 190: //ANDI.B #<data>,CCR |-|012346|-|*****|*****| |0000_001_000_111_100-{data} 191: case 0b0000_001_000: 192: irpAndiByte (); 193: break irpSwitch; 194: 195: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 196: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 197: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 198: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 199: //ANDI.W #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_001_001_mmm_rrr-{data} 200: //AND.W #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_001_001_mmm_rrr-{data} [ANDI.W #<data>,<ea>] 201: //ANDI.W #<data>,SR |-|012346|P|*****|*****| |0000_001_001_111_100-{data} 202: case 0b0000_001_001: 203: irpAndiWord (); 204: break irpSwitch; 205: 206: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 207: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 208: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 209: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 210: //ANDI.L #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_001_010_mmm_rrr-{data} 211: //AND.L #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_001_010_mmm_rrr-{data} [ANDI.L #<data>,<ea>] 212: case 0b0000_001_010: 213: irpAndiLong (); 214: break irpSwitch; 215: 216: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 217: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 218: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 219: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 220: //BYTEREV.L Dr |-|------|-|-----|-----|D |0000_001_011_000_rrr (ISA_C) 221: case 0b0000_001_011: 222: irpCmp2Chk2Word (); 223: break irpSwitch; 224: 225: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 226: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 227: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 228: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 229: //SUBI.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_010_000_mmm_rrr-{data} 230: //SUB.B #<data>,<ea> |A|012346|-|UUUUU|*****| M+-WXZ |0000_010_000_mmm_rrr-{data} [SUBI.B #<data>,<ea>] 231: case 0b0000_010_000: 232: irpSubiByte (); 233: break irpSwitch; 234: 235: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 236: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 237: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 238: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 239: //SUBI.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_010_001_mmm_rrr-{data} 240: //SUB.W #<data>,<ea> |A|012346|-|UUUUU|*****| M+-WXZ |0000_010_001_mmm_rrr-{data} [SUBI.W #<data>,<ea>] 241: case 0b0000_010_001: 242: irpSubiWord (); 243: break irpSwitch; 244: 245: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 246: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 247: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 248: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 249: //SUBI.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_010_010_mmm_rrr-{data} 250: //SUB.L #<data>,<ea> |A|012346|-|UUUUU|*****| M+-WXZ |0000_010_010_mmm_rrr-{data} [SUBI.L #<data>,<ea>] 251: case 0b0000_010_010: 252: irpSubiLong (); 253: break irpSwitch; 254: 255: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 256: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 257: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 258: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 259: //FF1.L Dr |-|------|-|-UUUU|-**00|D |0000_010_011_000_rrr (ISA_C) 260: case 0b0000_010_011: 261: irpCmp2Chk2Long (); 262: break irpSwitch; 263: 264: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 265: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 266: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 267: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 268: //ADDI.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_011_000_mmm_rrr-{data} 269: case 0b0000_011_000: 270: irpAddiByte (); 271: break irpSwitch; 272: 273: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 274: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 275: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 276: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 277: //ADDI.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_011_001_mmm_rrr-{data} 278: case 0b0000_011_001: 279: irpAddiWord (); 280: break irpSwitch; 281: 282: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 283: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 284: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 285: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 286: //ADDI.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_011_010_mmm_rrr-{data} 287: case 0b0000_011_010: 288: irpAddiLong (); 289: break irpSwitch; 290: 291: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 292: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 293: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 294: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 295: //BTST.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_000_000_rrr-{data} 296: //BTST.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZP |0000_100_000_mmm_rrr-{data} 297: case 0b0000_100_000: 298: irpBtstImm (); 299: break irpSwitch; 300: 301: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 302: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 303: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 304: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 305: //BCHG.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_001_000_rrr-{data} 306: //BCHG.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_100_001_mmm_rrr-{data} 307: case 0b0000_100_001: 308: irpBchgImm (); 309: break irpSwitch; 310: 311: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 312: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 313: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 314: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 315: //BCLR.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_010_000_rrr-{data} 316: //BCLR.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_100_010_mmm_rrr-{data} 317: case 0b0000_100_010: 318: irpBclrImm (); 319: break irpSwitch; 320: 321: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 322: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 323: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 324: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 325: //BSET.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_011_000_rrr-{data} 326: //BSET.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_100_011_mmm_rrr-{data} 327: case 0b0000_100_011: 328: irpBsetImm (); 329: break irpSwitch; 330: 331: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 332: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 333: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 334: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 335: //EORI.B #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_000_mmm_rrr-{data} 336: //EOR.B #<data>,<ea> |A|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_000_mmm_rrr-{data} [EORI.B #<data>,<ea>] 337: //EORI.B #<data>,CCR |-|012346|-|*****|*****| |0000_101_000_111_100-{data} 338: case 0b0000_101_000: 339: irpEoriByte (); 340: break irpSwitch; 341: 342: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 343: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 344: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 345: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 346: //EORI.W #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_001_mmm_rrr-{data} 347: //EOR.W #<data>,<ea> |A|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_001_mmm_rrr-{data} [EORI.W #<data>,<ea>] 348: //EORI.W #<data>,SR |-|012346|P|*****|*****| |0000_101_001_111_100-{data} 349: case 0b0000_101_001: 350: irpEoriWord (); 351: break irpSwitch; 352: 353: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 354: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 355: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 356: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 357: //EORI.L #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_010_mmm_rrr-{data} 358: //EOR.L #<data>,<ea> |A|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_010_mmm_rrr-{data} [EORI.L #<data>,<ea>] 359: case 0b0000_101_010: 360: irpEoriLong (); 361: break irpSwitch; 362: 363: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 364: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 365: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 366: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 367: //CMPI.B #<data>,<ea> |-|01----|-|-UUUU|-****|D M+-WXZ |0000_110_000_mmm_rrr-{data} 368: //CMP.B #<data>,<ea> |A|01----|-|-UUUU|-****| M+-WXZ |0000_110_000_mmm_rrr-{data} [CMPI.B #<data>,<ea>] 369: case 0b0000_110_000: 370: irpCmpiByte (); 371: break irpSwitch; 372: 373: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 374: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 375: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 376: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 377: //CMPI.W #<data>,<ea> |-|01----|-|-UUUU|-****|D M+-WXZ |0000_110_001_mmm_rrr-{data} 378: //CMP.W #<data>,<ea> |A|01----|-|-UUUU|-****| M+-WXZ |0000_110_001_mmm_rrr-{data} [CMPI.W #<data>,<ea>] 379: case 0b0000_110_001: 380: irpCmpiWord (); 381: break irpSwitch; 382: 383: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 384: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 385: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 386: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 387: //CMPI.L #<data>,<ea> |-|01----|-|-UUUU|-****|D M+-WXZ |0000_110_010_mmm_rrr-{data} 388: //CMP.L #<data>,<ea> |A|01----|-|-UUUU|-****| M+-WXZ |0000_110_010_mmm_rrr-{data} [CMPI.L #<data>,<ea>] 389: case 0b0000_110_010: 390: irpCmpiLong (); 391: break irpSwitch; 392: 393: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 394: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 395: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 396: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 397: //MOVES.B <ea>,Rn |-|-12346|P|-----|-----| M+-WXZ |0000_111_000_mmm_rrr-rnnn000000000000 398: //MOVES.B Rn,<ea> |-|-12346|P|-----|-----| M+-WXZ |0000_111_000_mmm_rrr-rnnn100000000000 399: case 0b0000_111_000: 400: irpMovesByte (); 401: break irpSwitch; 402: 403: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 404: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 405: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 406: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 407: //MOVES.W <ea>,Rn |-|-12346|P|-----|-----| M+-WXZ |0000_111_001_mmm_rrr-rnnn000000000000 408: //MOVES.W Rn,<ea> |-|-12346|P|-----|-----| M+-WXZ |0000_111_001_mmm_rrr-rnnn100000000000 409: case 0b0000_111_001: 410: irpMovesWord (); 411: break irpSwitch; 412: 413: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 414: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 415: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 416: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 417: //MOVES.L <ea>,Rn |-|-12346|P|-----|-----| M+-WXZ |0000_111_010_mmm_rrr-rnnn000000000000 418: //MOVES.L Rn,<ea> |-|-12346|P|-----|-----| M+-WXZ |0000_111_010_mmm_rrr-rnnn100000000000 419: case 0b0000_111_010: 420: irpMovesLong (); 421: break irpSwitch; 422: 423: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 424: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 425: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 426: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 427: //MOVE.B <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_000_mmm_rrr 428: case 0b0001_000_000: 429: case 0b0001_001_000: 430: case 0b0001_010_000: 431: case 0b0001_011_000: 432: case 0b0001_100_000: 433: case 0b0001_101_000: 434: case 0b0001_110_000: 435: case 0b0001_111_000: 436: irpMoveToDRByte (); 437: break irpSwitch; 438: 439: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 440: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 441: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 442: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 443: //MOVE.B <ea>,(Aq) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_010_mmm_rrr 444: case 0b0001_000_010: 445: case 0b0001_001_010: 446: case 0b0001_010_010: 447: case 0b0001_011_010: 448: case 0b0001_100_010: 449: case 0b0001_101_010: 450: case 0b0001_110_010: 451: case 0b0001_111_010: 452: irpMoveToMMByte (); 453: break irpSwitch; 454: 455: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 456: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 457: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 458: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 459: //MOVE.B <ea>,(Aq)+ |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_011_mmm_rrr 460: case 0b0001_000_011: 461: case 0b0001_001_011: 462: case 0b0001_010_011: 463: case 0b0001_011_011: 464: case 0b0001_100_011: 465: case 0b0001_101_011: 466: case 0b0001_110_011: 467: case 0b0001_111_011: 468: irpMoveToMPByte (); 469: break irpSwitch; 470: 471: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 472: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 473: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 474: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 475: //MOVE.B <ea>,-(Aq) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_100_mmm_rrr 476: case 0b0001_000_100: 477: case 0b0001_001_100: 478: case 0b0001_010_100: 479: case 0b0001_011_100: 480: case 0b0001_100_100: 481: case 0b0001_101_100: 482: case 0b0001_110_100: 483: case 0b0001_111_100: 484: irpMoveToMNByte (); 485: break irpSwitch; 486: 487: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 488: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 489: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 490: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 491: //MOVE.B <ea>,(d16,Aq) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_101_mmm_rrr 492: case 0b0001_000_101: 493: case 0b0001_001_101: 494: case 0b0001_010_101: 495: case 0b0001_011_101: 496: case 0b0001_100_101: 497: case 0b0001_101_101: 498: case 0b0001_110_101: 499: case 0b0001_111_101: 500: irpMoveToMWByte (); 501: break irpSwitch; 502: 503: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 504: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 505: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 506: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 507: //MOVE.B <ea>,(d8,Aq,Rn.wl) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_110_mmm_rrr 508: case 0b0001_000_110: 509: case 0b0001_001_110: 510: case 0b0001_010_110: 511: case 0b0001_011_110: 512: case 0b0001_100_110: 513: case 0b0001_101_110: 514: case 0b0001_110_110: 515: case 0b0001_111_110: 516: irpMoveToMXByte (); 517: break irpSwitch; 518: 519: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 520: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 521: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 522: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 523: //MOVE.B <ea>,(xxx).W |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_000_111_mmm_rrr 524: case 0b0001_000_111: 525: irpMoveToZWByte (); 526: break irpSwitch; 527: 528: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 529: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 530: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 531: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 532: //MOVE.B <ea>,(xxx).L |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_001_111_mmm_rrr 533: case 0b0001_001_111: 534: irpMoveToZLByte (); 535: break irpSwitch; 536: 537: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 538: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 539: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 540: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 541: //MOVE.L <ea>,Dq |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_000_mmm_rrr 542: case 0b0010_000_000: 543: case 0b0010_001_000: 544: case 0b0010_010_000: 545: case 0b0010_011_000: 546: case 0b0010_100_000: 547: case 0b0010_101_000: 548: case 0b0010_110_000: 549: case 0b0010_111_000: 550: irpMoveToDRLong (); 551: break irpSwitch; 552: 553: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 554: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 555: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 556: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 557: //MOVEA.L <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|0010_qqq_001_mmm_rrr 558: //MOVE.L <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|0010_qqq_001_mmm_rrr [MOVEA.L <ea>,Aq] 559: case 0b0010_000_001: 560: case 0b0010_001_001: 561: case 0b0010_010_001: 562: case 0b0010_011_001: 563: case 0b0010_100_001: 564: case 0b0010_101_001: 565: case 0b0010_110_001: 566: case 0b0010_111_001: 567: irpMoveaLong (); 568: break irpSwitch; 569: 570: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 571: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 572: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 573: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 574: //MOVE.L <ea>,(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_010_mmm_rrr 575: case 0b0010_000_010: 576: case 0b0010_001_010: 577: case 0b0010_010_010: 578: case 0b0010_011_010: 579: case 0b0010_100_010: 580: case 0b0010_101_010: 581: case 0b0010_110_010: 582: case 0b0010_111_010: 583: irpMoveToMMLong (); 584: break irpSwitch; 585: 586: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 587: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 588: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 589: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 590: //MOVE.L <ea>,(Aq)+ |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_011_mmm_rrr 591: case 0b0010_000_011: 592: case 0b0010_001_011: 593: case 0b0010_010_011: 594: case 0b0010_011_011: 595: case 0b0010_100_011: 596: case 0b0010_101_011: 597: case 0b0010_110_011: 598: case 0b0010_111_011: 599: irpMoveToMPLong (); 600: break irpSwitch; 601: 602: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 603: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 604: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 605: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 606: //MOVE.L <ea>,-(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_100_mmm_rrr 607: case 0b0010_000_100: 608: case 0b0010_001_100: 609: case 0b0010_010_100: 610: case 0b0010_011_100: 611: case 0b0010_100_100: 612: case 0b0010_101_100: 613: case 0b0010_110_100: 614: case 0b0010_111_100: 615: irpMoveToMNLong (); 616: break irpSwitch; 617: 618: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 619: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 620: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 621: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 622: //MOVE.L <ea>,(d16,Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_101_mmm_rrr 623: case 0b0010_000_101: 624: case 0b0010_001_101: 625: case 0b0010_010_101: 626: case 0b0010_011_101: 627: case 0b0010_100_101: 628: case 0b0010_101_101: 629: case 0b0010_110_101: 630: case 0b0010_111_101: 631: irpMoveToMWLong (); 632: break irpSwitch; 633: 634: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 635: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 636: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 637: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 638: //MOVE.L <ea>,(d8,Aq,Rn.wl) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_110_mmm_rrr 639: case 0b0010_000_110: 640: case 0b0010_001_110: 641: case 0b0010_010_110: 642: case 0b0010_011_110: 643: case 0b0010_100_110: 644: case 0b0010_101_110: 645: case 0b0010_110_110: 646: case 0b0010_111_110: 647: irpMoveToMXLong (); 648: break irpSwitch; 649: 650: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 651: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 652: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 653: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 654: //MOVE.L <ea>,(xxx).W |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_000_111_mmm_rrr 655: case 0b0010_000_111: 656: irpMoveToZWLong (); 657: break irpSwitch; 658: 659: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 660: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 661: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 662: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 663: //MOVE.L <ea>,(xxx).L |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_001_111_mmm_rrr 664: case 0b0010_001_111: 665: irpMoveToZLLong (); 666: break irpSwitch; 667: 668: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 669: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 670: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 671: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 672: //MOVE.W <ea>,Dq |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_000_mmm_rrr 673: case 0b0011_000_000: 674: case 0b0011_001_000: 675: case 0b0011_010_000: 676: case 0b0011_011_000: 677: case 0b0011_100_000: 678: case 0b0011_101_000: 679: case 0b0011_110_000: 680: case 0b0011_111_000: 681: irpMoveToDRWord (); 682: break irpSwitch; 683: 684: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 685: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 686: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 687: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 688: //MOVEA.W <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|0011_qqq_001_mmm_rrr 689: //MOVE.W <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|0011_qqq_001_mmm_rrr [MOVEA.W <ea>,Aq] 690: case 0b0011_000_001: 691: case 0b0011_001_001: 692: case 0b0011_010_001: 693: case 0b0011_011_001: 694: case 0b0011_100_001: 695: case 0b0011_101_001: 696: case 0b0011_110_001: 697: case 0b0011_111_001: 698: irpMoveaWord (); 699: break irpSwitch; 700: 701: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 702: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 703: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 704: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 705: //MOVE.W <ea>,(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_010_mmm_rrr 706: case 0b0011_000_010: 707: case 0b0011_001_010: 708: case 0b0011_010_010: 709: case 0b0011_011_010: 710: case 0b0011_100_010: 711: case 0b0011_101_010: 712: case 0b0011_110_010: 713: case 0b0011_111_010: 714: irpMoveToMMWord (); 715: break irpSwitch; 716: 717: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 718: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 719: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 720: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 721: //MOVE.W <ea>,(Aq)+ |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_011_mmm_rrr 722: case 0b0011_000_011: 723: case 0b0011_001_011: 724: case 0b0011_010_011: 725: case 0b0011_011_011: 726: case 0b0011_100_011: 727: case 0b0011_101_011: 728: case 0b0011_110_011: 729: case 0b0011_111_011: 730: irpMoveToMPWord (); 731: break irpSwitch; 732: 733: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 734: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 735: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 736: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 737: //MOVE.W <ea>,-(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_100_mmm_rrr 738: case 0b0011_000_100: 739: case 0b0011_001_100: 740: case 0b0011_010_100: 741: case 0b0011_011_100: 742: case 0b0011_100_100: 743: case 0b0011_101_100: 744: case 0b0011_110_100: 745: case 0b0011_111_100: 746: irpMoveToMNWord (); 747: break irpSwitch; 748: 749: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 750: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 751: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 752: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 753: //MOVE.W <ea>,(d16,Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_101_mmm_rrr 754: case 0b0011_000_101: 755: case 0b0011_001_101: 756: case 0b0011_010_101: 757: case 0b0011_011_101: 758: case 0b0011_100_101: 759: case 0b0011_101_101: 760: case 0b0011_110_101: 761: case 0b0011_111_101: 762: irpMoveToMWWord (); 763: break irpSwitch; 764: 765: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 766: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 767: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 768: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 769: //MOVE.W <ea>,(d8,Aq,Rn.wl) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_110_mmm_rrr 770: case 0b0011_000_110: 771: case 0b0011_001_110: 772: case 0b0011_010_110: 773: case 0b0011_011_110: 774: case 0b0011_100_110: 775: case 0b0011_101_110: 776: case 0b0011_110_110: 777: case 0b0011_111_110: 778: irpMoveToMXWord (); 779: break irpSwitch; 780: 781: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 782: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 783: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 784: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 785: //MOVE.W <ea>,(xxx).W |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_000_111_mmm_rrr 786: case 0b0011_000_111: 787: irpMoveToZWWord (); 788: break irpSwitch; 789: 790: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 791: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 792: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 793: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 794: //MOVE.W <ea>,(xxx).L |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_001_111_mmm_rrr 795: case 0b0011_001_111: 796: irpMoveToZLWord (); 797: break irpSwitch; 798: 799: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 800: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 801: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 802: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 803: //NEGX.B <ea> |-|012346|-|*UUUU|*****|D M+-WXZ |0100_000_000_mmm_rrr 804: case 0b0100_000_000: 805: irpNegxByte (); 806: break irpSwitch; 807: 808: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 809: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 810: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 811: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 812: //NEGX.W <ea> |-|012346|-|*UUUU|*****|D M+-WXZ |0100_000_001_mmm_rrr 813: case 0b0100_000_001: 814: irpNegxWord (); 815: break irpSwitch; 816: 817: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 818: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 819: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 820: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 821: //NEGX.L <ea> |-|012346|-|*UUUU|*****|D M+-WXZ |0100_000_010_mmm_rrr 822: case 0b0100_000_010: 823: irpNegxLong (); 824: break irpSwitch; 825: 826: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 827: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 828: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 829: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 830: //MOVE.W SR,<ea> |-|-12346|P|*****|-----|D M+-WXZ |0100_000_011_mmm_rrr 831: case 0b0100_000_011: 832: irpMoveFromSR (); 833: break irpSwitch; 834: 835: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 836: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 837: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 838: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 839: //CHK.W <ea>,Dq |-|012346|-|-UUUU|-*UUU|D M+-WXZPI|0100_qqq_110_mmm_rrr 840: case 0b0100_000_110: 841: case 0b0100_001_110: 842: case 0b0100_010_110: 843: case 0b0100_011_110: 844: case 0b0100_100_110: 845: case 0b0100_101_110: 846: case 0b0100_110_110: 847: case 0b0100_111_110: 848: irpChkWord (); 849: break irpSwitch; 850: 851: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 852: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 853: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 854: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 855: //LEA.L <ea>,Aq |-|012346|-|-----|-----| M WXZP |0100_qqq_111_mmm_rrr 856: case 0b0100_000_111: 857: case 0b0100_001_111: 858: case 0b0100_010_111: 859: case 0b0100_011_111: 860: case 0b0100_100_111: 861: case 0b0100_101_111: 862: case 0b0100_110_111: 863: case 0b0100_111_111: 864: irpLea (); 865: break irpSwitch; 866: 867: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 868: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 869: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 870: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 871: //CLR.B <ea> |-|012346|-|-UUUU|-0100|D M+-WXZ |0100_001_000_mmm_rrr (68000 and 68008 read before clear) 872: case 0b0100_001_000: 873: irpClrByte (); 874: break irpSwitch; 875: 876: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 877: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 878: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 879: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 880: //CLR.W <ea> |-|012346|-|-UUUU|-0100|D M+-WXZ |0100_001_001_mmm_rrr (68000 and 68008 read before clear) 881: case 0b0100_001_001: 882: irpClrWord (); 883: break irpSwitch; 884: 885: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 886: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 887: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 888: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 889: //CLR.L <ea> |-|012346|-|-UUUU|-0100|D M+-WXZ |0100_001_010_mmm_rrr (68000 and 68008 read before clear) 890: case 0b0100_001_010: 891: irpClrLong (); 892: break irpSwitch; 893: 894: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 895: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 896: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 897: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 898: //MOVE.W CCR,<ea> |-|-12346|-|*****|-----|D M+-WXZ |0100_001_011_mmm_rrr 899: case 0b0100_001_011: 900: irpMoveFromCCR (); 901: break irpSwitch; 902: 903: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 904: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 905: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 906: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 907: //NEG.B <ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0100_010_000_mmm_rrr 908: case 0b0100_010_000: 909: irpNegByte (); 910: break irpSwitch; 911: 912: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 913: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 914: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 915: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 916: //NEG.W <ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0100_010_001_mmm_rrr 917: case 0b0100_010_001: 918: irpNegWord (); 919: break irpSwitch; 920: 921: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 922: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 923: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 924: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 925: //NEG.L <ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0100_010_010_mmm_rrr 926: case 0b0100_010_010: 927: irpNegLong (); 928: break irpSwitch; 929: 930: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 931: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 932: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 933: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 934: //MOVE.W <ea>,CCR |-|012346|-|UUUUU|*****|D M+-WXZPI|0100_010_011_mmm_rrr 935: case 0b0100_010_011: 936: irpMoveToCCR (); 937: break irpSwitch; 938: 939: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 940: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 941: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 942: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 943: //NOT.B <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_011_000_mmm_rrr 944: case 0b0100_011_000: 945: irpNotByte (); 946: break irpSwitch; 947: 948: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 949: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 950: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 951: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 952: //NOT.W <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_011_001_mmm_rrr 953: case 0b0100_011_001: 954: irpNotWord (); 955: break irpSwitch; 956: 957: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 958: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 959: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 960: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 961: //NOT.L <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_011_010_mmm_rrr 962: case 0b0100_011_010: 963: irpNotLong (); 964: break irpSwitch; 965: 966: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 967: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 968: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 969: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 970: //MOVE.W <ea>,SR |-|012346|P|UUUUU|*****|D M+-WXZPI|0100_011_011_mmm_rrr 971: case 0b0100_011_011: 972: irpMoveToSR (); 973: break irpSwitch; 974: 975: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 976: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 977: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 978: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 979: //NBCD.B <ea> |-|012346|-|UUUUU|*U*U*|D M+-WXZ |0100_100_000_mmm_rrr 980: case 0b0100_100_000: 981: irpNbcd (); 982: break irpSwitch; 983: 984: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 985: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 986: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 987: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 988: //SWAP.W Dr |-|012346|-|-UUUU|-**00|D |0100_100_001_000_rrr 989: //BKPT #<data> |-|-12346|-|-----|-----| |0100_100_001_001_ddd 990: //PEA.L <ea> |-|012346|-|-----|-----| M WXZP |0100_100_001_mmm_rrr 991: case 0b0100_100_001: 992: irpPea (); 993: break irpSwitch; 994: 995: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 996: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 997: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 998: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 999: //EXT.W Dr |-|012346|-|-UUUU|-**00|D |0100_100_010_000_rrr 1000: //MOVEM.W <list>,<ea> |-|012346|-|-----|-----| M -WXZ |0100_100_010_mmm_rrr-llllllllllllllll 1001: case 0b0100_100_010: 1002: irpMovemToMemWord (); 1003: break irpSwitch; 1004: 1005: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1006: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1007: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1008: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1009: //EXT.L Dr |-|012346|-|-UUUU|-**00|D |0100_100_011_000_rrr 1010: //MOVEM.L <list>,<ea> |-|012346|-|-----|-----| M -WXZ |0100_100_011_mmm_rrr-llllllllllllllll 1011: case 0b0100_100_011: 1012: irpMovemToMemLong (); 1013: break irpSwitch; 1014: 1015: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1016: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1017: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1018: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1019: //TST.B <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_000_mmm_rrr 1020: case 0b0100_101_000: 1021: irpTstByte (); 1022: break irpSwitch; 1023: 1024: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1025: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1026: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1027: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1028: //TST.W <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_001_mmm_rrr 1029: case 0b0100_101_001: 1030: irpTstWord (); 1031: break irpSwitch; 1032: 1033: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1034: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1035: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1036: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1037: //TST.L <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_010_mmm_rrr 1038: case 0b0100_101_010: 1039: irpTstLong (); 1040: break irpSwitch; 1041: 1042: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1043: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1044: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1045: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1046: //TAS.B <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_011_mmm_rrr 1047: //ILLEGAL |-|012346|-|-----|-----| |0100_101_011_111_100 1048: case 0b0100_101_011: 1049: irpTas (); 1050: break irpSwitch; 1051: 1052: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1053: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1054: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1055: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1056: //SATS.L Dr |-|------|-|-UUUU|-**00|D |0100_110_010_000_rrr (ISA_B) 1057: //MOVEM.W <ea>,<list> |-|012346|-|-----|-----| M+ WXZP |0100_110_010_mmm_rrr-llllllllllllllll 1058: case 0b0100_110_010: 1059: irpMovemToRegWord (); 1060: break irpSwitch; 1061: 1062: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1063: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1064: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1065: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1066: //MOVEM.L <ea>,<list> |-|012346|-|-----|-----| M+ WXZP |0100_110_011_mmm_rrr-llllllllllllllll 1067: case 0b0100_110_011: 1068: irpMovemToRegLong (); 1069: break irpSwitch; 1070: 1071: case 0b0100_111_001: 1072: switch (XEiJ.regOC & 0b111_111) { 1073: 1074: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1075: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1076: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1077: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1078: //TRAP #<vector> |-|012346|-|-----|-----| |0100_111_001_00v_vvv 1079: case 0b000_000: 1080: case 0b000_001: 1081: case 0b000_010: 1082: case 0b000_011: 1083: case 0b000_100: 1084: case 0b000_101: 1085: case 0b000_110: 1086: case 0b000_111: 1087: case 0b001_000: 1088: case 0b001_001: 1089: case 0b001_010: 1090: case 0b001_011: 1091: case 0b001_100: 1092: case 0b001_101: 1093: case 0b001_110: 1094: irpTrap (); 1095: break irpSwitch; 1096: case 0b001_111: 1097: irpTrap15 (); 1098: break irpSwitch; 1099: 1100: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1101: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1102: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1103: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1104: //LINK.W Ar,#<data> |-|012346|-|-----|-----| |0100_111_001_010_rrr-{data} 1105: case 0b010_000: 1106: case 0b010_001: 1107: case 0b010_010: 1108: case 0b010_011: 1109: case 0b010_100: 1110: case 0b010_101: 1111: case 0b010_110: 1112: case 0b010_111: 1113: irpLinkWord (); 1114: break irpSwitch; 1115: 1116: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1117: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1118: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1119: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1120: //UNLK Ar |-|012346|-|-----|-----| |0100_111_001_011_rrr 1121: case 0b011_000: 1122: case 0b011_001: 1123: case 0b011_010: 1124: case 0b011_011: 1125: case 0b011_100: 1126: case 0b011_101: 1127: case 0b011_110: 1128: case 0b011_111: 1129: irpUnlk (); 1130: break irpSwitch; 1131: 1132: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1133: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1134: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1135: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1136: //MOVE.L Ar,USP |-|012346|P|-----|-----| |0100_111_001_100_rrr 1137: case 0b100_000: 1138: case 0b100_001: 1139: case 0b100_010: 1140: case 0b100_011: 1141: case 0b100_100: 1142: case 0b100_101: 1143: case 0b100_110: 1144: case 0b100_111: 1145: irpMoveToUsp (); 1146: break irpSwitch; 1147: 1148: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1149: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1150: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1151: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1152: //MOVE.L USP,Ar |-|012346|P|-----|-----| |0100_111_001_101_rrr 1153: case 0b101_000: 1154: case 0b101_001: 1155: case 0b101_010: 1156: case 0b101_011: 1157: case 0b101_100: 1158: case 0b101_101: 1159: case 0b101_110: 1160: case 0b101_111: 1161: irpMoveFromUsp (); 1162: break irpSwitch; 1163: 1164: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1165: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1166: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1167: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1168: //RESET |-|012346|P|-----|-----| |0100_111_001_110_000 1169: case 0b110_000: 1170: irpReset (); 1171: break irpSwitch; 1172: 1173: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1174: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1175: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1176: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1177: //NOP |-|012346|-|-----|-----| |0100_111_001_110_001 1178: case 0b110_001: 1179: irpNop (); 1180: break irpSwitch; 1181: 1182: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1183: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1184: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1185: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1186: //STOP #<data> |-|012346|P|UUUUU|*****| |0100_111_001_110_010-{data} 1187: case 0b110_010: 1188: irpStop (); 1189: break irpSwitch; 1190: 1191: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1192: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1193: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1194: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1195: //RTE |-|012346|P|UUUUU|*****| |0100_111_001_110_011 1196: case 0b110_011: 1197: irpRte (); 1198: break irpSwitch; 1199: 1200: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1201: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1202: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1203: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1204: //RTD #<data> |-|-12346|-|-----|-----| |0100_111_001_110_100-{data} 1205: case 0b110_100: 1206: irpRtd (); 1207: break irpSwitch; 1208: 1209: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1210: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1211: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1212: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1213: //RTS |-|012346|-|-----|-----| |0100_111_001_110_101 1214: case 0b110_101: 1215: irpRts (); 1216: break irpSwitch; 1217: 1218: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1219: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1220: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1221: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1222: //TRAPV |-|012346|-|---*-|-----| |0100_111_001_110_110 1223: case 0b110_110: 1224: irpTrapv (); 1225: break irpSwitch; 1226: 1227: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1228: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1229: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1230: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1231: //RTR |-|012346|-|UUUUU|*****| |0100_111_001_110_111 1232: case 0b110_111: 1233: irpRtr (); 1234: break irpSwitch; 1235: 1236: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1237: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1238: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1239: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1240: //MOVEC.L Rc,Rn |-|-12346|P|-----|-----| |0100_111_001_111_010-rnnncccccccccccc 1241: case 0b111_010: 1242: irpMovecFromControl (); 1243: break irpSwitch; 1244: 1245: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1246: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1247: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1248: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1249: //MOVEC.L Rn,Rc |-|-12346|P|-----|-----| |0100_111_001_111_011-rnnncccccccccccc 1250: case 0b111_011: 1251: irpMovecToControl (); 1252: break irpSwitch; 1253: 1254: default: 1255: irpIllegal (); 1256: 1257: } //switch XEiJ.regOC & 0b111_111 1258: break irpSwitch; 1259: 1260: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1261: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1262: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1263: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1264: //JSR <ea> |-|012346|-|-----|-----| M WXZP |0100_111_010_mmm_rrr 1265: //JBSR.L <label> |A|012346|-|-----|-----| |0100_111_010_111_001-{address} [JSR <label>] 1266: case 0b0100_111_010: 1267: irpJsr (); 1268: break irpSwitch; 1269: 1270: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1271: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1272: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1273: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1274: //JMP <ea> |-|012346|-|-----|-----| M WXZP |0100_111_011_mmm_rrr 1275: //JBRA.L <label> |A|012346|-|-----|-----| |0100_111_011_111_001-{address} [JMP <label>] 1276: case 0b0100_111_011: 1277: irpJmp (); 1278: break irpSwitch; 1279: 1280: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1281: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1282: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1283: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1284: //ADDQ.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_000_mmm_rrr 1285: //INC.B <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_000_mmm_rrr [ADDQ.B #1,<ea>] 1286: case 0b0101_000_000: 1287: case 0b0101_001_000: 1288: case 0b0101_010_000: 1289: case 0b0101_011_000: 1290: case 0b0101_100_000: 1291: case 0b0101_101_000: 1292: case 0b0101_110_000: 1293: case 0b0101_111_000: 1294: irpAddqByte (); 1295: break irpSwitch; 1296: 1297: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1298: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1299: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1300: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1301: //ADDQ.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_001_mmm_rrr 1302: //ADDQ.W #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_001_001_rrr 1303: //INC.W <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_001_mmm_rrr [ADDQ.W #1,<ea>] 1304: //INC.W Ar |A|012346|-|-----|-----| A |0101_001_001_001_rrr [ADDQ.W #1,Ar] 1305: case 0b0101_000_001: 1306: case 0b0101_001_001: 1307: case 0b0101_010_001: 1308: case 0b0101_011_001: 1309: case 0b0101_100_001: 1310: case 0b0101_101_001: 1311: case 0b0101_110_001: 1312: case 0b0101_111_001: 1313: irpAddqWord (); 1314: break irpSwitch; 1315: 1316: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1317: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1318: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1319: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1320: //ADDQ.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_010_mmm_rrr 1321: //ADDQ.L #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_010_001_rrr 1322: //INC.L <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_010_mmm_rrr [ADDQ.L #1,<ea>] 1323: //INC.L Ar |A|012346|-|-----|-----| A |0101_001_010_001_rrr [ADDQ.L #1,Ar] 1324: case 0b0101_000_010: 1325: case 0b0101_001_010: 1326: case 0b0101_010_010: 1327: case 0b0101_011_010: 1328: case 0b0101_100_010: 1329: case 0b0101_101_010: 1330: case 0b0101_110_010: 1331: case 0b0101_111_010: 1332: irpAddqLong (); 1333: break irpSwitch; 1334: 1335: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1336: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1337: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1338: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1339: //ST.B <ea> |-|012346|-|-----|-----|D M+-WXZ |0101_000_011_mmm_rrr 1340: //SNF.B <ea> |A|012346|-|-----|-----|D M+-WXZ |0101_000_011_mmm_rrr [ST.B <ea>] 1341: //DBT.W Dr,<label> |-|012346|-|-----|-----| |0101_000_011_001_rrr-{offset} 1342: //DBNF.W Dr,<label> |A|012346|-|-----|-----| |0101_000_011_001_rrr-{offset} [DBT.W Dr,<label>] 1343: case 0b0101_000_011: 1344: irpSt (); 1345: break irpSwitch; 1346: 1347: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1348: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1349: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1350: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1351: //SUBQ.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_100_mmm_rrr 1352: //DEC.B <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_100_mmm_rrr [SUBQ.B #1,<ea>] 1353: case 0b0101_000_100: 1354: case 0b0101_001_100: 1355: case 0b0101_010_100: 1356: case 0b0101_011_100: 1357: case 0b0101_100_100: 1358: case 0b0101_101_100: 1359: case 0b0101_110_100: 1360: case 0b0101_111_100: 1361: irpSubqByte (); 1362: break irpSwitch; 1363: 1364: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1365: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1366: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1367: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1368: //SUBQ.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_101_mmm_rrr 1369: //SUBQ.W #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_101_001_rrr 1370: //DEC.W <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_101_mmm_rrr [SUBQ.W #1,<ea>] 1371: //DEC.W Ar |A|012346|-|-----|-----| A |0101_001_101_001_rrr [SUBQ.W #1,Ar] 1372: case 0b0101_000_101: 1373: case 0b0101_001_101: 1374: case 0b0101_010_101: 1375: case 0b0101_011_101: 1376: case 0b0101_100_101: 1377: case 0b0101_101_101: 1378: case 0b0101_110_101: 1379: case 0b0101_111_101: 1380: irpSubqWord (); 1381: break irpSwitch; 1382: 1383: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1384: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1385: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1386: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1387: //SUBQ.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_110_mmm_rrr 1388: //SUBQ.L #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_110_001_rrr 1389: //DEC.L <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_110_mmm_rrr [SUBQ.L #1,<ea>] 1390: //DEC.L Ar |A|012346|-|-----|-----| A |0101_001_110_001_rrr [SUBQ.L #1,Ar] 1391: case 0b0101_000_110: 1392: case 0b0101_001_110: 1393: case 0b0101_010_110: 1394: case 0b0101_011_110: 1395: case 0b0101_100_110: 1396: case 0b0101_101_110: 1397: case 0b0101_110_110: 1398: case 0b0101_111_110: 1399: irpSubqLong (); 1400: break irpSwitch; 1401: 1402: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1403: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1404: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1405: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1406: //SF.B <ea> |-|012346|-|-----|-----|D M+-WXZ |0101_000_111_mmm_rrr 1407: //SNT.B <ea> |A|012346|-|-----|-----|D M+-WXZ |0101_000_111_mmm_rrr [SF.B <ea>] 1408: //DBF.W Dr,<label> |-|012346|-|-----|-----| |0101_000_111_001_rrr-{offset} 1409: //DBNT.W Dr,<label> |A|012346|-|-----|-----| |0101_000_111_001_rrr-{offset} [DBF.W Dr,<label>] 1410: //DBRA.W Dr,<label> |A|012346|-|-----|-----| |0101_000_111_001_rrr-{offset} [DBF.W Dr,<label>] 1411: case 0b0101_000_111: 1412: irpSf (); 1413: break irpSwitch; 1414: 1415: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1416: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1417: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1418: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1419: //SHI.B <ea> |-|012346|-|--*-*|-----|D M+-WXZ |0101_001_011_mmm_rrr 1420: //SNLS.B <ea> |A|012346|-|--*-*|-----|D M+-WXZ |0101_001_011_mmm_rrr [SHI.B <ea>] 1421: //DBHI.W Dr,<label> |-|012346|-|--*-*|-----| |0101_001_011_001_rrr-{offset} 1422: //DBNLS.W Dr,<label> |A|012346|-|--*-*|-----| |0101_001_011_001_rrr-{offset} [DBHI.W Dr,<label>] 1423: case 0b0101_001_011: 1424: irpShi (); 1425: break irpSwitch; 1426: 1427: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1428: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1429: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1430: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1431: //SLS.B <ea> |-|012346|-|--*-*|-----|D M+-WXZ |0101_001_111_mmm_rrr 1432: //SNHI.B <ea> |A|012346|-|--*-*|-----|D M+-WXZ |0101_001_111_mmm_rrr [SLS.B <ea>] 1433: //DBLS.W Dr,<label> |-|012346|-|--*-*|-----| |0101_001_111_001_rrr-{offset} 1434: //DBNHI.W Dr,<label> |A|012346|-|--*-*|-----| |0101_001_111_001_rrr-{offset} [DBLS.W Dr,<label>] 1435: case 0b0101_001_111: 1436: irpSls (); 1437: break irpSwitch; 1438: 1439: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1440: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1441: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1442: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1443: //SCC.B <ea> |-|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr 1444: //SHS.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr [SCC.B <ea>] 1445: //SNCS.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr [SCC.B <ea>] 1446: //SNLO.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr [SCC.B <ea>] 1447: //DBCC.W Dr,<label> |-|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} 1448: //DBHS.W Dr,<label> |A|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} [DBCC.W Dr,<label>] 1449: //DBNCS.W Dr,<label> |A|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} [DBCC.W Dr,<label>] 1450: //DBNLO.W Dr,<label> |A|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} [DBCC.W Dr,<label>] 1451: case 0b0101_010_011: 1452: irpShs (); 1453: break irpSwitch; 1454: 1455: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1456: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1457: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1458: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1459: //SCS.B <ea> |-|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr 1460: //SLO.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr [SCS.B <ea>] 1461: //SNCC.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr [SCS.B <ea>] 1462: //SNHS.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr [SCS.B <ea>] 1463: //DBCS.W Dr,<label> |-|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} 1464: //DBLO.W Dr,<label> |A|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} [DBCS.W Dr,<label>] 1465: //DBNCC.W Dr,<label> |A|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} [DBCS.W Dr,<label>] 1466: //DBNHS.W Dr,<label> |A|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} [DBCS.W Dr,<label>] 1467: case 0b0101_010_111: 1468: irpSlo (); 1469: break irpSwitch; 1470: 1471: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1472: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1473: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1474: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1475: //SNE.B <ea> |-|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr 1476: //SNEQ.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr [SNE.B <ea>] 1477: //SNZ.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr [SNE.B <ea>] 1478: //SNZE.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr [SNE.B <ea>] 1479: //DBNE.W Dr,<label> |-|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} 1480: //DBNEQ.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} [DBNE.W Dr,<label>] 1481: //DBNZ.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} [DBNE.W Dr,<label>] 1482: //DBNZE.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} [DBNE.W Dr,<label>] 1483: case 0b0101_011_011: 1484: irpSne (); 1485: break irpSwitch; 1486: 1487: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1488: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1489: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1490: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1491: //SEQ.B <ea> |-|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr 1492: //SNNE.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr [SEQ.B <ea>] 1493: //SNNZ.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr [SEQ.B <ea>] 1494: //SZE.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr [SEQ.B <ea>] 1495: //DBEQ.W Dr,<label> |-|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} 1496: //DBNNE.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} [DBEQ.W Dr,<label>] 1497: //DBNNZ.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} [DBEQ.W Dr,<label>] 1498: //DBZE.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} [DBEQ.W Dr,<label>] 1499: case 0b0101_011_111: 1500: irpSeq (); 1501: break irpSwitch; 1502: 1503: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1504: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1505: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1506: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1507: //SVC.B <ea> |-|012346|-|---*-|-----|D M+-WXZ |0101_100_011_mmm_rrr 1508: //SNVS.B <ea> |A|012346|-|---*-|-----|D M+-WXZ |0101_100_011_mmm_rrr [SVC.B <ea>] 1509: //DBVC.W Dr,<label> |-|012346|-|---*-|-----| |0101_100_011_001_rrr-{offset} 1510: //DBNVS.W Dr,<label> |A|012346|-|---*-|-----| |0101_100_011_001_rrr-{offset} [DBVC.W Dr,<label>] 1511: case 0b0101_100_011: 1512: irpSvc (); 1513: break irpSwitch; 1514: 1515: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1516: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1517: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1518: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1519: //SVS.B <ea> |-|012346|-|---*-|-----|D M+-WXZ |0101_100_111_mmm_rrr 1520: //SNVC.B <ea> |A|012346|-|---*-|-----|D M+-WXZ |0101_100_111_mmm_rrr [SVS.B <ea>] 1521: //DBVS.W Dr,<label> |-|012346|-|---*-|-----| |0101_100_111_001_rrr-{offset} 1522: //DBNVC.W Dr,<label> |A|012346|-|---*-|-----| |0101_100_111_001_rrr-{offset} [DBVS.W Dr,<label>] 1523: case 0b0101_100_111: 1524: irpSvs (); 1525: break irpSwitch; 1526: 1527: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1528: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1529: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1530: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1531: //SPL.B <ea> |-|012346|-|-*---|-----|D M+-WXZ |0101_101_011_mmm_rrr 1532: //SNMI.B <ea> |A|012346|-|-*---|-----|D M+-WXZ |0101_101_011_mmm_rrr [SPL.B <ea>] 1533: //DBPL.W Dr,<label> |-|012346|-|-*---|-----| |0101_101_011_001_rrr-{offset} 1534: //DBNMI.W Dr,<label> |A|012346|-|-*---|-----| |0101_101_011_001_rrr-{offset} [DBPL.W Dr,<label>] 1535: case 0b0101_101_011: 1536: irpSpl (); 1537: break irpSwitch; 1538: 1539: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1540: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1541: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1542: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1543: //SMI.B <ea> |-|012346|-|-*---|-----|D M+-WXZ |0101_101_111_mmm_rrr 1544: //SNPL.B <ea> |A|012346|-|-*---|-----|D M+-WXZ |0101_101_111_mmm_rrr [SMI.B <ea>] 1545: //DBMI.W Dr,<label> |-|012346|-|-*---|-----| |0101_101_111_001_rrr-{offset} 1546: //DBNPL.W Dr,<label> |A|012346|-|-*---|-----| |0101_101_111_001_rrr-{offset} [DBMI.W Dr,<label>] 1547: case 0b0101_101_111: 1548: irpSmi (); 1549: break irpSwitch; 1550: 1551: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1552: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1553: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1554: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1555: //SGE.B <ea> |-|012346|-|-*-*-|-----|D M+-WXZ |0101_110_011_mmm_rrr 1556: //SNLT.B <ea> |A|012346|-|-*-*-|-----|D M+-WXZ |0101_110_011_mmm_rrr [SGE.B <ea>] 1557: //DBGE.W Dr,<label> |-|012346|-|-*-*-|-----| |0101_110_011_001_rrr-{offset} 1558: //DBNLT.W Dr,<label> |A|012346|-|-*-*-|-----| |0101_110_011_001_rrr-{offset} [DBGE.W Dr,<label>] 1559: case 0b0101_110_011: 1560: irpSge (); 1561: break irpSwitch; 1562: 1563: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1564: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1565: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1566: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1567: //SLT.B <ea> |-|012346|-|-*-*-|-----|D M+-WXZ |0101_110_111_mmm_rrr 1568: //SNGE.B <ea> |A|012346|-|-*-*-|-----|D M+-WXZ |0101_110_111_mmm_rrr [SLT.B <ea>] 1569: //DBLT.W Dr,<label> |-|012346|-|-*-*-|-----| |0101_110_111_001_rrr-{offset} 1570: //DBNGE.W Dr,<label> |A|012346|-|-*-*-|-----| |0101_110_111_001_rrr-{offset} [DBLT.W Dr,<label>] 1571: case 0b0101_110_111: 1572: irpSlt (); 1573: break irpSwitch; 1574: 1575: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1576: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1577: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1578: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1579: //SGT.B <ea> |-|012346|-|-***-|-----|D M+-WXZ |0101_111_011_mmm_rrr 1580: //SNLE.B <ea> |A|012346|-|-***-|-----|D M+-WXZ |0101_111_011_mmm_rrr [SGT.B <ea>] 1581: //DBGT.W Dr,<label> |-|012346|-|-***-|-----| |0101_111_011_001_rrr-{offset} 1582: //DBNLE.W Dr,<label> |A|012346|-|-***-|-----| |0101_111_011_001_rrr-{offset} [DBGT.W Dr,<label>] 1583: case 0b0101_111_011: 1584: irpSgt (); 1585: break irpSwitch; 1586: 1587: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1588: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1589: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1590: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1591: //SLE.B <ea> |-|012346|-|-***-|-----|D M+-WXZ |0101_111_111_mmm_rrr 1592: //SNGT.B <ea> |A|012346|-|-***-|-----|D M+-WXZ |0101_111_111_mmm_rrr [SLE.B <ea>] 1593: //DBLE.W Dr,<label> |-|012346|-|-***-|-----| |0101_111_111_001_rrr-{offset} 1594: //DBNGT.W Dr,<label> |A|012346|-|-***-|-----| |0101_111_111_001_rrr-{offset} [DBLE.W Dr,<label>] 1595: case 0b0101_111_111: 1596: irpSle (); 1597: break irpSwitch; 1598: 1599: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1600: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1601: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1602: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1603: //BRA.W <label> |-|012346|-|-----|-----| |0110_000_000_000_000-{offset} 1604: //JBRA.W <label> |A|012346|-|-----|-----| |0110_000_000_000_000-{offset} [BRA.W <label>] 1605: //BRA.S <label> |-|012346|-|-----|-----| |0110_000_000_sss_sss (s is not equal to 0) 1606: //JBRA.S <label> |A|012346|-|-----|-----| |0110_000_000_sss_sss (s is not equal to 0) [BRA.S <label>] 1607: case 0b0110_000_000: 1608: irpBrasw (); 1609: break irpSwitch; 1610: 1611: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1612: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1613: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1614: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1615: //BRA.S <label> |-|012346|-|-----|-----| |0110_000_001_sss_sss 1616: //JBRA.S <label> |A|012346|-|-----|-----| |0110_000_001_sss_sss [BRA.S <label>] 1617: case 0b0110_000_001: 1618: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1619: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1620: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1621: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1622: //BRA.S <label> |-|012346|-|-----|-----| |0110_000_010_sss_sss 1623: //JBRA.S <label> |A|012346|-|-----|-----| |0110_000_010_sss_sss [BRA.S <label>] 1624: case 0b0110_000_010: 1625: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1626: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1627: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1628: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1629: //BRA.S <label> |-|01----|-|-----|-----| |0110_000_011_sss_sss 1630: //JBRA.S <label> |A|01----|-|-----|-----| |0110_000_011_sss_sss [BRA.S <label>] 1631: case 0b0110_000_011: 1632: irpBras (); 1633: break irpSwitch; 1634: 1635: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1636: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1637: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1638: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1639: //BSR.W <label> |-|012346|-|-----|-----| |0110_000_100_000_000-{offset} 1640: //JBSR.W <label> |A|012346|-|-----|-----| |0110_000_100_000_000-{offset} [BSR.W <label>] 1641: //BSR.S <label> |-|012346|-|-----|-----| |0110_000_100_sss_sss (s is not equal to 0) 1642: //JBSR.S <label> |A|012346|-|-----|-----| |0110_000_100_sss_sss (s is not equal to 0) [BSR.S <label>] 1643: case 0b0110_000_100: 1644: irpBsrsw (); 1645: break irpSwitch; 1646: 1647: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1648: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1649: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1650: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1651: //BSR.S <label> |-|012346|-|-----|-----| |0110_000_101_sss_sss 1652: //JBSR.S <label> |A|012346|-|-----|-----| |0110_000_101_sss_sss [BSR.S <label>] 1653: case 0b0110_000_101: 1654: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1655: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1656: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1657: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1658: //BSR.S <label> |-|012346|-|-----|-----| |0110_000_110_sss_sss 1659: //JBSR.S <label> |A|012346|-|-----|-----| |0110_000_110_sss_sss [BSR.S <label>] 1660: case 0b0110_000_110: 1661: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1662: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1663: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1664: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1665: //BSR.S <label> |-|01----|-|-----|-----| |0110_000_111_sss_sss 1666: //JBSR.S <label> |A|01----|-|-----|-----| |0110_000_111_sss_sss [BSR.S <label>] 1667: case 0b0110_000_111: 1668: irpBsrs (); 1669: break irpSwitch; 1670: 1671: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1672: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1673: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1674: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1675: //BHI.W <label> |-|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} 1676: //BNLS.W <label> |A|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} [BHI.W <label>] 1677: //JBHI.W <label> |A|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} [BHI.W <label>] 1678: //JBNLS.W <label> |A|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} [BHI.W <label>] 1679: //BHI.S <label> |-|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) 1680: //BNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) [BHI.S <label>] 1681: //JBHI.S <label> |A|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) [BHI.S <label>] 1682: //JBNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) [BHI.S <label>] 1683: //JBLS.L <label> |A|012346|-|--*-*|-----| |0110_001_000_000_110-0100111011111001-{address} [BHI.S (*)+8;JMP <label>] 1684: //JBNHI.L <label> |A|012346|-|--*-*|-----| |0110_001_000_000_110-0100111011111001-{address} [BHI.S (*)+8;JMP <label>] 1685: case 0b0110_001_000: 1686: irpBhisw (); 1687: break irpSwitch; 1688: 1689: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1690: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1691: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1692: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1693: //BHI.S <label> |-|012346|-|--*-*|-----| |0110_001_001_sss_sss 1694: //BNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_001_sss_sss [BHI.S <label>] 1695: //JBHI.S <label> |A|012346|-|--*-*|-----| |0110_001_001_sss_sss [BHI.S <label>] 1696: //JBNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_001_sss_sss [BHI.S <label>] 1697: case 0b0110_001_001: 1698: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1699: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1700: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1701: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1702: //BHI.S <label> |-|012346|-|--*-*|-----| |0110_001_010_sss_sss 1703: //BNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_010_sss_sss [BHI.S <label>] 1704: //JBHI.S <label> |A|012346|-|--*-*|-----| |0110_001_010_sss_sss [BHI.S <label>] 1705: //JBNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_010_sss_sss [BHI.S <label>] 1706: case 0b0110_001_010: 1707: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1708: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1709: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1710: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1711: //BHI.S <label> |-|01----|-|--*-*|-----| |0110_001_011_sss_sss 1712: //BNLS.S <label> |A|01----|-|--*-*|-----| |0110_001_011_sss_sss [BHI.S <label>] 1713: //JBHI.S <label> |A|01----|-|--*-*|-----| |0110_001_011_sss_sss [BHI.S <label>] 1714: //JBNLS.S <label> |A|01----|-|--*-*|-----| |0110_001_011_sss_sss [BHI.S <label>] 1715: case 0b0110_001_011: 1716: irpBhis (); 1717: break irpSwitch; 1718: 1719: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1720: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1721: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1722: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1723: //BLS.W <label> |-|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} 1724: //BNHI.W <label> |A|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} [BLS.W <label>] 1725: //JBLS.W <label> |A|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} [BLS.W <label>] 1726: //JBNHI.W <label> |A|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} [BLS.W <label>] 1727: //BLS.S <label> |-|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) 1728: //BNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) [BLS.S <label>] 1729: //JBLS.S <label> |A|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) [BLS.S <label>] 1730: //JBNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) [BLS.S <label>] 1731: //JBHI.L <label> |A|012346|-|--*-*|-----| |0110_001_100_000_110-0100111011111001-{address} [BLS.S (*)+8;JMP <label>] 1732: //JBNLS.L <label> |A|012346|-|--*-*|-----| |0110_001_100_000_110-0100111011111001-{address} [BLS.S (*)+8;JMP <label>] 1733: case 0b0110_001_100: 1734: irpBlssw (); 1735: break irpSwitch; 1736: 1737: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1738: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1739: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1740: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1741: //BLS.S <label> |-|012346|-|--*-*|-----| |0110_001_101_sss_sss 1742: //BNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_101_sss_sss [BLS.S <label>] 1743: //JBLS.S <label> |A|012346|-|--*-*|-----| |0110_001_101_sss_sss [BLS.S <label>] 1744: //JBNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_101_sss_sss [BLS.S <label>] 1745: case 0b0110_001_101: 1746: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1747: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1748: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1749: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1750: //BLS.S <label> |-|012346|-|--*-*|-----| |0110_001_110_sss_sss 1751: //BNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_110_sss_sss [BLS.S <label>] 1752: //JBLS.S <label> |A|012346|-|--*-*|-----| |0110_001_110_sss_sss [BLS.S <label>] 1753: //JBNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_110_sss_sss [BLS.S <label>] 1754: case 0b0110_001_110: 1755: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1756: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1757: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1758: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1759: //BLS.S <label> |-|01----|-|--*-*|-----| |0110_001_111_sss_sss 1760: //BNHI.S <label> |A|01----|-|--*-*|-----| |0110_001_111_sss_sss [BLS.S <label>] 1761: //JBLS.S <label> |A|01----|-|--*-*|-----| |0110_001_111_sss_sss [BLS.S <label>] 1762: //JBNHI.S <label> |A|01----|-|--*-*|-----| |0110_001_111_sss_sss [BLS.S <label>] 1763: case 0b0110_001_111: 1764: irpBlss (); 1765: break irpSwitch; 1766: 1767: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1768: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1769: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1770: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1771: //BCC.W <label> |-|012346|-|----*|-----| |0110_010_000_000_000-{offset} 1772: //BHS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 1773: //BNCS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 1774: //BNLO.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 1775: //JBCC.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 1776: //JBHS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 1777: //JBNCS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 1778: //JBNLO.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 1779: //BCC.S <label> |-|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) 1780: //BHS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 1781: //BNCS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 1782: //BNLO.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 1783: //JBCC.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 1784: //JBHS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 1785: //JBNCS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 1786: //JBNLO.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 1787: //JBCS.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 1788: //JBLO.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 1789: //JBNCC.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 1790: //JBNHS.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 1791: case 0b0110_010_000: 1792: irpBhssw (); 1793: break irpSwitch; 1794: 1795: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1796: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1797: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1798: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1799: //BCC.S <label> |-|012346|-|----*|-----| |0110_010_001_sss_sss 1800: //BHS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 1801: //BNCS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 1802: //BNLO.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 1803: //JBCC.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 1804: //JBHS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 1805: //JBNCS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 1806: //JBNLO.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 1807: case 0b0110_010_001: 1808: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1809: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1810: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1811: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1812: //BCC.S <label> |-|012346|-|----*|-----| |0110_010_010_sss_sss 1813: //BHS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 1814: //BNCS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 1815: //BNLO.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 1816: //JBCC.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 1817: //JBHS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 1818: //JBNCS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 1819: //JBNLO.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 1820: case 0b0110_010_010: 1821: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1822: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1823: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1824: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1825: //BCC.S <label> |-|01----|-|----*|-----| |0110_010_011_sss_sss 1826: //BHS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 1827: //BNCS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 1828: //BNLO.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 1829: //JBCC.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 1830: //JBHS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 1831: //JBNCS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 1832: //JBNLO.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 1833: case 0b0110_010_011: 1834: irpBhss (); 1835: break irpSwitch; 1836: 1837: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1838: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1839: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1840: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1841: //BCS.W <label> |-|012346|-|----*|-----| |0110_010_100_000_000-{offset} 1842: //BLO.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 1843: //BNCC.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 1844: //BNHS.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 1845: //JBCS.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 1846: //JBLO.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 1847: //JBNCC.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 1848: //JBNHS.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 1849: //BCS.S <label> |-|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) 1850: //BLO.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 1851: //BNCC.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 1852: //BNHS.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 1853: //JBCS.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 1854: //JBLO.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 1855: //JBNCC.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 1856: //JBNHS.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 1857: //JBCC.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 1858: //JBHS.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 1859: //JBNCS.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 1860: //JBNLO.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 1861: case 0b0110_010_100: 1862: irpBlosw (); 1863: break irpSwitch; 1864: 1865: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1866: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1867: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1868: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1869: //BCS.S <label> |-|012346|-|----*|-----| |0110_010_101_sss_sss 1870: //BLO.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 1871: //BNCC.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 1872: //BNHS.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 1873: //JBCS.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 1874: //JBLO.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 1875: //JBNCC.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 1876: //JBNHS.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 1877: case 0b0110_010_101: 1878: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1879: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1880: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1881: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1882: //BCS.S <label> |-|012346|-|----*|-----| |0110_010_110_sss_sss 1883: //BLO.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 1884: //BNCC.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 1885: //BNHS.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 1886: //JBCS.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 1887: //JBLO.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 1888: //JBNCC.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 1889: //JBNHS.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 1890: case 0b0110_010_110: 1891: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1892: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1893: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1894: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1895: //BCS.S <label> |-|01----|-|----*|-----| |0110_010_111_sss_sss 1896: //BLO.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 1897: //BNCC.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 1898: //BNHS.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 1899: //JBCS.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 1900: //JBLO.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 1901: //JBNCC.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 1902: //JBNHS.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 1903: case 0b0110_010_111: 1904: irpBlos (); 1905: break irpSwitch; 1906: 1907: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1908: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1909: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1910: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1911: //BNE.W <label> |-|012346|-|--*--|-----| |0110_011_000_000_000-{offset} 1912: //BNEQ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 1913: //BNZ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 1914: //BNZE.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 1915: //JBNE.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 1916: //JBNEQ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 1917: //JBNZ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 1918: //JBNZE.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 1919: //BNE.S <label> |-|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) 1920: //BNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 1921: //BNZ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 1922: //BNZE.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 1923: //JBNE.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 1924: //JBNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 1925: //JBNZ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 1926: //JBNZE.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 1927: //JBEQ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 1928: //JBNEQ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 1929: //JBNNE.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 1930: //JBNNZ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 1931: //JBNZ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 1932: //JBNZE.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 1933: //JBZE.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 1934: case 0b0110_011_000: 1935: irpBnesw (); 1936: break irpSwitch; 1937: 1938: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1939: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1940: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1941: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1942: //BNE.S <label> |-|012346|-|--*--|-----| |0110_011_001_sss_sss 1943: //BNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 1944: //BNZ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 1945: //BNZE.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 1946: //JBNE.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 1947: //JBNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 1948: //JBNZ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 1949: //JBNZE.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 1950: case 0b0110_011_001: 1951: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1952: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1953: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1954: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1955: //BNE.S <label> |-|012346|-|--*--|-----| |0110_011_010_sss_sss 1956: //BNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 1957: //BNZ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 1958: //BNZE.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 1959: //JBNE.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 1960: //JBNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 1961: //JBNZ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 1962: //JBNZE.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 1963: case 0b0110_011_010: 1964: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1965: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1966: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1967: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1968: //BNE.S <label> |-|01----|-|--*--|-----| |0110_011_011_sss_sss 1969: //BNEQ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 1970: //BNZ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 1971: //BNZE.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 1972: //JBNE.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 1973: //JBNEQ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 1974: //JBNZ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 1975: //JBNZE.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 1976: case 0b0110_011_011: 1977: irpBnes (); 1978: break irpSwitch; 1979: 1980: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1981: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 1982: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 1983: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 1984: //BEQ.W <label> |-|012346|-|--*--|-----| |0110_011_100_000_000-{offset} 1985: //BNNE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 1986: //BNNZ.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 1987: //BZE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 1988: //JBEQ.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 1989: //JBNNE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 1990: //JBNNZ.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 1991: //JBZE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 1992: //BEQ.S <label> |-|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) 1993: //BNNE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 1994: //BNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 1995: //BZE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 1996: //JBEQ.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 1997: //JBNNE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 1998: //JBNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 1999: //JBZE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 2000: //JBNE.L <label> |A|012346|-|--*--|-----| |0110_011_100_000_110-0100111011111001-{address} [BEQ.S (*)+8;JMP <label>] 2001: case 0b0110_011_100: 2002: irpBeqsw (); 2003: break irpSwitch; 2004: 2005: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2006: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2007: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2008: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2009: //BEQ.S <label> |-|012346|-|--*--|-----| |0110_011_101_sss_sss 2010: //BNNE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 2011: //BNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 2012: //BZE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 2013: //JBEQ.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 2014: //JBNNE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 2015: //JBNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 2016: //JBZE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 2017: case 0b0110_011_101: 2018: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2019: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2020: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2021: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2022: //BEQ.S <label> |-|012346|-|--*--|-----| |0110_011_110_sss_sss 2023: //BNNE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 2024: //BNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 2025: //BZE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 2026: //JBEQ.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 2027: //JBNNE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 2028: //JBNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 2029: //JBZE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 2030: case 0b0110_011_110: 2031: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2032: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2033: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2034: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2035: //BEQ.S <label> |-|01----|-|--*--|-----| |0110_011_111_sss_sss 2036: //BNNE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 2037: //BNNZ.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 2038: //BZE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 2039: //JBEQ.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 2040: //JBNNE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 2041: //JBNNZ.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 2042: //JBZE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 2043: case 0b0110_011_111: 2044: irpBeqs (); 2045: break irpSwitch; 2046: 2047: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2048: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2049: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2050: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2051: //BVC.W <label> |-|012346|-|---*-|-----| |0110_100_000_000_000-{offset} 2052: //BNVS.W <label> |A|012346|-|---*-|-----| |0110_100_000_000_000-{offset} [BVC.W <label>] 2053: //JBNVS.W <label> |A|012346|-|---*-|-----| |0110_100_000_000_000-{offset} [BVC.W <label>] 2054: //JBVC.W <label> |A|012346|-|---*-|-----| |0110_100_000_000_000-{offset} [BVC.W <label>] 2055: //BVC.S <label> |-|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) 2056: //BNVS.S <label> |A|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) [BVC.S <label>] 2057: //JBNVS.S <label> |A|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) [BVC.S <label>] 2058: //JBVC.S <label> |A|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) [BVC.S <label>] 2059: //JBNVC.L <label> |A|012346|-|---*-|-----| |0110_100_000_000_110-0100111011111001-{address} [BVC.S (*)+8;JMP <label>] 2060: //JBVS.L <label> |A|012346|-|---*-|-----| |0110_100_000_000_110-0100111011111001-{address} [BVC.S (*)+8;JMP <label>] 2061: case 0b0110_100_000: 2062: irpBvcsw (); 2063: break irpSwitch; 2064: 2065: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2066: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2067: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2068: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2069: //BVC.S <label> |-|012346|-|---*-|-----| |0110_100_001_sss_sss 2070: //BNVS.S <label> |A|012346|-|---*-|-----| |0110_100_001_sss_sss [BVC.S <label>] 2071: //JBNVS.S <label> |A|012346|-|---*-|-----| |0110_100_001_sss_sss [BVC.S <label>] 2072: //JBVC.S <label> |A|012346|-|---*-|-----| |0110_100_001_sss_sss [BVC.S <label>] 2073: case 0b0110_100_001: 2074: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2075: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2076: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2077: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2078: //BVC.S <label> |-|012346|-|---*-|-----| |0110_100_010_sss_sss 2079: //BNVS.S <label> |A|012346|-|---*-|-----| |0110_100_010_sss_sss [BVC.S <label>] 2080: //JBNVS.S <label> |A|012346|-|---*-|-----| |0110_100_010_sss_sss [BVC.S <label>] 2081: //JBVC.S <label> |A|012346|-|---*-|-----| |0110_100_010_sss_sss [BVC.S <label>] 2082: case 0b0110_100_010: 2083: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2084: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2085: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2086: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2087: //BVC.S <label> |-|01----|-|---*-|-----| |0110_100_011_sss_sss 2088: //BNVS.S <label> |A|01----|-|---*-|-----| |0110_100_011_sss_sss [BVC.S <label>] 2089: //JBNVS.S <label> |A|01----|-|---*-|-----| |0110_100_011_sss_sss [BVC.S <label>] 2090: //JBVC.S <label> |A|01----|-|---*-|-----| |0110_100_011_sss_sss [BVC.S <label>] 2091: case 0b0110_100_011: 2092: irpBvcs (); 2093: break irpSwitch; 2094: 2095: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2096: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2097: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2098: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2099: //BVS.W <label> |-|012346|-|---*-|-----| |0110_100_100_000_000-{offset} 2100: //BNVC.W <label> |A|012346|-|---*-|-----| |0110_100_100_000_000-{offset} [BVS.W <label>] 2101: //JBNVC.W <label> |A|012346|-|---*-|-----| |0110_100_100_000_000-{offset} [BVS.W <label>] 2102: //JBVS.W <label> |A|012346|-|---*-|-----| |0110_100_100_000_000-{offset} [BVS.W <label>] 2103: //BVS.S <label> |-|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) 2104: //BNVC.S <label> |A|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) [BVS.S <label>] 2105: //JBNVC.S <label> |A|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) [BVS.S <label>] 2106: //JBVS.S <label> |A|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) [BVS.S <label>] 2107: //JBNVS.L <label> |A|012346|-|---*-|-----| |0110_100_100_000_110-0100111011111001-{address} [BVS.S (*)+8;JMP <label>] 2108: //JBVC.L <label> |A|012346|-|---*-|-----| |0110_100_100_000_110-0100111011111001-{address} [BVS.S (*)+8;JMP <label>] 2109: case 0b0110_100_100: 2110: irpBvssw (); 2111: break irpSwitch; 2112: 2113: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2114: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2115: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2116: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2117: //BVS.S <label> |-|012346|-|---*-|-----| |0110_100_101_sss_sss 2118: //BNVC.S <label> |A|012346|-|---*-|-----| |0110_100_101_sss_sss [BVS.S <label>] 2119: //JBNVC.S <label> |A|012346|-|---*-|-----| |0110_100_101_sss_sss [BVS.S <label>] 2120: //JBVS.S <label> |A|012346|-|---*-|-----| |0110_100_101_sss_sss [BVS.S <label>] 2121: case 0b0110_100_101: 2122: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2123: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2124: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2125: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2126: //BVS.S <label> |-|012346|-|---*-|-----| |0110_100_110_sss_sss 2127: //BNVC.S <label> |A|012346|-|---*-|-----| |0110_100_110_sss_sss [BVS.S <label>] 2128: //JBNVC.S <label> |A|012346|-|---*-|-----| |0110_100_110_sss_sss [BVS.S <label>] 2129: //JBVS.S <label> |A|012346|-|---*-|-----| |0110_100_110_sss_sss [BVS.S <label>] 2130: case 0b0110_100_110: 2131: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2132: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2133: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2134: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2135: //BVS.S <label> |-|01----|-|---*-|-----| |0110_100_111_sss_sss 2136: //BNVC.S <label> |A|01----|-|---*-|-----| |0110_100_111_sss_sss [BVS.S <label>] 2137: //JBNVC.S <label> |A|01----|-|---*-|-----| |0110_100_111_sss_sss [BVS.S <label>] 2138: //JBVS.S <label> |A|01----|-|---*-|-----| |0110_100_111_sss_sss [BVS.S <label>] 2139: case 0b0110_100_111: 2140: irpBvss (); 2141: break irpSwitch; 2142: 2143: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2144: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2145: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2146: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2147: //BPL.W <label> |-|012346|-|-*---|-----| |0110_101_000_000_000-{offset} 2148: //BNMI.W <label> |A|012346|-|-*---|-----| |0110_101_000_000_000-{offset} [BPL.W <label>] 2149: //JBNMI.W <label> |A|012346|-|-*---|-----| |0110_101_000_000_000-{offset} [BPL.W <label>] 2150: //JBPL.W <label> |A|012346|-|-*---|-----| |0110_101_000_000_000-{offset} [BPL.W <label>] 2151: //BPL.S <label> |-|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) 2152: //BNMI.S <label> |A|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) [BPL.S <label>] 2153: //JBNMI.S <label> |A|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) [BPL.S <label>] 2154: //JBPL.S <label> |A|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) [BPL.S <label>] 2155: //JBMI.L <label> |A|012346|-|-*---|-----| |0110_101_000_000_110-0100111011111001-{address} [BPL.S (*)+8;JMP <label>] 2156: //JBNPL.L <label> |A|012346|-|-*---|-----| |0110_101_000_000_110-0100111011111001-{address} [BPL.S (*)+8;JMP <label>] 2157: case 0b0110_101_000: 2158: irpBplsw (); 2159: break irpSwitch; 2160: 2161: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2162: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2163: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2164: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2165: //BPL.S <label> |-|012346|-|-*---|-----| |0110_101_001_sss_sss 2166: //BNMI.S <label> |A|012346|-|-*---|-----| |0110_101_001_sss_sss [BPL.S <label>] 2167: //JBNMI.S <label> |A|012346|-|-*---|-----| |0110_101_001_sss_sss [BPL.S <label>] 2168: //JBPL.S <label> |A|012346|-|-*---|-----| |0110_101_001_sss_sss [BPL.S <label>] 2169: case 0b0110_101_001: 2170: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2171: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2172: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2173: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2174: //BPL.S <label> |-|012346|-|-*---|-----| |0110_101_010_sss_sss 2175: //BNMI.S <label> |A|012346|-|-*---|-----| |0110_101_010_sss_sss [BPL.S <label>] 2176: //JBNMI.S <label> |A|012346|-|-*---|-----| |0110_101_010_sss_sss [BPL.S <label>] 2177: //JBPL.S <label> |A|012346|-|-*---|-----| |0110_101_010_sss_sss [BPL.S <label>] 2178: case 0b0110_101_010: 2179: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2180: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2181: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2182: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2183: //BPL.S <label> |-|01----|-|-*---|-----| |0110_101_011_sss_sss 2184: //BNMI.S <label> |A|01----|-|-*---|-----| |0110_101_011_sss_sss [BPL.S <label>] 2185: //JBNMI.S <label> |A|01----|-|-*---|-----| |0110_101_011_sss_sss [BPL.S <label>] 2186: //JBPL.S <label> |A|01----|-|-*---|-----| |0110_101_011_sss_sss [BPL.S <label>] 2187: case 0b0110_101_011: 2188: irpBpls (); 2189: break irpSwitch; 2190: 2191: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2192: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2193: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2194: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2195: //BMI.W <label> |-|012346|-|-*---|-----| |0110_101_100_000_000-{offset} 2196: //BNPL.W <label> |A|012346|-|-*---|-----| |0110_101_100_000_000-{offset} [BMI.W <label>] 2197: //JBMI.W <label> |A|012346|-|-*---|-----| |0110_101_100_000_000-{offset} [BMI.W <label>] 2198: //JBNPL.W <label> |A|012346|-|-*---|-----| |0110_101_100_000_000-{offset} [BMI.W <label>] 2199: //BMI.S <label> |-|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) 2200: //BNPL.S <label> |A|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) [BMI.S <label>] 2201: //JBMI.S <label> |A|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) [BMI.S <label>] 2202: //JBNPL.S <label> |A|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) [BMI.S <label>] 2203: //JBNMI.L <label> |A|012346|-|-*---|-----| |0110_101_100_000_110-0100111011111001-{address} [BMI.S (*)+8;JMP <label>] 2204: //JBPL.L <label> |A|012346|-|-*---|-----| |0110_101_100_000_110-0100111011111001-{address} [BMI.S (*)+8;JMP <label>] 2205: case 0b0110_101_100: 2206: irpBmisw (); 2207: break irpSwitch; 2208: 2209: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2210: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2211: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2212: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2213: //BMI.S <label> |-|012346|-|-*---|-----| |0110_101_101_sss_sss 2214: //BNPL.S <label> |A|012346|-|-*---|-----| |0110_101_101_sss_sss [BMI.S <label>] 2215: //JBMI.S <label> |A|012346|-|-*---|-----| |0110_101_101_sss_sss [BMI.S <label>] 2216: //JBNPL.S <label> |A|012346|-|-*---|-----| |0110_101_101_sss_sss [BMI.S <label>] 2217: case 0b0110_101_101: 2218: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2219: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2220: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2221: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2222: //BMI.S <label> |-|012346|-|-*---|-----| |0110_101_110_sss_sss 2223: //BNPL.S <label> |A|012346|-|-*---|-----| |0110_101_110_sss_sss [BMI.S <label>] 2224: //JBMI.S <label> |A|012346|-|-*---|-----| |0110_101_110_sss_sss [BMI.S <label>] 2225: //JBNPL.S <label> |A|012346|-|-*---|-----| |0110_101_110_sss_sss [BMI.S <label>] 2226: case 0b0110_101_110: 2227: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2228: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2229: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2230: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2231: //BMI.S <label> |-|01----|-|-*---|-----| |0110_101_111_sss_sss 2232: //BNPL.S <label> |A|01----|-|-*---|-----| |0110_101_111_sss_sss [BMI.S <label>] 2233: //JBMI.S <label> |A|01----|-|-*---|-----| |0110_101_111_sss_sss [BMI.S <label>] 2234: //JBNPL.S <label> |A|01----|-|-*---|-----| |0110_101_111_sss_sss [BMI.S <label>] 2235: case 0b0110_101_111: 2236: irpBmis (); 2237: break irpSwitch; 2238: 2239: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2240: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2241: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2242: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2243: //BGE.W <label> |-|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} 2244: //BNLT.W <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} [BGE.W <label>] 2245: //JBGE.W <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} [BGE.W <label>] 2246: //JBNLT.W <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} [BGE.W <label>] 2247: //BGE.S <label> |-|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) 2248: //BNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) [BGE.S <label>] 2249: //JBGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) [BGE.S <label>] 2250: //JBNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) [BGE.S <label>] 2251: //JBLT.L <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_110-0100111011111001-{address} [BGE.S (*)+8;JMP <label>] 2252: //JBNGE.L <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_110-0100111011111001-{address} [BGE.S (*)+8;JMP <label>] 2253: case 0b0110_110_000: 2254: irpBgesw (); 2255: break irpSwitch; 2256: 2257: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2258: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2259: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2260: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2261: //BGE.S <label> |-|012346|-|-*-*-|-----| |0110_110_001_sss_sss 2262: //BNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_001_sss_sss [BGE.S <label>] 2263: //JBGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_001_sss_sss [BGE.S <label>] 2264: //JBNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_001_sss_sss [BGE.S <label>] 2265: case 0b0110_110_001: 2266: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2267: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2268: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2269: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2270: //BGE.S <label> |-|012346|-|-*-*-|-----| |0110_110_010_sss_sss 2271: //BNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_010_sss_sss [BGE.S <label>] 2272: //JBGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_010_sss_sss [BGE.S <label>] 2273: //JBNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_010_sss_sss [BGE.S <label>] 2274: case 0b0110_110_010: 2275: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2276: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2277: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2278: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2279: //BGE.S <label> |-|01----|-|-*-*-|-----| |0110_110_011_sss_sss 2280: //BNLT.S <label> |A|01----|-|-*-*-|-----| |0110_110_011_sss_sss [BGE.S <label>] 2281: //JBGE.S <label> |A|01----|-|-*-*-|-----| |0110_110_011_sss_sss [BGE.S <label>] 2282: //JBNLT.S <label> |A|01----|-|-*-*-|-----| |0110_110_011_sss_sss [BGE.S <label>] 2283: case 0b0110_110_011: 2284: irpBges (); 2285: break irpSwitch; 2286: 2287: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2288: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2289: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2290: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2291: //BLT.W <label> |-|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} 2292: //BNGE.W <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} [BLT.W <label>] 2293: //JBLT.W <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} [BLT.W <label>] 2294: //JBNGE.W <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} [BLT.W <label>] 2295: //BLT.S <label> |-|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) 2296: //BNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) [BLT.S <label>] 2297: //JBLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) [BLT.S <label>] 2298: //JBNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) [BLT.S <label>] 2299: //JBGE.L <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_110-0100111011111001-{address} [BLT.S (*)+8;JMP <label>] 2300: //JBNLT.L <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_110-0100111011111001-{address} [BLT.S (*)+8;JMP <label>] 2301: case 0b0110_110_100: 2302: irpBltsw (); 2303: break irpSwitch; 2304: 2305: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2306: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2307: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2308: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2309: //BLT.S <label> |-|012346|-|-*-*-|-----| |0110_110_101_sss_sss 2310: //BNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_101_sss_sss [BLT.S <label>] 2311: //JBLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_101_sss_sss [BLT.S <label>] 2312: //JBNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_101_sss_sss [BLT.S <label>] 2313: case 0b0110_110_101: 2314: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2315: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2316: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2317: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2318: //BLT.S <label> |-|012346|-|-*-*-|-----| |0110_110_110_sss_sss 2319: //BNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_110_sss_sss [BLT.S <label>] 2320: //JBLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_110_sss_sss [BLT.S <label>] 2321: //JBNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_110_sss_sss [BLT.S <label>] 2322: case 0b0110_110_110: 2323: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2324: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2325: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2326: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2327: //BLT.S <label> |-|01----|-|-*-*-|-----| |0110_110_111_sss_sss 2328: //BNGE.S <label> |A|01----|-|-*-*-|-----| |0110_110_111_sss_sss [BLT.S <label>] 2329: //JBLT.S <label> |A|01----|-|-*-*-|-----| |0110_110_111_sss_sss [BLT.S <label>] 2330: //JBNGE.S <label> |A|01----|-|-*-*-|-----| |0110_110_111_sss_sss [BLT.S <label>] 2331: case 0b0110_110_111: 2332: irpBlts (); 2333: break irpSwitch; 2334: 2335: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2336: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2337: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2338: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2339: //BGT.W <label> |-|012346|-|-***-|-----| |0110_111_000_000_000-{offset} 2340: //BNLE.W <label> |A|012346|-|-***-|-----| |0110_111_000_000_000-{offset} [BGT.W <label>] 2341: //JBGT.W <label> |A|012346|-|-***-|-----| |0110_111_000_000_000-{offset} [BGT.W <label>] 2342: //JBNLE.W <label> |A|012346|-|-***-|-----| |0110_111_000_000_000-{offset} [BGT.W <label>] 2343: //BGT.S <label> |-|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) 2344: //BNLE.S <label> |A|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) [BGT.S <label>] 2345: //JBGT.S <label> |A|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) [BGT.S <label>] 2346: //JBNLE.S <label> |A|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) [BGT.S <label>] 2347: //JBLE.L <label> |A|012346|-|-***-|-----| |0110_111_000_000_110-0100111011111001-{address} [BGT.S (*)+8;JMP <label>] 2348: //JBNGT.L <label> |A|012346|-|-***-|-----| |0110_111_000_000_110-0100111011111001-{address} [BGT.S (*)+8;JMP <label>] 2349: case 0b0110_111_000: 2350: irpBgtsw (); 2351: break irpSwitch; 2352: 2353: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2354: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2355: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2356: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2357: //BGT.S <label> |-|012346|-|-***-|-----| |0110_111_001_sss_sss 2358: //BNLE.S <label> |A|012346|-|-***-|-----| |0110_111_001_sss_sss [BGT.S <label>] 2359: //JBGT.S <label> |A|012346|-|-***-|-----| |0110_111_001_sss_sss [BGT.S <label>] 2360: //JBNLE.S <label> |A|012346|-|-***-|-----| |0110_111_001_sss_sss [BGT.S <label>] 2361: case 0b0110_111_001: 2362: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2363: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2364: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2365: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2366: //BGT.S <label> |-|012346|-|-***-|-----| |0110_111_010_sss_sss 2367: //BNLE.S <label> |A|012346|-|-***-|-----| |0110_111_010_sss_sss [BGT.S <label>] 2368: //JBGT.S <label> |A|012346|-|-***-|-----| |0110_111_010_sss_sss [BGT.S <label>] 2369: //JBNLE.S <label> |A|012346|-|-***-|-----| |0110_111_010_sss_sss [BGT.S <label>] 2370: case 0b0110_111_010: 2371: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2372: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2373: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2374: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2375: //BGT.S <label> |-|01----|-|-***-|-----| |0110_111_011_sss_sss 2376: //BNLE.S <label> |A|01----|-|-***-|-----| |0110_111_011_sss_sss [BGT.S <label>] 2377: //JBGT.S <label> |A|01----|-|-***-|-----| |0110_111_011_sss_sss [BGT.S <label>] 2378: //JBNLE.S <label> |A|01----|-|-***-|-----| |0110_111_011_sss_sss [BGT.S <label>] 2379: case 0b0110_111_011: 2380: irpBgts (); 2381: break irpSwitch; 2382: 2383: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2384: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2385: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2386: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2387: //BLE.W <label> |-|012346|-|-***-|-----| |0110_111_100_000_000-{offset} 2388: //BNGT.W <label> |A|012346|-|-***-|-----| |0110_111_100_000_000-{offset} [BLE.W <label>] 2389: //JBLE.W <label> |A|012346|-|-***-|-----| |0110_111_100_000_000-{offset} [BLE.W <label>] 2390: //JBNGT.W <label> |A|012346|-|-***-|-----| |0110_111_100_000_000-{offset} [BLE.W <label>] 2391: //BLE.S <label> |-|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) 2392: //BNGT.S <label> |A|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) [BLE.S <label>] 2393: //JBLE.S <label> |A|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) [BLE.S <label>] 2394: //JBNGT.S <label> |A|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) [BLE.S <label>] 2395: //JBGT.L <label> |A|012346|-|-***-|-----| |0110_111_100_000_110-0100111011111001-{address} [BLE.S (*)+8;JMP <label>] 2396: //JBNLE.L <label> |A|012346|-|-***-|-----| |0110_111_100_000_110-0100111011111001-{address} [BLE.S (*)+8;JMP <label>] 2397: case 0b0110_111_100: 2398: irpBlesw (); 2399: break irpSwitch; 2400: 2401: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2402: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2403: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2404: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2405: //BLE.S <label> |-|012346|-|-***-|-----| |0110_111_101_sss_sss 2406: //BNGT.S <label> |A|012346|-|-***-|-----| |0110_111_101_sss_sss [BLE.S <label>] 2407: //JBLE.S <label> |A|012346|-|-***-|-----| |0110_111_101_sss_sss [BLE.S <label>] 2408: //JBNGT.S <label> |A|012346|-|-***-|-----| |0110_111_101_sss_sss [BLE.S <label>] 2409: case 0b0110_111_101: 2410: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2411: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2412: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2413: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2414: //BLE.S <label> |-|012346|-|-***-|-----| |0110_111_110_sss_sss 2415: //BNGT.S <label> |A|012346|-|-***-|-----| |0110_111_110_sss_sss [BLE.S <label>] 2416: //JBLE.S <label> |A|012346|-|-***-|-----| |0110_111_110_sss_sss [BLE.S <label>] 2417: //JBNGT.S <label> |A|012346|-|-***-|-----| |0110_111_110_sss_sss [BLE.S <label>] 2418: case 0b0110_111_110: 2419: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2420: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2421: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2422: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2423: //BLE.S <label> |-|01----|-|-***-|-----| |0110_111_111_sss_sss 2424: //BNGT.S <label> |A|01----|-|-***-|-----| |0110_111_111_sss_sss [BLE.S <label>] 2425: //JBLE.S <label> |A|01----|-|-***-|-----| |0110_111_111_sss_sss [BLE.S <label>] 2426: //JBNGT.S <label> |A|01----|-|-***-|-----| |0110_111_111_sss_sss [BLE.S <label>] 2427: case 0b0110_111_111: 2428: irpBles (); 2429: break irpSwitch; 2430: 2431: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2432: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2433: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2434: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2435: //IOCS <name> |A|012346|-|UUUUU|UUUUU| |0111_000_0dd_ddd_ddd-0100111001001111 [MOVEQ.L #<data>,D0;TRAP #15] 2436: //MOVEQ.L #<data>,Dq |-|012346|-|-UUUU|-**00| |0111_qqq_0dd_ddd_ddd 2437: case 0b0111_000_000: 2438: case 0b0111_000_001: 2439: case 0b0111_000_010: 2440: case 0b0111_000_011: 2441: case 0b0111_001_000: 2442: case 0b0111_001_001: 2443: case 0b0111_001_010: 2444: case 0b0111_001_011: 2445: case 0b0111_010_000: 2446: case 0b0111_010_001: 2447: case 0b0111_010_010: 2448: case 0b0111_010_011: 2449: case 0b0111_011_000: 2450: case 0b0111_011_001: 2451: case 0b0111_011_010: 2452: case 0b0111_011_011: 2453: case 0b0111_100_000: 2454: case 0b0111_100_001: 2455: case 0b0111_100_010: 2456: case 0b0111_100_011: 2457: case 0b0111_101_000: 2458: case 0b0111_101_001: 2459: case 0b0111_101_010: 2460: case 0b0111_101_011: 2461: case 0b0111_110_000: 2462: case 0b0111_110_001: 2463: case 0b0111_110_010: 2464: case 0b0111_110_011: 2465: case 0b0111_111_000: 2466: case 0b0111_111_001: 2467: case 0b0111_111_010: 2468: case 0b0111_111_011: 2469: irpMoveq (); 2470: break irpSwitch; 2471: 2472: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2473: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2474: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2475: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2476: //MVS.B <ea>,Dq |-|------|-|-UUUU|-**00|D M+-WXZPI|0111_qqq_100_mmm_rrr (ISA_B) 2477: case 0b0111_000_100: 2478: case 0b0111_001_100: 2479: case 0b0111_010_100: 2480: case 0b0111_011_100: 2481: case 0b0111_100_100: 2482: case 0b0111_101_100: 2483: case 0b0111_110_100: 2484: case 0b0111_111_100: 2485: irpMvsByte (); 2486: break irpSwitch; 2487: 2488: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2489: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2490: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2491: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2492: //MVS.W <ea>,Dq |-|------|-|-UUUU|-**00|D M+-WXZPI|0111_qqq_101_mmm_rrr (ISA_B) 2493: case 0b0111_000_101: 2494: case 0b0111_001_101: 2495: case 0b0111_010_101: 2496: case 0b0111_011_101: 2497: case 0b0111_100_101: 2498: case 0b0111_101_101: 2499: case 0b0111_110_101: 2500: case 0b0111_111_101: 2501: irpMvsWord (); 2502: break irpSwitch; 2503: 2504: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2505: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2506: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2507: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2508: //MVZ.B <ea>,Dq |-|------|-|-UUUU|-0*00|D M+-WXZPI|0111_qqq_110_mmm_rrr (ISA_B) 2509: case 0b0111_000_110: 2510: case 0b0111_001_110: 2511: case 0b0111_010_110: 2512: case 0b0111_011_110: 2513: case 0b0111_100_110: 2514: case 0b0111_101_110: 2515: case 0b0111_110_110: 2516: case 0b0111_111_110: 2517: irpMvzByte (); 2518: break irpSwitch; 2519: 2520: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2521: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2522: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2523: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2524: //MVZ.W <ea>,Dq |-|------|-|-UUUU|-0*00|D M+-WXZPI|0111_qqq_111_mmm_rrr (ISA_B) 2525: case 0b0111_000_111: 2526: case 0b0111_001_111: 2527: case 0b0111_010_111: 2528: case 0b0111_011_111: 2529: case 0b0111_100_111: 2530: case 0b0111_101_111: 2531: case 0b0111_110_111: 2532: case 0b0111_111_111: 2533: irpMvzWord (); 2534: break irpSwitch; 2535: 2536: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2537: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2538: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2539: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2540: //OR.B <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1000_qqq_000_mmm_rrr 2541: case 0b1000_000_000: 2542: case 0b1000_001_000: 2543: case 0b1000_010_000: 2544: case 0b1000_011_000: 2545: case 0b1000_100_000: 2546: case 0b1000_101_000: 2547: case 0b1000_110_000: 2548: case 0b1000_111_000: 2549: irpOrToRegByte (); 2550: break irpSwitch; 2551: 2552: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2553: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2554: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2555: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2556: //OR.W <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1000_qqq_001_mmm_rrr 2557: case 0b1000_000_001: 2558: case 0b1000_001_001: 2559: case 0b1000_010_001: 2560: case 0b1000_011_001: 2561: case 0b1000_100_001: 2562: case 0b1000_101_001: 2563: case 0b1000_110_001: 2564: case 0b1000_111_001: 2565: irpOrToRegWord (); 2566: break irpSwitch; 2567: 2568: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2569: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2570: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2571: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2572: //OR.L <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1000_qqq_010_mmm_rrr 2573: case 0b1000_000_010: 2574: case 0b1000_001_010: 2575: case 0b1000_010_010: 2576: case 0b1000_011_010: 2577: case 0b1000_100_010: 2578: case 0b1000_101_010: 2579: case 0b1000_110_010: 2580: case 0b1000_111_010: 2581: irpOrToRegLong (); 2582: break irpSwitch; 2583: 2584: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2585: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2586: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2587: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2588: //DIVU.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1000_qqq_011_mmm_rrr 2589: case 0b1000_000_011: 2590: case 0b1000_001_011: 2591: case 0b1000_010_011: 2592: case 0b1000_011_011: 2593: case 0b1000_100_011: 2594: case 0b1000_101_011: 2595: case 0b1000_110_011: 2596: case 0b1000_111_011: 2597: irpDivuWord (); 2598: break irpSwitch; 2599: 2600: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2601: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2602: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2603: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2604: //SBCD.B Dr,Dq |-|012346|-|UUUUU|*U*U*| |1000_qqq_100_000_rrr 2605: //SBCD.B -(Ar),-(Aq) |-|012346|-|UUUUU|*U*U*| |1000_qqq_100_001_rrr 2606: //OR.B Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1000_qqq_100_mmm_rrr 2607: case 0b1000_000_100: 2608: case 0b1000_001_100: 2609: case 0b1000_010_100: 2610: case 0b1000_011_100: 2611: case 0b1000_100_100: 2612: case 0b1000_101_100: 2613: case 0b1000_110_100: 2614: case 0b1000_111_100: 2615: irpOrToMemByte (); 2616: break irpSwitch; 2617: 2618: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2619: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2620: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2621: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2622: //OR.W Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1000_qqq_101_mmm_rrr 2623: case 0b1000_000_101: 2624: case 0b1000_001_101: 2625: case 0b1000_010_101: 2626: case 0b1000_011_101: 2627: case 0b1000_100_101: 2628: case 0b1000_101_101: 2629: case 0b1000_110_101: 2630: case 0b1000_111_101: 2631: irpOrToMemWord (); 2632: break irpSwitch; 2633: 2634: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2635: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2636: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2637: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2638: //OR.L Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1000_qqq_110_mmm_rrr 2639: case 0b1000_000_110: 2640: case 0b1000_001_110: 2641: case 0b1000_010_110: 2642: case 0b1000_011_110: 2643: case 0b1000_100_110: 2644: case 0b1000_101_110: 2645: case 0b1000_110_110: 2646: case 0b1000_111_110: 2647: irpOrToMemLong (); 2648: break irpSwitch; 2649: 2650: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2651: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2652: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2653: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2654: //DIVS.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1000_qqq_111_mmm_rrr 2655: case 0b1000_000_111: 2656: case 0b1000_001_111: 2657: case 0b1000_010_111: 2658: case 0b1000_011_111: 2659: case 0b1000_100_111: 2660: case 0b1000_101_111: 2661: case 0b1000_110_111: 2662: case 0b1000_111_111: 2663: irpDivsWord (); 2664: break irpSwitch; 2665: 2666: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2667: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2668: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2669: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2670: //SUB.B <ea>,Dq |-|012346|-|UUUUU|*****|D M+-WXZPI|1001_qqq_000_mmm_rrr 2671: case 0b1001_000_000: 2672: case 0b1001_001_000: 2673: case 0b1001_010_000: 2674: case 0b1001_011_000: 2675: case 0b1001_100_000: 2676: case 0b1001_101_000: 2677: case 0b1001_110_000: 2678: case 0b1001_111_000: 2679: irpSubToRegByte (); 2680: break irpSwitch; 2681: 2682: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2683: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2684: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2685: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2686: //SUB.W <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1001_qqq_001_mmm_rrr 2687: case 0b1001_000_001: 2688: case 0b1001_001_001: 2689: case 0b1001_010_001: 2690: case 0b1001_011_001: 2691: case 0b1001_100_001: 2692: case 0b1001_101_001: 2693: case 0b1001_110_001: 2694: case 0b1001_111_001: 2695: irpSubToRegWord (); 2696: break irpSwitch; 2697: 2698: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2699: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2700: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2701: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2702: //SUB.L <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1001_qqq_010_mmm_rrr 2703: case 0b1001_000_010: 2704: case 0b1001_001_010: 2705: case 0b1001_010_010: 2706: case 0b1001_011_010: 2707: case 0b1001_100_010: 2708: case 0b1001_101_010: 2709: case 0b1001_110_010: 2710: case 0b1001_111_010: 2711: irpSubToRegLong (); 2712: break irpSwitch; 2713: 2714: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2715: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2716: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2717: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2718: //SUBA.W <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_011_mmm_rrr 2719: //SUB.W <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_011_mmm_rrr [SUBA.W <ea>,Aq] 2720: //CLR.W Ar |A|012346|-|-----|-----| A |1001_rrr_011_001_rrr [SUBA.W Ar,Ar] 2721: case 0b1001_000_011: 2722: case 0b1001_001_011: 2723: case 0b1001_010_011: 2724: case 0b1001_011_011: 2725: case 0b1001_100_011: 2726: case 0b1001_101_011: 2727: case 0b1001_110_011: 2728: case 0b1001_111_011: 2729: irpSubaWord (); 2730: break irpSwitch; 2731: 2732: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2733: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2734: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2735: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2736: //SUBX.B Dr,Dq |-|012346|-|*UUUU|*****| |1001_qqq_100_000_rrr 2737: //SUBX.B -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1001_qqq_100_001_rrr 2738: //SUB.B Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1001_qqq_100_mmm_rrr 2739: case 0b1001_000_100: 2740: case 0b1001_001_100: 2741: case 0b1001_010_100: 2742: case 0b1001_011_100: 2743: case 0b1001_100_100: 2744: case 0b1001_101_100: 2745: case 0b1001_110_100: 2746: case 0b1001_111_100: 2747: irpSubToMemByte (); 2748: break irpSwitch; 2749: 2750: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2751: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2752: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2753: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2754: //SUBX.W Dr,Dq |-|012346|-|*UUUU|*****| |1001_qqq_101_000_rrr 2755: //SUBX.W -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1001_qqq_101_001_rrr 2756: //SUB.W Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1001_qqq_101_mmm_rrr 2757: case 0b1001_000_101: 2758: case 0b1001_001_101: 2759: case 0b1001_010_101: 2760: case 0b1001_011_101: 2761: case 0b1001_100_101: 2762: case 0b1001_101_101: 2763: case 0b1001_110_101: 2764: case 0b1001_111_101: 2765: irpSubToMemWord (); 2766: break irpSwitch; 2767: 2768: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2769: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2770: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2771: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2772: //SUBX.L Dr,Dq |-|012346|-|*UUUU|*****| |1001_qqq_110_000_rrr 2773: //SUBX.L -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1001_qqq_110_001_rrr 2774: //SUB.L Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1001_qqq_110_mmm_rrr 2775: case 0b1001_000_110: 2776: case 0b1001_001_110: 2777: case 0b1001_010_110: 2778: case 0b1001_011_110: 2779: case 0b1001_100_110: 2780: case 0b1001_101_110: 2781: case 0b1001_110_110: 2782: case 0b1001_111_110: 2783: irpSubToMemLong (); 2784: break irpSwitch; 2785: 2786: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2787: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2788: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2789: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2790: //SUBA.L <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_111_mmm_rrr 2791: //SUB.L <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_111_mmm_rrr [SUBA.L <ea>,Aq] 2792: //CLR.L Ar |A|012346|-|-----|-----| A |1001_rrr_111_001_rrr [SUBA.L Ar,Ar] 2793: case 0b1001_000_111: 2794: case 0b1001_001_111: 2795: case 0b1001_010_111: 2796: case 0b1001_011_111: 2797: case 0b1001_100_111: 2798: case 0b1001_101_111: 2799: case 0b1001_110_111: 2800: case 0b1001_111_111: 2801: irpSubaLong (); 2802: break irpSwitch; 2803: 2804: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2805: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2806: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2807: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2808: //SXCALL <name> |A|012346|-|UUUUU|*****| |1010_0dd_ddd_ddd_ddd [ALINE #<data>] 2809: case 0b1010_000_000: 2810: case 0b1010_000_001: 2811: case 0b1010_000_010: 2812: case 0b1010_000_011: 2813: case 0b1010_000_100: 2814: case 0b1010_000_101: 2815: case 0b1010_000_110: 2816: case 0b1010_000_111: 2817: case 0b1010_001_000: 2818: case 0b1010_001_001: 2819: case 0b1010_001_010: 2820: case 0b1010_001_011: 2821: case 0b1010_001_100: 2822: case 0b1010_001_101: 2823: case 0b1010_001_110: 2824: case 0b1010_001_111: 2825: case 0b1010_010_000: 2826: case 0b1010_010_001: 2827: case 0b1010_010_010: 2828: case 0b1010_010_011: 2829: case 0b1010_010_100: 2830: case 0b1010_010_101: 2831: case 0b1010_010_110: 2832: case 0b1010_010_111: 2833: case 0b1010_011_000: 2834: case 0b1010_011_001: 2835: case 0b1010_011_010: 2836: case 0b1010_011_011: 2837: case 0b1010_011_100: 2838: case 0b1010_011_101: 2839: case 0b1010_011_110: 2840: case 0b1010_011_111: 2841: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2842: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2843: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2844: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2845: //ALINE #<data> |-|012346|-|UUUUU|*****| |1010_ddd_ddd_ddd_ddd (line 1010 emulator) 2846: case 0b1010_100_000: 2847: case 0b1010_100_001: 2848: case 0b1010_100_010: 2849: case 0b1010_100_011: 2850: case 0b1010_100_100: 2851: case 0b1010_100_101: 2852: case 0b1010_100_110: 2853: case 0b1010_100_111: 2854: case 0b1010_101_000: 2855: case 0b1010_101_001: 2856: case 0b1010_101_010: 2857: case 0b1010_101_011: 2858: case 0b1010_101_100: 2859: case 0b1010_101_101: 2860: case 0b1010_101_110: 2861: case 0b1010_101_111: 2862: case 0b1010_110_000: 2863: case 0b1010_110_001: 2864: case 0b1010_110_010: 2865: case 0b1010_110_011: 2866: case 0b1010_110_100: 2867: case 0b1010_110_101: 2868: case 0b1010_110_110: 2869: case 0b1010_110_111: 2870: case 0b1010_111_000: 2871: case 0b1010_111_001: 2872: case 0b1010_111_010: 2873: case 0b1010_111_011: 2874: case 0b1010_111_100: 2875: case 0b1010_111_101: 2876: case 0b1010_111_110: 2877: case 0b1010_111_111: 2878: irpAline (); 2879: break irpSwitch; 2880: 2881: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2882: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2883: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2884: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2885: //CMP.B <ea>,Dq |-|012346|-|-UUUU|-****|D M+-WXZPI|1011_qqq_000_mmm_rrr 2886: case 0b1011_000_000: 2887: case 0b1011_001_000: 2888: case 0b1011_010_000: 2889: case 0b1011_011_000: 2890: case 0b1011_100_000: 2891: case 0b1011_101_000: 2892: case 0b1011_110_000: 2893: case 0b1011_111_000: 2894: irpCmpByte (); 2895: break irpSwitch; 2896: 2897: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2898: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2899: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2900: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2901: //CMP.W <ea>,Dq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_001_mmm_rrr 2902: case 0b1011_000_001: 2903: case 0b1011_001_001: 2904: case 0b1011_010_001: 2905: case 0b1011_011_001: 2906: case 0b1011_100_001: 2907: case 0b1011_101_001: 2908: case 0b1011_110_001: 2909: case 0b1011_111_001: 2910: irpCmpWord (); 2911: break irpSwitch; 2912: 2913: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2914: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2915: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2916: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2917: //CMP.L <ea>,Dq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_010_mmm_rrr 2918: case 0b1011_000_010: 2919: case 0b1011_001_010: 2920: case 0b1011_010_010: 2921: case 0b1011_011_010: 2922: case 0b1011_100_010: 2923: case 0b1011_101_010: 2924: case 0b1011_110_010: 2925: case 0b1011_111_010: 2926: irpCmpLong (); 2927: break irpSwitch; 2928: 2929: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2930: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2931: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2932: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2933: //CMPA.W <ea>,Aq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_011_mmm_rrr 2934: //CMP.W <ea>,Aq |A|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_011_mmm_rrr [CMPA.W <ea>,Aq] 2935: case 0b1011_000_011: 2936: case 0b1011_001_011: 2937: case 0b1011_010_011: 2938: case 0b1011_011_011: 2939: case 0b1011_100_011: 2940: case 0b1011_101_011: 2941: case 0b1011_110_011: 2942: case 0b1011_111_011: 2943: irpCmpaWord (); 2944: break irpSwitch; 2945: 2946: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2947: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2948: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2949: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2950: //EOR.B Dq,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |1011_qqq_100_mmm_rrr 2951: //CMPM.B (Ar)+,(Aq)+ |-|012346|-|-UUUU|-****| |1011_qqq_100_001_rrr 2952: case 0b1011_000_100: 2953: case 0b1011_001_100: 2954: case 0b1011_010_100: 2955: case 0b1011_011_100: 2956: case 0b1011_100_100: 2957: case 0b1011_101_100: 2958: case 0b1011_110_100: 2959: case 0b1011_111_100: 2960: irpEorByte (); 2961: break irpSwitch; 2962: 2963: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2964: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2965: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2966: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2967: //EOR.W Dq,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |1011_qqq_101_mmm_rrr 2968: //CMPM.W (Ar)+,(Aq)+ |-|012346|-|-UUUU|-****| |1011_qqq_101_001_rrr 2969: case 0b1011_000_101: 2970: case 0b1011_001_101: 2971: case 0b1011_010_101: 2972: case 0b1011_011_101: 2973: case 0b1011_100_101: 2974: case 0b1011_101_101: 2975: case 0b1011_110_101: 2976: case 0b1011_111_101: 2977: irpEorWord (); 2978: break irpSwitch; 2979: 2980: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2981: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2982: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 2983: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2984: //EOR.L Dq,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |1011_qqq_110_mmm_rrr 2985: //CMPM.L (Ar)+,(Aq)+ |-|012346|-|-UUUU|-****| |1011_qqq_110_001_rrr 2986: case 0b1011_000_110: 2987: case 0b1011_001_110: 2988: case 0b1011_010_110: 2989: case 0b1011_011_110: 2990: case 0b1011_100_110: 2991: case 0b1011_101_110: 2992: case 0b1011_110_110: 2993: case 0b1011_111_110: 2994: irpEorLong (); 2995: break irpSwitch; 2996: 2997: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 2998: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 2999: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3000: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3001: //CMPA.L <ea>,Aq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_111_mmm_rrr 3002: //CMP.L <ea>,Aq |A|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_111_mmm_rrr [CMPA.L <ea>,Aq] 3003: case 0b1011_000_111: 3004: case 0b1011_001_111: 3005: case 0b1011_010_111: 3006: case 0b1011_011_111: 3007: case 0b1011_100_111: 3008: case 0b1011_101_111: 3009: case 0b1011_110_111: 3010: case 0b1011_111_111: 3011: irpCmpaLong (); 3012: break irpSwitch; 3013: 3014: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3015: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3016: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3017: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3018: //AND.B <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1100_qqq_000_mmm_rrr 3019: case 0b1100_000_000: 3020: case 0b1100_001_000: 3021: case 0b1100_010_000: 3022: case 0b1100_011_000: 3023: case 0b1100_100_000: 3024: case 0b1100_101_000: 3025: case 0b1100_110_000: 3026: case 0b1100_111_000: 3027: irpAndToRegByte (); 3028: break irpSwitch; 3029: 3030: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3031: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3032: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3033: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3034: //AND.W <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1100_qqq_001_mmm_rrr 3035: case 0b1100_000_001: 3036: case 0b1100_001_001: 3037: case 0b1100_010_001: 3038: case 0b1100_011_001: 3039: case 0b1100_100_001: 3040: case 0b1100_101_001: 3041: case 0b1100_110_001: 3042: case 0b1100_111_001: 3043: irpAndToRegWord (); 3044: break irpSwitch; 3045: 3046: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3047: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3048: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3049: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3050: //AND.L <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1100_qqq_010_mmm_rrr 3051: case 0b1100_000_010: 3052: case 0b1100_001_010: 3053: case 0b1100_010_010: 3054: case 0b1100_011_010: 3055: case 0b1100_100_010: 3056: case 0b1100_101_010: 3057: case 0b1100_110_010: 3058: case 0b1100_111_010: 3059: irpAndToRegLong (); 3060: break irpSwitch; 3061: 3062: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3063: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3064: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3065: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3066: //MULU.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1100_qqq_011_mmm_rrr 3067: case 0b1100_000_011: 3068: case 0b1100_001_011: 3069: case 0b1100_010_011: 3070: case 0b1100_011_011: 3071: case 0b1100_100_011: 3072: case 0b1100_101_011: 3073: case 0b1100_110_011: 3074: case 0b1100_111_011: 3075: irpMuluWord (); 3076: break irpSwitch; 3077: 3078: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3079: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3080: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3081: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3082: //ABCD.B Dr,Dq |-|012346|-|UUUUU|*U*U*| |1100_qqq_100_000_rrr 3083: //ABCD.B -(Ar),-(Aq) |-|012346|-|UUUUU|*U*U*| |1100_qqq_100_001_rrr 3084: //AND.B Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1100_qqq_100_mmm_rrr 3085: case 0b1100_000_100: 3086: case 0b1100_001_100: 3087: case 0b1100_010_100: 3088: case 0b1100_011_100: 3089: case 0b1100_100_100: 3090: case 0b1100_101_100: 3091: case 0b1100_110_100: 3092: case 0b1100_111_100: 3093: irpAndToMemByte (); 3094: break irpSwitch; 3095: 3096: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3097: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3098: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3099: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3100: //EXG.L Dq,Dr |-|012346|-|-----|-----| |1100_qqq_101_000_rrr 3101: //EXG.L Aq,Ar |-|012346|-|-----|-----| |1100_qqq_101_001_rrr 3102: //AND.W Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1100_qqq_101_mmm_rrr 3103: case 0b1100_000_101: 3104: case 0b1100_001_101: 3105: case 0b1100_010_101: 3106: case 0b1100_011_101: 3107: case 0b1100_100_101: 3108: case 0b1100_101_101: 3109: case 0b1100_110_101: 3110: case 0b1100_111_101: 3111: irpAndToMemWord (); 3112: break irpSwitch; 3113: 3114: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3115: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3116: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3117: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3118: //EXG.L Dq,Ar |-|012346|-|-----|-----| |1100_qqq_110_001_rrr 3119: //AND.L Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1100_qqq_110_mmm_rrr 3120: case 0b1100_000_110: 3121: case 0b1100_001_110: 3122: case 0b1100_010_110: 3123: case 0b1100_011_110: 3124: case 0b1100_100_110: 3125: case 0b1100_101_110: 3126: case 0b1100_110_110: 3127: case 0b1100_111_110: 3128: irpAndToMemLong (); 3129: break irpSwitch; 3130: 3131: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3132: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3133: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3134: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3135: //MULS.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1100_qqq_111_mmm_rrr 3136: case 0b1100_000_111: 3137: case 0b1100_001_111: 3138: case 0b1100_010_111: 3139: case 0b1100_011_111: 3140: case 0b1100_100_111: 3141: case 0b1100_101_111: 3142: case 0b1100_110_111: 3143: case 0b1100_111_111: 3144: irpMulsWord (); 3145: break irpSwitch; 3146: 3147: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3148: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3149: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3150: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3151: //ADD.B <ea>,Dq |-|012346|-|UUUUU|*****|D M+-WXZPI|1101_qqq_000_mmm_rrr 3152: case 0b1101_000_000: 3153: case 0b1101_001_000: 3154: case 0b1101_010_000: 3155: case 0b1101_011_000: 3156: case 0b1101_100_000: 3157: case 0b1101_101_000: 3158: case 0b1101_110_000: 3159: case 0b1101_111_000: 3160: irpAddToRegByte (); 3161: break irpSwitch; 3162: 3163: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3164: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3165: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3166: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3167: //ADD.W <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1101_qqq_001_mmm_rrr 3168: case 0b1101_000_001: 3169: case 0b1101_001_001: 3170: case 0b1101_010_001: 3171: case 0b1101_011_001: 3172: case 0b1101_100_001: 3173: case 0b1101_101_001: 3174: case 0b1101_110_001: 3175: case 0b1101_111_001: 3176: irpAddToRegWord (); 3177: break irpSwitch; 3178: 3179: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3180: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3181: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3182: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3183: //ADD.L <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1101_qqq_010_mmm_rrr 3184: case 0b1101_000_010: 3185: case 0b1101_001_010: 3186: case 0b1101_010_010: 3187: case 0b1101_011_010: 3188: case 0b1101_100_010: 3189: case 0b1101_101_010: 3190: case 0b1101_110_010: 3191: case 0b1101_111_010: 3192: irpAddToRegLong (); 3193: break irpSwitch; 3194: 3195: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3196: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3197: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3198: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3199: //ADDA.W <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_011_mmm_rrr 3200: //ADD.W <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_011_mmm_rrr [ADDA.W <ea>,Aq] 3201: case 0b1101_000_011: 3202: case 0b1101_001_011: 3203: case 0b1101_010_011: 3204: case 0b1101_011_011: 3205: case 0b1101_100_011: 3206: case 0b1101_101_011: 3207: case 0b1101_110_011: 3208: case 0b1101_111_011: 3209: irpAddaWord (); 3210: break irpSwitch; 3211: 3212: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3213: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3214: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3215: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3216: //ADDX.B Dr,Dq |-|012346|-|*UUUU|*****| |1101_qqq_100_000_rrr 3217: //ADDX.B -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1101_qqq_100_001_rrr 3218: //ADD.B Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1101_qqq_100_mmm_rrr 3219: case 0b1101_000_100: 3220: case 0b1101_001_100: 3221: case 0b1101_010_100: 3222: case 0b1101_011_100: 3223: case 0b1101_100_100: 3224: case 0b1101_101_100: 3225: case 0b1101_110_100: 3226: case 0b1101_111_100: 3227: irpAddToMemByte (); 3228: break irpSwitch; 3229: 3230: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3231: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3232: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3233: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3234: //ADDX.W Dr,Dq |-|012346|-|*UUUU|*****| |1101_qqq_101_000_rrr 3235: //ADDX.W -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1101_qqq_101_001_rrr 3236: //ADD.W Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1101_qqq_101_mmm_rrr 3237: case 0b1101_000_101: 3238: case 0b1101_001_101: 3239: case 0b1101_010_101: 3240: case 0b1101_011_101: 3241: case 0b1101_100_101: 3242: case 0b1101_101_101: 3243: case 0b1101_110_101: 3244: case 0b1101_111_101: 3245: irpAddToMemWord (); 3246: break irpSwitch; 3247: 3248: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3249: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3250: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3251: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3252: //ADDX.L Dr,Dq |-|012346|-|*UUUU|*****| |1101_qqq_110_000_rrr 3253: //ADDX.L -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1101_qqq_110_001_rrr 3254: //ADD.L Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1101_qqq_110_mmm_rrr 3255: case 0b1101_000_110: 3256: case 0b1101_001_110: 3257: case 0b1101_010_110: 3258: case 0b1101_011_110: 3259: case 0b1101_100_110: 3260: case 0b1101_101_110: 3261: case 0b1101_110_110: 3262: case 0b1101_111_110: 3263: irpAddToMemLong (); 3264: break irpSwitch; 3265: 3266: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3267: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3268: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3269: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3270: //ADDA.L <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_111_mmm_rrr 3271: //ADD.L <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_111_mmm_rrr [ADDA.L <ea>,Aq] 3272: case 0b1101_000_111: 3273: case 0b1101_001_111: 3274: case 0b1101_010_111: 3275: case 0b1101_011_111: 3276: case 0b1101_100_111: 3277: case 0b1101_101_111: 3278: case 0b1101_110_111: 3279: case 0b1101_111_111: 3280: irpAddaLong (); 3281: break irpSwitch; 3282: 3283: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3284: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3285: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3286: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3287: //ASR.B #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_000_rrr 3288: //LSR.B #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_001_rrr 3289: //ROXR.B #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_000_010_rrr 3290: //ROR.B #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_000_011_rrr 3291: //ASR.B Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_100_rrr 3292: //LSR.B Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_101_rrr 3293: //ROXR.B Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_000_110_rrr 3294: //ROR.B Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_000_111_rrr 3295: //ASR.B Dr |A|012346|-|UUUUU|***0*| |1110_001_000_000_rrr [ASR.B #1,Dr] 3296: //LSR.B Dr |A|012346|-|UUUUU|***0*| |1110_001_000_001_rrr [LSR.B #1,Dr] 3297: //ROXR.B Dr |A|012346|-|*UUUU|***0*| |1110_001_000_010_rrr [ROXR.B #1,Dr] 3298: //ROR.B Dr |A|012346|-|-UUUU|-**0*| |1110_001_000_011_rrr [ROR.B #1,Dr] 3299: case 0b1110_000_000: 3300: case 0b1110_001_000: 3301: case 0b1110_010_000: 3302: case 0b1110_011_000: 3303: case 0b1110_100_000: 3304: case 0b1110_101_000: 3305: case 0b1110_110_000: 3306: case 0b1110_111_000: 3307: irpXxrToRegByte (); 3308: break irpSwitch; 3309: 3310: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3311: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3312: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3313: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3314: //ASR.W #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_000_rrr 3315: //LSR.W #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_001_rrr 3316: //ROXR.W #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_001_010_rrr 3317: //ROR.W #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_001_011_rrr 3318: //ASR.W Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_100_rrr 3319: //LSR.W Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_101_rrr 3320: //ROXR.W Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_001_110_rrr 3321: //ROR.W Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_001_111_rrr 3322: //ASR.W Dr |A|012346|-|UUUUU|***0*| |1110_001_001_000_rrr [ASR.W #1,Dr] 3323: //LSR.W Dr |A|012346|-|UUUUU|***0*| |1110_001_001_001_rrr [LSR.W #1,Dr] 3324: //ROXR.W Dr |A|012346|-|*UUUU|***0*| |1110_001_001_010_rrr [ROXR.W #1,Dr] 3325: //ROR.W Dr |A|012346|-|-UUUU|-**0*| |1110_001_001_011_rrr [ROR.W #1,Dr] 3326: case 0b1110_000_001: 3327: case 0b1110_001_001: 3328: case 0b1110_010_001: 3329: case 0b1110_011_001: 3330: case 0b1110_100_001: 3331: case 0b1110_101_001: 3332: case 0b1110_110_001: 3333: case 0b1110_111_001: 3334: irpXxrToRegWord (); 3335: break irpSwitch; 3336: 3337: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3338: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3339: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3340: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3341: //ASR.L #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_000_rrr 3342: //LSR.L #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_001_rrr 3343: //ROXR.L #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_010_010_rrr 3344: //ROR.L #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_010_011_rrr 3345: //ASR.L Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_100_rrr 3346: //LSR.L Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_101_rrr 3347: //ROXR.L Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_010_110_rrr 3348: //ROR.L Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_010_111_rrr 3349: //ASR.L Dr |A|012346|-|UUUUU|***0*| |1110_001_010_000_rrr [ASR.L #1,Dr] 3350: //LSR.L Dr |A|012346|-|UUUUU|***0*| |1110_001_010_001_rrr [LSR.L #1,Dr] 3351: //ROXR.L Dr |A|012346|-|*UUUU|***0*| |1110_001_010_010_rrr [ROXR.L #1,Dr] 3352: //ROR.L Dr |A|012346|-|-UUUU|-**0*| |1110_001_010_011_rrr [ROR.L #1,Dr] 3353: case 0b1110_000_010: 3354: case 0b1110_001_010: 3355: case 0b1110_010_010: 3356: case 0b1110_011_010: 3357: case 0b1110_100_010: 3358: case 0b1110_101_010: 3359: case 0b1110_110_010: 3360: case 0b1110_111_010: 3361: irpXxrToRegLong (); 3362: break irpSwitch; 3363: 3364: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3365: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3366: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3367: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3368: //ASR.W <ea> |-|012346|-|UUUUU|***0*| M+-WXZ |1110_000_011_mmm_rrr 3369: case 0b1110_000_011: 3370: irpAsrToMem (); 3371: break irpSwitch; 3372: 3373: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3374: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3375: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3376: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3377: //ASL.B #<data>,Dr |-|012346|-|UUUUU|*****| |1110_qqq_100_000_rrr 3378: //LSL.B #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_100_001_rrr 3379: //ROXL.B #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_100_010_rrr 3380: //ROL.B #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_100_011_rrr 3381: //ASL.B Dq,Dr |-|012346|-|UUUUU|*****| |1110_qqq_100_100_rrr 3382: //LSL.B Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_100_101_rrr 3383: //ROXL.B Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_100_110_rrr 3384: //ROL.B Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_100_111_rrr 3385: //ASL.B Dr |A|012346|-|UUUUU|*****| |1110_001_100_000_rrr [ASL.B #1,Dr] 3386: //LSL.B Dr |A|012346|-|UUUUU|***0*| |1110_001_100_001_rrr [LSL.B #1,Dr] 3387: //ROXL.B Dr |A|012346|-|*UUUU|***0*| |1110_001_100_010_rrr [ROXL.B #1,Dr] 3388: //ROL.B Dr |A|012346|-|-UUUU|-**0*| |1110_001_100_011_rrr [ROL.B #1,Dr] 3389: case 0b1110_000_100: 3390: case 0b1110_001_100: 3391: case 0b1110_010_100: 3392: case 0b1110_011_100: 3393: case 0b1110_100_100: 3394: case 0b1110_101_100: 3395: case 0b1110_110_100: 3396: case 0b1110_111_100: 3397: irpXxlToRegByte (); 3398: break irpSwitch; 3399: 3400: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3401: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3402: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3403: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3404: //ASL.W #<data>,Dr |-|012346|-|UUUUU|*****| |1110_qqq_101_000_rrr 3405: //LSL.W #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_101_001_rrr 3406: //ROXL.W #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_101_010_rrr 3407: //ROL.W #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_101_011_rrr 3408: //ASL.W Dq,Dr |-|012346|-|UUUUU|*****| |1110_qqq_101_100_rrr 3409: //LSL.W Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_101_101_rrr 3410: //ROXL.W Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_101_110_rrr 3411: //ROL.W Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_101_111_rrr 3412: //ASL.W Dr |A|012346|-|UUUUU|*****| |1110_001_101_000_rrr [ASL.W #1,Dr] 3413: //LSL.W Dr |A|012346|-|UUUUU|***0*| |1110_001_101_001_rrr [LSL.W #1,Dr] 3414: //ROXL.W Dr |A|012346|-|*UUUU|***0*| |1110_001_101_010_rrr [ROXL.W #1,Dr] 3415: //ROL.W Dr |A|012346|-|-UUUU|-**0*| |1110_001_101_011_rrr [ROL.W #1,Dr] 3416: case 0b1110_000_101: 3417: case 0b1110_001_101: 3418: case 0b1110_010_101: 3419: case 0b1110_011_101: 3420: case 0b1110_100_101: 3421: case 0b1110_101_101: 3422: case 0b1110_110_101: 3423: case 0b1110_111_101: 3424: irpXxlToRegWord (); 3425: break irpSwitch; 3426: 3427: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3428: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3429: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3430: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3431: //ASL.L #<data>,Dr |-|012346|-|UUUUU|*****| |1110_qqq_110_000_rrr 3432: //LSL.L #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_110_001_rrr 3433: //ROXL.L #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_110_010_rrr 3434: //ROL.L #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_110_011_rrr 3435: //ASL.L Dq,Dr |-|012346|-|UUUUU|*****| |1110_qqq_110_100_rrr 3436: //LSL.L Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_110_101_rrr 3437: //ROXL.L Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_110_110_rrr 3438: //ROL.L Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_110_111_rrr 3439: //ASL.L Dr |A|012346|-|UUUUU|*****| |1110_001_110_000_rrr [ASL.L #1,Dr] 3440: //LSL.L Dr |A|012346|-|UUUUU|***0*| |1110_001_110_001_rrr [LSL.L #1,Dr] 3441: //ROXL.L Dr |A|012346|-|*UUUU|***0*| |1110_001_110_010_rrr [ROXL.L #1,Dr] 3442: //ROL.L Dr |A|012346|-|-UUUU|-**0*| |1110_001_110_011_rrr [ROL.L #1,Dr] 3443: case 0b1110_000_110: 3444: case 0b1110_001_110: 3445: case 0b1110_010_110: 3446: case 0b1110_011_110: 3447: case 0b1110_100_110: 3448: case 0b1110_101_110: 3449: case 0b1110_110_110: 3450: case 0b1110_111_110: 3451: irpXxlToRegLong (); 3452: break irpSwitch; 3453: 3454: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3455: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3456: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3457: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3458: //ASL.W <ea> |-|012346|-|UUUUU|*****| M+-WXZ |1110_000_111_mmm_rrr 3459: case 0b1110_000_111: 3460: irpAslToMem (); 3461: break irpSwitch; 3462: 3463: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3464: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3465: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3466: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3467: //LSR.W <ea> |-|012346|-|UUUUU|*0*0*| M+-WXZ |1110_001_011_mmm_rrr 3468: case 0b1110_001_011: 3469: irpLsrToMem (); 3470: break irpSwitch; 3471: 3472: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3473: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3474: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3475: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3476: //LSL.W <ea> |-|012346|-|UUUUU|***0*| M+-WXZ |1110_001_111_mmm_rrr 3477: case 0b1110_001_111: 3478: irpLslToMem (); 3479: break irpSwitch; 3480: 3481: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3482: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3483: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3484: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3485: //ROXR.W <ea> |-|012346|-|*UUUU|***0*| M+-WXZ |1110_010_011_mmm_rrr 3486: case 0b1110_010_011: 3487: irpRoxrToMem (); 3488: break irpSwitch; 3489: 3490: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3491: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3492: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3493: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3494: //ROXL.W <ea> |-|012346|-|*UUUU|***0*| M+-WXZ |1110_010_111_mmm_rrr 3495: case 0b1110_010_111: 3496: irpRoxlToMem (); 3497: break irpSwitch; 3498: 3499: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3500: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3501: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3502: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3503: //ROR.W <ea> |-|012346|-|-UUUU|-**0*| M+-WXZ |1110_011_011_mmm_rrr 3504: case 0b1110_011_011: 3505: irpRorToMem (); 3506: break irpSwitch; 3507: 3508: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3509: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3510: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3511: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3512: //ROL.W <ea> |-|012346|-|-UUUU|-**0*| M+-WXZ |1110_011_111_mmm_rrr 3513: case 0b1110_011_111: 3514: irpRolToMem (); 3515: break irpSwitch; 3516: 3517: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3518: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3519: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3520: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3521: //FPACK <data> |A|012346|-|UUUUU|*****| |1111_111_0dd_ddd_ddd [FLINE #<data>] 3522: case 0b1111_111_000: 3523: case 0b1111_111_001: 3524: case 0b1111_111_010: 3525: case 0b1111_111_011: 3526: irpFpack (); 3527: break irpSwitch; 3528: 3529: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3530: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3531: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3532: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3533: //DOS <data> |A|012346|-|UUUUU|UUUUU| |1111_111_1dd_ddd_ddd [FLINE #<data>] 3534: case 0b1111_111_100: 3535: case 0b1111_111_101: 3536: case 0b1111_111_110: 3537: case 0b1111_111_111: 3538: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3539: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3540: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3541: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3542: //FLINE #<data> |-|012346|-|UUUUU|UUUUU| |1111_ddd_ddd_ddd_ddd (line 1111 emulator) 3543: case 0b1111_000_000: 3544: case 0b1111_000_001: 3545: case 0b1111_000_010: 3546: case 0b1111_000_011: 3547: case 0b1111_000_100: 3548: case 0b1111_000_101: 3549: case 0b1111_000_110: 3550: case 0b1111_000_111: 3551: case 0b1111_001_000: 3552: case 0b1111_001_001: 3553: case 0b1111_001_010: 3554: case 0b1111_001_011: 3555: case 0b1111_001_100: 3556: case 0b1111_001_101: 3557: case 0b1111_001_110: 3558: case 0b1111_001_111: 3559: case 0b1111_010_000: 3560: case 0b1111_010_001: 3561: case 0b1111_010_010: 3562: case 0b1111_010_011: 3563: case 0b1111_010_100: 3564: case 0b1111_010_101: 3565: case 0b1111_010_110: 3566: case 0b1111_010_111: 3567: case 0b1111_011_000: 3568: case 0b1111_011_001: 3569: case 0b1111_011_010: 3570: case 0b1111_011_011: 3571: case 0b1111_011_100: 3572: case 0b1111_011_101: 3573: case 0b1111_011_110: 3574: case 0b1111_011_111: 3575: case 0b1111_100_000: 3576: case 0b1111_100_001: 3577: case 0b1111_100_010: 3578: case 0b1111_100_011: 3579: case 0b1111_100_100: 3580: case 0b1111_100_101: 3581: case 0b1111_100_110: 3582: case 0b1111_100_111: 3583: case 0b1111_101_000: 3584: case 0b1111_101_001: 3585: case 0b1111_101_010: 3586: case 0b1111_101_011: 3587: case 0b1111_101_100: 3588: case 0b1111_101_101: 3589: case 0b1111_101_110: 3590: case 0b1111_101_111: 3591: case 0b1111_110_000: 3592: case 0b1111_110_001: 3593: case 0b1111_110_010: 3594: case 0b1111_110_011: 3595: case 0b1111_110_100: 3596: case 0b1111_110_101: 3597: case 0b1111_110_110: 3598: case 0b1111_110_111: 3599: irpFline (); 3600: break irpSwitch; 3601: 3602: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3603: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 3604: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 3605: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 3606: //HFSBOOT |-|012346|-|-----|-----| |0100_111_000_000_000 3607: //HFSINST |-|012346|-|-----|-----| |0100_111_000_000_001 3608: //HFSSTR |-|012346|-|-----|-----| |0100_111_000_000_010 3609: //HFSINT |-|012346|-|-----|-----| |0100_111_000_000_011 3610: //EMXNOP |-|012346|-|-----|-----| |0100_111_000_000_100 3611: case 0b0100_111_000: 3612: irpEmx (); 3613: break; 3614: 3615: default: 3616: irpIllegal (); 3617: 3618: } //switch XEiJ.regOC >>> 6 3619: 3620: //トレース例外 3621: // 命令実行前にsrのTビットがセットされていたとき命令実行後にトレース例外が発生する 3622: // トレース例外の発動は命令の機能拡張であり、他の例外処理で命令が中断されたときはトレース例外は発生しない 3623: // 命令例外はトレース例外の前に、割り込み例外はトレース例外の後に処理される 3624: // 未実装命令のエミュレーションルーチンはrteの直前にsrのTビットを復元することで未実装命令が1個の命令としてトレースされたように見せる 3625: // ;DOSコールの終了 3626: // ~008616: 3627: // btst.b #$07,(sp) 3628: // bne.s ~00861E 3629: // rte 3630: // ~00861E: 3631: // ori.w #$8000,sr 3632: // rte 3633: if (XEiJ.mpuTraceFlag != 0) { //命令実行前にsrのTビットがセットされていた 3634: XEiJ.mpuCycleCount += 34; 3635: irpException (M68kException.M6E_TRACE, XEiJ.regPC, XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR); //pcは次の命令 3636: } 3637: //クロックをカウントアップする 3638: // オペランドをアクセスした時点ではまだXEiJ.mpuClockTimeが更新されていないのでXEiJ.mpuClockTime<xxxClock 3639: // xxxTickを呼び出すときはXEiJ.mpuClockTime>=xxxClock 3640: XEiJ.mpuClockTime += XEiJ.mpuModifiedUnit * XEiJ.mpuCycleCount; 3641: //デバイスを呼び出す 3642: TickerQueue.tkqRun (XEiJ.mpuClockTime); 3643: //割り込みを受け付ける 3644: if ((t = XEiJ.mpuIMR & XEiJ.mpuIRR) != 0) { //マスクされているレベルよりも高くて受け付けていない割り込みがあるとき 3645: if (XEiJ.MPU_INTERRUPT_SWITCH) { 3646: switch (t) { 3647: case 0b00000001: 3648: case 0b00000011: 3649: case 0b00000101: 3650: case 0b00000111: 3651: case 0b00001001: 3652: case 0b00001011: 3653: case 0b00001101: 3654: case 0b00001111: 3655: case 0b00010001: 3656: case 0b00010011: 3657: case 0b00010101: 3658: case 0b00010111: 3659: case 0b00011001: 3660: case 0b00011011: 3661: case 0b00011101: 3662: case 0b00011111: 3663: case 0b00100001: 3664: case 0b00100011: 3665: case 0b00100101: 3666: case 0b00100111: 3667: case 0b00101001: 3668: case 0b00101011: 3669: case 0b00101101: 3670: case 0b00101111: 3671: case 0b00110001: 3672: case 0b00110011: 3673: case 0b00110101: 3674: case 0b00110111: 3675: case 0b00111001: 3676: case 0b00111011: 3677: case 0b00111101: 3678: case 0b00111111: 3679: case 0b01000001: 3680: case 0b01000011: 3681: case 0b01000101: 3682: case 0b01000111: 3683: case 0b01001001: 3684: case 0b01001011: 3685: case 0b01001101: 3686: case 0b01001111: 3687: case 0b01010001: 3688: case 0b01010011: 3689: case 0b01010101: 3690: case 0b01010111: 3691: case 0b01011001: 3692: case 0b01011011: 3693: case 0b01011101: 3694: case 0b01011111: 3695: case 0b01100001: 3696: case 0b01100011: 3697: case 0b01100101: 3698: case 0b01100111: 3699: case 0b01101001: 3700: case 0b01101011: 3701: case 0b01101101: 3702: case 0b01101111: 3703: case 0b01110001: 3704: case 0b01110011: 3705: case 0b01110101: 3706: case 0b01110111: 3707: case 0b01111001: 3708: case 0b01111011: 3709: case 0b01111101: 3710: case 0b01111111: 3711: case 0b10000001: 3712: case 0b10000011: 3713: case 0b10000101: 3714: case 0b10000111: 3715: case 0b10001001: 3716: case 0b10001011: 3717: case 0b10001101: 3718: case 0b10001111: 3719: case 0b10010001: 3720: case 0b10010011: 3721: case 0b10010101: 3722: case 0b10010111: 3723: case 0b10011001: 3724: case 0b10011011: 3725: case 0b10011101: 3726: case 0b10011111: 3727: case 0b10100001: 3728: case 0b10100011: 3729: case 0b10100101: 3730: case 0b10100111: 3731: case 0b10101001: 3732: case 0b10101011: 3733: case 0b10101101: 3734: case 0b10101111: 3735: case 0b10110001: 3736: case 0b10110011: 3737: case 0b10110101: 3738: case 0b10110111: 3739: case 0b10111001: 3740: case 0b10111011: 3741: case 0b10111101: 3742: case 0b10111111: 3743: case 0b11000001: 3744: case 0b11000011: 3745: case 0b11000101: 3746: case 0b11000111: 3747: case 0b11001001: 3748: case 0b11001011: 3749: case 0b11001101: 3750: case 0b11001111: 3751: case 0b11010001: 3752: case 0b11010011: 3753: case 0b11010101: 3754: case 0b11010111: 3755: case 0b11011001: 3756: case 0b11011011: 3757: case 0b11011101: 3758: case 0b11011111: 3759: case 0b11100001: 3760: case 0b11100011: 3761: case 0b11100101: 3762: case 0b11100111: 3763: case 0b11101001: 3764: case 0b11101011: 3765: case 0b11101101: 3766: case 0b11101111: 3767: case 0b11110001: 3768: case 0b11110011: 3769: case 0b11110101: 3770: case 0b11110111: 3771: case 0b11111001: 3772: case 0b11111011: 3773: case 0b11111101: 3774: case 0b11111111: 3775: //レベル7 3776: XEiJ.mpuIRR &= ~XEiJ.MPU_SYS_INTERRUPT_MASK; //割り込みを受け付ける 3777: if ((t = XEiJ.sysAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3778: irpInterrupt (t, XEiJ.MPU_SYS_INTERRUPT_LEVEL); //割り込み処理を開始する 3779: } 3780: break; 3781: case 0b00000010: 3782: case 0b00000110: 3783: case 0b00001010: 3784: case 0b00001110: 3785: case 0b00010010: 3786: case 0b00010110: 3787: case 0b00011010: 3788: case 0b00011110: 3789: case 0b00100010: 3790: case 0b00100110: 3791: case 0b00101010: 3792: case 0b00101110: 3793: case 0b00110010: 3794: case 0b00110110: 3795: case 0b00111010: 3796: case 0b00111110: 3797: case 0b01000010: 3798: case 0b01000110: 3799: case 0b01001010: 3800: case 0b01001110: 3801: case 0b01010010: 3802: case 0b01010110: 3803: case 0b01011010: 3804: case 0b01011110: 3805: case 0b01100010: 3806: case 0b01100110: 3807: case 0b01101010: 3808: case 0b01101110: 3809: case 0b01110010: 3810: case 0b01110110: 3811: case 0b01111010: 3812: case 0b01111110: 3813: case 0b10000010: 3814: case 0b10000110: 3815: case 0b10001010: 3816: case 0b10001110: 3817: case 0b10010010: 3818: case 0b10010110: 3819: case 0b10011010: 3820: case 0b10011110: 3821: case 0b10100010: 3822: case 0b10100110: 3823: case 0b10101010: 3824: case 0b10101110: 3825: case 0b10110010: 3826: case 0b10110110: 3827: case 0b10111010: 3828: case 0b10111110: 3829: case 0b11000010: 3830: case 0b11000110: 3831: case 0b11001010: 3832: case 0b11001110: 3833: case 0b11010010: 3834: case 0b11010110: 3835: case 0b11011010: 3836: case 0b11011110: 3837: case 0b11100010: 3838: case 0b11100110: 3839: case 0b11101010: 3840: case 0b11101110: 3841: case 0b11110010: 3842: case 0b11110110: 3843: case 0b11111010: 3844: case 0b11111110: 3845: //レベル6 3846: XEiJ.mpuIRR &= ~XEiJ.MPU_MFP_INTERRUPT_MASK; //割り込みを受け付ける 3847: if ((t = MC68901.mfpAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3848: irpInterrupt (t, XEiJ.MPU_MFP_INTERRUPT_LEVEL); //割り込み処理を開始する 3849: } 3850: break; 3851: case 0b00000100: 3852: case 0b00001100: 3853: case 0b00010100: 3854: case 0b00011100: 3855: case 0b00100100: 3856: case 0b00101100: 3857: case 0b00110100: 3858: case 0b00111100: 3859: case 0b01000100: 3860: case 0b01001100: 3861: case 0b01010100: 3862: case 0b01011100: 3863: case 0b01100100: 3864: case 0b01101100: 3865: case 0b01110100: 3866: case 0b01111100: 3867: case 0b10000100: 3868: case 0b10001100: 3869: case 0b10010100: 3870: case 0b10011100: 3871: case 0b10100100: 3872: case 0b10101100: 3873: case 0b10110100: 3874: case 0b10111100: 3875: case 0b11000100: 3876: case 0b11001100: 3877: case 0b11010100: 3878: case 0b11011100: 3879: case 0b11100100: 3880: case 0b11101100: 3881: case 0b11110100: 3882: case 0b11111100: 3883: //レベル5 3884: XEiJ.mpuIRR &= ~XEiJ.MPU_SCC_INTERRUPT_MASK; //割り込みを受け付ける 3885: if ((t = Z8530.sccAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3886: irpInterrupt (t, XEiJ.MPU_SCC_INTERRUPT_LEVEL); //割り込み処理を開始する 3887: } 3888: break; 3889: case 0b00010000: 3890: case 0b00110000: 3891: case 0b01010000: 3892: case 0b01110000: 3893: case 0b10010000: 3894: case 0b10110000: 3895: case 0b11010000: 3896: case 0b11110000: 3897: //レベル3 3898: XEiJ.mpuIRR &= ~XEiJ.MPU_DMA_INTERRUPT_MASK; //割り込みを受け付ける 3899: if ((t = HD63450.dmaAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3900: irpInterrupt (t, XEiJ.MPU_DMA_INTERRUPT_LEVEL); //割り込み処理を開始する 3901: } 3902: break; 3903: case 0b00100000: 3904: case 0b01100000: 3905: case 0b10100000: 3906: case 0b11100000: 3907: //レベル2 3908: XEiJ.mpuIRR &= ~XEiJ.MPU_EB2_INTERRUPT_MASK; //割り込みを受け付ける 3909: if ((t = XEiJ.eb2Acknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3910: irpInterrupt (t, XEiJ.MPU_EB2_INTERRUPT_LEVEL); //割り込み処理を開始する 3911: } 3912: break; 3913: case 0b01000000: 3914: case 0b11000000: 3915: //レベル1 3916: XEiJ.mpuIRR &= ~XEiJ.MPU_IOI_INTERRUPT_MASK; //割り込みを受け付ける 3917: if ((t = IOInterrupt.ioiAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3918: irpInterrupt (t, XEiJ.MPU_IOI_INTERRUPT_LEVEL); //割り込み処理を開始する 3919: } 3920: break; 3921: } 3922: } else { 3923: t &= -t; 3924: // x&=-xはxの最下位の1のビットだけを残す演算 3925: // すなわちマスクされているレベルよりも高くて受け付けていない割り込みの中で最高レベルの割り込みのビットだけが残る 3926: // 最高レベルの割り込みのビットしか残っていないので、割り込みの有無をレベルの高い順ではなく使用頻度の高い順に調べられる 3927: // MFPやDMAの割り込みがかかる度にそれより優先度の高いインタラプトスイッチが押されていないかどうかを確かめる必要がない 3928: if (t == XEiJ.MPU_MFP_INTERRUPT_MASK) { 3929: XEiJ.mpuIRR &= ~XEiJ.MPU_MFP_INTERRUPT_MASK; //割り込みを受け付ける 3930: if ((t = MC68901.mfpAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3931: irpInterrupt (t, XEiJ.MPU_MFP_INTERRUPT_LEVEL); //割り込み処理を開始する 3932: } 3933: } else if (t == XEiJ.MPU_DMA_INTERRUPT_MASK) { 3934: XEiJ.mpuIRR &= ~XEiJ.MPU_DMA_INTERRUPT_MASK; //割り込みを受け付ける 3935: if ((t = HD63450.dmaAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3936: irpInterrupt (t, XEiJ.MPU_DMA_INTERRUPT_LEVEL); //割り込み処理を開始する 3937: } 3938: } else if (t == XEiJ.MPU_SCC_INTERRUPT_MASK) { 3939: XEiJ.mpuIRR &= ~XEiJ.MPU_SCC_INTERRUPT_MASK; //割り込みを受け付ける 3940: if ((t = Z8530.sccAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3941: irpInterrupt (t, XEiJ.MPU_SCC_INTERRUPT_LEVEL); //割り込み処理を開始する 3942: } 3943: } else if (t == XEiJ.MPU_IOI_INTERRUPT_MASK) { 3944: XEiJ.mpuIRR &= ~XEiJ.MPU_IOI_INTERRUPT_MASK; //割り込みを受け付ける 3945: if ((t = IOInterrupt.ioiAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3946: irpInterrupt (t, XEiJ.MPU_IOI_INTERRUPT_LEVEL); //割り込み処理を開始する 3947: } 3948: } else if (t == XEiJ.MPU_EB2_INTERRUPT_MASK) { 3949: XEiJ.mpuIRR &= ~XEiJ.MPU_EB2_INTERRUPT_MASK; //割り込みを受け付ける 3950: if ((t = XEiJ.eb2Acknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3951: irpInterrupt (t, XEiJ.MPU_EB2_INTERRUPT_LEVEL); //割り込み処理を開始する 3952: } 3953: } else if (t == XEiJ.MPU_SYS_INTERRUPT_MASK) { 3954: XEiJ.mpuIRR &= ~XEiJ.MPU_SYS_INTERRUPT_MASK; //割り込みを受け付ける 3955: if ((t = XEiJ.sysAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 3956: irpInterrupt (t, XEiJ.MPU_SYS_INTERRUPT_LEVEL); //割り込み処理を開始する 3957: } 3958: } 3959: } 3960: } //if t!=0 3961: if (MC68901.MFP_DELAYED_INTERRUPT) { 3962: XEiJ.mpuIRR |= XEiJ.mpuDIRR; //遅延割り込み要求 3963: XEiJ.mpuDIRR = 0; 3964: } 3965: } //命令ループ 3966: } catch (M68kException e) { 3967: if (M68kException.m6eNumber == M68kException.M6E_WAIT_EXCEPTION) { //待機例外 3968: if (irpWaitException ()) { 3969: continue; 3970: } else { 3971: break errorLoop; 3972: } 3973: } 3974: if (M68kException.m6eNumber == M68kException.M6E_INSTRUCTION_BREAK_POINT) { //命令ブレークポイントによる停止 3975: XEiJ.regPC = XEiJ.regPC0; 3976: XEiJ.mpuStop1 (null); //"Instruction Break Point" 3977: break errorLoop; 3978: } 3979: XEiJ.mpuClockTime += XEiJ.mpuModifiedUnit * XEiJ.mpuCycleCount; 3980: //例外処理 3981: // ここで処理するのはベクタ番号が2~31の例外に限る。TRAP #n命令はインライン展開する 3982: // 使用頻度が高いと思われる例外はインライン展開するのでここには来ない 3983: // 例外処理をインライン展開する場合はMC68000とMC68030のコードを分けなければならずコードが冗長になる 3984: // 使用頻度が低いと思われる例外はインライン展開しない 3985: // セーブされるpcは以下の例外は命令の先頭、これ以外は次の命令 3986: // 2 BUS_ERROR 3987: // 3 ADDRESS_ERROR 3988: // 4 ILLEGAL_INSTRUCTION 3989: // 8 PRIVILEGE_VIOLATION 3990: // 10 LINE_1010_EMULATOR 3991: // 11 LINE_1111_EMULATOR 3992: // fedcba9876543210fedcba9876543210 3993: //if ((1 << M68kException.m6eNumber & 0b00000000000000000000110100011100) != 0) { 3994: // 0123456789abcdef0123456789abcdef 3995: if (0b00111000101100000000000000000000 << M68kException.m6eNumber < 0) { 3996: XEiJ.regPC = XEiJ.regPC0; //セーブされるpcは命令の先頭 3997: } 3998: try { 3999: int save_sr = XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR; 4000: int sp = XEiJ.regRn[15]; 4001: XEiJ.regSRT1 = 0; //srのTビットを消す 4002: if (XEiJ.regSRS == 0) { //ユーザモードのとき 4003: XEiJ.regSRS = XEiJ.REG_SR_S; //スーパーバイザモードへ移行する 4004: XEiJ.mpuUSP = sp; //USPを保存 4005: sp = XEiJ.mpuISP; //SSPを復元 4006: if (DataBreakPoint.DBP_ON) { 4007: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpSuperMap; //スーパーバイザメモリマップに切り替える 4008: } else { 4009: XEiJ.busMemoryMap = XEiJ.busSuperMap; //スーパーバイザメモリマップに切り替える 4010: } 4011: if (InstructionBreakPoint.IBP_ON) { 4012: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1SuperMap; 4013: } 4014: } 4015: int vectorOffset = M68kException.m6eNumber << 2; //vector offset 4016: if (M68kException.m6eNumber <= M68kException.M6E_ADDRESS_ERROR) { //バスエラーまたはアドレスエラー 4017: //ホストファイルシステムのデバイスコマンドを強制終了させる 4018: HFS.hfsState = HFS.HFS_STATE_IDLE; 4019: XEiJ.mpuClockTime += 50 * XEiJ.mpuModifiedUnit; 4020: //long format stack frame (bus error/address error) 4021: // $0000 .w status register 4022: // $0002 .l program counter 4023: // $0006 .w format and vector offset. $8008=bus error, $800C=address error 4024: // $0008 .w special status word 4025: // $000A .l fault address 4026: // $000E .w unused, reserved 4027: // $0010 .w data output buffer 4028: // $0012 .w unused, reserved 4029: // $0014 .w data input buffer 4030: // $0016 .w unused, reserved 4031: // $0018 .w instruction input buffer 4032: // $001A .w[16] internal information, 16 words 4033: // 29 words, 58 bytes 4034: //special status word 4035: // bit15 RR Rerun flag; 0=processor rerun (default), 1=software rerun 4036: // bit14 * These bits are reserved for future use by Motorola and will be zero when written by the MC68010. 4037: // bit13 IF Instruction fetch to the instruction input buffer 4038: // bit12 DF Data fetch to the data input buffer 4039: // bit11 RM Read-modify-write cycle 4040: // bit10 HB High-byte transfer from the data output buffer or to the data input buffer 4041: // bit9 BY Byte-transfer flag; HB selects the high or low byte of the transfer register. 4042: // If BY is clear, the transfer is word. 4043: // bit8 RW Read/write flag; 0=write, 1=read 4044: // bit7-3 * 4045: // bit2-0 FC2-FC0 The function code used during the faulted access 4046: XEiJ.regRn[15] = sp -= 58; //long format 4047: XEiJ.busWl (sp + 10, M68kException.m6eAddress); //fault address 4048: XEiJ.busWw (sp + 8, 4049: (M68kException.m6eSize == XEiJ.MPU_SS_BYTE ? 0x0200 : 0x0000) | //BY 4050: (M68kException.m6eDirection == XEiJ.MPU_WR_READ ? 0x0100 : 0x0000) //RW 4051: //!!! 他のフラグをセットしていない 4052: ); //special status word 4053: XEiJ.busWw (sp + 6, 0x8000 | vectorOffset); //format and vector offset 4054: XEiJ.busWl (sp + 2, XEiJ.regPC); //program counter 4055: XEiJ.busWw (sp, save_sr); //status register 4056: } else { 4057: //short format stack frame 4058: // $0000 .w status register 4059: // $0002 .l program counter 4060: // $0006 .w format and vector offset 4061: // 4 words, 8 bytes 4062: XEiJ.regRn[15] = sp -= 8; //short format 4063: XEiJ.busWw (sp + 6, 0x0000 | vectorOffset); //format and vector offset 4064: XEiJ.busWl (sp + 2, XEiJ.regPC); //program counter 4065: XEiJ.busWw (sp, save_sr); //status register 4066: } 4067: irpSetPC (XEiJ.busRlsf (XEiJ.mpuVBR + vectorOffset)); //例外ベクタを取り出してジャンプする 4068: if (XEiJ.dbgStopOnError) { //エラーで停止する場合 4069: if (XEiJ.dbgDoStopOnError ()) { 4070: break errorLoop; 4071: } 4072: } 4073: } catch (M68kException ee) { //ダブルバスフォルト 4074: XEiJ.dbgDoubleBusFault (); 4075: break errorLoop; 4076: } 4077: } //catch M68kException 4078: } //例外ループ 4079: 4080: // 通常 4081: // pc0 最後に実行した命令 4082: // pc 次に実行する命令 4083: // バスエラー、アドレスエラー、不当命令、特権違反で停止したとき 4084: // pc0 エラーを発生させた命令 4085: // pc 例外処理ルーチンの先頭 4086: // ダブルバスフォルトで停止したとき 4087: // pc0 エラーを発生させた命令 4088: // pc エラーを発生させた命令 4089: // 命令ブレークポイントで停止したとき 4090: // pc0 命令ブレークポイントが設定された、次に実行する命令 4091: // pc 命令ブレークポイントが設定された、次に実行する命令 4092: // データブレークポイントで停止したとき 4093: // pc0 データを書き換えた、最後に実行した命令 4094: // pc 次に実行する命令 4095: 4096: //分岐ログに停止レコードを記録する 4097: if (BranchLog.BLG_ON) { 4098: //BranchLog.blgStop (); 4099: int i = (char) BranchLog.blgNewestRecord << BranchLog.BLG_RECORD_SHIFT; 4100: BranchLog.blgArray[i] = BranchLog.blgHead | BranchLog.blgSuper; 4101: BranchLog.blgArray[i + 1] = XEiJ.regPC; //次に実行する命令 4102: } 4103: 4104: } //mpuCore() 4105: 4106: 4107: 4108: //cont = irpWaitException () 4109: // 待機例外をキャッチしたとき 4110: public static boolean irpWaitException () { 4111: XEiJ.regPC = XEiJ.regPC0; //PCを巻き戻す 4112: XEiJ.regRn[8 + (XEiJ.regOC & 7)] += WaitInstruction.REWIND_AR[XEiJ.regOC >> 3]; //(Ar)+|-(Ar)で変化したArを巻き戻す 4113: try { 4114: //トレース例外を処理する 4115: if (XEiJ.mpuTraceFlag != 0) { //命令実行前にsrのTビットがセットされていた 4116: XEiJ.mpuCycleCount += 34; 4117: irpException (M68kException.M6E_TRACE, XEiJ.regPC, XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR); //pcは次の命令 4118: } 4119: //デバイスを呼び出す 4120: TickerQueue.tkqRun (XEiJ.mpuClockTime); 4121: //割り込みを受け付ける 4122: int t; 4123: if ((t = XEiJ.mpuIMR & XEiJ.mpuIRR) != 0) { //マスクされているレベルよりも高くて受け付けていない割り込みがあるとき 4124: t &= -t; 4125: // x&=-xはxの最下位の1のビットだけを残す演算 4126: // すなわちマスクされているレベルよりも高くて受け付けていない割り込みの中で最高レベルの割り込みのビットだけが残る 4127: // 最高レベルの割り込みのビットしか残っていないので、割り込みの有無をレベルの高い順ではなく使用頻度の高い順に調べられる 4128: // MFPやDMAの割り込みがかかる度にそれより優先度の高いインタラプトスイッチが押されていないかどうかを確かめる必要がない 4129: if (t == XEiJ.MPU_MFP_INTERRUPT_MASK) { 4130: XEiJ.mpuIRR &= ~XEiJ.MPU_MFP_INTERRUPT_MASK; //割り込みを受け付ける 4131: if ((t = MC68901.mfpAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 4132: irpInterrupt (t, XEiJ.MPU_MFP_INTERRUPT_LEVEL); //割り込み処理を開始する 4133: } 4134: } else if (t == XEiJ.MPU_DMA_INTERRUPT_MASK) { 4135: XEiJ.mpuIRR &= ~XEiJ.MPU_DMA_INTERRUPT_MASK; //割り込みを受け付ける 4136: if ((t = HD63450.dmaAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 4137: irpInterrupt (t, XEiJ.MPU_DMA_INTERRUPT_LEVEL); //割り込み処理を開始する 4138: } 4139: } else if (t == XEiJ.MPU_SCC_INTERRUPT_MASK) { 4140: XEiJ.mpuIRR &= ~XEiJ.MPU_SCC_INTERRUPT_MASK; //割り込みを受け付ける 4141: if ((t = Z8530.sccAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 4142: irpInterrupt (t, XEiJ.MPU_SCC_INTERRUPT_LEVEL); //割り込み処理を開始する 4143: } 4144: } else if (t == XEiJ.MPU_IOI_INTERRUPT_MASK) { 4145: XEiJ.mpuIRR &= ~XEiJ.MPU_IOI_INTERRUPT_MASK; //割り込みを受け付ける 4146: if ((t = IOInterrupt.ioiAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 4147: irpInterrupt (t, XEiJ.MPU_IOI_INTERRUPT_LEVEL); //割り込み処理を開始する 4148: } 4149: } else if (t == XEiJ.MPU_EB2_INTERRUPT_MASK) { 4150: XEiJ.mpuIRR &= ~XEiJ.MPU_EB2_INTERRUPT_MASK; //割り込みを受け付ける 4151: if ((t = XEiJ.eb2Acknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 4152: irpInterrupt (t, XEiJ.MPU_EB2_INTERRUPT_LEVEL); //割り込み処理を開始する 4153: } 4154: } else if (t == XEiJ.MPU_SYS_INTERRUPT_MASK) { 4155: XEiJ.mpuIRR &= ~XEiJ.MPU_SYS_INTERRUPT_MASK; //割り込みを受け付ける 4156: if ((t = XEiJ.sysAcknowledge ()) != 0) { //デバイスにベクタ番号を要求して割り込み処理中の状態になったとき 4157: irpInterrupt (t, XEiJ.MPU_SYS_INTERRUPT_LEVEL); //割り込み処理を開始する 4158: } 4159: } 4160: } //if t!=0 4161: if (MC68901.MFP_DELAYED_INTERRUPT) { 4162: XEiJ.mpuIRR |= XEiJ.mpuDIRR; //遅延割り込み要求 4163: XEiJ.mpuDIRR = 0; 4164: } 4165: } catch (M68kException e) { 4166: //!!! 待機例外処理中のバスエラーの処理は省略 4167: XEiJ.dbgDoubleBusFault (); 4168: return false; 4169: } //catch M68kException 4170: return true; 4171: } //irpWaitException 4172: 4173: 4174: 4175: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4176: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4177: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4178: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4179: //ORI.B #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_000_000_mmm_rrr-{data} 4180: //OR.B #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_000_000_mmm_rrr-{data} [ORI.B #<data>,<ea>] 4181: //ORI.B #<data>,CCR |-|012346|-|*****|*****| |0000_000_000_111_100-{data} 4182: public static void irpOriByte () throws M68kException { 4183: int ea = XEiJ.regOC & 63; 4184: int z; 4185: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4186: z = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4187: } else { 4188: z = XEiJ.regPC; 4189: XEiJ.regPC = z + 2; 4190: z = XEiJ.busRbs (z + 1); //pcbs 4191: } 4192: if (ea < XEiJ.EA_AR) { //ORI.B #<data>,Dr 4193: if (XEiJ.DBG_ORI_BYTE_ZERO_D0) { 4194: if (z == 0 && ea == 0 && XEiJ.dbgOriByteZeroD0) { //ORI.B #$00,D0 4195: XEiJ.mpuCycleCount += 34; 4196: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 4197: throw M68kException.m6eSignal; 4198: } 4199: } 4200: XEiJ.mpuCycleCount += 8; 4201: z = XEiJ.regRn[ea] |= 255 & z; //0拡張してからOR 4202: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 4203: } else if (ea == XEiJ.EA_IM) { //ORI.B #<data>,CCR 4204: XEiJ.mpuCycleCount += 20; 4205: XEiJ.regCCR |= XEiJ.REG_CCR_MASK & z; 4206: } else { //ORI.B #<data>,<mem> 4207: XEiJ.mpuCycleCount += 12; 4208: int a = efaMltByte (ea); 4209: XEiJ.busWb (a, z |= XEiJ.busRbs (a)); 4210: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 4211: } 4212: } //irpOriByte 4213: 4214: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4215: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4216: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4217: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4218: //ORI.W #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_000_001_mmm_rrr-{data} 4219: //OR.W #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_000_001_mmm_rrr-{data} [ORI.W #<data>,<ea>] 4220: //ORI.W #<data>,SR |-|012346|P|*****|*****| |0000_000_001_111_100-{data} 4221: public static void irpOriWord () throws M68kException { 4222: int ea = XEiJ.regOC & 63; 4223: if (ea < XEiJ.EA_AR) { //ORI.W #<data>,Dr 4224: int z; 4225: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4226: z = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 4227: } else { 4228: z = XEiJ.regPC; 4229: XEiJ.regPC = z + 2; 4230: z = XEiJ.busRwse (z); //pcws 4231: } 4232: XEiJ.mpuCycleCount += 8; 4233: z = XEiJ.regRn[ea] |= (char) z; //0拡張してからOR 4234: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 4235: } else if (ea == XEiJ.EA_IM) { //ORI.W #<data>,SR 4236: if (XEiJ.regSRS == 0) { //ユーザモードのとき 4237: XEiJ.mpuCycleCount += 34; 4238: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 4239: throw M68kException.m6eSignal; 4240: } 4241: //以下はスーパーバイザモード 4242: XEiJ.mpuCycleCount += 20; 4243: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4244: irpSetSR (XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR | XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。特権違反チェックが先 4245: } else { 4246: int t = XEiJ.regPC; 4247: XEiJ.regPC = t + 2; 4248: irpSetSR (XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR | XEiJ.busRwse (t)); //pcws。特権違反チェックが先 4249: } 4250: } else { //ORI.W #<data>,<mem> 4251: int z; 4252: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4253: z = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 4254: } else { 4255: z = XEiJ.regPC; 4256: XEiJ.regPC = z + 2; 4257: z = XEiJ.busRwse (z); //pcws 4258: } 4259: XEiJ.mpuCycleCount += 12; 4260: int a = efaMltWord (ea); 4261: XEiJ.busWw (a, z |= XEiJ.busRws (a)); 4262: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 4263: } 4264: } //irpOriWord 4265: 4266: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4267: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4268: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4269: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4270: //ORI.L #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_000_010_mmm_rrr-{data} 4271: //OR.L #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_000_010_mmm_rrr-{data} [ORI.L #<data>,<ea>] 4272: public static void irpOriLong () throws M68kException { 4273: int ea = XEiJ.regOC & 63; 4274: int y; 4275: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4276: y = XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 4277: } else { 4278: y = XEiJ.regPC; 4279: XEiJ.regPC = y + 4; 4280: y = XEiJ.busRlse (y); //pcls 4281: } 4282: int z; 4283: if (ea < XEiJ.EA_AR) { //ORI.L #<data>,Dr 4284: XEiJ.mpuCycleCount += 16; 4285: z = XEiJ.regRn[ea] |= y; 4286: } else { //ORI.L #<data>,<mem> 4287: XEiJ.mpuCycleCount += 20; 4288: int a = efaMltLong (ea); 4289: XEiJ.busWl (a, z = XEiJ.busRls (a) | y); 4290: } 4291: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 4292: } //irpOriLong 4293: 4294: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4295: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4296: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4297: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4298: //BITREV.L Dr |-|------|-|-----|-----|D |0000_000_011_000_rrr (ISA_C) 4299: // 4300: //BITREV.L Dr 4301: // Drのビットの並びを逆順にする。CCRは変化しない 4302: public static void irpCmp2Chk2Byte () throws M68kException { 4303: int ea = XEiJ.regOC & 63; 4304: if (ea < XEiJ.EA_AR) { //BITREV.L Dr 4305: XEiJ.mpuCycleCount += 4; 4306: if (XEiJ.IRP_BITREV_REVERSE) { //2.83ns 0x0f801f3c 4307: XEiJ.regRn[ea] = Integer.reverse (XEiJ.regRn[ea]); 4308: } else if (XEiJ.IRP_BITREV_SHIFT) { //2.57ns 0x0f801f3c 4309: int x = XEiJ.regRn[ea]; 4310: x = x << 16 | x >>> 16; 4311: x = x << 8 & 0xff00ff00 | x >>> 8 & 0x00ff00ff; 4312: x = x << 4 & 0xf0f0f0f0 | x >>> 4 & 0x0f0f0f0f; 4313: x = x << 2 & 0xcccccccc | x >>> 2 & 0x33333333; 4314: XEiJ.regRn[ea] = x << 1 & 0xaaaaaaaa | x >>> 1 & 0x55555555; 4315: } else if (XEiJ.IRP_BITREV_TABLE) { //1.57ns 0x0f801f3c 4316: int x = XEiJ.regRn[ea]; 4317: XEiJ.regRn[ea] = XEiJ.MPU_BITREV_TABLE_0[x & 2047] | XEiJ.MPU_BITREV_TABLE_1[x << 10 >>> 21] | XEiJ.MPU_BITREV_TABLE_2[x >>> 22]; 4318: } 4319: } else { //CMP2/CHK2.B <ea>,Rn 4320: //プロセッサの判別に使われることがあるのでMC68000ではCMP2/CHK2をエラーにしなければならない 4321: XEiJ.mpuCycleCount += 34; 4322: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 4323: throw M68kException.m6eSignal; 4324: } 4325: } //irpCmp2Chk2Byte 4326: 4327: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4328: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4329: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4330: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4331: //BTST.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_100_000_rrr 4332: //MOVEP.W (d16,Ar),Dq |-|01234S|-|-----|-----| |0000_qqq_100_001_rrr-{data} 4333: //BTST.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZPI|0000_qqq_100_mmm_rrr 4334: public static void irpBtstReg () throws M68kException { 4335: int ea = XEiJ.regOC & 63; 4336: int qqq = XEiJ.regOC >> 9; //qqq 4337: if (ea >> 3 == XEiJ.MMM_AR) { //MOVEP.W (d16,Ar),Dq 4338: XEiJ.mpuCycleCount += 16; 4339: int a; 4340: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4341: a = XEiJ.regRn[ea] + XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws。このr[ea]はアドレスレジスタ 4342: } else { 4343: a = XEiJ.regPC; 4344: XEiJ.regPC = a + 2; 4345: a = XEiJ.regRn[ea] + XEiJ.busRwse (a); //pcws。このr[ea]はアドレスレジスタ 4346: } 4347: XEiJ.regRn[qqq] = ~0xffff & XEiJ.regRn[qqq] | XEiJ.busRbz (a) << 8 | XEiJ.busRbz (a + 2); //Javaは評価順序が保証されている 4348: } else { //BTST.L Dq,Dr/<ea> 4349: int y = XEiJ.regRn[qqq]; 4350: if (ea < XEiJ.EA_AR) { //BTST.L Dq,Dr 4351: XEiJ.mpuCycleCount += 6; 4352: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (~XEiJ.regRn[ea] >>> y & 1) << 2; //ccr_btst。intのシフトは5bitでマスクされるので&31を省略 4353: } else { //BTST.B Dq,<ea> 4354: XEiJ.mpuCycleCount += 4; 4355: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (~XEiJ.busRbs (efaAnyByte (ea)) >>> (y & 7) & 1) << 2; //ccr_btst 4356: } 4357: } 4358: } //irpBtstReg 4359: 4360: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4361: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4362: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4363: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4364: //BCHG.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_101_000_rrr 4365: //MOVEP.L (d16,Ar),Dq |-|01234S|-|-----|-----| |0000_qqq_101_001_rrr-{data} 4366: //BCHG.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_qqq_101_mmm_rrr 4367: public static void irpBchgReg () throws M68kException { 4368: int ea = XEiJ.regOC & 63; 4369: int qqq = XEiJ.regOC >> 9; //qqq 4370: if (ea >> 3 == XEiJ.MMM_AR) { //MOVEP.L (d16,Ar),Dq 4371: XEiJ.mpuCycleCount += 24; 4372: int a; 4373: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4374: a = XEiJ.regRn[ea] + XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws。このr[ea]はアドレスレジスタ 4375: } else { 4376: a = XEiJ.regPC; 4377: XEiJ.regPC = a + 2; 4378: a = XEiJ.regRn[ea] + XEiJ.busRwse (a); //pcws。このr[ea]はアドレスレジスタ 4379: } 4380: XEiJ.regRn[qqq] = XEiJ.busRbs (a) << 24 | XEiJ.busRbz (a + 2) << 16 | XEiJ.busRbz (a + 4) << 8 | XEiJ.busRbz (a + 6); //Javaは評価順序が保証されている 4381: } else { //BCHG.L Dq,Dr/<ea> 4382: int x; 4383: int y = XEiJ.regRn[qqq]; 4384: if (ea < XEiJ.EA_AR) { //BCHG.L Dq,Dr 4385: XEiJ.regRn[ea] = (x = XEiJ.regRn[ea]) ^ (y = 1 << y); //intのシフトは5bitでマスクされるので1<<(y&0x1f)の&0x1fを省略 4386: XEiJ.mpuCycleCount += (char) y != 0 ? 6 : 8; //(0xffff&y)!=0 4387: } else { //BCHG.B Dq,<ea> 4388: XEiJ.mpuCycleCount += 8; 4389: int a = efaMltByte (ea); 4390: XEiJ.busWb (a, (x = XEiJ.busRbs (a)) ^ (y = 1 << (y & 7))); 4391: } 4392: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (x & y) - 1 >>> 31 << 2; //ccr_btst 4393: } 4394: } //irpBchgReg 4395: 4396: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4397: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4398: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4399: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4400: //BCLR.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_110_000_rrr 4401: //MOVEP.W Dq,(d16,Ar) |-|01234S|-|-----|-----| |0000_qqq_110_001_rrr-{data} 4402: //BCLR.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_qqq_110_mmm_rrr 4403: public static void irpBclrReg () throws M68kException { 4404: int ea = XEiJ.regOC & 63; 4405: int y = XEiJ.regRn[XEiJ.regOC >> 9]; //qqq 4406: if (ea >> 3 == XEiJ.MMM_AR) { //MOVEP.W Dq,(d16,Ar) 4407: XEiJ.mpuCycleCount += 16; 4408: int a; 4409: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4410: a = XEiJ.regRn[ea] + XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws。このr[ea]はアドレスレジスタ 4411: } else { 4412: a = XEiJ.regPC; 4413: XEiJ.regPC = a + 2; 4414: a = XEiJ.regRn[ea] + XEiJ.busRwse (a); //pcws。このr[ea]はアドレスレジスタ 4415: } 4416: XEiJ.busWb (a, y >> 8); 4417: XEiJ.busWb (a + 2, y); 4418: } else { //BCLR.L Dq,Dr/<ea> 4419: int x; 4420: if (ea < XEiJ.EA_AR) { //BCLR.L Dq,Dr 4421: XEiJ.regRn[ea] = (x = XEiJ.regRn[ea]) & ~(y = 1 << y); //intのシフトは5bitでマスクされるので1<<(y&0x1f)の&0x1fを省略 4422: XEiJ.mpuCycleCount += (char) y != 0 ? 8 : 10; //(0xffff&y)!=0 4423: } else { //BCLR.B Dq,<ea> 4424: XEiJ.mpuCycleCount += 8; 4425: int a = efaMltByte (ea); 4426: XEiJ.busWb (a, (x = XEiJ.busRbs (a)) & ~(y = 1 << (y & 7))); 4427: } 4428: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (x & y) - 1 >>> 31 << 2; //ccr_btst 4429: } 4430: } //irpBclrReg 4431: 4432: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4433: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4434: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4435: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4436: //BSET.L Dq,Dr |-|012346|-|--U--|--*--|D |0000_qqq_111_000_rrr 4437: //MOVEP.L Dq,(d16,Ar) |-|01234S|-|-----|-----| |0000_qqq_111_001_rrr-{data} 4438: //BSET.B Dq,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_qqq_111_mmm_rrr 4439: public static void irpBsetReg () throws M68kException { 4440: int ea = XEiJ.regOC & 63; 4441: int y = XEiJ.regRn[XEiJ.regOC >> 9]; //qqq 4442: if (ea >> 3 == XEiJ.MMM_AR) { //MOVEP.L Dq,(d16,Ar) 4443: XEiJ.mpuCycleCount += 24; 4444: int a; 4445: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4446: a = XEiJ.regRn[ea] + XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws。このr[ea]はアドレスレジスタ 4447: } else { 4448: a = XEiJ.regPC; 4449: XEiJ.regPC = a + 2; 4450: a = XEiJ.regRn[ea] + XEiJ.busRwse (a); //pcws。このr[ea]はアドレスレジスタ 4451: } 4452: XEiJ.busWb (a, y >> 24); 4453: XEiJ.busWb (a + 2, y >> 16); 4454: XEiJ.busWb (a + 4, y >> 8); 4455: XEiJ.busWb (a + 6, y); 4456: } else { //BSET.L Dq,Dr/<ea> 4457: int x; 4458: if (ea < XEiJ.EA_AR) { //BSET.L Dq,Dr 4459: XEiJ.regRn[ea] = (x = XEiJ.regRn[ea]) | (y = 1 << y); //intのシフトは5bitでマスクされるので1<<(y&0x1f)の&0x1fを省略 4460: XEiJ.mpuCycleCount += (char) y != 0 ? 6 : 8; //(0xffff&y)!=0 4461: } else { //BSET.B Dq,<ea> 4462: XEiJ.mpuCycleCount += 8; 4463: int a = efaMltByte (ea); 4464: XEiJ.busWb (a, (x = XEiJ.busRbs (a)) | (y = 1 << (y & 7))); 4465: } 4466: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (x & y) - 1 >>> 31 << 2; //ccr_btst 4467: } 4468: } //irpBsetReg 4469: 4470: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4471: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4472: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4473: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4474: //ANDI.B #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_001_000_mmm_rrr-{data} 4475: //AND.B #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_001_000_mmm_rrr-{data} [ANDI.B #<data>,<ea>] 4476: //ANDI.B #<data>,CCR |-|012346|-|*****|*****| |0000_001_000_111_100-{data} 4477: public static void irpAndiByte () throws M68kException { 4478: int ea = XEiJ.regOC & 63; 4479: int z; 4480: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4481: z = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4482: } else { 4483: z = XEiJ.regPC; 4484: XEiJ.regPC = z + 2; 4485: z = XEiJ.busRbs (z + 1); //pcbs 4486: } 4487: if (ea < XEiJ.EA_AR) { //ANDI.B #<data>,Dr 4488: XEiJ.mpuCycleCount += 8; 4489: z = XEiJ.regRn[ea] &= ~255 | z; //1拡張してからAND 4490: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 4491: } else if (ea == XEiJ.EA_IM) { //ANDI.B #<data>,CCR 4492: XEiJ.mpuCycleCount += 20; 4493: XEiJ.regCCR &= z; 4494: } else { //ANDI.B #<data>,<mem> 4495: XEiJ.mpuCycleCount += 12; 4496: int a = efaMltByte (ea); 4497: XEiJ.busWb (a, z &= XEiJ.busRbs (a)); 4498: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 4499: } 4500: } //irpAndiByte 4501: 4502: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4503: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4504: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4505: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4506: //ANDI.W #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_001_001_mmm_rrr-{data} 4507: //AND.W #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_001_001_mmm_rrr-{data} [ANDI.W #<data>,<ea>] 4508: //ANDI.W #<data>,SR |-|012346|P|*****|*****| |0000_001_001_111_100-{data} 4509: public static void irpAndiWord () throws M68kException { 4510: int ea = XEiJ.regOC & 63; 4511: if (ea < XEiJ.EA_AR) { //ANDI.W #<data>,Dr 4512: int z; 4513: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4514: z = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 4515: } else { 4516: z = XEiJ.regPC; 4517: XEiJ.regPC = z + 2; 4518: z = XEiJ.busRwse (z); //pcws 4519: } 4520: XEiJ.mpuCycleCount += 8; 4521: z = XEiJ.regRn[ea] &= ~65535 | z; //1拡張してからAND 4522: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 4523: } else if (ea == XEiJ.EA_IM) { //ANDI.W #<data>,SR 4524: if (XEiJ.regSRS == 0) { //ユーザモードのとき 4525: XEiJ.mpuCycleCount += 34; 4526: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 4527: throw M68kException.m6eSignal; 4528: } 4529: //以下はスーパーバイザモード 4530: XEiJ.mpuCycleCount += 20; 4531: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4532: irpSetSR ((XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR) & XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。特権違反チェックが先 4533: } else { 4534: int t = XEiJ.regPC; 4535: XEiJ.regPC = t + 2; 4536: irpSetSR ((XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR) & XEiJ.busRwse (t)); //pcws。特権違反チェックが先 4537: } 4538: } else { //ANDI.W #<data>,<mem> 4539: int z; 4540: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4541: z = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 4542: } else { 4543: z = XEiJ.regPC; 4544: XEiJ.regPC = z + 2; 4545: z = XEiJ.busRwse (z); //pcws 4546: } 4547: XEiJ.mpuCycleCount += 12; 4548: int a = efaMltWord (ea); 4549: XEiJ.busWw (a, z &= XEiJ.busRws (a)); 4550: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 4551: } 4552: } //irpAndiWord 4553: 4554: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4555: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4556: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4557: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4558: //ANDI.L #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_001_010_mmm_rrr-{data} 4559: //AND.L #<data>,<ea> |A|012346|-|-UUUU|-**00| M+-WXZ |0000_001_010_mmm_rrr-{data} [ANDI.L #<data>,<ea>] 4560: public static void irpAndiLong () throws M68kException { 4561: int ea = XEiJ.regOC & 63; 4562: int y; 4563: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4564: y = XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 4565: } else { 4566: y = XEiJ.regPC; 4567: XEiJ.regPC = y + 4; 4568: y = XEiJ.busRlse (y); //pcls 4569: } 4570: int z; 4571: if (ea < XEiJ.EA_AR) { //ANDI.L #<data>,Dr 4572: XEiJ.mpuCycleCount += 16; 4573: z = XEiJ.regRn[ea] &= y; 4574: } else { //ANDI.L #<data>,<mem> 4575: XEiJ.mpuCycleCount += 20; 4576: int a = efaMltLong (ea); 4577: XEiJ.busWl (a, z = XEiJ.busRls (a) & y); 4578: } 4579: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 4580: } //irpAndiLong 4581: 4582: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4583: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4584: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4585: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4586: //BYTEREV.L Dr |-|------|-|-----|-----|D |0000_001_011_000_rrr (ISA_C) 4587: // 4588: //BYTEREV.L Dr 4589: // Drのバイトの並びを逆順にする。CCRは変化しない 4590: public static void irpCmp2Chk2Word () throws M68kException { 4591: int ea = XEiJ.regOC & 63; 4592: if (ea < XEiJ.EA_AR) { //BYTEREV.L Dr 4593: XEiJ.mpuCycleCount += 4; 4594: if (true) { //0.10ns-0.18ns 0x782750ec 4595: XEiJ.regRn[ea] = Integer.reverseBytes (XEiJ.regRn[ea]); 4596: } else { //1.06ns 0x782750ec 4597: int x = XEiJ.regRn[ea]; 4598: XEiJ.regRn[ea] = x << 24 | x << 8 & 0x00ff0000 | x >>> 8 & 0x0000ff00 | x >>> 24; 4599: } 4600: } else { //CMP2/CHK2.W <ea>,Rn 4601: //プロセッサの判別に使われることがあるのでMC68000ではCMP2/CHK2をエラーにしなければならない 4602: XEiJ.mpuCycleCount += 34; 4603: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 4604: throw M68kException.m6eSignal; 4605: } 4606: } //irpCmp2Chk2Word 4607: 4608: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4609: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4610: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4611: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4612: //SUBI.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_010_000_mmm_rrr-{data} 4613: //SUB.B #<data>,<ea> |A|012346|-|UUUUU|*****| M+-WXZ |0000_010_000_mmm_rrr-{data} [SUBI.B #<data>,<ea>] 4614: public static void irpSubiByte () throws M68kException { 4615: int ea = XEiJ.regOC & 63; 4616: int x; 4617: int y; 4618: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4619: y = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4620: } else { 4621: y = XEiJ.regPC; 4622: XEiJ.regPC = y + 2; 4623: y = XEiJ.busRbs (y + 1); //pcbs 4624: } 4625: int z; 4626: if (ea < XEiJ.EA_AR) { //SUBI.B #<data>,Dr 4627: XEiJ.mpuCycleCount += 8; 4628: z = (byte) (XEiJ.regRn[ea] = ~0xff & (x = XEiJ.regRn[ea]) | 0xff & (x = (byte) x) - y); 4629: } else { //SUBI.B #<data>,<mem> 4630: XEiJ.mpuCycleCount += 12; 4631: int a = efaMltByte (ea); 4632: XEiJ.busWb (a, z = (byte) ((x = XEiJ.busRbs (a)) - y)); 4633: } 4634: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 4635: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 4636: (x & (y ^ z) ^ (y | z)) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub 4637: } //irpSubiByte 4638: 4639: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4640: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4641: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4642: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4643: //SUBI.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_010_001_mmm_rrr-{data} 4644: //SUB.W #<data>,<ea> |A|012346|-|UUUUU|*****| M+-WXZ |0000_010_001_mmm_rrr-{data} [SUBI.W #<data>,<ea>] 4645: public static void irpSubiWord () throws M68kException { 4646: int ea = XEiJ.regOC & 63; 4647: int x; 4648: int y; 4649: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4650: y = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 4651: } else { 4652: y = XEiJ.regPC; 4653: XEiJ.regPC = y + 2; 4654: y = XEiJ.busRwse (y); //pcws 4655: } 4656: int z; 4657: if (ea < XEiJ.EA_AR) { //SUBI.W #<data>,Dr 4658: XEiJ.mpuCycleCount += 8; 4659: z = (short) (XEiJ.regRn[ea] = ~0xffff & (x = XEiJ.regRn[ea]) | (char) ((x = (short) x) - y)); 4660: } else { //SUBI.W #<data>,<mem> 4661: XEiJ.mpuCycleCount += 12; 4662: int a = efaMltWord (ea); 4663: XEiJ.busWw (a, z = (short) ((x = XEiJ.busRws (a)) - y)); 4664: } 4665: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 4666: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 4667: (x & (y ^ z) ^ (y | z)) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub 4668: } //irpSubiWord 4669: 4670: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4671: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4672: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4673: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4674: //SUBI.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_010_010_mmm_rrr-{data} 4675: //SUB.L #<data>,<ea> |A|012346|-|UUUUU|*****| M+-WXZ |0000_010_010_mmm_rrr-{data} [SUBI.L #<data>,<ea>] 4676: public static void irpSubiLong () throws M68kException { 4677: int ea = XEiJ.regOC & 63; 4678: int x; 4679: int y; 4680: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4681: y = XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 4682: } else { 4683: y = XEiJ.regPC; 4684: XEiJ.regPC = y + 4; 4685: y = XEiJ.busRlse (y); //pcls 4686: } 4687: int z; 4688: if (ea < XEiJ.EA_AR) { //SUBI.L #<data>,Dr 4689: XEiJ.mpuCycleCount += 16; 4690: XEiJ.regRn[ea] = z = (x = XEiJ.regRn[ea]) - y; 4691: } else { //SUBI.L #<data>,<mem> 4692: XEiJ.mpuCycleCount += 20; 4693: int a = efaMltLong (ea); 4694: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) - y); 4695: } 4696: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 4697: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 4698: (x & (y ^ z) ^ (y | z)) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub 4699: } //irpSubiLong 4700: 4701: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4702: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4703: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4704: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4705: //FF1.L Dr |-|------|-|-UUUU|-**00|D |0000_010_011_000_rrr (ISA_C) 4706: // 4707: //FF1.L Dr 4708: // Drの最上位の1のbit31からのオフセットをDrに格納する 4709: // Drが0のときは32になる 4710: public static void irpCmp2Chk2Long () throws M68kException { 4711: int ea = XEiJ.regOC & 63; 4712: if (ea < XEiJ.EA_AR) { //FF1.L Dr 4713: XEiJ.mpuCycleCount += 4; 4714: int z = XEiJ.regRn[ea]; 4715: if (true) { 4716: XEiJ.regRn[ea] = Integer.numberOfLeadingZeros (z); 4717: } else { 4718: if (z == 0) { 4719: XEiJ.regRn[ea] = 32; 4720: } else { 4721: int k = -(z >>> 16) >> 16 & 16; 4722: k += -(z >>> k + 8) >> 8 & 8; 4723: k += -(z >>> k + 4) >> 4 & 4; 4724: // bit3 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 4725: // bit2 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 4726: // bit1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 4727: // bit0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 4728: XEiJ.regRn[ea] = ((0b11_11_11_11_11_11_11_11_10_10_10_10_01_01_00_00 >>> (z >>> k << 1)) & 3) + k; //intのシフトカウントは下位5bitだけが使用される 4729: } 4730: } 4731: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 4732: } else { //CMP2/CHK2.L <ea>,Rn 4733: //プロセッサの判別に使われることがあるのでMC68000ではCMP2/CHK2をエラーにしなければならない 4734: XEiJ.mpuCycleCount += 34; 4735: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 4736: throw M68kException.m6eSignal; 4737: } 4738: } //irpCmp2Chk2Long 4739: 4740: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4741: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4742: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4743: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4744: //ADDI.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_011_000_mmm_rrr-{data} 4745: public static void irpAddiByte () throws M68kException { 4746: int ea = XEiJ.regOC & 63; 4747: int x; 4748: int y; 4749: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4750: y = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4751: } else { 4752: y = XEiJ.regPC; 4753: XEiJ.regPC = y + 2; 4754: y = XEiJ.busRbs (y + 1); //pcbs 4755: } 4756: int z; 4757: if (ea < XEiJ.EA_AR) { //ADDI.B #<data>,Dr 4758: XEiJ.mpuCycleCount += 8; 4759: z = (byte) (XEiJ.regRn[ea] = ~0xff & (x = XEiJ.regRn[ea]) | 0xff & (x = (byte) x) + y); 4760: } else { //ADDI.B #<data>,<mem> 4761: XEiJ.mpuCycleCount += 12; 4762: int a = efaMltByte (ea); 4763: XEiJ.busWb (a, z = (byte) ((x = XEiJ.busRbs (a)) + y)); 4764: } 4765: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 4766: ((x ^ z) & (y ^ z)) >>> 31 << 1 | 4767: ((x | y) ^ (x ^ y) & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add 4768: } //irpAddiByte 4769: 4770: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4771: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4772: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4773: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4774: //ADDI.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_011_001_mmm_rrr-{data} 4775: public static void irpAddiWord () throws M68kException { 4776: int ea = XEiJ.regOC & 63; 4777: int x; 4778: int y; 4779: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4780: y = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 4781: } else { 4782: y = XEiJ.regPC; 4783: XEiJ.regPC = y + 2; 4784: y = XEiJ.busRwse (y); //pcws 4785: } 4786: int z; 4787: if (ea < XEiJ.EA_AR) { //ADDI.W #<data>,Dr 4788: XEiJ.mpuCycleCount += 8; 4789: z = (short) (XEiJ.regRn[ea] = ~0xffff & (x = XEiJ.regRn[ea]) | (char) ((x = (short) x) + y)); 4790: } else { //ADDI.W #<data>,<mem> 4791: XEiJ.mpuCycleCount += 12; 4792: int a = efaMltWord (ea); 4793: XEiJ.busWw (a, z = (short) ((x = XEiJ.busRws (a)) + y)); 4794: } 4795: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 4796: ((x ^ z) & (y ^ z)) >>> 31 << 1 | 4797: ((x | y) ^ (x ^ y) & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add 4798: } //irpAddiWord 4799: 4800: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4801: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4802: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4803: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4804: //ADDI.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0000_011_010_mmm_rrr-{data} 4805: public static void irpAddiLong () throws M68kException { 4806: int ea = XEiJ.regOC & 63; 4807: int x; 4808: int y; 4809: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4810: y = XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 4811: } else { 4812: y = XEiJ.regPC; 4813: XEiJ.regPC = y + 4; 4814: y = XEiJ.busRlse (y); //pcls 4815: } 4816: int z; 4817: if (ea < XEiJ.EA_AR) { //ADDI.L #<data>,Dr 4818: XEiJ.mpuCycleCount += 16; 4819: XEiJ.regRn[ea] = z = (x = XEiJ.regRn[ea]) + y; 4820: } else { //ADDI.L #<data>,<mem> 4821: XEiJ.mpuCycleCount += 20; 4822: int a = efaMltLong (ea); 4823: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) + y); 4824: } 4825: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 4826: ((x ^ z) & (y ^ z)) >>> 31 << 1 | 4827: ((x | y) ^ (x ^ y) & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add 4828: } //irpAddiLong 4829: 4830: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4831: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4832: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4833: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4834: //BTST.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_000_000_rrr-{data} 4835: //BTST.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZP |0000_100_000_mmm_rrr-{data} 4836: public static void irpBtstImm () throws M68kException { 4837: int ea = XEiJ.regOC & 63; 4838: int y; 4839: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4840: y = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4841: } else { 4842: y = XEiJ.regPC; 4843: XEiJ.regPC = y + 2; 4844: y = XEiJ.busRbs (y + 1); //pcbs 4845: } 4846: if (ea < XEiJ.EA_AR) { //BTST.L #<data>,Dr 4847: XEiJ.mpuCycleCount += 10; 4848: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (~XEiJ.regRn[ea] >>> y & 1) << 2; //ccr_btst。intのシフトは5bitでマスクされるので&31を省略 4849: } else { //BTST.B #<data>,<ea> 4850: XEiJ.mpuCycleCount += 8; 4851: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (~XEiJ.busRbs (efaMemByte (ea)) >>> (y & 7) & 1) << 2; //ccr_btst 4852: } 4853: } //irpBtstImm 4854: 4855: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4856: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4857: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4858: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4859: //BCHG.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_001_000_rrr-{data} 4860: //BCHG.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_100_001_mmm_rrr-{data} 4861: public static void irpBchgImm () throws M68kException { 4862: int ea = XEiJ.regOC & 63; 4863: int x; 4864: int y; 4865: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4866: y = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4867: } else { 4868: y = XEiJ.regPC; 4869: XEiJ.regPC = y + 2; 4870: y = XEiJ.busRbs (y + 1); //pcbs 4871: } 4872: if (ea < XEiJ.EA_AR) { //BCHG.L #<data>,Dr 4873: XEiJ.regRn[ea] = (x = XEiJ.regRn[ea]) ^ (y = 1 << y); //intのシフトは5bitでマスクされるので1<<(y&0x1f)の&0x1fを省略 4874: XEiJ.mpuCycleCount += (char) y != 0 ? 10 : 12; //(0xffff&y)!=0 4875: } else { //BCHG.B #<data>,<ea> 4876: XEiJ.mpuCycleCount += 12; 4877: int a = efaMltByte (ea); 4878: XEiJ.busWb (a, (x = XEiJ.busRbs (a)) ^ (y = 1 << (y & 7))); 4879: } 4880: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (x & y) - 1 >>> 31 << 2; //ccr_btst 4881: } //irpBchgImm 4882: 4883: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4884: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4885: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4886: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4887: //BCLR.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_010_000_rrr-{data} 4888: //BCLR.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_100_010_mmm_rrr-{data} 4889: public static void irpBclrImm () throws M68kException { 4890: int ea = XEiJ.regOC & 63; 4891: int x; 4892: int y; 4893: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4894: y = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4895: } else { 4896: y = XEiJ.regPC; 4897: XEiJ.regPC = y + 2; 4898: y = XEiJ.busRbs (y + 1); //pcbs 4899: } 4900: if (ea < XEiJ.EA_AR) { //BCLR.L #<data>,Dr 4901: XEiJ.regRn[ea] = (x = XEiJ.regRn[ea]) & ~(y = 1 << y); //intのシフトは5bitでマスクされるので1<<(y&0x1f)の&0x1fを省略 4902: XEiJ.mpuCycleCount += (char) y != 0 ? 12 : 14; //(0xffff&y)!=0 4903: } else { //BCLR.B #<data>,<ea> 4904: XEiJ.mpuCycleCount += 12; 4905: int a = efaMltByte (ea); 4906: XEiJ.busWb (a, (x = XEiJ.busRbs (a)) & ~(y = 1 << (y & 7))); 4907: } 4908: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (x & y) - 1 >>> 31 << 2; //ccr_btst 4909: } //irpBclrImm 4910: 4911: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4912: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4913: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4914: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4915: //BSET.L #<data>,Dr |-|012346|-|--U--|--*--|D |0000_100_011_000_rrr-{data} 4916: //BSET.B #<data>,<ea> |-|012346|-|--U--|--*--| M+-WXZ |0000_100_011_mmm_rrr-{data} 4917: public static void irpBsetImm () throws M68kException { 4918: int ea = XEiJ.regOC & 63; 4919: int x; 4920: int y; 4921: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4922: y = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4923: } else { 4924: y = XEiJ.regPC; 4925: XEiJ.regPC = y + 2; 4926: y = XEiJ.busRbs (y + 1); //pcbs 4927: } 4928: if (ea < XEiJ.EA_AR) { //BSET.L #<data>,Dr 4929: XEiJ.regRn[ea] = (x = XEiJ.regRn[ea]) | (y = 1 << y); //intのシフトは5bitでマスクされるので1<<(y&0x1f)の&0x1fを省略 4930: XEiJ.mpuCycleCount += (char) y != 0 ? 10 : 12; //(0xffff&y)!=0 4931: } else { //BSET.B #<data>,<ea> 4932: XEiJ.mpuCycleCount += 12; 4933: int a = efaMltByte (ea); 4934: XEiJ.busWb (a, (x = XEiJ.busRbs (a)) | (y = 1 << (y & 7))); 4935: } 4936: XEiJ.regCCR = XEiJ.regCCR & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_N | XEiJ.REG_CCR_V | XEiJ.REG_CCR_C) | (x & y) - 1 >>> 31 << 2; //ccr_btst 4937: } //irpBsetImm 4938: 4939: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4940: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4941: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4942: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4943: //EORI.B #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_000_mmm_rrr-{data} 4944: //EOR.B #<data>,<ea> |A|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_000_mmm_rrr-{data} [EORI.B #<data>,<ea>] 4945: //EORI.B #<data>,CCR |-|012346|-|*****|*****| |0000_101_000_111_100-{data} 4946: public static void irpEoriByte () throws M68kException { 4947: int ea = XEiJ.regOC & 63; 4948: int z; 4949: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4950: z = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 4951: } else { 4952: z = XEiJ.regPC; 4953: XEiJ.regPC = z + 2; 4954: z = XEiJ.busRbs (z + 1); //pcbs 4955: } 4956: if (ea < XEiJ.EA_AR) { //EORI.B #<data>,Dr 4957: XEiJ.mpuCycleCount += 8; 4958: z = XEiJ.regRn[ea] ^= 255 & z; //0拡張してからEOR 4959: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 4960: } else if (ea == XEiJ.EA_IM) { //EORI.B #<data>,CCR 4961: XEiJ.mpuCycleCount += 20; 4962: XEiJ.regCCR ^= XEiJ.REG_CCR_MASK & z; 4963: } else { //EORI.B #<data>,<mem> 4964: XEiJ.mpuCycleCount += 12; 4965: int a = efaMltByte (ea); 4966: XEiJ.busWb (a, z ^= XEiJ.busRbs (a)); 4967: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 4968: } 4969: } //irpEoriByte 4970: 4971: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4972: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 4973: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 4974: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 4975: //EORI.W #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_001_mmm_rrr-{data} 4976: //EOR.W #<data>,<ea> |A|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_001_mmm_rrr-{data} [EORI.W #<data>,<ea>] 4977: //EORI.W #<data>,SR |-|012346|P|*****|*****| |0000_101_001_111_100-{data} 4978: public static void irpEoriWord () throws M68kException { 4979: int ea = XEiJ.regOC & 63; 4980: if (ea < XEiJ.EA_AR) { //EORI.W #<data>,Dr 4981: int z; 4982: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 4983: z = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 4984: } else { 4985: z = XEiJ.regPC; 4986: XEiJ.regPC = z + 2; 4987: z = XEiJ.busRwse (z); //pcws 4988: } 4989: XEiJ.mpuCycleCount += 8; 4990: z = XEiJ.regRn[ea] ^= (char) z; //0拡張してからEOR 4991: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 4992: } else if (ea == XEiJ.EA_IM) { //EORI.W #<data>,SR 4993: if (XEiJ.regSRS == 0) { //ユーザモードのとき 4994: XEiJ.mpuCycleCount += 34; 4995: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 4996: throw M68kException.m6eSignal; 4997: } 4998: //以下はスーパーバイザモード 4999: XEiJ.mpuCycleCount += 20; 5000: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5001: irpSetSR ((XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR) ^ XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。特権違反チェックが先 5002: } else { 5003: int t = XEiJ.regPC; 5004: XEiJ.regPC = t + 2; 5005: irpSetSR ((XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR) ^ XEiJ.busRwse (t)); //pcws。特権違反チェックが先 5006: } 5007: } else { //EORI.W #<data>,<mem> 5008: int z; 5009: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5010: z = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 5011: } else { 5012: z = XEiJ.regPC; 5013: XEiJ.regPC = z + 2; 5014: z = XEiJ.busRwse (z); //pcws 5015: } 5016: XEiJ.mpuCycleCount += 12; 5017: int a = efaMltWord (ea); 5018: XEiJ.busWw (a, z ^= XEiJ.busRws (a)); 5019: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5020: } 5021: } //irpEoriWord 5022: 5023: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5024: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5025: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5026: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5027: //EORI.L #<data>,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_010_mmm_rrr-{data} 5028: //EOR.L #<data>,<ea> |A|012346|-|-UUUU|-**00|D M+-WXZ |0000_101_010_mmm_rrr-{data} [EORI.L #<data>,<ea>] 5029: public static void irpEoriLong () throws M68kException { 5030: int ea = XEiJ.regOC & 63; 5031: int y; 5032: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5033: y = XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 5034: } else { 5035: y = XEiJ.regPC; 5036: XEiJ.regPC = y + 4; 5037: y = XEiJ.busRlse (y); //pcls 5038: } 5039: int z; 5040: if (ea < XEiJ.EA_AR) { //EORI.L #<data>,Dr 5041: XEiJ.mpuCycleCount += 16; 5042: z = XEiJ.regRn[ea] ^= y; 5043: } else { //EORI.L #<data>,<mem> 5044: XEiJ.mpuCycleCount += 20; 5045: int a = efaMltLong (ea); 5046: XEiJ.busWl (a, z = XEiJ.busRls (a) ^ y); 5047: } 5048: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5049: } //irpEoriLong 5050: 5051: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5052: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5053: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5054: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5055: //CMPI.B #<data>,<ea> |-|01----|-|-UUUU|-****|D M+-WXZ |0000_110_000_mmm_rrr-{data} 5056: //CMP.B #<data>,<ea> |A|01----|-|-UUUU|-****| M+-WXZ |0000_110_000_mmm_rrr-{data} [CMPI.B #<data>,<ea>] 5057: public static void irpCmpiByte () throws M68kException { 5058: XEiJ.mpuCycleCount += 8; 5059: int ea = XEiJ.regOC & 63; 5060: int x; 5061: int y; 5062: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5063: y = XEiJ.busRbs ((XEiJ.regPC += 2) - 1); //pcbs 5064: } else { 5065: y = XEiJ.regPC; 5066: XEiJ.regPC = y + 2; 5067: y = XEiJ.busRbs (y + 1); //pcbs 5068: } 5069: int z = (byte) ((x = ea < XEiJ.EA_AR ? (byte) XEiJ.regRn[ea] : XEiJ.busRbs (efaMltByte (ea))) - y); //アドレッシングモードに注意 5070: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 5071: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 5072: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 5073: } //irpCmpiByte 5074: 5075: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5076: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5077: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5078: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5079: //CMPI.W #<data>,<ea> |-|01----|-|-UUUU|-****|D M+-WXZ |0000_110_001_mmm_rrr-{data} 5080: //CMP.W #<data>,<ea> |A|01----|-|-UUUU|-****| M+-WXZ |0000_110_001_mmm_rrr-{data} [CMPI.W #<data>,<ea>] 5081: public static void irpCmpiWord () throws M68kException { 5082: XEiJ.mpuCycleCount += 8; 5083: int ea = XEiJ.regOC & 63; 5084: int x; 5085: int y; 5086: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5087: y = XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 5088: } else { 5089: y = XEiJ.regPC; 5090: XEiJ.regPC = y + 2; 5091: y = XEiJ.busRwse (y); //pcws 5092: } 5093: int z = (short) ((x = ea < XEiJ.EA_AR ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaMltWord (ea))) - y); //アドレッシングモードに注意 5094: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 5095: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 5096: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 5097: } //irpCmpiWord 5098: 5099: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5100: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5101: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5102: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5103: //CMPI.L #<data>,<ea> |-|01----|-|-UUUU|-****|D M+-WXZ |0000_110_010_mmm_rrr-{data} 5104: //CMP.L #<data>,<ea> |A|01----|-|-UUUU|-****| M+-WXZ |0000_110_010_mmm_rrr-{data} [CMPI.L #<data>,<ea>] 5105: public static void irpCmpiLong () throws M68kException { 5106: int ea = XEiJ.regOC & 63; 5107: int x; 5108: int y; 5109: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5110: y = XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 5111: } else { 5112: y = XEiJ.regPC; 5113: XEiJ.regPC = y + 4; 5114: y = XEiJ.busRlse (y); //pcls 5115: } 5116: int z; 5117: if (ea < XEiJ.EA_AR) { //CMPI.L #<data>,Dr 5118: XEiJ.mpuCycleCount += 14; 5119: z = (x = XEiJ.regRn[ea]) - y; 5120: } else { //CMPI.L #<data>,<mem> 5121: XEiJ.mpuCycleCount += 12; 5122: z = (x = XEiJ.busRls (efaMltLong (ea))) - y; //アドレッシングモードに注意 5123: } 5124: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 5125: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 5126: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 5127: } //irpCmpiLong 5128: 5129: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5130: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5131: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5132: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5133: //MOVES.B <ea>,Rn |-|-12346|P|-----|-----| M+-WXZ |0000_111_000_mmm_rrr-rnnn000000000000 5134: //MOVES.B Rn,<ea> |-|-12346|P|-----|-----| M+-WXZ |0000_111_000_mmm_rrr-rnnn100000000000 5135: // 5136: //MOVES.B <ea>,Rn 5137: // MOVES.B <ea>,DnはDnの最下位バイトだけ更新する 5138: // MOVES.B <ea>,Anはバイトデータをロングに符号拡張してAnの全体を更新する 5139: // SFC=1,2,5,6はアドレス変換あり、SFC=0,3,4はアドレス変換なし、 5140: // SFC=7はCPU空間なのでコプロセッサが割り当てられている領域以外はバスエラーになる 5141: // 5142: //MOVES.B Rn,<ea> 5143: // DFC=1,2,5,6はアドレス変換あり、DFC=0,3,4はアドレス変換なし、 5144: // DFC=7はCPU空間なのでコプロセッサが割り当てられている領域以外はバスエラーになる 5145: public static void irpMovesByte () throws M68kException { 5146: int w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz 5147: if (w << -11 != 0) { 5148: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 5149: throw M68kException.m6eSignal; 5150: } 5151: if (XEiJ.regSRS == 0) { //ユーザモードのとき 5152: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 5153: throw M68kException.m6eSignal; 5154: } 5155: //以下はスーパーバイザモード 5156: XEiJ.mpuCycleCount += 4; 5157: int a = efaMltByte (XEiJ.regOC & 63); 5158: int n = w >>> 12; //n 5159: if (w << 31 - 11 >= 0) { //MOVES.B <ea>,Rn。リード 5160: MemoryMappedDevice[] mm; 5161: if (XEiJ.mpuSFC == 1 || XEiJ.mpuSFC == 2) { //ユーザモード 5162: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpUserMap : XEiJ.busUserMap; 5163: } else if (XEiJ.mpuSFC == 5 || XEiJ.mpuSFC == 6) { //スーパーバイザモード 5164: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap; 5165: } else { //CPU空間などは不可 5166: M68kException.m6eFSLW |= M68kException.M6E_FSLW_BUS_ERROR_ON_READ; 5167: M68kException.m6eNumber = M68kException.M6E_ACCESS_FAULT; 5168: M68kException.m6eAddress = a; 5169: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 5170: M68kException.m6eSize = XEiJ.MPU_SS_BYTE; 5171: throw M68kException.m6eSignal; 5172: } 5173: if (n < 8) { //MOVES.B <ea>,Dn 5174: XEiJ.regRn[n] = XEiJ.regRn[n] & ~255 | mm[a >>> XEiJ.BUS_PAGE_BITS].mmdRbz (a); 5175: } else { //MOVES.B <ea>,An 5176: XEiJ.regRn[n] = mm[a >>> XEiJ.BUS_PAGE_BITS].mmdRbs (a); 5177: } 5178: } else { //MOVES.B Rn,<ea>。ライト 5179: MemoryMappedDevice[] mm; 5180: if (XEiJ.mpuDFC == 1 || XEiJ.mpuDFC == 2) { //ユーザモード 5181: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpUserMap : XEiJ.busUserMap; 5182: } else if (XEiJ.mpuDFC == 5 || XEiJ.mpuDFC == 6) { //スーパーバイザモード 5183: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap; 5184: } else { //CPU空間などは不可 5185: M68kException.m6eFSLW |= M68kException.M6E_FSLW_BUS_ERROR_ON_WRITE; 5186: M68kException.m6eNumber = M68kException.M6E_ACCESS_FAULT; 5187: M68kException.m6eAddress = a; 5188: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 5189: M68kException.m6eSize = XEiJ.MPU_SS_BYTE; 5190: throw M68kException.m6eSignal; 5191: } 5192: mm[a >>> XEiJ.BUS_PAGE_BITS].mmdWb (a, XEiJ.regRn[n]); 5193: } 5194: } //irpMovesByte 5195: 5196: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5197: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5198: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5199: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5200: //MOVES.W <ea>,Rn |-|-12346|P|-----|-----| M+-WXZ |0000_111_001_mmm_rrr-rnnn000000000000 5201: //MOVES.W Rn,<ea> |-|-12346|P|-----|-----| M+-WXZ |0000_111_001_mmm_rrr-rnnn100000000000 5202: // 5203: //MOVES.W <ea>,Rn 5204: // MOVES.W <ea>,DnはDnの下位ワードだけ更新する 5205: // MOVES.W <ea>,Anはワードデータをロングに符号拡張してAnの全体を更新する 5206: // SFC=1,2,5,6はアドレス変換あり、SFC=0,3,4はアドレス変換なし、 5207: // SFC=7はCPU空間なのでコプロセッサが割り当てられている領域以外はバスエラーになる 5208: // 5209: //MOVES.W Rn,<ea> 5210: // DFC=1,2,5,6はアドレス変換あり、DFC=0,3,4はアドレス変換なし、 5211: // DFC=7はCPU空間なのでコプロセッサが割り当てられている領域以外はバスエラーになる 5212: public static void irpMovesWord () throws M68kException { 5213: int w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz 5214: if (w << -11 != 0) { 5215: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 5216: throw M68kException.m6eSignal; 5217: } 5218: if (XEiJ.regSRS == 0) { //ユーザモードのとき 5219: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 5220: throw M68kException.m6eSignal; 5221: } 5222: //以下はスーパーバイザモード 5223: XEiJ.mpuCycleCount += 4; 5224: int a = efaMltWord (XEiJ.regOC & 63); 5225: int n = w >>> 12; //n 5226: if (w << 31 - 11 >= 0) { //MOVES.W <ea>,Rn。リード 5227: MemoryMappedDevice[] mm; 5228: if (XEiJ.mpuSFC == 1 || XEiJ.mpuSFC == 2) { //ユーザモード 5229: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpUserMap : XEiJ.busUserMap; 5230: } else if (XEiJ.mpuSFC == 5 || XEiJ.mpuSFC == 6) { //スーパーバイザモード 5231: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap; 5232: } else { //CPU空間などは不可 5233: M68kException.m6eFSLW |= M68kException.M6E_FSLW_BUS_ERROR_ON_READ; 5234: M68kException.m6eNumber = M68kException.M6E_ACCESS_FAULT; 5235: M68kException.m6eAddress = a; 5236: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 5237: M68kException.m6eSize = XEiJ.MPU_SS_WORD; 5238: throw M68kException.m6eSignal; 5239: } 5240: int z; 5241: if ((a & 1) == 0) { //偶数 5242: z = mm[a >>> XEiJ.BUS_PAGE_BITS].mmdRwz (a); 5243: } else { //奇数 5244: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 5245: M68kException.m6eAddress = a; 5246: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 5247: M68kException.m6eSize = XEiJ.MPU_SS_WORD; 5248: throw M68kException.m6eSignal; 5249: } 5250: if (n < 8) { //MOVES.W <ea>,Dn 5251: XEiJ.regRn[n] = XEiJ.regRn[n] & ~65535 | z; 5252: } else { //MOVES.W <ea>,An 5253: XEiJ.regRn[n] = (short) z; 5254: } 5255: } else { //MOVES.W Rn,<ea>。ライト 5256: MemoryMappedDevice[] mm; 5257: if (XEiJ.mpuDFC == 1 || XEiJ.mpuDFC == 2) { //ユーザモード 5258: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpUserMap : XEiJ.busUserMap; 5259: } else if (XEiJ.mpuDFC == 5 || XEiJ.mpuDFC == 6) { //スーパーバイザモード 5260: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap; 5261: } else { //CPU空間などは不可 5262: M68kException.m6eFSLW |= M68kException.M6E_FSLW_BUS_ERROR_ON_WRITE; 5263: M68kException.m6eNumber = M68kException.M6E_ACCESS_FAULT; 5264: M68kException.m6eAddress = a; 5265: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 5266: M68kException.m6eSize = XEiJ.MPU_SS_WORD; 5267: throw M68kException.m6eSignal; 5268: } 5269: int z = XEiJ.regRn[n]; 5270: if ((a & 1) == 0) { //偶数 5271: mm[a >>> XEiJ.BUS_PAGE_BITS].mmdWw (a, z); 5272: } else { //奇数 5273: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 5274: M68kException.m6eAddress = a; 5275: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 5276: M68kException.m6eSize = XEiJ.MPU_SS_WORD; 5277: throw M68kException.m6eSignal; 5278: } 5279: } 5280: } //irpMovesWord 5281: 5282: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5283: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5284: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5285: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5286: //MOVES.L <ea>,Rn |-|-12346|P|-----|-----| M+-WXZ |0000_111_010_mmm_rrr-rnnn000000000000 5287: //MOVES.L Rn,<ea> |-|-12346|P|-----|-----| M+-WXZ |0000_111_010_mmm_rrr-rnnn100000000000 5288: // 5289: //MOVES.L <ea>,Rn 5290: // SFC=1,2,5,6はアドレス変換あり、SFC=0,3,4はアドレス変換なし、 5291: // SFC=7はCPU空間なのでコプロセッサが割り当てられている領域以外はバスエラーになる 5292: // 5293: //MOVES.L Rn,<ea> 5294: // DFC=1,2,5,6はアドレス変換あり、DFC=0,3,4はアドレス変換なし、 5295: // DFC=7はCPU空間なのでコプロセッサが割り当てられている領域以外はバスエラーになる 5296: public static void irpMovesLong () throws M68kException { 5297: int w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz 5298: if (w << -11 != 0) { 5299: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 5300: throw M68kException.m6eSignal; 5301: } 5302: if (XEiJ.regSRS == 0) { //ユーザモードのとき 5303: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 5304: throw M68kException.m6eSignal; 5305: } 5306: //以下はスーパーバイザモード 5307: XEiJ.mpuCycleCount += 4; 5308: int a = efaMltLong (XEiJ.regOC & 63); 5309: int n = w >>> 12; //n 5310: if (w << 31 - 11 >= 0) { //MOVES.L <ea>,Rn。リード 5311: MemoryMappedDevice[] mm; 5312: if (XEiJ.mpuSFC == 1 || XEiJ.mpuSFC == 2) { //ユーザモード 5313: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpUserMap : XEiJ.busUserMap; 5314: } else if (XEiJ.mpuSFC == 5 || XEiJ.mpuSFC == 6) { //スーパーバイザモード 5315: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap; 5316: } else { //CPU空間などは不可 5317: M68kException.m6eFSLW |= M68kException.M6E_FSLW_BUS_ERROR_ON_READ; 5318: M68kException.m6eNumber = M68kException.M6E_ACCESS_FAULT; 5319: M68kException.m6eAddress = a; 5320: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 5321: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 5322: throw M68kException.m6eSignal; 5323: } 5324: int z; 5325: if ((a & 3) == 0) { //4の倍数 5326: z = mm[a >>> XEiJ.BUS_PAGE_BITS].mmdRls (a); 5327: } else if ((a & 1) == 0) { //4の倍数+2 5328: z = mm[a >>> XEiJ.BUS_PAGE_BITS].mmdRws (a) << 16; 5329: a += 2; 5330: z |= mm[a >>> XEiJ.BUS_PAGE_BITS].mmdRwz (a); 5331: } else { //奇数 5332: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 5333: M68kException.m6eAddress = a; 5334: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 5335: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 5336: throw M68kException.m6eSignal; 5337: } 5338: XEiJ.regRn[n] = z; 5339: } else { //MOVES.L Rn,<ea>。ライト 5340: MemoryMappedDevice[] mm; 5341: if (XEiJ.mpuDFC == 1 || XEiJ.mpuDFC == 2) { //ユーザモード 5342: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpUserMap : XEiJ.busUserMap; 5343: } else if (XEiJ.mpuDFC == 5 || XEiJ.mpuDFC == 6) { //スーパーバイザモード 5344: mm = DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap; 5345: } else { //CPU空間などは不可 5346: M68kException.m6eFSLW |= M68kException.M6E_FSLW_BUS_ERROR_ON_WRITE; 5347: M68kException.m6eNumber = M68kException.M6E_ACCESS_FAULT; 5348: M68kException.m6eAddress = a; 5349: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 5350: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 5351: throw M68kException.m6eSignal; 5352: } 5353: int z = XEiJ.regRn[n]; 5354: if ((a & 3) == 0) { //4の倍数 5355: mm[a >>> XEiJ.BUS_PAGE_BITS].mmdWl (a, z); 5356: } else if ((a & 1) == 0) { //4の倍数+2 5357: mm[a >>> XEiJ.BUS_PAGE_BITS].mmdWw (a, z >> 16); 5358: a += 2; 5359: mm[a >>> XEiJ.BUS_PAGE_BITS].mmdWw (a, z); 5360: } else { //奇数 5361: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 5362: M68kException.m6eAddress = a; 5363: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 5364: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 5365: throw M68kException.m6eSignal; 5366: } 5367: } 5368: } //irpMovesLong 5369: 5370: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5371: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5372: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5373: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5374: //MOVE.B <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_000_mmm_rrr 5375: public static void irpMoveToDRByte () throws M68kException { 5376: XEiJ.mpuCycleCount += 4; 5377: int ea = XEiJ.regOC & 63; 5378: int qqq = XEiJ.regOC >> 9 & 7; 5379: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); 5380: XEiJ.regRn[qqq] = ~255 & XEiJ.regRn[qqq] | 255 & z; 5381: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5382: } //irpMoveToDRByte 5383: 5384: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5385: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5386: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5387: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5388: //MOVE.B <ea>,(Aq) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_010_mmm_rrr 5389: public static void irpMoveToMMByte () throws M68kException { 5390: XEiJ.mpuCycleCount += 8; 5391: int ea = XEiJ.regOC & 63; 5392: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); //ここでAqが変化する可能性があることに注意 5393: XEiJ.busWb (XEiJ.regRn[XEiJ.regOC >> 9], z); //1qqq=aqq 5394: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5395: } //irpMoveToMMByte 5396: 5397: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5398: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5399: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5400: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5401: //MOVE.B <ea>,(Aq)+ |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_011_mmm_rrr 5402: public static void irpMoveToMPByte () throws M68kException { 5403: XEiJ.mpuCycleCount += 8; 5404: int ea = XEiJ.regOC & 63; 5405: int aqq = XEiJ.regOC >> 9; //1qqq=aqq 5406: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); //ここでAqが変化する可能性があることに注意 5407: XEiJ.busWb (aqq < 15 ? XEiJ.regRn[aqq]++ : (XEiJ.regRn[15] += 2) - 2, z); 5408: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5409: } //irpMoveToMPByte 5410: 5411: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5412: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5413: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5414: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5415: //MOVE.B <ea>,-(Aq) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_100_mmm_rrr 5416: public static void irpMoveToMNByte () throws M68kException { 5417: XEiJ.mpuCycleCount += 8; 5418: int ea = XEiJ.regOC & 63; 5419: int aqq = XEiJ.regOC >> 9; //1qqq=aqq 5420: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); //ここでAqが変化する可能性があることに注意 5421: XEiJ.busWb (aqq < 15 ? --XEiJ.regRn[aqq] : (XEiJ.regRn[15] -= 2), z); 5422: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5423: } //irpMoveToMNByte 5424: 5425: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5426: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5427: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5428: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5429: //MOVE.B <ea>,(d16,Aq) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_101_mmm_rrr 5430: public static void irpMoveToMWByte () throws M68kException { 5431: XEiJ.mpuCycleCount += 12; 5432: int ea = XEiJ.regOC & 63; 5433: int aqq = XEiJ.regOC >> 9; //1qqq=aqq 5434: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); //ここでAqが変化する可能性があることに注意 5435: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5436: XEiJ.busWb (XEiJ.regRn[aqq] //ベースレジスタ 5437: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2), //pcws。ワードディスプレースメント 5438: z); 5439: } else { 5440: int t = XEiJ.regPC; 5441: XEiJ.regPC = t + 2; 5442: XEiJ.busWb (XEiJ.regRn[aqq] //ベースレジスタ 5443: + XEiJ.busRwse (t), //pcws。ワードディスプレースメント 5444: z); 5445: } 5446: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5447: } //irpMoveToMWByte 5448: 5449: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5450: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5451: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5452: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5453: //MOVE.B <ea>,(d8,Aq,Rn.wl) |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_qqq_110_mmm_rrr 5454: public static void irpMoveToMXByte () throws M68kException { 5455: XEiJ.mpuCycleCount += 14; 5456: int ea = XEiJ.regOC & 63; 5457: int aqq = XEiJ.regOC >> 9; //1qqq=aqq 5458: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); //ここでAqが変化する可能性があることに注意 5459: int w; 5460: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5461: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 5462: } else { 5463: w = XEiJ.regPC; 5464: XEiJ.regPC = w + 2; 5465: w = XEiJ.busRwze (w); //pcwz。拡張ワード 5466: } 5467: XEiJ.busWb (XEiJ.regRn[aqq] //ベースレジスタ 5468: + (byte) w //バイトディスプレースメント 5469: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 5470: XEiJ.regRn[w >> 12]), //ロングインデックス 5471: z); 5472: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5473: } //irpMoveToMXByte 5474: 5475: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5476: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5477: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5478: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5479: //MOVE.B <ea>,(xxx).W |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_000_111_mmm_rrr 5480: public static void irpMoveToZWByte () throws M68kException { 5481: XEiJ.mpuCycleCount += 12; 5482: int ea = XEiJ.regOC & 63; 5483: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); 5484: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5485: XEiJ.busWb (XEiJ.busRwse ((XEiJ.regPC += 2) - 2), //pcws 5486: z); 5487: } else { 5488: int t = XEiJ.regPC; 5489: XEiJ.regPC = t + 2; 5490: XEiJ.busWb (XEiJ.busRwse (t), //pcws 5491: z); 5492: } 5493: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5494: } //irpMoveToZWByte 5495: 5496: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5497: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5498: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5499: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5500: //MOVE.B <ea>,(xxx).L |-|012346|-|-UUUU|-**00|D M+-WXZPI|0001_001_111_mmm_rrr 5501: public static void irpMoveToZLByte () throws M68kException { 5502: XEiJ.mpuCycleCount += 16; 5503: int ea = XEiJ.regOC & 63; 5504: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); 5505: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5506: XEiJ.busWb (XEiJ.busRlse ((XEiJ.regPC += 4) - 4), //pcls 5507: z); 5508: } else { 5509: int t = XEiJ.regPC; 5510: XEiJ.regPC = t + 4; 5511: XEiJ.busWb (XEiJ.busRlse (t), //pcls 5512: z); 5513: } 5514: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 5515: } //irpMoveToZLByte 5516: 5517: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5518: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5519: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5520: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5521: //MOVE.L <ea>,Dq |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_000_mmm_rrr 5522: public static void irpMoveToDRLong () throws M68kException { 5523: XEiJ.mpuCycleCount += 4; 5524: int ea = XEiJ.regOC & 63; 5525: int z; 5526: XEiJ.regRn[XEiJ.regOC >> 9 & 7] = z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 5527: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5528: } //irpMoveToDRLong 5529: 5530: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5531: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5532: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5533: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5534: //MOVEA.L <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|0010_qqq_001_mmm_rrr 5535: //MOVE.L <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|0010_qqq_001_mmm_rrr [MOVEA.L <ea>,Aq] 5536: public static void irpMoveaLong () throws M68kException { 5537: XEiJ.mpuCycleCount += 4; 5538: int ea = XEiJ.regOC & 63; 5539: XEiJ.regRn[(XEiJ.regOC >> 9) - (16 - 8)] = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。右辺でAqが変化する可能性があることに注意 5540: } //irpMoveaLong 5541: 5542: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5543: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5544: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5545: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5546: //MOVE.L <ea>,(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_010_mmm_rrr 5547: public static void irpMoveToMMLong () throws M68kException { 5548: XEiJ.mpuCycleCount += 12; 5549: int ea = XEiJ.regOC & 63; 5550: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5551: XEiJ.busWl (XEiJ.regRn[(XEiJ.regOC >> 9) - (16 - 8)], z); 5552: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5553: } //irpMoveToMMLong 5554: 5555: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5556: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5557: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5558: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5559: //MOVE.L <ea>,(Aq)+ |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_011_mmm_rrr 5560: public static void irpMoveToMPLong () throws M68kException { 5561: XEiJ.mpuCycleCount += 12; 5562: int ea = XEiJ.regOC & 63; 5563: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5564: XEiJ.busWl ((XEiJ.regRn[(XEiJ.regOC >> 9) - (16 - 8)] += 4) - 4, z); 5565: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5566: } //irpMoveToMPLong 5567: 5568: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5569: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5570: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5571: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5572: //MOVE.L <ea>,-(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_100_mmm_rrr 5573: public static void irpMoveToMNLong () throws M68kException { 5574: XEiJ.mpuCycleCount += 12; 5575: int ea = XEiJ.regOC & 63; 5576: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5577: XEiJ.busWl ((XEiJ.regRn[(XEiJ.regOC >> 9) - (16 - 8)] -= 4), z); 5578: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5579: } //irpMoveToMNLong 5580: 5581: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5582: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5583: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5584: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5585: //MOVE.L <ea>,(d16,Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_101_mmm_rrr 5586: public static void irpMoveToMWLong () throws M68kException { 5587: XEiJ.mpuCycleCount += 16; 5588: int ea = XEiJ.regOC & 63; 5589: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5590: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5591: XEiJ.busWl (XEiJ.regRn[(XEiJ.regOC >> 9) - (16 - 8)] //ベースレジスタ 5592: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2), //pcws。ワードディスプレースメント 5593: z); 5594: } else { 5595: int t = XEiJ.regPC; 5596: XEiJ.regPC = t + 2; 5597: XEiJ.busWl (XEiJ.regRn[(XEiJ.regOC >> 9) - (16 - 8)] //ベースレジスタ 5598: + XEiJ.busRwse (t), //pcws。ワードディスプレースメント 5599: z); 5600: } 5601: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5602: } //irpMoveToMWLong 5603: 5604: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5605: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5606: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5607: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5608: //MOVE.L <ea>,(d8,Aq,Rn.wl) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_qqq_110_mmm_rrr 5609: public static void irpMoveToMXLong () throws M68kException { 5610: XEiJ.mpuCycleCount += 18; 5611: int ea = XEiJ.regOC & 63; 5612: int aqq = (XEiJ.regOC >> 9) - (16 - 8); 5613: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5614: int w; 5615: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5616: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 5617: } else { 5618: w = XEiJ.regPC; 5619: XEiJ.regPC = w + 2; 5620: w = XEiJ.busRwze (w); //pcwz。拡張ワード 5621: } 5622: XEiJ.busWl (XEiJ.regRn[aqq] //ベースレジスタ 5623: + (byte) w //バイトディスプレースメント 5624: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 5625: XEiJ.regRn[w >> 12]), //ロングインデックス 5626: z); 5627: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5628: } //irpMoveToMXLong 5629: 5630: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5631: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5632: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5633: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5634: //MOVE.L <ea>,(xxx).W |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_000_111_mmm_rrr 5635: public static void irpMoveToZWLong () throws M68kException { 5636: XEiJ.mpuCycleCount += 16; 5637: int ea = XEiJ.regOC & 63; 5638: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 5639: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5640: XEiJ.busWl (XEiJ.busRwse ((XEiJ.regPC += 2) - 2), //pcws 5641: z); 5642: } else { 5643: int t = XEiJ.regPC; 5644: XEiJ.regPC = t + 2; 5645: XEiJ.busWl (XEiJ.busRwse (t), //pcws 5646: z); 5647: } 5648: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5649: } //irpMoveToZWLong 5650: 5651: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5652: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5653: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5654: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5655: //MOVE.L <ea>,(xxx).L |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0010_001_111_mmm_rrr 5656: public static void irpMoveToZLLong () throws M68kException { 5657: XEiJ.mpuCycleCount += 20; 5658: int ea = XEiJ.regOC & 63; 5659: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 5660: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5661: XEiJ.busWl (XEiJ.busRlse ((XEiJ.regPC += 4) - 4), //pcls 5662: z); 5663: } else { 5664: int t = XEiJ.regPC; 5665: XEiJ.regPC = t + 4; 5666: XEiJ.busWl (XEiJ.busRlse (t), //pcls 5667: z); 5668: } 5669: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 5670: } //irpMoveToZLLong 5671: 5672: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5673: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5674: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5675: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5676: //MOVE.W <ea>,Dq |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_000_mmm_rrr 5677: public static void irpMoveToDRWord () throws M68kException { 5678: XEiJ.mpuCycleCount += 4; 5679: int ea = XEiJ.regOC & 63; 5680: int qqq = XEiJ.regOC >> 9 & 7; 5681: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 5682: XEiJ.regRn[qqq] = ~65535 & XEiJ.regRn[qqq] | (char) z; 5683: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5684: } //irpMoveToDRWord 5685: 5686: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5687: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5688: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5689: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5690: //MOVEA.W <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|0011_qqq_001_mmm_rrr 5691: //MOVE.W <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|0011_qqq_001_mmm_rrr [MOVEA.W <ea>,Aq] 5692: // 5693: //MOVEA.W <ea>,Aq 5694: // ワードデータをロングに符号拡張してAqの全体を更新する 5695: public static void irpMoveaWord () throws M68kException { 5696: XEiJ.mpuCycleCount += 4; 5697: int ea = XEiJ.regOC & 63; 5698: XEiJ.regRn[XEiJ.regOC >> 9 & 15] = ea < XEiJ.EA_MM ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //符号拡張して32bit全部書き換える。このr[ea]はデータレジスタまたはアドレスレジスタ。右辺でAqが変化する可能性があることに注意 5699: } //irpMoveaWord 5700: 5701: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5702: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5703: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5704: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5705: //MOVE.W <ea>,(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_010_mmm_rrr 5706: public static void irpMoveToMMWord () throws M68kException { 5707: XEiJ.mpuCycleCount += 8; 5708: int ea = XEiJ.regOC & 63; 5709: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5710: XEiJ.busWw (XEiJ.regRn[XEiJ.regOC >> 9 & 15], z); 5711: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5712: } //irpMoveToMMWord 5713: 5714: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5715: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5716: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5717: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5718: //MOVE.W <ea>,(Aq)+ |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_011_mmm_rrr 5719: public static void irpMoveToMPWord () throws M68kException { 5720: XEiJ.mpuCycleCount += 8; 5721: int ea = XEiJ.regOC & 63; 5722: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5723: XEiJ.busWw ((XEiJ.regRn[XEiJ.regOC >> 9 & 15] += 2) - 2, z); 5724: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5725: } //irpMoveToMPWord 5726: 5727: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5728: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5729: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5730: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5731: //MOVE.W <ea>,-(Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_100_mmm_rrr 5732: public static void irpMoveToMNWord () throws M68kException { 5733: XEiJ.mpuCycleCount += 8; 5734: int ea = XEiJ.regOC & 63; 5735: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5736: XEiJ.busWw ((XEiJ.regRn[XEiJ.regOC >> 9 & 15] -= 2), z); 5737: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5738: } //irpMoveToMNWord 5739: 5740: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5741: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5742: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5743: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5744: //MOVE.W <ea>,(d16,Aq) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_101_mmm_rrr 5745: public static void irpMoveToMWWord () throws M68kException { 5746: XEiJ.mpuCycleCount += 12; 5747: int ea = XEiJ.regOC & 63; 5748: int aqq = XEiJ.regOC >> 9 & 15; 5749: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5750: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5751: XEiJ.busWw (XEiJ.regRn[aqq] //ベースレジスタ 5752: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2), //pcws。ワードディスプレースメント 5753: z); 5754: } else { 5755: int t = XEiJ.regPC; 5756: XEiJ.regPC = t + 2; 5757: XEiJ.busWw (XEiJ.regRn[aqq] //ベースレジスタ 5758: + XEiJ.busRwse (t), //pcws。ワードディスプレースメント 5759: z); 5760: } 5761: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5762: } //irpMoveToMWWord 5763: 5764: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5765: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5766: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5767: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5768: //MOVE.W <ea>,(d8,Aq,Rn.wl) |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_qqq_110_mmm_rrr 5769: public static void irpMoveToMXWord () throws M68kException { 5770: XEiJ.mpuCycleCount += 14; 5771: int ea = XEiJ.regOC & 63; 5772: int aqq = XEiJ.regOC >> 9 & 15; 5773: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 5774: int w; 5775: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5776: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 5777: } else { 5778: w = XEiJ.regPC; 5779: XEiJ.regPC = w + 2; 5780: w = XEiJ.busRwze (w); //pcwz。拡張ワード 5781: } 5782: XEiJ.busWw (XEiJ.regRn[aqq] //ベースレジスタ 5783: + (byte) w //バイトディスプレースメント 5784: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 5785: XEiJ.regRn[w >> 12]), //ロングインデックス 5786: z); 5787: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5788: } //irpMoveToMXWord 5789: 5790: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5791: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5792: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5793: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5794: //MOVE.W <ea>,(xxx).W |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_000_111_mmm_rrr 5795: public static void irpMoveToZWWord () throws M68kException { 5796: XEiJ.mpuCycleCount += 12; 5797: int ea = XEiJ.regOC & 63; 5798: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 5799: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5800: XEiJ.busWw (XEiJ.busRwse ((XEiJ.regPC += 2) - 2), //pcws 5801: z); 5802: } else { 5803: int t = XEiJ.regPC; 5804: XEiJ.regPC = t + 2; 5805: XEiJ.busWw (XEiJ.busRwse (t), //pcws 5806: z); 5807: } 5808: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5809: } //irpMoveToZWWord 5810: 5811: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5812: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5813: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5814: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5815: //MOVE.W <ea>,(xxx).L |-|012346|-|-UUUU|-**00|DAM+-WXZPI|0011_001_111_mmm_rrr 5816: public static void irpMoveToZLWord () throws M68kException { 5817: XEiJ.mpuCycleCount += 16; 5818: int ea = XEiJ.regOC & 63; 5819: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 5820: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 5821: XEiJ.busWw (XEiJ.busRlse ((XEiJ.regPC += 4) - 4), //pcls 5822: z); 5823: } else { 5824: int t = XEiJ.regPC; 5825: XEiJ.regPC = t + 4; 5826: XEiJ.busWw (XEiJ.busRlse (t), //pcls 5827: z); 5828: } 5829: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 5830: } //irpMoveToZLWord 5831: 5832: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5833: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5834: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5835: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5836: //NEGX.B <ea> |-|012346|-|*UUUU|*****|D M+-WXZ |0100_000_000_mmm_rrr 5837: public static void irpNegxByte () throws M68kException { 5838: int ea = XEiJ.regOC & 63; 5839: int y; 5840: int z; 5841: if (ea < XEiJ.EA_AR) { //NEGX.B Dr 5842: XEiJ.mpuCycleCount += 4; 5843: z = (byte) (XEiJ.regRn[ea] = ~0xff & (y = XEiJ.regRn[ea]) | 0xff & -(y = (byte) y) - (XEiJ.regCCR >> 4)); //Xの左側はすべて0なのでCCR_X&を省略 5844: } else { //NEGX.B <mem> 5845: XEiJ.mpuCycleCount += 8; 5846: int a = efaMltByte (ea); 5847: XEiJ.busWb (a, z = (byte) (-(y = XEiJ.busRbs (a)) - (XEiJ.regCCR >> 4))); //Xの左側はすべて0なのでCCR_X&を省略 5848: } 5849: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_Z : 0) | 5850: (y & z) >>> 31 << 1 | 5851: (y | z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_negx 5852: } //irpNegxByte 5853: 5854: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5855: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5856: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5857: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5858: //NEGX.W <ea> |-|012346|-|*UUUU|*****|D M+-WXZ |0100_000_001_mmm_rrr 5859: public static void irpNegxWord () throws M68kException { 5860: int ea = XEiJ.regOC & 63; 5861: int y; 5862: int z; 5863: if (ea < XEiJ.EA_AR) { //NEGX.W Dr 5864: XEiJ.mpuCycleCount += 4; 5865: z = (short) (XEiJ.regRn[ea] = ~0xffff & (y = XEiJ.regRn[ea]) | (char) (-(y = (short) y) - (XEiJ.regCCR >> 4))); //Xの左側はすべて0なのでCCR_X&を省略 5866: } else { //NEGX.W <mem> 5867: XEiJ.mpuCycleCount += 8; 5868: int a = efaMltWord (ea); 5869: XEiJ.busWw (a, z = (short) (-(y = XEiJ.busRws (a)) - (XEiJ.regCCR >> 4))); //Xの左側はすべて0なのでCCR_X&を省略 5870: } 5871: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_Z : 0) | 5872: (y & z) >>> 31 << 1 | 5873: (y | z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_negx 5874: } //irpNegxWord 5875: 5876: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5877: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5878: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5879: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5880: //NEGX.L <ea> |-|012346|-|*UUUU|*****|D M+-WXZ |0100_000_010_mmm_rrr 5881: public static void irpNegxLong () throws M68kException { 5882: int ea = XEiJ.regOC & 63; 5883: int y; 5884: int z; 5885: if (ea < XEiJ.EA_AR) { //NEGX.L Dr 5886: XEiJ.mpuCycleCount += 6; 5887: XEiJ.regRn[ea] = z = -(y = XEiJ.regRn[ea]) - (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 5888: } else { //NEGX.L <mem> 5889: XEiJ.mpuCycleCount += 12; 5890: int a = efaMltLong (ea); 5891: XEiJ.busWl (a, z = -(y = XEiJ.busRls (a)) - (XEiJ.regCCR >> 4)); //Xの左側はすべて0なのでCCR_X&を省略 5892: } 5893: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_Z : 0) | 5894: (y & z) >>> 31 << 1 | 5895: (y | z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_negx 5896: } //irpNegxLong 5897: 5898: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5899: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5900: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5901: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5902: //MOVE.W SR,<ea> |-|-12346|P|*****|-----|D M+-WXZ |0100_000_011_mmm_rrr 5903: public static void irpMoveFromSR () throws M68kException { 5904: //MC68010以上では特権命令 5905: if (XEiJ.regSRS == 0) { //ユーザモードのとき 5906: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 5907: throw M68kException.m6eSignal; 5908: } 5909: //以下はスーパーバイザモード 5910: int ea = XEiJ.regOC & 63; 5911: if (ea < XEiJ.EA_AR) { //MOVE.W SR,Dr 5912: XEiJ.mpuCycleCount += 6; 5913: XEiJ.regRn[ea] = ~0xffff & XEiJ.regRn[ea] | XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR; 5914: } else { //MOVE.W SR,<mem> 5915: //! 軽量化。MOVE from SRによる直後の命令のイミディエイトオペランドの自己書き換えが直後に反映されてしまう 5916: // MC68000でFEファンクションコールやSXコールのようなCCRを変化させる例外処理ルーチンの出口を次のように書くと、 5917: // 自己書き換えが直後に反映されずイミディエイトオペランドの領域がバッファになって前回の結果を返すことになるので期待通りに動作しない 5918: // move.w sr,@f+2 5919: // @@: move.b #0,(1,sp) 5920: // rte 5921: // これが期待通りに動作してしまったらMC68000を正しくエミュレートできていないということになる 5922: // https://stdkmd.net/bbs/page2.htm#comment134 5923: XEiJ.mpuCycleCount += 8; 5924: int a = efaMltWord (ea); 5925: if (XEiJ.MPU_OMIT_EXTRA_READ) { 5926: //! 軽量化。MC68000では書き込む前にリードが入るが省略する 5927: } else { 5928: XEiJ.busRws (a); 5929: } 5930: XEiJ.busWw (a, XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR); 5931: } 5932: } //irpMoveFromSR 5933: 5934: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5935: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5936: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5937: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5938: //CHK.W <ea>,Dq |-|012346|-|-UUUU|-*UUU|D M+-WXZPI|0100_qqq_110_mmm_rrr 5939: public static void irpChkWord () throws M68kException { 5940: XEiJ.mpuCycleCount += 10; 5941: int ea = XEiJ.regOC & 63; 5942: int x = ea < XEiJ.EA_AR ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); 5943: int y = (short) XEiJ.regRn[XEiJ.regOC >> 9 & 7]; 5944: int z = (short) (x - y); 5945: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | 5946: (y < 0 ? XEiJ.REG_CCR_N : 0) | 5947: (y == 0 ? XEiJ.REG_CCR_Z : 0) | 5948: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 5949: (x & (y ^ z) ^ (y | z)) >>> 31); 5950: if (y < 0 || x < y) { 5951: XEiJ.mpuCycleCount += 38 - 10; 5952: M68kException.m6eNumber = M68kException.M6E_CHK_INSTRUCTION; 5953: throw M68kException.m6eSignal; 5954: } 5955: } //irpChkWord 5956: 5957: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5958: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5959: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5960: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5961: //LEA.L <ea>,Aq |-|012346|-|-----|-----| M WXZP |0100_qqq_111_mmm_rrr 5962: public static void irpLea () throws M68kException { 5963: //XEiJ.mpuCycleCount += 4 - 4; 5964: XEiJ.regRn[(XEiJ.regOC >> 9) - (32 - 8)] = efaLeaPea (XEiJ.regOC & 63); 5965: } //irpLea 5966: 5967: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5968: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5969: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5970: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5971: //CLR.B <ea> |-|012346|-|-UUUU|-0100|D M+-WXZ |0100_001_000_mmm_rrr (68000 and 68008 read before clear) 5972: public static void irpClrByte () throws M68kException { 5973: int ea = XEiJ.regOC & 63; 5974: if (ea < XEiJ.EA_AR) { //CLR.B Dr 5975: XEiJ.mpuCycleCount += 4; 5976: XEiJ.regRn[ea] &= ~0xff; 5977: } else { //CLR.B <mem> 5978: //MC68010はリードしない 5979: XEiJ.mpuCycleCount += 8; 5980: XEiJ.busWb (efaMltByte (ea), 0); 5981: } 5982: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z; //ccr_clr 5983: } //irpClrByte 5984: 5985: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5986: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 5987: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 5988: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 5989: //CLR.W <ea> |-|012346|-|-UUUU|-0100|D M+-WXZ |0100_001_001_mmm_rrr (68000 and 68008 read before clear) 5990: public static void irpClrWord () throws M68kException { 5991: int ea = XEiJ.regOC & 63; 5992: if (ea < XEiJ.EA_AR) { //CLR.W Dr 5993: XEiJ.mpuCycleCount += 4; 5994: XEiJ.regRn[ea] &= ~0xffff; 5995: } else { //CLR.W <mem> 5996: //MC68010はリードしない 5997: XEiJ.mpuCycleCount += 8; 5998: XEiJ.busWw (efaMltWord (ea), 0); 5999: } 6000: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z; //ccr_clr 6001: } //irpClrWord 6002: 6003: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6004: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6005: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6006: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6007: //CLR.L <ea> |-|012346|-|-UUUU|-0100|D M+-WXZ |0100_001_010_mmm_rrr (68000 and 68008 read before clear) 6008: public static void irpClrLong () throws M68kException { 6009: int ea = XEiJ.regOC & 63; 6010: if (ea < XEiJ.EA_AR) { //CLR.L Dr 6011: XEiJ.mpuCycleCount += 6; 6012: XEiJ.regRn[ea] = 0; 6013: } else { //CLR.L <mem> 6014: //MC68010はリードしない 6015: XEiJ.mpuCycleCount += 12; 6016: XEiJ.busWl (efaMltLong (ea), 0); 6017: } 6018: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z; //ccr_clr 6019: } //irpClrLong 6020: 6021: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6022: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6023: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6024: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6025: //MOVE.W CCR,<ea> |-|-12346|-|*****|-----|D M+-WXZ |0100_001_011_mmm_rrr 6026: public static void irpMoveFromCCR () throws M68kException { 6027: int ea = XEiJ.regOC & 63; 6028: if (ea < XEiJ.EA_AR) { //MOVE.W CCR,Dr 6029: XEiJ.mpuCycleCount += 4; 6030: XEiJ.regRn[ea] = ~0xffff & XEiJ.regRn[ea] | XEiJ.regCCR; 6031: } else { //MOVE.W CCR,<mem> 6032: XEiJ.mpuCycleCount += 8; 6033: XEiJ.busWw (efaMltWord (ea), XEiJ.regCCR); 6034: } 6035: } //irpMoveFromCCR 6036: 6037: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6038: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6039: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6040: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6041: //NEG.B <ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0100_010_000_mmm_rrr 6042: public static void irpNegByte () throws M68kException { 6043: int ea = XEiJ.regOC & 63; 6044: int y; 6045: int z; 6046: if (ea < XEiJ.EA_AR) { //NEG.B Dr 6047: XEiJ.mpuCycleCount += 4; 6048: z = (byte) (XEiJ.regRn[ea] = ~0xff & (y = XEiJ.regRn[ea]) | 0xff & -(y = (byte) y)); 6049: } else { //NEG.B <mem> 6050: XEiJ.mpuCycleCount += 8; 6051: int a = efaMltByte (ea); 6052: XEiJ.busWb (a, z = (byte) -(y = XEiJ.busRbs (a))); 6053: } 6054: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 6055: (y & z) >>> 31 << 1 | 6056: (y | z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_neg 6057: } //irpNegByte 6058: 6059: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6060: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6061: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6062: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6063: //NEG.W <ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0100_010_001_mmm_rrr 6064: public static void irpNegWord () throws M68kException { 6065: int ea = XEiJ.regOC & 63; 6066: int y; 6067: int z; 6068: if (ea < XEiJ.EA_AR) { //NEG.W Dr 6069: XEiJ.mpuCycleCount += 4; 6070: z = (short) (XEiJ.regRn[ea] = ~0xffff & (y = XEiJ.regRn[ea]) | (char) -(y = (short) y)); 6071: } else { //NEG.W <mem> 6072: XEiJ.mpuCycleCount += 8; 6073: int a = efaMltWord (ea); 6074: XEiJ.busWw (a, z = (short) -(y = XEiJ.busRws (a))); 6075: } 6076: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 6077: (y & z) >>> 31 << 1 | 6078: (y | z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_neg 6079: } //irpNegWord 6080: 6081: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6082: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6083: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6084: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6085: //NEG.L <ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0100_010_010_mmm_rrr 6086: public static void irpNegLong () throws M68kException { 6087: int ea = XEiJ.regOC & 63; 6088: int y; 6089: int z; 6090: if (ea < XEiJ.EA_AR) { //NEG.L Dr 6091: XEiJ.mpuCycleCount += 6; 6092: XEiJ.regRn[ea] = z = -(y = XEiJ.regRn[ea]); 6093: } else { //NEG.L <mem> 6094: XEiJ.mpuCycleCount += 12; 6095: int a = efaMltLong (ea); 6096: XEiJ.busWl (a, z = -(y = XEiJ.busRls (a))); 6097: } 6098: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 6099: (y & z) >>> 31 << 1 | 6100: (y | z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_neg 6101: } //irpNegLong 6102: 6103: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6104: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6105: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6106: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6107: //MOVE.W <ea>,CCR |-|012346|-|UUUUU|*****|D M+-WXZPI|0100_010_011_mmm_rrr 6108: public static void irpMoveToCCR () throws M68kException { 6109: XEiJ.mpuCycleCount += 12; 6110: int ea = XEiJ.regOC & 63; 6111: XEiJ.regCCR = XEiJ.REG_CCR_MASK & (ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea))); 6112: } //irpMoveToCCR 6113: 6114: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6115: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6116: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6117: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6118: //NOT.B <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_011_000_mmm_rrr 6119: public static void irpNotByte () throws M68kException { 6120: int ea = XEiJ.regOC & 63; 6121: int z; 6122: if (ea < XEiJ.EA_AR) { //NOT.B Dr 6123: XEiJ.mpuCycleCount += 4; 6124: z = XEiJ.regRn[ea] ^= 255; //0拡張してからEOR 6125: } else { //NOT.B <mem> 6126: XEiJ.mpuCycleCount += 8; 6127: int a = efaMltByte (ea); 6128: XEiJ.busWb (a, z = ~XEiJ.busRbs (a)); 6129: } 6130: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 6131: } //irpNotByte 6132: 6133: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6134: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6135: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6136: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6137: //NOT.W <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_011_001_mmm_rrr 6138: public static void irpNotWord () throws M68kException { 6139: int ea = XEiJ.regOC & 63; 6140: int z; 6141: if (ea < XEiJ.EA_AR) { //NOT.W Dr 6142: XEiJ.mpuCycleCount += 4; 6143: z = XEiJ.regRn[ea] ^= 65535; //0拡張してからEOR 6144: } else { //NOT.W <mem> 6145: XEiJ.mpuCycleCount += 8; 6146: int a = efaMltWord (ea); 6147: XEiJ.busWw (a, z = ~XEiJ.busRws (a)); 6148: } 6149: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 6150: } //irpNotWord 6151: 6152: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6153: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6154: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6155: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6156: //NOT.L <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_011_010_mmm_rrr 6157: public static void irpNotLong () throws M68kException { 6158: int ea = XEiJ.regOC & 63; 6159: int z; 6160: if (ea < XEiJ.EA_AR) { //NOT.L Dr 6161: XEiJ.mpuCycleCount += 6; 6162: z = XEiJ.regRn[ea] ^= 0xffffffff; 6163: } else { //NOT.L <mem> 6164: XEiJ.mpuCycleCount += 12; 6165: int a = efaMltLong (ea); 6166: XEiJ.busWl (a, z = ~XEiJ.busRls (a)); 6167: } 6168: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 6169: } //irpNotLong 6170: 6171: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6172: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6173: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6174: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6175: //MOVE.W <ea>,SR |-|012346|P|UUUUU|*****|D M+-WXZPI|0100_011_011_mmm_rrr 6176: public static void irpMoveToSR () throws M68kException { 6177: if (XEiJ.regSRS == 0) { //ユーザモードのとき 6178: XEiJ.mpuCycleCount += 34; 6179: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 6180: throw M68kException.m6eSignal; 6181: } 6182: //以下はスーパーバイザモード 6183: XEiJ.mpuCycleCount += 12; 6184: int ea = XEiJ.regOC & 63; 6185: irpSetSR (ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRwz (efaAnyWord (ea))); //特権違反チェックが先 6186: } //irpMoveToSR 6187: 6188: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6189: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6190: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6191: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6192: //NBCD.B <ea> |-|012346|-|UUUUU|*U*U*|D M+-WXZ |0100_100_000_mmm_rrr 6193: public static void irpNbcd () throws M68kException { 6194: int ea = XEiJ.regOC & 63; 6195: if (ea < XEiJ.EA_AR) { //NBCD.B Dr 6196: XEiJ.mpuCycleCount += 6; 6197: XEiJ.regRn[ea] = ~0xff & XEiJ.regRn[ea] | irpSbcd (0, XEiJ.regRn[ea]); 6198: } else { //NBCD.B <mem> 6199: XEiJ.mpuCycleCount += 8; 6200: int a = efaMltByte (ea); 6201: XEiJ.busWb (a, irpSbcd (0, XEiJ.busRbs (a))); 6202: } 6203: } //irpNbcd 6204: 6205: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6206: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6207: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6208: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6209: //SWAP.W Dr |-|012346|-|-UUUU|-**00|D |0100_100_001_000_rrr 6210: //BKPT #<data> |-|-12346|-|-----|-----| |0100_100_001_001_ddd 6211: //PEA.L <ea> |-|012346|-|-----|-----| M WXZP |0100_100_001_mmm_rrr 6212: public static void irpPea () throws M68kException { 6213: int ea = XEiJ.regOC & 63; 6214: if (ea < XEiJ.EA_AR) { //SWAP.W Dr 6215: XEiJ.mpuCycleCount += 4; 6216: int x; 6217: int z; 6218: XEiJ.regRn[ea] = z = (x = XEiJ.regRn[ea]) << 16 | x >>> 16; 6219: //上位ワードと下位ワードを入れ替えた後のDrをロングでテストする 6220: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 6221: } else { //PEA.L <ea> 6222: XEiJ.mpuCycleCount += 12 - 4; 6223: int a = efaLeaPea (ea); //BKPT #<data>はここでillegal instructionになる 6224: XEiJ.busWl (XEiJ.regRn[15] -= 4, a); //pushl。評価順序に注意。wl(r[15]-=4,eaz_leapea(ea))は不可 6225: } 6226: } //irpPea 6227: 6228: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6229: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6230: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6231: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6232: //EXT.W Dr |-|012346|-|-UUUU|-**00|D |0100_100_010_000_rrr 6233: //MOVEM.W <list>,<ea> |-|012346|-|-----|-----| M -WXZ |0100_100_010_mmm_rrr-llllllllllllllll 6234: public static void irpMovemToMemWord () throws M68kException { 6235: int ea = XEiJ.regOC & 63; 6236: if (ea < XEiJ.EA_AR) { //EXT.W Dr 6237: XEiJ.mpuCycleCount += 4; 6238: int z; 6239: XEiJ.regRn[ea] = ~0xffff & (z = XEiJ.regRn[ea]) | (char) (z = (byte) z); 6240: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 6241: } else { //MOVEM.W <list>,<ea> 6242: int l = XEiJ.busRwze (XEiJ.regPC); //pcwze。レジスタリスト。ゼロ拡張 6243: XEiJ.regPC += 2; 6244: if (ea >> 3 == XEiJ.MMM_MN) { //-(Ar) 6245: //MOVEM.wl <list>,-(Ar)で<list>にArが含まれているとき、000/010は命令開始時のArを、020/030/040/060は命令開始時のAr-オペレーションサイズをメモリに書き込む 6246: //転送するレジスタが0個のときArは変化しない 6247: int arr = ea - (XEiJ.EA_MN - 8); 6248: int a = XEiJ.regRn[arr]; 6249: if ((a & 1) != 0 && l != 0) { //奇数アドレスで1ワード以上転送する 6250: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 6251: M68kException.m6eAddress = a; 6252: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 6253: M68kException.m6eSize = XEiJ.MPU_SS_WORD; 6254: throw M68kException.m6eSignal; 6255: } 6256: int t = a; 6257: if (XEiJ.IRP_MOVEM_MAINMEMORY && //000のときMOVEMでメインメモリを特別扱いにする 6258: (DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap)[a - 2 >>> XEiJ.BUS_PAGE_BITS] == MemoryMappedDevice.MMD_MMR && //メインメモリ 6259: 2 * 16 <= (a & XEiJ.BUS_PAGE_SIZE - 1)) { //16個転送してもページを跨がない 6260: a &= XEiJ.BUS_MOTHER_MASK; 6261: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 6262: if ((l & 0x0001) != 0) { 6263: a -= 2; 6264: int x = XEiJ.regRn[15]; 6265: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6266: MainMemory.mmrM8[a + 1] = (byte) x; 6267: } 6268: if ((l & 0x0002) != 0) { 6269: a -= 2; 6270: int x = XEiJ.regRn[14]; 6271: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6272: MainMemory.mmrM8[a + 1] = (byte) x; 6273: } 6274: if ((l & 0x0004) != 0) { 6275: a -= 2; 6276: int x = XEiJ.regRn[13]; 6277: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6278: MainMemory.mmrM8[a + 1] = (byte) x; 6279: } 6280: if ((l & 0x0008) != 0) { 6281: a -= 2; 6282: int x = XEiJ.regRn[12]; 6283: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6284: MainMemory.mmrM8[a + 1] = (byte) x; 6285: } 6286: if ((l & 0x0010) != 0) { 6287: a -= 2; 6288: int x = XEiJ.regRn[11]; 6289: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6290: MainMemory.mmrM8[a + 1] = (byte) x; 6291: } 6292: if ((l & 0x0020) != 0) { 6293: a -= 2; 6294: int x = XEiJ.regRn[10]; 6295: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6296: MainMemory.mmrM8[a + 1] = (byte) x; 6297: } 6298: if ((l & 0x0040) != 0) { 6299: a -= 2; 6300: int x = XEiJ.regRn[ 9]; 6301: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6302: MainMemory.mmrM8[a + 1] = (byte) x; 6303: } 6304: if ((byte) l < 0) { //(l & 0x0080) != 0 6305: a -= 2; 6306: int x = XEiJ.regRn[ 8]; 6307: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6308: MainMemory.mmrM8[a + 1] = (byte) x; 6309: } 6310: if ((l & 0x0100) != 0) { 6311: a -= 2; 6312: int x = XEiJ.regRn[ 7]; 6313: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6314: MainMemory.mmrM8[a + 1] = (byte) x; 6315: } 6316: if ((l & 0x0200) != 0) { 6317: a -= 2; 6318: int x = XEiJ.regRn[ 6]; 6319: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6320: MainMemory.mmrM8[a + 1] = (byte) x; 6321: } 6322: if ((l & 0x0400) != 0) { 6323: a -= 2; 6324: int x = XEiJ.regRn[ 5]; 6325: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6326: MainMemory.mmrM8[a + 1] = (byte) x; 6327: } 6328: if ((l & 0x0800) != 0) { 6329: a -= 2; 6330: int x = XEiJ.regRn[ 4]; 6331: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6332: MainMemory.mmrM8[a + 1] = (byte) x; 6333: } 6334: if ((l & 0x1000) != 0) { 6335: a -= 2; 6336: int x = XEiJ.regRn[ 3]; 6337: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6338: MainMemory.mmrM8[a + 1] = (byte) x; 6339: } 6340: if ((l & 0x2000) != 0) { 6341: a -= 2; 6342: int x = XEiJ.regRn[ 2]; 6343: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6344: MainMemory.mmrM8[a + 1] = (byte) x; 6345: } 6346: if ((l & 0x4000) != 0) { 6347: a -= 2; 6348: int x = XEiJ.regRn[ 1]; 6349: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6350: MainMemory.mmrM8[a + 1] = (byte) x; 6351: } 6352: if ((short) l < 0) { //(l & 0x8000) != 0 6353: a -= 2; 6354: int x = XEiJ.regRn[ 0]; 6355: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6356: MainMemory.mmrM8[a + 1] = (byte) x; 6357: } 6358: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 6359: for (int i = 15; i >= 0; i--) { 6360: if ((l & 0x8000 >>> i) != 0) { 6361: a -= 2; 6362: int x = XEiJ.regRn[i]; 6363: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6364: MainMemory.mmrM8[a + 1] = (byte) x; 6365: } 6366: } 6367: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 6368: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 6369: for (int i = 15; l != 0; i--, l <<= 1) { 6370: if (l < 0) { 6371: a -= 2; 6372: int x = XEiJ.regRn[i]; 6373: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6374: MainMemory.mmrM8[a + 1] = (byte) x; 6375: } 6376: } 6377: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 6378: for (int i = 15; l != 0; i--, l >>>= 1) { 6379: if ((l & 1) != 0) { 6380: a -= 2; 6381: int x = XEiJ.regRn[i]; 6382: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6383: MainMemory.mmrM8[a + 1] = (byte) x; 6384: } 6385: } 6386: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 6387: for (int i = 15; l != 0; ) { 6388: int k = Integer.numberOfTrailingZeros (l); 6389: a -= 2; 6390: int x = XEiJ.regRn[i -= k]; 6391: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6392: MainMemory.mmrM8[a + 1] = (byte) x; 6393: l = l >>> k & ~1; 6394: } 6395: } 6396: a = t - (short) (t - a); 6397: } else { //メインメモリでないかページを跨ぐ可能性がある 6398: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 6399: if ((l & 0x0001) != 0) { 6400: XEiJ.busWwe (a -= 2, XEiJ.regRn[15]); 6401: } 6402: if ((l & 0x0002) != 0) { 6403: XEiJ.busWwe (a -= 2, XEiJ.regRn[14]); 6404: } 6405: if ((l & 0x0004) != 0) { 6406: XEiJ.busWwe (a -= 2, XEiJ.regRn[13]); 6407: } 6408: if ((l & 0x0008) != 0) { 6409: XEiJ.busWwe (a -= 2, XEiJ.regRn[12]); 6410: } 6411: if ((l & 0x0010) != 0) { 6412: XEiJ.busWwe (a -= 2, XEiJ.regRn[11]); 6413: } 6414: if ((l & 0x0020) != 0) { 6415: XEiJ.busWwe (a -= 2, XEiJ.regRn[10]); 6416: } 6417: if ((l & 0x0040) != 0) { 6418: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 9]); 6419: } 6420: if ((byte) l < 0) { //(l & 0x0080) != 0 6421: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 8]); 6422: } 6423: if ((l & 0x0100) != 0) { 6424: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 7]); 6425: } 6426: if ((l & 0x0200) != 0) { 6427: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 6]); 6428: } 6429: if ((l & 0x0400) != 0) { 6430: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 5]); 6431: } 6432: if ((l & 0x0800) != 0) { 6433: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 4]); 6434: } 6435: if ((l & 0x1000) != 0) { 6436: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 3]); 6437: } 6438: if ((l & 0x2000) != 0) { 6439: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 2]); 6440: } 6441: if ((l & 0x4000) != 0) { 6442: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 1]); 6443: } 6444: if ((short) l < 0) { //(l & 0x8000) != 0 6445: XEiJ.busWwe (a -= 2, XEiJ.regRn[ 0]); 6446: } 6447: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 6448: for (int i = 15; i >= 0; i--) { 6449: if ((l & 0x8000 >>> i) != 0) { 6450: XEiJ.busWwe (a -= 2, XEiJ.regRn[i]); 6451: } 6452: } 6453: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 6454: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 6455: for (int i = 15; l != 0; i--, l <<= 1) { 6456: if (l < 0) { 6457: XEiJ.busWwe (a -= 2, XEiJ.regRn[i]); 6458: } 6459: } 6460: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 6461: for (int i = 15; l != 0; i--, l >>>= 1) { 6462: if ((l & 1) != 0) { 6463: XEiJ.busWwe (a -= 2, XEiJ.regRn[i]); 6464: } 6465: } 6466: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 6467: for (int i = 15; l != 0; ) { 6468: int k = Integer.numberOfTrailingZeros (l); 6469: XEiJ.busWwe (a -= 2, XEiJ.regRn[i -= k]); 6470: l = l >>> k & ~1; 6471: } 6472: } 6473: } 6474: XEiJ.regRn[arr] = a; 6475: XEiJ.mpuCycleCount += 8 + (t - a << 1); //2バイト/個→4サイクル/個 6476: } else { //-(Ar)以外 6477: int a = efaCltWord (ea); 6478: if ((a & 1) != 0 && l != 0) { //奇数アドレスで1ワード以上転送する 6479: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 6480: M68kException.m6eAddress = a; 6481: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 6482: M68kException.m6eSize = XEiJ.MPU_SS_WORD; 6483: throw M68kException.m6eSignal; 6484: } 6485: int t = a; 6486: if (XEiJ.IRP_MOVEM_MAINMEMORY && //000のときMOVEMでメインメモリを特別扱いにする 6487: (DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap)[a >>> XEiJ.BUS_PAGE_BITS] == MemoryMappedDevice.MMD_MMR && //メインメモリ 6488: (a & XEiJ.BUS_PAGE_SIZE - 1) <= XEiJ.BUS_PAGE_SIZE - 2 * 16) { //16個転送してもページを跨がない 6489: a &= XEiJ.BUS_MOTHER_MASK; 6490: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 6491: if ((l & 0x0001) != 0) { 6492: int x = XEiJ.regRn[ 0]; 6493: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6494: MainMemory.mmrM8[a + 1] = (byte) x; 6495: a += 2; 6496: } 6497: if ((l & 0x0002) != 0) { 6498: int x = XEiJ.regRn[ 1]; 6499: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6500: MainMemory.mmrM8[a + 1] = (byte) x; 6501: a += 2; 6502: } 6503: if ((l & 0x0004) != 0) { 6504: int x = XEiJ.regRn[ 2]; 6505: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6506: MainMemory.mmrM8[a + 1] = (byte) x; 6507: a += 2; 6508: } 6509: if ((l & 0x0008) != 0) { 6510: int x = XEiJ.regRn[ 3]; 6511: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6512: MainMemory.mmrM8[a + 1] = (byte) x; 6513: a += 2; 6514: } 6515: if ((l & 0x0010) != 0) { 6516: int x = XEiJ.regRn[ 4]; 6517: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6518: MainMemory.mmrM8[a + 1] = (byte) x; 6519: a += 2; 6520: } 6521: if ((l & 0x0020) != 0) { 6522: int x = XEiJ.regRn[ 5]; 6523: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6524: MainMemory.mmrM8[a + 1] = (byte) x; 6525: a += 2; 6526: } 6527: if ((l & 0x0040) != 0) { 6528: int x = XEiJ.regRn[ 6]; 6529: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6530: MainMemory.mmrM8[a + 1] = (byte) x; 6531: a += 2; 6532: } 6533: if ((byte) l < 0) { //(l & 0x0080) != 0 6534: int x = XEiJ.regRn[ 7]; 6535: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6536: MainMemory.mmrM8[a + 1] = (byte) x; 6537: a += 2; 6538: } 6539: if ((l & 0x0100) != 0) { 6540: int x = XEiJ.regRn[ 8]; 6541: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6542: MainMemory.mmrM8[a + 1] = (byte) x; 6543: a += 2; 6544: } 6545: if ((l & 0x0200) != 0) { 6546: int x = XEiJ.regRn[ 9]; 6547: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6548: MainMemory.mmrM8[a + 1] = (byte) x; 6549: a += 2; 6550: } 6551: if ((l & 0x0400) != 0) { 6552: int x = XEiJ.regRn[10]; 6553: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6554: MainMemory.mmrM8[a + 1] = (byte) x; 6555: a += 2; 6556: } 6557: if ((l & 0x0800) != 0) { 6558: int x = XEiJ.regRn[11]; 6559: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6560: MainMemory.mmrM8[a + 1] = (byte) x; 6561: a += 2; 6562: } 6563: if ((l & 0x1000) != 0) { 6564: int x = XEiJ.regRn[12]; 6565: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6566: MainMemory.mmrM8[a + 1] = (byte) x; 6567: a += 2; 6568: } 6569: if ((l & 0x2000) != 0) { 6570: int x = XEiJ.regRn[13]; 6571: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6572: MainMemory.mmrM8[a + 1] = (byte) x; 6573: a += 2; 6574: } 6575: if ((l & 0x4000) != 0) { 6576: int x = XEiJ.regRn[14]; 6577: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6578: MainMemory.mmrM8[a + 1] = (byte) x; 6579: a += 2; 6580: } 6581: if ((short) l < 0) { //(l & 0x8000) != 0 6582: int x = XEiJ.regRn[15]; 6583: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6584: MainMemory.mmrM8[a + 1] = (byte) x; 6585: a += 2; 6586: } 6587: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 6588: for (int i = 0; i <= 15; i++) { 6589: if ((l & 0x0001 << i) != 0) { 6590: int x = XEiJ.regRn[i]; 6591: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6592: MainMemory.mmrM8[a + 1] = (byte) x; 6593: a += 2; 6594: } 6595: } 6596: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 6597: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 6598: for (int i = 0; l != 0; i++, l <<= 1) { 6599: if (l < 0) { 6600: int x = XEiJ.regRn[i]; 6601: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6602: MainMemory.mmrM8[a + 1] = (byte) x; 6603: a += 2; 6604: } 6605: } 6606: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 6607: for (int i = 0; l != 0; i++, l >>>= 1) { 6608: if ((l & 1) != 0) { 6609: int x = XEiJ.regRn[i]; 6610: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6611: MainMemory.mmrM8[a + 1] = (byte) x; 6612: a += 2; 6613: } 6614: } 6615: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 6616: for (int i = 0; l != 0; ) { 6617: int k = Integer.numberOfTrailingZeros (l); 6618: int x = XEiJ.regRn[i += k]; 6619: MainMemory.mmrM8[a ] = (byte) (x >> 8); 6620: MainMemory.mmrM8[a + 1] = (byte) x; 6621: a += 2; 6622: l = l >>> k & ~1; 6623: } 6624: } 6625: a = t + (short) (a - t); 6626: } else { //メインメモリでないかページを跨ぐ可能性がある 6627: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 6628: if ((l & 0x0001) != 0) { 6629: XEiJ.busWwe (a, XEiJ.regRn[ 0]); 6630: a += 2; 6631: } 6632: if ((l & 0x0002) != 0) { 6633: XEiJ.busWwe (a, XEiJ.regRn[ 1]); 6634: a += 2; 6635: } 6636: if ((l & 0x0004) != 0) { 6637: XEiJ.busWwe (a, XEiJ.regRn[ 2]); 6638: a += 2; 6639: } 6640: if ((l & 0x0008) != 0) { 6641: XEiJ.busWwe (a, XEiJ.regRn[ 3]); 6642: a += 2; 6643: } 6644: if ((l & 0x0010) != 0) { 6645: XEiJ.busWwe (a, XEiJ.regRn[ 4]); 6646: a += 2; 6647: } 6648: if ((l & 0x0020) != 0) { 6649: XEiJ.busWwe (a, XEiJ.regRn[ 5]); 6650: a += 2; 6651: } 6652: if ((l & 0x0040) != 0) { 6653: XEiJ.busWwe (a, XEiJ.regRn[ 6]); 6654: a += 2; 6655: } 6656: if ((byte) l < 0) { //(l & 0x0080) != 0 6657: XEiJ.busWwe (a, XEiJ.regRn[ 7]); 6658: a += 2; 6659: } 6660: if ((l & 0x0100) != 0) { 6661: XEiJ.busWwe (a, XEiJ.regRn[ 8]); 6662: a += 2; 6663: } 6664: if ((l & 0x0200) != 0) { 6665: XEiJ.busWwe (a, XEiJ.regRn[ 9]); 6666: a += 2; 6667: } 6668: if ((l & 0x0400) != 0) { 6669: XEiJ.busWwe (a, XEiJ.regRn[10]); 6670: a += 2; 6671: } 6672: if ((l & 0x0800) != 0) { 6673: XEiJ.busWwe (a, XEiJ.regRn[11]); 6674: a += 2; 6675: } 6676: if ((l & 0x1000) != 0) { 6677: XEiJ.busWwe (a, XEiJ.regRn[12]); 6678: a += 2; 6679: } 6680: if ((l & 0x2000) != 0) { 6681: XEiJ.busWwe (a, XEiJ.regRn[13]); 6682: a += 2; 6683: } 6684: if ((l & 0x4000) != 0) { 6685: XEiJ.busWwe (a, XEiJ.regRn[14]); 6686: a += 2; 6687: } 6688: if ((short) l < 0) { //(l & 0x8000) != 0 6689: XEiJ.busWwe (a, XEiJ.regRn[15]); 6690: a += 2; 6691: } 6692: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 6693: for (int i = 0; i <= 15; i++) { 6694: if ((l & 0x0001 << i) != 0) { 6695: XEiJ.busWwe (a, XEiJ.regRn[i]); 6696: a += 2; 6697: } 6698: } 6699: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 6700: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 6701: for (int i = 0; l != 0; i++, l <<= 1) { 6702: if (l < 0) { 6703: XEiJ.busWwe (a, XEiJ.regRn[i]); 6704: a += 2; 6705: } 6706: } 6707: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 6708: for (int i = 0; l != 0; i++, l >>>= 1) { 6709: if ((l & 1) != 0) { 6710: XEiJ.busWwe (a, XEiJ.regRn[i]); 6711: a += 2; 6712: } 6713: } 6714: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 6715: for (int i = 0; l != 0; ) { 6716: int k = Integer.numberOfTrailingZeros (l); 6717: XEiJ.busWwe (a, XEiJ.regRn[i += k]); 6718: a += 2; 6719: l = l >>> k & ~1; 6720: } 6721: } 6722: } 6723: XEiJ.mpuCycleCount += 4 + (a - t << 1); //2バイト/個→4サイクル/個 6724: } 6725: } 6726: } //irpMovemToMemWord 6727: 6728: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6729: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 6730: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 6731: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 6732: //EXT.L Dr |-|012346|-|-UUUU|-**00|D |0100_100_011_000_rrr 6733: //MOVEM.L <list>,<ea> |-|012346|-|-----|-----| M -WXZ |0100_100_011_mmm_rrr-llllllllllllllll 6734: public static void irpMovemToMemLong () throws M68kException { 6735: int ea = XEiJ.regOC & 63; 6736: if (ea < XEiJ.EA_AR) { //EXT.L Dr 6737: XEiJ.mpuCycleCount += 4; 6738: int z; 6739: XEiJ.regRn[ea] = z = (short) XEiJ.regRn[ea]; 6740: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 6741: } else { //MOVEM.L <list>,<ea> 6742: int l = XEiJ.busRwze (XEiJ.regPC); //pcwze。レジスタリスト。ゼロ拡張 6743: XEiJ.regPC += 2; 6744: if (ea >> 3 == XEiJ.MMM_MN) { //-(Ar) 6745: //MOVEM.wl <list>,-(Ar)で<list>にArが含まれているとき、000/010は命令開始時のArを、020/030/040/060は命令開始時のAr-オペレーションサイズをメモリに書き込む 6746: //転送するレジスタが0個のときArは変化しない 6747: int arr = ea - (XEiJ.EA_MN - 8); 6748: int a = XEiJ.regRn[arr]; 6749: if ((a & 1) != 0 && l != 0) { //奇数アドレスで1ワード以上転送する 6750: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 6751: M68kException.m6eAddress = a; 6752: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 6753: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 6754: throw M68kException.m6eSignal; 6755: } 6756: int t = a; 6757: if (XEiJ.IRP_MOVEM_MAINMEMORY && //000のときMOVEMでメインメモリを特別扱いにする 6758: (DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap)[a - 4 >>> XEiJ.BUS_PAGE_BITS] == MemoryMappedDevice.MMD_MMR && //メインメモリ 6759: 4 * 16 <= (a & XEiJ.BUS_PAGE_SIZE - 1)) { //16個転送してもページを跨がない 6760: a &= XEiJ.BUS_MOTHER_MASK; 6761: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 6762: if ((l & 0x0001) != 0) { 6763: a -= 4; 6764: int x = XEiJ.regRn[15]; 6765: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6766: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6767: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6768: MainMemory.mmrM8[a + 3] = (byte) x; 6769: } 6770: if ((l & 0x0002) != 0) { 6771: a -= 4; 6772: int x = XEiJ.regRn[14]; 6773: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6774: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6775: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6776: MainMemory.mmrM8[a + 3] = (byte) x; 6777: } 6778: if ((l & 0x0004) != 0) { 6779: a -= 4; 6780: int x = XEiJ.regRn[13]; 6781: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6782: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6783: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6784: MainMemory.mmrM8[a + 3] = (byte) x; 6785: } 6786: if ((l & 0x0008) != 0) { 6787: a -= 4; 6788: int x = XEiJ.regRn[12]; 6789: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6790: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6791: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6792: MainMemory.mmrM8[a + 3] = (byte) x; 6793: } 6794: if ((l & 0x0010) != 0) { 6795: a -= 4; 6796: int x = XEiJ.regRn[11]; 6797: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6798: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6799: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6800: MainMemory.mmrM8[a + 3] = (byte) x; 6801: } 6802: if ((l & 0x0020) != 0) { 6803: a -= 4; 6804: int x = XEiJ.regRn[10]; 6805: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6806: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6807: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6808: MainMemory.mmrM8[a + 3] = (byte) x; 6809: } 6810: if ((l & 0x0040) != 0) { 6811: a -= 4; 6812: int x = XEiJ.regRn[ 9]; 6813: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6814: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6815: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6816: MainMemory.mmrM8[a + 3] = (byte) x; 6817: } 6818: if ((byte) l < 0) { //(l & 0x0080) != 0 6819: a -= 4; 6820: int x = XEiJ.regRn[ 8]; 6821: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6822: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6823: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6824: MainMemory.mmrM8[a + 3] = (byte) x; 6825: } 6826: if ((l & 0x0100) != 0) { 6827: a -= 4; 6828: int x = XEiJ.regRn[ 7]; 6829: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6830: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6831: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6832: MainMemory.mmrM8[a + 3] = (byte) x; 6833: } 6834: if ((l & 0x0200) != 0) { 6835: a -= 4; 6836: int x = XEiJ.regRn[ 6]; 6837: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6838: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6839: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6840: MainMemory.mmrM8[a + 3] = (byte) x; 6841: } 6842: if ((l & 0x0400) != 0) { 6843: a -= 4; 6844: int x = XEiJ.regRn[ 5]; 6845: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6846: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6847: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6848: MainMemory.mmrM8[a + 3] = (byte) x; 6849: } 6850: if ((l & 0x0800) != 0) { 6851: a -= 4; 6852: int x = XEiJ.regRn[ 4]; 6853: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6854: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6855: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6856: MainMemory.mmrM8[a + 3] = (byte) x; 6857: } 6858: if ((l & 0x1000) != 0) { 6859: a -= 4; 6860: int x = XEiJ.regRn[ 3]; 6861: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6862: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6863: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6864: MainMemory.mmrM8[a + 3] = (byte) x; 6865: } 6866: if ((l & 0x2000) != 0) { 6867: a -= 4; 6868: int x = XEiJ.regRn[ 2]; 6869: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6870: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6871: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6872: MainMemory.mmrM8[a + 3] = (byte) x; 6873: } 6874: if ((l & 0x4000) != 0) { 6875: a -= 4; 6876: int x = XEiJ.regRn[ 1]; 6877: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6878: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6879: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6880: MainMemory.mmrM8[a + 3] = (byte) x; 6881: } 6882: if ((short) l < 0) { //(l & 0x8000) != 0 6883: a -= 4; 6884: int x = XEiJ.regRn[ 0]; 6885: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6886: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6887: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6888: MainMemory.mmrM8[a + 3] = (byte) x; 6889: } 6890: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 6891: for (int i = 15; i >= 0; i--) { 6892: if ((l & 0x8000 >>> i) != 0) { 6893: a -= 4; 6894: int x = XEiJ.regRn[i]; 6895: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6896: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6897: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6898: MainMemory.mmrM8[a + 3] = (byte) x; 6899: } 6900: } 6901: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 6902: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 6903: for (int i = 15; l != 0; i--, l <<= 1) { 6904: if (l < 0) { 6905: a -= 4; 6906: int x = XEiJ.regRn[i]; 6907: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6908: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6909: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6910: MainMemory.mmrM8[a + 3] = (byte) x; 6911: } 6912: } 6913: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 6914: for (int i = 15; l != 0; i--, l >>>= 1) { 6915: if ((l & 1) != 0) { 6916: a -= 4; 6917: int x = XEiJ.regRn[i]; 6918: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6919: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6920: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6921: MainMemory.mmrM8[a + 3] = (byte) x; 6922: } 6923: } 6924: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 6925: for (int i = 15; l != 0; ) { 6926: int k = Integer.numberOfTrailingZeros (l); 6927: a -= 4; 6928: int x = XEiJ.regRn[i -= k]; 6929: MainMemory.mmrM8[a ] = (byte) (x >> 24); 6930: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 6931: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 6932: MainMemory.mmrM8[a + 3] = (byte) x; 6933: l = l >>> k & ~1; 6934: } 6935: } 6936: a = t - (short) (t - a); 6937: } else { //メインメモリでないかページを跨ぐ可能性がある 6938: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 6939: if ((l & 0x0001) != 0) { 6940: XEiJ.busWle (a -= 4, XEiJ.regRn[15]); 6941: } 6942: if ((l & 0x0002) != 0) { 6943: XEiJ.busWle (a -= 4, XEiJ.regRn[14]); 6944: } 6945: if ((l & 0x0004) != 0) { 6946: XEiJ.busWle (a -= 4, XEiJ.regRn[13]); 6947: } 6948: if ((l & 0x0008) != 0) { 6949: XEiJ.busWle (a -= 4, XEiJ.regRn[12]); 6950: } 6951: if ((l & 0x0010) != 0) { 6952: XEiJ.busWle (a -= 4, XEiJ.regRn[11]); 6953: } 6954: if ((l & 0x0020) != 0) { 6955: XEiJ.busWle (a -= 4, XEiJ.regRn[10]); 6956: } 6957: if ((l & 0x0040) != 0) { 6958: XEiJ.busWle (a -= 4, XEiJ.regRn[ 9]); 6959: } 6960: if ((byte) l < 0) { //(l & 0x0080) != 0 6961: XEiJ.busWle (a -= 4, XEiJ.regRn[ 8]); 6962: } 6963: if ((l & 0x0100) != 0) { 6964: XEiJ.busWle (a -= 4, XEiJ.regRn[ 7]); 6965: } 6966: if ((l & 0x0200) != 0) { 6967: XEiJ.busWle (a -= 4, XEiJ.regRn[ 6]); 6968: } 6969: if ((l & 0x0400) != 0) { 6970: XEiJ.busWle (a -= 4, XEiJ.regRn[ 5]); 6971: } 6972: if ((l & 0x0800) != 0) { 6973: XEiJ.busWle (a -= 4, XEiJ.regRn[ 4]); 6974: } 6975: if ((l & 0x1000) != 0) { 6976: XEiJ.busWle (a -= 4, XEiJ.regRn[ 3]); 6977: } 6978: if ((l & 0x2000) != 0) { 6979: XEiJ.busWle (a -= 4, XEiJ.regRn[ 2]); 6980: } 6981: if ((l & 0x4000) != 0) { 6982: XEiJ.busWle (a -= 4, XEiJ.regRn[ 1]); 6983: } 6984: if ((short) l < 0) { //(l & 0x8000) != 0 6985: XEiJ.busWle (a -= 4, XEiJ.regRn[ 0]); 6986: } 6987: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 6988: for (int i = 15; i >= 0; i--) { 6989: if ((l & 0x8000 >>> i) != 0) { 6990: XEiJ.busWle (a -= 4, XEiJ.regRn[i]); 6991: } 6992: } 6993: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 6994: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 6995: for (int i = 15; l != 0; i--, l <<= 1) { 6996: if (l < 0) { 6997: XEiJ.busWle (a -= 4, XEiJ.regRn[i]); 6998: } 6999: } 7000: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 7001: for (int i = 15; l != 0; i--, l >>>= 1) { 7002: if ((l & 1) != 0) { 7003: XEiJ.busWle (a -= 4, XEiJ.regRn[i]); 7004: } 7005: } 7006: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 7007: for (int i = 15; l != 0; ) { 7008: int k = Integer.numberOfTrailingZeros (l); 7009: XEiJ.busWle (a -= 4, XEiJ.regRn[i -= k]); 7010: l = l >>> k & ~1; 7011: } 7012: } 7013: } 7014: XEiJ.regRn[arr] = a; 7015: XEiJ.mpuCycleCount += 8 + (t - a << 1); //4バイト/個→8サイクル/個 7016: } else { //-(Ar)以外 7017: int a = efaCltLong (ea); 7018: if ((a & 1) != 0 && l != 0) { //奇数アドレスで1ワード以上転送する 7019: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 7020: M68kException.m6eAddress = a; 7021: M68kException.m6eDirection = XEiJ.MPU_WR_WRITE; 7022: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 7023: throw M68kException.m6eSignal; 7024: } 7025: int t = a; 7026: if (XEiJ.IRP_MOVEM_MAINMEMORY && //000のときMOVEMでメインメモリを特別扱いにする 7027: (DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap)[a >>> XEiJ.BUS_PAGE_BITS] == MemoryMappedDevice.MMD_MMR && //メインメモリ 7028: (a & XEiJ.BUS_PAGE_SIZE - 1) <= XEiJ.BUS_PAGE_SIZE - 4 * 16) { //16個転送してもページを跨がない 7029: a &= XEiJ.BUS_MOTHER_MASK; 7030: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 7031: if ((l & 0x0001) != 0) { 7032: int x = XEiJ.regRn[ 0]; 7033: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7034: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7035: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7036: MainMemory.mmrM8[a + 3] = (byte) x; 7037: a += 4; 7038: } 7039: if ((l & 0x0002) != 0) { 7040: int x = XEiJ.regRn[ 1]; 7041: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7042: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7043: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7044: MainMemory.mmrM8[a + 3] = (byte) x; 7045: a += 4; 7046: } 7047: if ((l & 0x0004) != 0) { 7048: int x = XEiJ.regRn[ 2]; 7049: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7050: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7051: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7052: MainMemory.mmrM8[a + 3] = (byte) x; 7053: a += 4; 7054: } 7055: if ((l & 0x0008) != 0) { 7056: int x = XEiJ.regRn[ 3]; 7057: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7058: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7059: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7060: MainMemory.mmrM8[a + 3] = (byte) x; 7061: a += 4; 7062: } 7063: if ((l & 0x0010) != 0) { 7064: int x = XEiJ.regRn[ 4]; 7065: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7066: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7067: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7068: MainMemory.mmrM8[a + 3] = (byte) x; 7069: a += 4; 7070: } 7071: if ((l & 0x0020) != 0) { 7072: int x = XEiJ.regRn[ 5]; 7073: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7074: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7075: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7076: MainMemory.mmrM8[a + 3] = (byte) x; 7077: a += 4; 7078: } 7079: if ((l & 0x0040) != 0) { 7080: int x = XEiJ.regRn[ 6]; 7081: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7082: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7083: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7084: MainMemory.mmrM8[a + 3] = (byte) x; 7085: a += 4; 7086: } 7087: if ((byte) l < 0) { //(l & 0x0080) != 0 7088: int x = XEiJ.regRn[ 7]; 7089: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7090: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7091: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7092: MainMemory.mmrM8[a + 3] = (byte) x; 7093: a += 4; 7094: } 7095: if ((l & 0x0100) != 0) { 7096: int x = XEiJ.regRn[ 8]; 7097: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7098: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7099: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7100: MainMemory.mmrM8[a + 3] = (byte) x; 7101: a += 4; 7102: } 7103: if ((l & 0x0200) != 0) { 7104: int x = XEiJ.regRn[ 9]; 7105: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7106: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7107: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7108: MainMemory.mmrM8[a + 3] = (byte) x; 7109: a += 4; 7110: } 7111: if ((l & 0x0400) != 0) { 7112: int x = XEiJ.regRn[10]; 7113: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7114: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7115: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7116: MainMemory.mmrM8[a + 3] = (byte) x; 7117: a += 4; 7118: } 7119: if ((l & 0x0800) != 0) { 7120: int x = XEiJ.regRn[11]; 7121: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7122: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7123: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7124: MainMemory.mmrM8[a + 3] = (byte) x; 7125: a += 4; 7126: } 7127: if ((l & 0x1000) != 0) { 7128: int x = XEiJ.regRn[12]; 7129: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7130: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7131: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7132: MainMemory.mmrM8[a + 3] = (byte) x; 7133: a += 4; 7134: } 7135: if ((l & 0x2000) != 0) { 7136: int x = XEiJ.regRn[13]; 7137: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7138: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7139: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7140: MainMemory.mmrM8[a + 3] = (byte) x; 7141: a += 4; 7142: } 7143: if ((l & 0x4000) != 0) { 7144: int x = XEiJ.regRn[14]; 7145: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7146: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7147: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7148: MainMemory.mmrM8[a + 3] = (byte) x; 7149: a += 4; 7150: } 7151: if ((short) l < 0) { //(l & 0x8000) != 0 7152: int x = XEiJ.regRn[15]; 7153: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7154: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7155: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7156: MainMemory.mmrM8[a + 3] = (byte) x; 7157: a += 4; 7158: } 7159: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 7160: for (int i = 0; i <= 15; i++) { 7161: if ((l & 0x0001 << i) != 0) { 7162: int x = XEiJ.regRn[i]; 7163: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7164: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7165: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7166: MainMemory.mmrM8[a + 3] = (byte) x; 7167: a += 4; 7168: } 7169: } 7170: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 7171: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 7172: for (int i = 0; l != 0; i++, l <<= 1) { 7173: if (l < 0) { 7174: int x = XEiJ.regRn[i]; 7175: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7176: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7177: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7178: MainMemory.mmrM8[a + 3] = (byte) x; 7179: a += 4; 7180: } 7181: } 7182: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 7183: for (int i = 0; l != 0; i++, l >>>= 1) { 7184: if ((l & 1) != 0) { 7185: int x = XEiJ.regRn[i]; 7186: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7187: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7188: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7189: MainMemory.mmrM8[a + 3] = (byte) x; 7190: a += 4; 7191: } 7192: } 7193: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 7194: for (int i = 0; l != 0; ) { 7195: int k = Integer.numberOfTrailingZeros (l); 7196: int x = XEiJ.regRn[i += k]; 7197: MainMemory.mmrM8[a ] = (byte) (x >> 24); 7198: MainMemory.mmrM8[a + 1] = (byte) (x >> 16); 7199: MainMemory.mmrM8[a + 2] = (byte) (x >> 8); 7200: MainMemory.mmrM8[a + 3] = (byte) x; 7201: a += 4; 7202: l = l >>> k & ~1; 7203: } 7204: } 7205: a = t + (short) (a - t); 7206: } else { //メインメモリでないかページを跨ぐ可能性がある 7207: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 7208: if ((l & 0x0001) != 0) { 7209: XEiJ.busWle (a, XEiJ.regRn[ 0]); 7210: a += 4; 7211: } 7212: if ((l & 0x0002) != 0) { 7213: XEiJ.busWle (a, XEiJ.regRn[ 1]); 7214: a += 4; 7215: } 7216: if ((l & 0x0004) != 0) { 7217: XEiJ.busWle (a, XEiJ.regRn[ 2]); 7218: a += 4; 7219: } 7220: if ((l & 0x0008) != 0) { 7221: XEiJ.busWle (a, XEiJ.regRn[ 3]); 7222: a += 4; 7223: } 7224: if ((l & 0x0010) != 0) { 7225: XEiJ.busWle (a, XEiJ.regRn[ 4]); 7226: a += 4; 7227: } 7228: if ((l & 0x0020) != 0) { 7229: XEiJ.busWle (a, XEiJ.regRn[ 5]); 7230: a += 4; 7231: } 7232: if ((l & 0x0040) != 0) { 7233: XEiJ.busWle (a, XEiJ.regRn[ 6]); 7234: a += 4; 7235: } 7236: if ((byte) l < 0) { //(l & 0x0080) != 0 7237: XEiJ.busWle (a, XEiJ.regRn[ 7]); 7238: a += 4; 7239: } 7240: if ((l & 0x0100) != 0) { 7241: XEiJ.busWle (a, XEiJ.regRn[ 8]); 7242: a += 4; 7243: } 7244: if ((l & 0x0200) != 0) { 7245: XEiJ.busWle (a, XEiJ.regRn[ 9]); 7246: a += 4; 7247: } 7248: if ((l & 0x0400) != 0) { 7249: XEiJ.busWle (a, XEiJ.regRn[10]); 7250: a += 4; 7251: } 7252: if ((l & 0x0800) != 0) { 7253: XEiJ.busWle (a, XEiJ.regRn[11]); 7254: a += 4; 7255: } 7256: if ((l & 0x1000) != 0) { 7257: XEiJ.busWle (a, XEiJ.regRn[12]); 7258: a += 4; 7259: } 7260: if ((l & 0x2000) != 0) { 7261: XEiJ.busWle (a, XEiJ.regRn[13]); 7262: a += 4; 7263: } 7264: if ((l & 0x4000) != 0) { 7265: XEiJ.busWle (a, XEiJ.regRn[14]); 7266: a += 4; 7267: } 7268: if ((short) l < 0) { //(l & 0x8000) != 0 7269: XEiJ.busWle (a, XEiJ.regRn[15]); 7270: a += 4; 7271: } 7272: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 7273: for (int i = 0; i <= 15; i++) { 7274: if ((l & 0x0001 << i) != 0) { 7275: XEiJ.busWle (a, XEiJ.regRn[i]); 7276: a += 4; 7277: } 7278: } 7279: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 7280: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 7281: for (int i = 0; l != 0; i++, l <<= 1) { 7282: if (l < 0) { 7283: XEiJ.busWle (a, XEiJ.regRn[i]); 7284: a += 4; 7285: } 7286: } 7287: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 7288: for (int i = 0; l != 0; i++, l >>>= 1) { 7289: if ((l & 1) != 0) { 7290: XEiJ.busWle (a, XEiJ.regRn[i]); 7291: a += 4; 7292: } 7293: } 7294: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 7295: for (int i = 0; l != 0; ) { 7296: int k = Integer.numberOfTrailingZeros (l); 7297: XEiJ.busWle (a, XEiJ.regRn[i += k]); 7298: a += 4; 7299: l = l >>> k & ~1; 7300: } 7301: } 7302: } 7303: XEiJ.mpuCycleCount += 0 + (a - t << 1); //4バイト/個→8サイクル/個 7304: } 7305: } 7306: } //irpMovemToMemLong 7307: 7308: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7309: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7310: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7311: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7312: //TST.B <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_000_mmm_rrr 7313: public static void irpTstByte () throws M68kException { 7314: XEiJ.mpuCycleCount += 4; 7315: int ea = XEiJ.regOC & 63; 7316: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & (ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaMltByte (ea)))]; //ccr_tst_byte。アドレッシングモードに注意 7317: } //irpTstByte 7318: 7319: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7320: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7321: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7322: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7323: //TST.W <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_001_mmm_rrr 7324: public static void irpTstWord () throws M68kException { 7325: XEiJ.mpuCycleCount += 4; 7326: int ea = XEiJ.regOC & 63; 7327: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRws (efaMltWord (ea)); //アドレッシングモードに注意 7328: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 7329: } //irpTstWord 7330: 7331: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7332: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7333: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7334: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7335: //TST.L <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_010_mmm_rrr 7336: public static void irpTstLong () throws M68kException { 7337: XEiJ.mpuCycleCount += 4; 7338: int ea = XEiJ.regOC & 63; 7339: int z = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRls (efaMltLong (ea)); //アドレッシングモードに注意 7340: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 7341: } //irpTstLong 7342: 7343: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7344: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7345: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7346: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7347: //TAS.B <ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |0100_101_011_mmm_rrr 7348: //ILLEGAL |-|012346|-|-----|-----| |0100_101_011_111_100 7349: public static void irpTas () throws M68kException { 7350: int ea = XEiJ.regOC & 63; 7351: int z; 7352: if (ea < XEiJ.EA_AR) { //TAS.B Dr 7353: XEiJ.mpuCycleCount += 4; 7354: XEiJ.regRn[ea] = 0x80 | (z = XEiJ.regRn[ea]); 7355: } else if (ea == XEiJ.EA_IM) { //ILLEGAL 7356: XEiJ.mpuCycleCount += 34; 7357: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 7358: throw M68kException.m6eSignal; 7359: } else { //TAS.B <mem> 7360: XEiJ.mpuCycleCount += 10; 7361: int a = efaMltByte (ea); 7362: XEiJ.busWb (a, 0x80 | (z = XEiJ.busRbs (a))); 7363: } 7364: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 7365: } //irpTas 7366: 7367: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7368: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7369: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7370: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7371: //SATS.L Dr |-|------|-|-UUUU|-**00|D |0100_110_010_000_rrr (ISA_B) 7372: //MOVEM.W <ea>,<list> |-|012346|-|-----|-----| M+ WXZP |0100_110_010_mmm_rrr-llllllllllllllll 7373: // 7374: //SATS.L Dr 7375: // VがセットされていたらDrを符号が逆で絶対値が最大の値にする(直前のDrに対する演算を飽和演算にする) 7376: public static void irpMovemToRegWord () throws M68kException { 7377: int ea = XEiJ.regOC & 63; 7378: if (ea < XEiJ.EA_AR) { //SATS.L Dr 7379: XEiJ.mpuCycleCount += 4; 7380: int z = XEiJ.regRn[ea]; 7381: if (XEiJ.TEST_BIT_1_SHIFT ? XEiJ.regCCR << 31 - 1 < 0 : (XEiJ.regCCR & XEiJ.REG_CCR_V) != 0) { //Vがセットされているとき 7382: XEiJ.regRn[ea] = z = z >> 31 ^ 0x80000000; //符号が逆で絶対値が最大の値にする 7383: } 7384: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 7385: } else { //MOVEM.W <ea>,<list> 7386: int l = XEiJ.busRwze (XEiJ.regPC); //pcwze。レジスタリスト。ゼロ拡張 7387: XEiJ.regPC += 2; 7388: int arr, a; 7389: if (ea >> 3 == XEiJ.MMM_MP) { //(Ar)+ 7390: XEiJ.mpuCycleCount += 12; 7391: arr = ea - (XEiJ.EA_MP - 8); 7392: a = XEiJ.regRn[arr]; 7393: } else { //(Ar)+以外 7394: XEiJ.mpuCycleCount += 8; 7395: arr = 16; 7396: a = efaCntWord (ea); 7397: } 7398: if ((a & 1) != 0 && l != 0) { //奇数アドレスで1ワード以上転送する 7399: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 7400: M68kException.m6eAddress = a; 7401: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 7402: M68kException.m6eSize = XEiJ.MPU_SS_WORD; 7403: throw M68kException.m6eSignal; 7404: } 7405: int t = a; 7406: if (XEiJ.IRP_MOVEM_MAINMEMORY && //000のときMOVEMでメインメモリを特別扱いにする 7407: (DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap)[a >>> XEiJ.BUS_PAGE_BITS] == MemoryMappedDevice.MMD_MMR && //メインメモリ 7408: (a & XEiJ.BUS_PAGE_SIZE - 1) <= XEiJ.BUS_PAGE_SIZE - 2 * 16) { //16個転送してもページを跨がない 7409: a &= XEiJ.BUS_MOTHER_MASK; 7410: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 7411: if ((l & 0x0001) != 0) { 7412: XEiJ.regRn[ 0] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7413: a += 2; 7414: } 7415: if ((l & 0x0002) != 0) { 7416: XEiJ.regRn[ 1] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7417: a += 2; 7418: } 7419: if ((l & 0x0004) != 0) { 7420: XEiJ.regRn[ 2] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7421: a += 2; 7422: } 7423: if ((l & 0x0008) != 0) { 7424: XEiJ.regRn[ 3] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7425: a += 2; 7426: } 7427: if ((l & 0x0010) != 0) { 7428: XEiJ.regRn[ 4] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7429: a += 2; 7430: } 7431: if ((l & 0x0020) != 0) { 7432: XEiJ.regRn[ 5] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7433: a += 2; 7434: } 7435: if ((l & 0x0040) != 0) { 7436: XEiJ.regRn[ 6] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7437: a += 2; 7438: } 7439: if ((byte) l < 0) { //(l & 0x0080) != 0 7440: XEiJ.regRn[ 7] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //データレジスタも符号拡張して32bit全部書き換える 7441: a += 2; 7442: } 7443: if ((l & 0x0100) != 0) { 7444: XEiJ.regRn[ 8] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7445: a += 2; 7446: } 7447: if ((l & 0x0200) != 0) { 7448: XEiJ.regRn[ 9] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7449: a += 2; 7450: } 7451: if ((l & 0x0400) != 0) { 7452: XEiJ.regRn[10] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7453: a += 2; 7454: } 7455: if ((l & 0x0800) != 0) { 7456: XEiJ.regRn[11] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7457: a += 2; 7458: } 7459: if ((l & 0x1000) != 0) { 7460: XEiJ.regRn[12] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7461: a += 2; 7462: } 7463: if ((l & 0x2000) != 0) { 7464: XEiJ.regRn[13] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7465: a += 2; 7466: } 7467: if ((l & 0x4000) != 0) { 7468: XEiJ.regRn[14] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7469: a += 2; 7470: } 7471: if ((short) l < 0) { //(l & 0x8000) != 0 7472: XEiJ.regRn[15] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //符号拡張して32bit全部書き換える 7473: a += 2; 7474: } 7475: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 7476: for (int i = 0; i <= 15; i++) { 7477: if ((l & 0x0001 << i) != 0) { 7478: XEiJ.regRn[i] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //(データレジスタも)符号拡張して32bit全部書き換える 7479: a += 2; 7480: } 7481: } 7482: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 7483: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 7484: for (int i = 0; l != 0; i++, l <<= 1) { 7485: if (l < 0) { 7486: XEiJ.regRn[i] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //(データレジスタも)符号拡張して32bit全部書き換える 7487: a += 2; 7488: } 7489: } 7490: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 7491: for (int i = 0; l != 0; i++, l >>>= 1) { 7492: if ((l & 1) != 0) { 7493: XEiJ.regRn[i] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //(データレジスタも)符号拡張して32bit全部書き換える 7494: a += 2; 7495: } 7496: } 7497: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 7498: for (int i = 0; l != 0; ) { 7499: int k = Integer.numberOfTrailingZeros (l); 7500: XEiJ.regRn[i += k] = MainMemory.mmrM8[a] << 8 | MainMemory.mmrM8[a + 1] & 255; //(データレジスタも)符号拡張して32bit全部書き換える 7501: a += 2; 7502: l = l >>> k & ~1; 7503: } 7504: } 7505: a = t + (short) (a - t); 7506: } else { //メインメモリでないかページを跨ぐ可能性がある 7507: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 7508: if ((l & 0x0001) != 0) { 7509: XEiJ.regRn[ 0] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7510: a += 2; 7511: } 7512: if ((l & 0x0002) != 0) { 7513: XEiJ.regRn[ 1] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7514: a += 2; 7515: } 7516: if ((l & 0x0004) != 0) { 7517: XEiJ.regRn[ 2] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7518: a += 2; 7519: } 7520: if ((l & 0x0008) != 0) { 7521: XEiJ.regRn[ 3] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7522: a += 2; 7523: } 7524: if ((l & 0x0010) != 0) { 7525: XEiJ.regRn[ 4] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7526: a += 2; 7527: } 7528: if ((l & 0x0020) != 0) { 7529: XEiJ.regRn[ 5] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7530: a += 2; 7531: } 7532: if ((l & 0x0040) != 0) { 7533: XEiJ.regRn[ 6] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7534: a += 2; 7535: } 7536: if ((byte) l < 0) { //(l & 0x0080) != 0 7537: XEiJ.regRn[ 7] = XEiJ.busRwse (a); //データレジスタも符号拡張して32bit全部書き換える 7538: a += 2; 7539: } 7540: if ((l & 0x0100) != 0) { 7541: XEiJ.regRn[ 8] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7542: a += 2; 7543: } 7544: if ((l & 0x0200) != 0) { 7545: XEiJ.regRn[ 9] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7546: a += 2; 7547: } 7548: if ((l & 0x0400) != 0) { 7549: XEiJ.regRn[10] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7550: a += 2; 7551: } 7552: if ((l & 0x0800) != 0) { 7553: XEiJ.regRn[11] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7554: a += 2; 7555: } 7556: if ((l & 0x1000) != 0) { 7557: XEiJ.regRn[12] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7558: a += 2; 7559: } 7560: if ((l & 0x2000) != 0) { 7561: XEiJ.regRn[13] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7562: a += 2; 7563: } 7564: if ((l & 0x4000) != 0) { 7565: XEiJ.regRn[14] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7566: a += 2; 7567: } 7568: if ((short) l < 0) { //(l & 0x8000) != 0 7569: XEiJ.regRn[15] = XEiJ.busRwse (a); //符号拡張して32bit全部書き換える 7570: a += 2; 7571: } 7572: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 7573: for (int i = 0; i <= 15; i++) { 7574: if ((l & 0x0001 << i) != 0) { 7575: XEiJ.regRn[i] = XEiJ.busRwse (a); //(データレジスタも)符号拡張して32bit全部書き換える 7576: a += 2; 7577: } 7578: } 7579: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 7580: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 7581: for (int i = 0; l != 0; i++, l <<= 1) { 7582: if (l < 0) { 7583: XEiJ.regRn[i] = XEiJ.busRwse (a); //(データレジスタも)符号拡張して32bit全部書き換える 7584: a += 2; 7585: } 7586: } 7587: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 7588: for (int i = 0; l != 0; i++, l >>>= 1) { 7589: if ((l & 1) != 0) { 7590: XEiJ.regRn[i] = XEiJ.busRwse (a); //(データレジスタも)符号拡張して32bit全部書き換える 7591: a += 2; 7592: } 7593: } 7594: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 7595: for (int i = 0; l != 0; ) { 7596: int k = Integer.numberOfTrailingZeros (l); 7597: XEiJ.regRn[i += k] = XEiJ.busRwse (a); //(データレジスタも)符号拡張して32bit全部書き換える 7598: a += 2; 7599: l = l >>> k & ~1; 7600: } 7601: } 7602: } 7603: if (XEiJ.MPU_OMIT_EXTRA_READ) { 7604: //! 軽量化。MC68000のMOVEM.W <ea>,<list>は1ワード余分にリードするが省略する 7605: // MC68000のMOVEM.W <ea>,<list>は1ワード余分にリードするため転送する領域の直後にアクセスできない領域があるとバスエラーが発生する 7606: // RAMDISK.SYSを高速化しようとしてデータ転送ルーチンの転送命令をすべてMOVEMに変更してしまうと、 7607: // 12MBフル実装でないX68000の実機で最後のセクタをアクセスしたときだけバスエラーが出て動かなくなるのはこれが原因 7608: } else { 7609: XEiJ.busRws (a); 7610: } 7611: //MOVEM.W (Ar)+,<list>で<list>にArが含まれているとき、メモリから読み出したデータを捨ててArをインクリメントする 7612: XEiJ.regRn[arr] = a; 7613: XEiJ.mpuCycleCount += a - t << 1; //2バイト/個→4サイクル/個 7614: } 7615: } //irpMovemToRegWord 7616: 7617: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7618: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7619: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7620: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7621: //MOVEM.L <ea>,<list> |-|012346|-|-----|-----| M+ WXZP |0100_110_011_mmm_rrr-llllllllllllllll 7622: public static void irpMovemToRegLong () throws M68kException { 7623: int ea = XEiJ.regOC & 63; 7624: { 7625: int l = XEiJ.busRwze (XEiJ.regPC); //pcwze。レジスタリスト。ゼロ拡張 7626: XEiJ.regPC += 2; 7627: int arr, a; 7628: if (ea >> 3 == XEiJ.MMM_MP) { //(Ar)+ 7629: XEiJ.mpuCycleCount += 8; 7630: arr = ea - (XEiJ.EA_MP - 8); 7631: a = XEiJ.regRn[arr]; 7632: } else { //(Ar)+以外 7633: XEiJ.mpuCycleCount += 4; 7634: arr = 16; 7635: a = efaCntLong (ea); 7636: } 7637: if ((a & 1) != 0 && l != 0) { //奇数アドレスで1ワード以上転送する 7638: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 7639: M68kException.m6eAddress = a; 7640: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 7641: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 7642: throw M68kException.m6eSignal; 7643: } 7644: int t = a; 7645: if (XEiJ.IRP_MOVEM_MAINMEMORY && //000のときMOVEMでメインメモリを特別扱いにする 7646: (DataBreakPoint.DBP_ON ? DataBreakPoint.dbpSuperMap : XEiJ.busSuperMap)[a >>> XEiJ.BUS_PAGE_BITS] == MemoryMappedDevice.MMD_MMR && //メインメモリ 7647: (a & XEiJ.BUS_PAGE_SIZE - 1) <= XEiJ.BUS_PAGE_SIZE - 4 * 16) { //16個転送してもページを跨がない 7648: a &= XEiJ.BUS_MOTHER_MASK; 7649: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 7650: if ((l & 0x0001) != 0) { 7651: XEiJ.regRn[ 0] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7652: a += 4; 7653: } 7654: if ((l & 0x0002) != 0) { 7655: XEiJ.regRn[ 1] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7656: a += 4; 7657: } 7658: if ((l & 0x0004) != 0) { 7659: XEiJ.regRn[ 2] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7660: a += 4; 7661: } 7662: if ((l & 0x0008) != 0) { 7663: XEiJ.regRn[ 3] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7664: a += 4; 7665: } 7666: if ((l & 0x0010) != 0) { 7667: XEiJ.regRn[ 4] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7668: a += 4; 7669: } 7670: if ((l & 0x0020) != 0) { 7671: XEiJ.regRn[ 5] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7672: a += 4; 7673: } 7674: if ((l & 0x0040) != 0) { 7675: XEiJ.regRn[ 6] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7676: a += 4; 7677: } 7678: if ((byte) l < 0) { //(l & 0x0080) != 0 7679: XEiJ.regRn[ 7] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7680: a += 4; 7681: } 7682: if ((l & 0x0100) != 0) { 7683: XEiJ.regRn[ 8] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7684: a += 4; 7685: } 7686: if ((l & 0x0200) != 0) { 7687: XEiJ.regRn[ 9] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7688: a += 4; 7689: } 7690: if ((l & 0x0400) != 0) { 7691: XEiJ.regRn[10] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7692: a += 4; 7693: } 7694: if ((l & 0x0800) != 0) { 7695: XEiJ.regRn[11] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7696: a += 4; 7697: } 7698: if ((l & 0x1000) != 0) { 7699: XEiJ.regRn[12] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7700: a += 4; 7701: } 7702: if ((l & 0x2000) != 0) { 7703: XEiJ.regRn[13] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7704: a += 4; 7705: } 7706: if ((l & 0x4000) != 0) { 7707: XEiJ.regRn[14] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7708: a += 4; 7709: } 7710: if ((short) l < 0) { //(l & 0x8000) != 0 7711: XEiJ.regRn[15] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7712: a += 4; 7713: } 7714: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 7715: for (int i = 0; i <= 15; i++) { 7716: if ((l & 0x0001 << i) != 0) { 7717: XEiJ.regRn[i] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7718: a += 4; 7719: } 7720: } 7721: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 7722: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 7723: for (int i = 0; l != 0; i++, l <<= 1) { 7724: if (l < 0) { 7725: XEiJ.regRn[i] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7726: a += 4; 7727: } 7728: } 7729: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 7730: for (int i = 0; l != 0; i++, l >>>= 1) { 7731: if ((l & 1) != 0) { 7732: XEiJ.regRn[i] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7733: a += 4; 7734: } 7735: } 7736: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 7737: for (int i = 0; l != 0; ) { 7738: int k = Integer.numberOfTrailingZeros (l); 7739: XEiJ.regRn[i += k] = MainMemory.mmrM8[a] << 24 | (MainMemory.mmrM8[a + 1] & 255) << 16 | (char) (MainMemory.mmrM8[a + 2] << 8 | MainMemory.mmrM8[a + 3] & 255); 7740: a += 4; 7741: l = l >>> k & ~1; 7742: } 7743: } 7744: a = t + (short) (a - t); 7745: } else { //メインメモリでないかページを跨ぐ可能性がある 7746: if (XEiJ.IRP_MOVEM_EXPAND) { //16回展開する 7747: if ((l & 0x0001) != 0) { 7748: XEiJ.regRn[ 0] = XEiJ.busRlse (a); 7749: a += 4; 7750: } 7751: if ((l & 0x0002) != 0) { 7752: XEiJ.regRn[ 1] = XEiJ.busRlse (a); 7753: a += 4; 7754: } 7755: if ((l & 0x0004) != 0) { 7756: XEiJ.regRn[ 2] = XEiJ.busRlse (a); 7757: a += 4; 7758: } 7759: if ((l & 0x0008) != 0) { 7760: XEiJ.regRn[ 3] = XEiJ.busRlse (a); 7761: a += 4; 7762: } 7763: if ((l & 0x0010) != 0) { 7764: XEiJ.regRn[ 4] = XEiJ.busRlse (a); 7765: a += 4; 7766: } 7767: if ((l & 0x0020) != 0) { 7768: XEiJ.regRn[ 5] = XEiJ.busRlse (a); 7769: a += 4; 7770: } 7771: if ((l & 0x0040) != 0) { 7772: XEiJ.regRn[ 6] = XEiJ.busRlse (a); 7773: a += 4; 7774: } 7775: if ((byte) l < 0) { //(l & 0x0080) != 0 7776: XEiJ.regRn[ 7] = XEiJ.busRlse (a); 7777: a += 4; 7778: } 7779: if ((l & 0x0100) != 0) { 7780: XEiJ.regRn[ 8] = XEiJ.busRlse (a); 7781: a += 4; 7782: } 7783: if ((l & 0x0200) != 0) { 7784: XEiJ.regRn[ 9] = XEiJ.busRlse (a); 7785: a += 4; 7786: } 7787: if ((l & 0x0400) != 0) { 7788: XEiJ.regRn[10] = XEiJ.busRlse (a); 7789: a += 4; 7790: } 7791: if ((l & 0x0800) != 0) { 7792: XEiJ.regRn[11] = XEiJ.busRlse (a); 7793: a += 4; 7794: } 7795: if ((l & 0x1000) != 0) { 7796: XEiJ.regRn[12] = XEiJ.busRlse (a); 7797: a += 4; 7798: } 7799: if ((l & 0x2000) != 0) { 7800: XEiJ.regRn[13] = XEiJ.busRlse (a); 7801: a += 4; 7802: } 7803: if ((l & 0x4000) != 0) { 7804: XEiJ.regRn[14] = XEiJ.busRlse (a); 7805: a += 4; 7806: } 7807: if ((short) l < 0) { //(l & 0x8000) != 0 7808: XEiJ.regRn[15] = XEiJ.busRlse (a); 7809: a += 4; 7810: } 7811: } else if (XEiJ.IRP_MOVEM_LOOP) { //16回ループする。コンパイラが展開する 7812: for (int i = 0; i <= 15; i++) { 7813: if ((l & 0x0001 << i) != 0) { 7814: XEiJ.regRn[i] = XEiJ.busRlse (a); 7815: a += 4; 7816: } 7817: } 7818: } else if (XEiJ.IRP_MOVEM_SHIFT_LEFT) { //0になるまで左にシフトする 7819: l = XEiJ.MPU_BITREV_TABLE_0[l & 2047] | XEiJ.MPU_BITREV_TABLE_1[l << 10 >>> 21]; //Integer.reverse(l) 7820: for (int i = 0; l != 0; i++, l <<= 1) { 7821: if (l < 0) { 7822: XEiJ.regRn[i] = XEiJ.busRlse (a); 7823: a += 4; 7824: } 7825: } 7826: } else if (XEiJ.IRP_MOVEM_SHIFT_RIGHT) { //0になるまで右にシフトする 7827: for (int i = 0; l != 0; i++, l >>>= 1) { 7828: if ((l & 1) != 0) { 7829: XEiJ.regRn[i] = XEiJ.busRlse (a); 7830: a += 4; 7831: } 7832: } 7833: } else if (XEiJ.IRP_MOVEM_ZEROS) { //Integer.numberOfTrailingZerosを使う 7834: for (int i = 0; l != 0; ) { 7835: int k = Integer.numberOfTrailingZeros (l); 7836: XEiJ.regRn[i += k] = XEiJ.busRlse (a); 7837: a += 4; 7838: l = l >>> k & ~1; 7839: } 7840: } 7841: } 7842: if (XEiJ.MPU_OMIT_EXTRA_READ) { 7843: //! 軽量化。MC68000のMOVEM.L <ea>,<list>は1ワード余分にリードするが省略する 7844: // MC68000のMOVEM.L <ea>,<list>は1ワード余分にリードするため転送する領域の直後にアクセスできない領域があるとバスエラーが発生する 7845: // RAMDISK.SYSを高速化しようとしてデータ転送ルーチンの転送命令をすべてMOVEMに変更してしまうと、 7846: // 12MBフル実装でないX68000の実機で最後のセクタをアクセスしたときだけバスエラーが出て動かなくなるのはこれが原因 7847: } else { 7848: XEiJ.busRws (a); 7849: } 7850: //MOVEM.L (Ar)+,<list>で<list>にArが含まれているとき、メモリから読み出したデータを捨ててArをインクリメントする 7851: XEiJ.regRn[arr] = a; //XEiJ.regRn[arr]は破壊されているのでXEiJ.regRn[arr]+=a-=tは不可 7852: XEiJ.mpuCycleCount += a - t << 1; //4バイト/個→8サイクル/個 7853: } 7854: } //irpMovemToRegLong 7855: 7856: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7857: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7858: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7859: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7860: //TRAP #<vector> |-|012346|-|-----|-----| |0100_111_001_00v_vvv 7861: public static void irpTrap () throws M68kException { 7862: XEiJ.mpuCycleCount += 34; 7863: if (XEiJ.MPU_INLINE_EXCEPTION) { 7864: int save_sr = XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR; 7865: int sp = XEiJ.regRn[15]; 7866: XEiJ.regSRT1 = XEiJ.mpuTraceFlag = 0; //srのTビットを消す 7867: if (XEiJ.regSRS == 0) { //ユーザモードのとき 7868: XEiJ.regSRS = XEiJ.REG_SR_S; //スーパーバイザモードへ移行する 7869: XEiJ.mpuUSP = sp; //USPを保存 7870: sp = XEiJ.mpuISP; //SSPを復元 7871: if (DataBreakPoint.DBP_ON) { 7872: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpSuperMap; //スーパーバイザメモリマップに切り替える 7873: } else { 7874: XEiJ.busMemoryMap = XEiJ.busSuperMap; //スーパーバイザメモリマップに切り替える 7875: } 7876: if (InstructionBreakPoint.IBP_ON) { 7877: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1SuperMap; 7878: } 7879: } 7880: int vectorOffset = XEiJ.regOC - (0x4e40 - M68kException.M6E_TRAP_0_INSTRUCTION_VECTOR) << 2; //vector offset 7881: XEiJ.regRn[15] = sp -= 8; //short format 7882: XEiJ.busWw (sp + 6, 0x0000 | vectorOffset); //format and vector offset 7883: XEiJ.busWl (sp + 2, XEiJ.regPC); //program counter 7884: XEiJ.busWw (sp, save_sr); //status register 7885: irpSetPC (XEiJ.busRlsf (XEiJ.mpuVBR + vectorOffset)); //例外ベクタを取り出してジャンプする 7886: } else { 7887: irpException (XEiJ.regOC - (0x4e40 - M68kException.M6E_TRAP_0_INSTRUCTION_VECTOR), XEiJ.regPC, XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR); //pcは次の命令 7888: } 7889: } //irpTrap 7890: public static void irpTrap15 () throws M68kException { 7891: if ((XEiJ.regRn[0] & 255) == 0x8e) { //IOCS _BOOTINF 7892: MainMemory.mmrCheckHuman (); 7893: } 7894: XEiJ.mpuCycleCount += 34; 7895: if (XEiJ.MPU_INLINE_EXCEPTION) { 7896: int save_sr = XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR; 7897: int sp = XEiJ.regRn[15]; 7898: XEiJ.regSRT1 = XEiJ.mpuTraceFlag = 0; //srのTビットを消す 7899: if (XEiJ.regSRS == 0) { //ユーザモードのとき 7900: XEiJ.regSRS = XEiJ.REG_SR_S; //スーパーバイザモードへ移行する 7901: XEiJ.mpuUSP = sp; //USPを保存 7902: sp = XEiJ.mpuISP; //SSPを復元 7903: if (DataBreakPoint.DBP_ON) { 7904: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpSuperMap; //スーパーバイザメモリマップに切り替える 7905: } else { 7906: XEiJ.busMemoryMap = XEiJ.busSuperMap; //スーパーバイザメモリマップに切り替える 7907: } 7908: if (InstructionBreakPoint.IBP_ON) { 7909: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1SuperMap; 7910: } 7911: } 7912: int vectorOffset = M68kException.M6E_TRAP_15_INSTRUCTION_VECTOR << 2; //vector offset 7913: XEiJ.regRn[15] = sp -= 8; //short format 7914: XEiJ.busWw (sp + 6, 0x0000 | vectorOffset); //format and vector offset 7915: XEiJ.busWl (sp + 2, XEiJ.regPC); //program counter 7916: XEiJ.busWw (sp, save_sr); //status register 7917: irpSetPC (XEiJ.busRlsf (XEiJ.mpuVBR + vectorOffset)); //例外ベクタを取り出してジャンプする 7918: } else { 7919: irpException (M68kException.M6E_TRAP_15_INSTRUCTION_VECTOR, XEiJ.regPC, XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR); //pcは次の命令 7920: } 7921: } //irpTrap15 7922: 7923: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7924: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7925: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7926: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7927: //LINK.W Ar,#<data> |-|012346|-|-----|-----| |0100_111_001_010_rrr-{data} 7928: // 7929: //LINK.W Ar,#<data> 7930: // PEA.L (Ar);MOVEA.L A7,Ar;ADDA.W #<data>,A7と同じ 7931: // LINK.W A7,#<data>はA7をデクリメントする前の値がプッシュされ、A7に#<data>が加算される 7932: public static void irpLinkWord () throws M68kException { 7933: XEiJ.mpuCycleCount += 16; 7934: int arr = XEiJ.regOC - (0b0100_111_001_010_000 - 8); 7935: //評価順序に注意 7936: // wl(r[15]-=4,r[8+rrr])は不可 7937: int sp = XEiJ.regRn[15] - 4; 7938: XEiJ.busWl (sp, XEiJ.regRn[arr]); //pushl 7939: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 7940: XEiJ.regRn[15] = (XEiJ.regRn[arr] = sp) + XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 7941: } else { 7942: int t = XEiJ.regPC; 7943: XEiJ.regPC = t + 2; 7944: XEiJ.regRn[15] = (XEiJ.regRn[arr] = sp) + XEiJ.busRwse (t); //pcws 7945: } 7946: } //irpLinkWord 7947: 7948: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7949: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7950: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7951: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7952: //UNLK Ar |-|012346|-|-----|-----| |0100_111_001_011_rrr 7953: // 7954: //UNLK Ar 7955: // MOVEA.L Ar,A7;MOVEA.L (A7)+,Arと同じ 7956: // UNLK A7はMOVEA.L A7,A7;MOVEA.L (A7)+,A7すなわちMOVEA.L (A7),A7と同じ 7957: // ソースオペランドのポストインクリメントはデスティネーションオペランドが評価される前に完了しているとみなされる 7958: // 例えばMOVE.L (A0)+,(A0)+はMOVE.L (A0),(4,A0);ADDQ.L #8,A0と同じ 7959: // MOVEA.L (A0)+,A0はポストインクリメントされたA0が(A0)から読み出された値で上書きされるのでMOVEA.L (A0),A0と同じ 7960: // M68000PRMにUNLK Anの動作はAn→SP;(SP)→An;SP+4→SPだと書かれているがこれはn=7の場合に当てはまらない 7961: // 余談だが68040の初期のマスクセットはUNLK A7を実行すると固まるらしい 7962: public static void irpUnlk () throws M68kException { 7963: XEiJ.mpuCycleCount += 12; 7964: int arr = XEiJ.regOC - (0b0100_111_001_011_000 - 8); 7965: //評価順序に注意 7966: int sp = XEiJ.regRn[arr]; 7967: XEiJ.regRn[15] = sp + 4; 7968: XEiJ.regRn[arr] = XEiJ.busRls (sp); //popls 7969: } //irpUnlk 7970: 7971: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7972: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7973: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7974: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7975: //MOVE.L Ar,USP |-|012346|P|-----|-----| |0100_111_001_100_rrr 7976: public static void irpMoveToUsp () throws M68kException { 7977: if (XEiJ.regSRS == 0) { //ユーザモードのとき 7978: XEiJ.mpuCycleCount += 34; 7979: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 7980: throw M68kException.m6eSignal; 7981: } 7982: //以下はスーパーバイザモード 7983: XEiJ.mpuCycleCount += 4; 7984: XEiJ.mpuUSP = XEiJ.regRn[XEiJ.regOC - (0b0100_111_001_100_000 - 8)]; 7985: } //irpMoveToUsp 7986: 7987: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7988: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 7989: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 7990: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 7991: //MOVE.L USP,Ar |-|012346|P|-----|-----| |0100_111_001_101_rrr 7992: public static void irpMoveFromUsp () throws M68kException { 7993: if (XEiJ.regSRS == 0) { //ユーザモードのとき 7994: XEiJ.mpuCycleCount += 34; 7995: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 7996: throw M68kException.m6eSignal; 7997: } 7998: //以下はスーパーバイザモード 7999: XEiJ.mpuCycleCount += 4; 8000: XEiJ.regRn[XEiJ.regOC - (0b0100_111_001_101_000 - 8)] = XEiJ.mpuUSP; 8001: } //irpMoveFromUsp 8002: 8003: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8004: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8005: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8006: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8007: //RESET |-|012346|P|-----|-----| |0100_111_001_110_000 8008: public static void irpReset () throws M68kException { 8009: if (XEiJ.regSRS == 0) { //ユーザモードのとき 8010: XEiJ.mpuCycleCount += 34; 8011: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 8012: throw M68kException.m6eSignal; 8013: } 8014: //以下はスーパーバイザモード 8015: XEiJ.mpuCycleCount += 132; 8016: XEiJ.irpReset (); 8017: } //irpReset 8018: 8019: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8020: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8021: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8022: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8023: //NOP |-|012346|-|-----|-----| |0100_111_001_110_001 8024: public static void irpNop () throws M68kException { 8025: XEiJ.mpuCycleCount += 4; 8026: //何もしない 8027: } //irpNop 8028: 8029: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8030: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8031: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8032: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8033: //STOP #<data> |-|012346|P|UUUUU|*****| |0100_111_001_110_010-{data} 8034: // 8035: //STOP #<data> 8036: // 1. #<data>をsrに設定する 8037: // 2. pcを進める 8038: // 3. 以下のいずれかの条件が成立するまで停止する 8039: // 3a. トレース 8040: // 3b. マスクされているレベルよりも高い割り込み要求 8041: // 3c. リセット 8042: // コアと一緒にデバイスを止めるわけにいかないので、ここでは条件が成立するまで同じ命令を繰り返すループ命令として実装する 8043: public static void irpStop () throws M68kException { 8044: if (XEiJ.regSRS == 0) { //ユーザモードのとき 8045: XEiJ.mpuCycleCount += 34; 8046: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 8047: throw M68kException.m6eSignal; 8048: } 8049: //以下はスーパーバイザモード 8050: XEiJ.mpuCycleCount += 4; 8051: irpSetSR (XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。特権違反チェックが先 8052: if (XEiJ.mpuTraceFlag == 0) { //トレースまたはマスクされているレベルよりも高い割り込み要求がない 8053: XEiJ.regPC = XEiJ.regPC0; //ループ 8054: //任意の負荷率を100%に設定しているときSTOP命令が軽すぎると動作周波数が大きくなりすぎて割り込みがかかったとき次に進めなくなる 8055: //負荷率の計算にSTOP命令で止まっていた時間を含めないことにする 8056: XEiJ.mpuClockTime += XEiJ.TMR_FREQ * 4 / 1000000; //4μs。10MHzのとき40clk 8057: XEiJ.mpuLastNano += 4000L; 8058: } 8059: } //irpStop 8060: 8061: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8062: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8063: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8064: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8065: //RTE |-|012346|P|UUUUU|*****| |0100_111_001_110_011 8066: public static void irpRte () throws M68kException { 8067: if (XEiJ.regSRS == 0) { //ユーザモードのとき 8068: XEiJ.mpuCycleCount += 34; 8069: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 8070: throw M68kException.m6eSignal; 8071: } 8072: //以下はスーパーバイザモード 8073: XEiJ.mpuCycleCount += 20; 8074: int sp = XEiJ.regRn[15]; 8075: int format = XEiJ.busRws (sp + 6) >>> 12; 8076: int frameSize; 8077: if (format == 0x0) { //010,020,030,040,060 8078: frameSize = 8; 8079: } else if (format == 0x8) { //010 8080: frameSize = 58; 8081: } else { 8082: M68kException.m6eNumber = M68kException.M6E_FORMAT_ERROR; 8083: throw M68kException.m6eSignal; 8084: } 8085: XEiJ.regRn[15] = sp + frameSize; 8086: int newSR = XEiJ.busRwz (sp); //popwz。ここでバスエラーが生じる可能性がある 8087: int newPC = XEiJ.busRls (sp + 2); //popls 8088: //irpSetSRでモードが切り替わる場合があるのでその前にr[15]を更新しておくこと 8089: irpSetSR (newSR); //ここでユーザモードに戻る場合がある。特権違反チェックが先 8090: irpSetPC (newPC); //分岐ログが新しいsrを使う。順序に注意 8091: } //irpRte 8092: 8093: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8094: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8095: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8096: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8097: //RTD #<data> |-|-12346|-|-----|-----| |0100_111_001_110_100-{data} 8098: public static void irpRtd () throws M68kException { 8099: XEiJ.mpuCycleCount += 20; 8100: int sp = XEiJ.regRn[15]; 8101: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 8102: XEiJ.regRn[15] = sp + 4 + XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 8103: } else { 8104: int t = XEiJ.regPC; 8105: XEiJ.regPC = t + 2; 8106: XEiJ.regRn[15] = sp + 4 + XEiJ.busRwse (t); //pcws 8107: } 8108: irpSetPC (XEiJ.busRls (sp)); //popls 8109: } //irpRtd 8110: 8111: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8112: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8113: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8114: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8115: //RTS |-|012346|-|-----|-----| |0100_111_001_110_101 8116: public static void irpRts () throws M68kException { 8117: XEiJ.mpuCycleCount += 16; 8118: int sp = XEiJ.regRn[15]; 8119: XEiJ.regRn[15] = sp + 4; 8120: irpSetPC (XEiJ.busRls (sp)); //popls 8121: } //irpRts 8122: 8123: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8124: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8125: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8126: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8127: //TRAPV |-|012346|-|---*-|-----| |0100_111_001_110_110 8128: public static void irpTrapv () throws M68kException { 8129: if (XEiJ.TEST_BIT_1_SHIFT ? XEiJ.regCCR << 31 - 1 >= 0 : (XEiJ.regCCR & XEiJ.REG_CCR_V) == 0) { //通過 8130: XEiJ.mpuCycleCount += 4; 8131: } else { 8132: XEiJ.mpuCycleCount += 34; 8133: M68kException.m6eNumber = M68kException.M6E_TRAPV_INSTRUCTION; 8134: throw M68kException.m6eSignal; 8135: } 8136: } //irpTrapv 8137: 8138: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8139: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8140: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8141: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8142: //RTR |-|012346|-|UUUUU|*****| |0100_111_001_110_111 8143: public static void irpRtr () throws M68kException { 8144: XEiJ.mpuCycleCount += 20; 8145: int sp = XEiJ.regRn[15]; 8146: XEiJ.regRn[15] = sp + 6; 8147: XEiJ.regCCR = XEiJ.REG_CCR_MASK & XEiJ.busRwz (sp); //popwz 8148: irpSetPC (XEiJ.busRlse (sp + 2)); //popls。ccrを読めたのだからspは奇数ではない 8149: } //irpRtr 8150: 8151: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8152: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8153: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8154: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8155: //MOVEC.L Rc,Rn |-|-12346|P|-----|-----| |0100_111_001_111_010-rnnncccccccccccc 8156: public static void irpMovecFromControl () throws M68kException { 8157: if (XEiJ.regSRS == 0) { //ユーザモードのとき 8158: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 8159: throw M68kException.m6eSignal; 8160: } 8161: //以下はスーパーバイザモード 8162: XEiJ.mpuCycleCount += 10; 8163: int w; 8164: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 8165: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 8166: } else { 8167: w = XEiJ.regPC; 8168: XEiJ.regPC = w + 2; 8169: w = XEiJ.busRwze (w); //pcwz。拡張ワード 8170: } 8171: switch (w & 0x0fff) { 8172: case 0x000: //SFC 8173: XEiJ.regRn[w >> 12] = XEiJ.mpuSFC; 8174: break; 8175: case 0x001: //DFC 8176: XEiJ.regRn[w >> 12] = XEiJ.mpuDFC; 8177: break; 8178: case 0x801: //VBR 8179: XEiJ.regRn[w >> 12] = XEiJ.mpuVBR; 8180: break; 8181: default: 8182: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 8183: throw M68kException.m6eSignal; 8184: } 8185: } //irpMovecFromControl 8186: 8187: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8188: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8189: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8190: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8191: //MOVEC.L Rn,Rc |-|-12346|P|-----|-----| |0100_111_001_111_011-rnnncccccccccccc 8192: public static void irpMovecToControl () throws M68kException { 8193: if (XEiJ.regSRS == 0) { //ユーザモードのとき 8194: M68kException.m6eNumber = M68kException.M6E_PRIVILEGE_VIOLATION; 8195: throw M68kException.m6eSignal; 8196: } 8197: //以下はスーパーバイザモード 8198: XEiJ.mpuCycleCount += 12; 8199: int w; 8200: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 8201: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 8202: } else { 8203: w = XEiJ.regPC; 8204: XEiJ.regPC = w + 2; 8205: w = XEiJ.busRwze (w); //pcwz。拡張ワード 8206: } 8207: int d = XEiJ.regRn[w >> 12]; 8208: switch (w & 0x0fff) { 8209: case 0x000: //SFC 8210: XEiJ.mpuSFC = d & 0x00000007; 8211: break; 8212: case 0x001: //DFC 8213: XEiJ.mpuDFC = d & 0x00000007; 8214: break; 8215: case 0x801: //VBR 8216: XEiJ.mpuVBR = d & -4; //4の倍数でないと困る 8217: break; 8218: default: 8219: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 8220: throw M68kException.m6eSignal; 8221: } 8222: } //irpMovecToControl 8223: 8224: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8225: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8226: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8227: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8228: //JSR <ea> |-|012346|-|-----|-----| M WXZP |0100_111_010_mmm_rrr 8229: //JBSR.L <label> |A|012346|-|-----|-----| |0100_111_010_111_001-{address} [JSR <label>] 8230: public static void irpJsr () throws M68kException { 8231: XEiJ.mpuCycleCount += 16 - 8; 8232: int a = efaJmpJsr (XEiJ.regOC & 63); //プッシュする前に実効アドレスを計算する 8233: XEiJ.busWl (XEiJ.regRn[15] -= 4, XEiJ.regPC); //pushl 8234: irpSetPC (a); 8235: } //irpJsr 8236: 8237: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8238: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8239: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8240: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8241: //JMP <ea> |-|012346|-|-----|-----| M WXZP |0100_111_011_mmm_rrr 8242: //JBRA.L <label> |A|012346|-|-----|-----| |0100_111_011_111_001-{address} [JMP <label>] 8243: public static void irpJmp () throws M68kException { 8244: //XEiJ.mpuCycleCount += 8 - 8; 8245: irpSetPC (efaJmpJsr (XEiJ.regOC & 63)); 8246: } //irpJmp 8247: 8248: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8249: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8250: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8251: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8252: //ADDQ.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_000_mmm_rrr 8253: //INC.B <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_000_mmm_rrr [ADDQ.B #1,<ea>] 8254: public static void irpAddqByte () throws M68kException { 8255: int ea = XEiJ.regOC & 63; 8256: int x; 8257: int y = ((XEiJ.regOC >> 9) - 1 & 7) + 1; //qqq==0?8:qqq 8258: int z; 8259: if (ea < XEiJ.EA_AR) { //ADDQ.B #<data>,Dr 8260: XEiJ.mpuCycleCount += 4; 8261: z = (byte) (XEiJ.regRn[ea] = ~0xff & (x = XEiJ.regRn[ea]) | 0xff & (x = (byte) x) + y); 8262: } else { //ADDQ.B #<data>,<mem> 8263: XEiJ.mpuCycleCount += 8; 8264: int a = efaMltByte (ea); 8265: XEiJ.busWb (a, z = (byte) ((x = XEiJ.busRbs (a)) + y)); 8266: } 8267: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 8268: (~x & z) >>> 31 << 1 | 8269: (x & ~z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_addq 8270: } //irpAddqByte 8271: 8272: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8273: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8274: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8275: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8276: //ADDQ.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_001_mmm_rrr 8277: //ADDQ.W #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_001_001_rrr 8278: //INC.W <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_001_mmm_rrr [ADDQ.W #1,<ea>] 8279: //INC.W Ar |A|012346|-|-----|-----| A |0101_001_001_001_rrr [ADDQ.W #1,Ar] 8280: // 8281: //ADDQ.W #<data>,Ar 8282: // ソースを符号拡張してロングで加算する 8283: public static void irpAddqWord () throws M68kException { 8284: int ea = XEiJ.regOC & 63; 8285: int y = ((XEiJ.regOC >> 9) - 1 & 7) + 1; //qqq==0?8:qqq 8286: if (ea >> 3 == XEiJ.MMM_AR) { //ADDQ.W #<data>,Ar 8287: XEiJ.mpuCycleCount += 8; //MC68000 User's Manualに4と書いてあるのは8の間違い 8288: XEiJ.regRn[ea] += y; //ロングで計算する。このr[ea]はアドレスレジスタ 8289: //ccrは操作しない 8290: } else { 8291: int x; 8292: int z; 8293: if (ea < XEiJ.EA_AR) { //ADDQ.W #<data>,Dr 8294: XEiJ.mpuCycleCount += 4; 8295: z = (short) (XEiJ.regRn[ea] = ~0xffff & (x = XEiJ.regRn[ea]) | (char) ((x = (short) x) + y)); 8296: } else { //ADDQ.W #<data>,<mem> 8297: XEiJ.mpuCycleCount += 8; 8298: int a = efaMltWord (ea); 8299: XEiJ.busWw (a, z = (short) ((x = XEiJ.busRws (a)) + y)); 8300: } 8301: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 8302: (~x & z) >>> 31 << 1 | 8303: (x & ~z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_addq 8304: } 8305: } //irpAddqWord 8306: 8307: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8308: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8309: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8310: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8311: //ADDQ.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_010_mmm_rrr 8312: //ADDQ.L #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_010_001_rrr 8313: //INC.L <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_010_mmm_rrr [ADDQ.L #1,<ea>] 8314: //INC.L Ar |A|012346|-|-----|-----| A |0101_001_010_001_rrr [ADDQ.L #1,Ar] 8315: public static void irpAddqLong () throws M68kException { 8316: int ea = XEiJ.regOC & 63; 8317: int y = ((XEiJ.regOC >> 9) - 1 & 7) + 1; //qqq==0?8:qqq 8318: if (ea >> 3 == XEiJ.MMM_AR) { //ADDQ.L #<data>,Ar 8319: XEiJ.mpuCycleCount += 8; 8320: XEiJ.regRn[ea] += y; //このr[ea]はアドレスレジスタ 8321: //ccrは操作しない 8322: } else { 8323: int x; 8324: int z; 8325: if (ea < XEiJ.EA_AR) { //ADDQ.L #<data>,Dr 8326: XEiJ.mpuCycleCount += 8; 8327: XEiJ.regRn[ea] = z = (x = XEiJ.regRn[ea]) + y; 8328: } else { //ADDQ.L #<data>,<mem> 8329: XEiJ.mpuCycleCount += 12; 8330: int a = efaMltLong (ea); 8331: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) + y); 8332: } 8333: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 8334: (~x & z) >>> 31 << 1 | 8335: (x & ~z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_addq 8336: } 8337: } //irpAddqLong 8338: 8339: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8340: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8341: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8342: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8343: //ST.B <ea> |-|012346|-|-----|-----|D M+-WXZ |0101_000_011_mmm_rrr 8344: //SNF.B <ea> |A|012346|-|-----|-----|D M+-WXZ |0101_000_011_mmm_rrr [ST.B <ea>] 8345: //DBT.W Dr,<label> |-|012346|-|-----|-----| |0101_000_011_001_rrr-{offset} 8346: //DBNF.W Dr,<label> |A|012346|-|-----|-----| |0101_000_011_001_rrr-{offset} [DBT.W Dr,<label>] 8347: public static void irpSt () throws M68kException { 8348: int ea = XEiJ.regOC & 63; 8349: //DBT.W Dr,<label>よりもST.B Drを優先する 8350: if (ea < XEiJ.EA_AR) { //ST.B Dr 8351: XEiJ.mpuCycleCount += 6; 8352: XEiJ.regRn[ea] |= 0xff; 8353: } else if (ea < XEiJ.EA_MM) { //DBT.W Dr,<label> 8354: //条件が成立しているので通過 8355: XEiJ.mpuCycleCount += 12; 8356: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8357: //リードを省略する 8358: } else { 8359: XEiJ.busRws (XEiJ.regPC); 8360: } 8361: XEiJ.regPC += 2; 8362: } else { //ST.B <mem> 8363: XEiJ.mpuCycleCount += 8; 8364: XEiJ.busWb (efaMltByte (ea), 0xff); 8365: } 8366: } //irpSt 8367: 8368: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8369: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8370: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8371: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8372: //SUBQ.B #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_100_mmm_rrr 8373: //DEC.B <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_100_mmm_rrr [SUBQ.B #1,<ea>] 8374: public static void irpSubqByte () throws M68kException { 8375: int ea = XEiJ.regOC & 63; 8376: int x; 8377: int y = ((XEiJ.regOC >> 9) - 1 & 7) + 1; //qqq==0?8:qqq 8378: int z; 8379: if (ea < XEiJ.EA_AR) { //SUBQ.B #<data>,Dr 8380: XEiJ.mpuCycleCount += 4; 8381: z = (byte) (XEiJ.regRn[ea] = ~0xff & (x = XEiJ.regRn[ea]) | 0xff & (x = (byte) x) - y); 8382: } else { //SUBQ.B #<data>,<mem> 8383: XEiJ.mpuCycleCount += 8; 8384: int a = efaMltByte (ea); 8385: XEiJ.busWb (a, z = (byte) ((x = XEiJ.busRbs (a)) - y)); 8386: } 8387: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 8388: (x & ~z) >>> 31 << 1 | 8389: (~x & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_subq 8390: } //irpSubqByte 8391: 8392: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8393: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8394: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8395: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8396: //SUBQ.W #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_101_mmm_rrr 8397: //SUBQ.W #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_101_001_rrr 8398: //DEC.W <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_101_mmm_rrr [SUBQ.W #1,<ea>] 8399: //DEC.W Ar |A|012346|-|-----|-----| A |0101_001_101_001_rrr [SUBQ.W #1,Ar] 8400: // 8401: //SUBQ.W #<data>,Ar 8402: // ソースを符号拡張してロングで減算する 8403: public static void irpSubqWord () throws M68kException { 8404: int ea = XEiJ.regOC & 63; 8405: int y = ((XEiJ.regOC >> 9) - 1 & 7) + 1; //qqq==0?8:qqq 8406: if (ea >> 3 == XEiJ.MMM_AR) { //SUBQ.W #<data>,Ar 8407: XEiJ.mpuCycleCount += 8; 8408: XEiJ.regRn[ea] -= y; //ロングで計算する。このr[ea]はアドレスレジスタ 8409: //ccrは操作しない 8410: } else { 8411: int x; 8412: int z; 8413: if (ea < XEiJ.EA_AR) { //SUBQ.W #<data>,Dr 8414: XEiJ.mpuCycleCount += 4; 8415: z = (short) (XEiJ.regRn[ea] = ~0xffff & (x = XEiJ.regRn[ea]) | (char) ((x = (short) x) - y)); 8416: } else { //SUBQ.W #<data>,<mem> 8417: XEiJ.mpuCycleCount += 8; 8418: int a = efaMltWord (ea); 8419: XEiJ.busWw (a, z = (short) ((x = XEiJ.busRws (a)) - y)); 8420: } 8421: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 8422: (x & ~z) >>> 31 << 1 | 8423: (~x & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_subq 8424: } 8425: } //irpSubqWord 8426: 8427: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8428: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8429: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8430: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8431: //SUBQ.L #<data>,<ea> |-|012346|-|UUUUU|*****|D M+-WXZ |0101_qqq_110_mmm_rrr 8432: //SUBQ.L #<data>,Ar |-|012346|-|-----|-----| A |0101_qqq_110_001_rrr 8433: //DEC.L <ea> |A|012346|-|UUUUU|*****|D M+-WXZ |0101_001_110_mmm_rrr [SUBQ.L #1,<ea>] 8434: //DEC.L Ar |A|012346|-|-----|-----| A |0101_001_110_001_rrr [SUBQ.L #1,Ar] 8435: public static void irpSubqLong () throws M68kException { 8436: int ea = XEiJ.regOC & 63; 8437: int y = ((XEiJ.regOC >> 9) - 1 & 7) + 1; //qqq==0?8:qqq 8438: if (ea >> 3 == XEiJ.MMM_AR) { //SUBQ.L #<data>,Ar 8439: XEiJ.mpuCycleCount += 8; 8440: XEiJ.regRn[ea] -= y; //このr[ea]はアドレスレジスタ 8441: //ccrは操作しない 8442: } else { 8443: int x; 8444: int z; 8445: if (ea < XEiJ.EA_AR) { //SUBQ.L #<data>,Dr 8446: XEiJ.mpuCycleCount += 8; 8447: XEiJ.regRn[ea] = z = (x = XEiJ.regRn[ea]) - y; 8448: } else { //SUBQ.L #<data>,<mem> 8449: XEiJ.mpuCycleCount += 12; 8450: int a = efaMltLong (ea); 8451: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) - y); 8452: } 8453: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 8454: (x & ~z) >>> 31 << 1 | 8455: (~x & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_subq 8456: } 8457: } //irpSubqLong 8458: 8459: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8460: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8461: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8462: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8463: //SF.B <ea> |-|012346|-|-----|-----|D M+-WXZ |0101_000_111_mmm_rrr 8464: //SNT.B <ea> |A|012346|-|-----|-----|D M+-WXZ |0101_000_111_mmm_rrr [SF.B <ea>] 8465: //DBF.W Dr,<label> |-|012346|-|-----|-----| |0101_000_111_001_rrr-{offset} 8466: //DBNT.W Dr,<label> |A|012346|-|-----|-----| |0101_000_111_001_rrr-{offset} [DBF.W Dr,<label>] 8467: //DBRA.W Dr,<label> |A|012346|-|-----|-----| |0101_000_111_001_rrr-{offset} [DBF.W Dr,<label>] 8468: public static void irpSf () throws M68kException { 8469: int ea = XEiJ.regOC & 63; 8470: //DBRA.W Dr,<label>よりもSF.B Drを優先する 8471: if (ea < XEiJ.EA_AR) { //SF.B Dr 8472: XEiJ.mpuCycleCount += 4; 8473: XEiJ.regRn[ea] &= ~0xff; 8474: } else if (ea < XEiJ.EA_MM) { //DBRA.W Dr,<label> 8475: //条件が成立していないのでデクリメント 8476: int rrr = XEiJ.regOC & 7; 8477: int t = XEiJ.regRn[rrr]; 8478: if ((short) t == 0) { //Drの下位16bitが0なので通過 8479: XEiJ.mpuCycleCount += 14; 8480: XEiJ.regRn[rrr] = t + 65535; 8481: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8482: //リードを省略する 8483: } else { 8484: XEiJ.busRws (XEiJ.regPC); 8485: } 8486: XEiJ.regPC += 2; 8487: } else { //Drの下位16bitが0でないのでジャンプ 8488: XEiJ.mpuCycleCount += 10; 8489: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8490: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8491: } 8492: } else { //SF.B <mem> 8493: XEiJ.mpuCycleCount += 8; 8494: XEiJ.busWb (efaMltByte (ea), 0x00); 8495: } 8496: } //irpSf 8497: 8498: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8499: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8500: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8501: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8502: //SHI.B <ea> |-|012346|-|--*-*|-----|D M+-WXZ |0101_001_011_mmm_rrr 8503: //SNLS.B <ea> |A|012346|-|--*-*|-----|D M+-WXZ |0101_001_011_mmm_rrr [SHI.B <ea>] 8504: //DBHI.W Dr,<label> |-|012346|-|--*-*|-----| |0101_001_011_001_rrr-{offset} 8505: //DBNLS.W Dr,<label> |A|012346|-|--*-*|-----| |0101_001_011_001_rrr-{offset} [DBHI.W Dr,<label>] 8506: public static void irpShi () throws M68kException { 8507: int ea = XEiJ.regOC & 63; 8508: if (ea >> 3 == XEiJ.MMM_AR) { //DBHI.W Dr,<label> 8509: if (XEiJ.MPU_CC_HI << XEiJ.regCCR < 0) { 8510: //条件が成立しているので通過 8511: XEiJ.mpuCycleCount += 12; 8512: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8513: //リードを省略する 8514: } else { 8515: XEiJ.busRws (XEiJ.regPC); 8516: } 8517: XEiJ.regPC += 2; 8518: } else { 8519: //条件が成立していないのでデクリメント 8520: int rrr = XEiJ.regOC & 7; 8521: int t = XEiJ.regRn[rrr]; 8522: if ((short) t == 0) { //Drの下位16bitが0なので通過 8523: XEiJ.mpuCycleCount += 14; 8524: XEiJ.regRn[rrr] = t + 65535; 8525: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8526: //リードを省略する 8527: } else { 8528: XEiJ.busRws (XEiJ.regPC); 8529: } 8530: XEiJ.regPC += 2; 8531: } else { //Drの下位16bitが0でないのでジャンプ 8532: XEiJ.mpuCycleCount += 10; 8533: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8534: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8535: } 8536: } 8537: } else if (ea < XEiJ.EA_AR) { //SHI.B Dr 8538: if (XEiJ.MPU_CC_HI << XEiJ.regCCR < 0) { //セット 8539: XEiJ.mpuCycleCount += 6; 8540: XEiJ.regRn[ea] |= 0xff; 8541: } else { //クリア 8542: XEiJ.mpuCycleCount += 4; 8543: XEiJ.regRn[ea] &= ~0xff; 8544: } 8545: } else { //SHI.B <mem> 8546: XEiJ.mpuCycleCount += 8; 8547: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_HI << XEiJ.regCCR >> 31); 8548: } 8549: } //irpShi 8550: 8551: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8552: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8553: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8554: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8555: //SLS.B <ea> |-|012346|-|--*-*|-----|D M+-WXZ |0101_001_111_mmm_rrr 8556: //SNHI.B <ea> |A|012346|-|--*-*|-----|D M+-WXZ |0101_001_111_mmm_rrr [SLS.B <ea>] 8557: //DBLS.W Dr,<label> |-|012346|-|--*-*|-----| |0101_001_111_001_rrr-{offset} 8558: //DBNHI.W Dr,<label> |A|012346|-|--*-*|-----| |0101_001_111_001_rrr-{offset} [DBLS.W Dr,<label>] 8559: public static void irpSls () throws M68kException { 8560: int ea = XEiJ.regOC & 63; 8561: if (ea >> 3 == XEiJ.MMM_AR) { //DBLS.W Dr,<label> 8562: if (XEiJ.MPU_CC_LS << XEiJ.regCCR < 0) { 8563: //条件が成立しているので通過 8564: XEiJ.mpuCycleCount += 12; 8565: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8566: //リードを省略する 8567: } else { 8568: XEiJ.busRws (XEiJ.regPC); 8569: } 8570: XEiJ.regPC += 2; 8571: } else { 8572: //条件が成立していないのでデクリメント 8573: int rrr = XEiJ.regOC & 7; 8574: int t = XEiJ.regRn[rrr]; 8575: if ((short) t == 0) { //Drの下位16bitが0なので通過 8576: XEiJ.mpuCycleCount += 14; 8577: XEiJ.regRn[rrr] = t + 65535; 8578: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8579: //リードを省略する 8580: } else { 8581: XEiJ.busRws (XEiJ.regPC); 8582: } 8583: XEiJ.regPC += 2; 8584: } else { //Drの下位16bitが0でないのでジャンプ 8585: XEiJ.mpuCycleCount += 10; 8586: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8587: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8588: } 8589: } 8590: } else if (ea < XEiJ.EA_AR) { //SLS.B Dr 8591: if (XEiJ.MPU_CC_LS << XEiJ.regCCR < 0) { //セット 8592: XEiJ.mpuCycleCount += 6; 8593: XEiJ.regRn[ea] |= 0xff; 8594: } else { //クリア 8595: XEiJ.mpuCycleCount += 4; 8596: XEiJ.regRn[ea] &= ~0xff; 8597: } 8598: } else { //SLS.B <mem> 8599: XEiJ.mpuCycleCount += 8; 8600: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_LS << XEiJ.regCCR >> 31); 8601: } 8602: } //irpSls 8603: 8604: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8605: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8606: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8607: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8608: //SCC.B <ea> |-|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr 8609: //SHS.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr [SCC.B <ea>] 8610: //SNCS.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr [SCC.B <ea>] 8611: //SNLO.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_011_mmm_rrr [SCC.B <ea>] 8612: //DBCC.W Dr,<label> |-|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} 8613: //DBHS.W Dr,<label> |A|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} [DBCC.W Dr,<label>] 8614: //DBNCS.W Dr,<label> |A|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} [DBCC.W Dr,<label>] 8615: //DBNLO.W Dr,<label> |A|012346|-|----*|-----| |0101_010_011_001_rrr-{offset} [DBCC.W Dr,<label>] 8616: public static void irpShs () throws M68kException { 8617: int ea = XEiJ.regOC & 63; 8618: if (ea >> 3 == XEiJ.MMM_AR) { //DBHS.W Dr,<label> 8619: if (XEiJ.MPU_CC_HS << XEiJ.regCCR < 0) { 8620: //条件が成立しているので通過 8621: XEiJ.mpuCycleCount += 12; 8622: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8623: //リードを省略する 8624: } else { 8625: XEiJ.busRws (XEiJ.regPC); 8626: } 8627: XEiJ.regPC += 2; 8628: } else { 8629: //条件が成立していないのでデクリメント 8630: int rrr = XEiJ.regOC & 7; 8631: int t = XEiJ.regRn[rrr]; 8632: if ((short) t == 0) { //Drの下位16bitが0なので通過 8633: XEiJ.mpuCycleCount += 14; 8634: XEiJ.regRn[rrr] = t + 65535; 8635: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8636: //リードを省略する 8637: } else { 8638: XEiJ.busRws (XEiJ.regPC); 8639: } 8640: XEiJ.regPC += 2; 8641: } else { //Drの下位16bitが0でないのでジャンプ 8642: XEiJ.mpuCycleCount += 10; 8643: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8644: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8645: } 8646: } 8647: } else if (ea < XEiJ.EA_AR) { //SHS.B Dr 8648: if (XEiJ.MPU_CC_HS << XEiJ.regCCR < 0) { //セット 8649: XEiJ.mpuCycleCount += 6; 8650: XEiJ.regRn[ea] |= 0xff; 8651: } else { //クリア 8652: XEiJ.mpuCycleCount += 4; 8653: XEiJ.regRn[ea] &= ~0xff; 8654: } 8655: } else { //SHS.B <mem> 8656: XEiJ.mpuCycleCount += 8; 8657: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_HS << XEiJ.regCCR >> 31); 8658: } 8659: } //irpShs 8660: 8661: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8662: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8663: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8664: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8665: //SCS.B <ea> |-|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr 8666: //SLO.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr [SCS.B <ea>] 8667: //SNCC.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr [SCS.B <ea>] 8668: //SNHS.B <ea> |A|012346|-|----*|-----|D M+-WXZ |0101_010_111_mmm_rrr [SCS.B <ea>] 8669: //DBCS.W Dr,<label> |-|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} 8670: //DBLO.W Dr,<label> |A|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} [DBCS.W Dr,<label>] 8671: //DBNCC.W Dr,<label> |A|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} [DBCS.W Dr,<label>] 8672: //DBNHS.W Dr,<label> |A|012346|-|----*|-----| |0101_010_111_001_rrr-{offset} [DBCS.W Dr,<label>] 8673: public static void irpSlo () throws M68kException { 8674: int ea = XEiJ.regOC & 63; 8675: if (ea >> 3 == XEiJ.MMM_AR) { //DBLO.W Dr,<label> 8676: if (XEiJ.MPU_CC_LO << XEiJ.regCCR < 0) { 8677: //条件が成立しているので通過 8678: XEiJ.mpuCycleCount += 12; 8679: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8680: //リードを省略する 8681: } else { 8682: XEiJ.busRws (XEiJ.regPC); 8683: } 8684: XEiJ.regPC += 2; 8685: } else { 8686: //条件が成立していないのでデクリメント 8687: int rrr = XEiJ.regOC & 7; 8688: int t = XEiJ.regRn[rrr]; 8689: if ((short) t == 0) { //Drの下位16bitが0なので通過 8690: XEiJ.mpuCycleCount += 14; 8691: XEiJ.regRn[rrr] = t + 65535; 8692: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8693: //リードを省略する 8694: } else { 8695: XEiJ.busRws (XEiJ.regPC); 8696: } 8697: XEiJ.regPC += 2; 8698: } else { //Drの下位16bitが0でないのでジャンプ 8699: XEiJ.mpuCycleCount += 10; 8700: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8701: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8702: } 8703: } 8704: } else if (ea < XEiJ.EA_AR) { //SLO.B Dr 8705: if (XEiJ.MPU_CC_LO << XEiJ.regCCR < 0) { //セット 8706: XEiJ.mpuCycleCount += 6; 8707: XEiJ.regRn[ea] |= 0xff; 8708: } else { //クリア 8709: XEiJ.mpuCycleCount += 4; 8710: XEiJ.regRn[ea] &= ~0xff; 8711: } 8712: } else { //SLO.B <mem> 8713: XEiJ.mpuCycleCount += 8; 8714: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_LO << XEiJ.regCCR >> 31); 8715: } 8716: } //irpSlo 8717: 8718: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8719: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8720: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8721: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8722: //SNE.B <ea> |-|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr 8723: //SNEQ.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr [SNE.B <ea>] 8724: //SNZ.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr [SNE.B <ea>] 8725: //SNZE.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_011_mmm_rrr [SNE.B <ea>] 8726: //DBNE.W Dr,<label> |-|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} 8727: //DBNEQ.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} [DBNE.W Dr,<label>] 8728: //DBNZ.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} [DBNE.W Dr,<label>] 8729: //DBNZE.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_011_001_rrr-{offset} [DBNE.W Dr,<label>] 8730: public static void irpSne () throws M68kException { 8731: int ea = XEiJ.regOC & 63; 8732: if (ea >> 3 == XEiJ.MMM_AR) { //DBNE.W Dr,<label> 8733: if (XEiJ.MPU_CC_NE << XEiJ.regCCR < 0) { 8734: //条件が成立しているので通過 8735: XEiJ.mpuCycleCount += 12; 8736: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8737: //リードを省略する 8738: } else { 8739: XEiJ.busRws (XEiJ.regPC); 8740: } 8741: XEiJ.regPC += 2; 8742: } else { 8743: //条件が成立していないのでデクリメント 8744: int rrr = XEiJ.regOC & 7; 8745: int t = XEiJ.regRn[rrr]; 8746: if ((short) t == 0) { //Drの下位16bitが0なので通過 8747: XEiJ.mpuCycleCount += 14; 8748: XEiJ.regRn[rrr] = t + 65535; 8749: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8750: //リードを省略する 8751: } else { 8752: XEiJ.busRws (XEiJ.regPC); 8753: } 8754: XEiJ.regPC += 2; 8755: } else { //Drの下位16bitが0でないのでジャンプ 8756: XEiJ.mpuCycleCount += 10; 8757: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8758: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8759: } 8760: } 8761: } else if (ea < XEiJ.EA_AR) { //SNE.B Dr 8762: if (XEiJ.MPU_CC_NE << XEiJ.regCCR < 0) { //セット 8763: XEiJ.mpuCycleCount += 6; 8764: XEiJ.regRn[ea] |= 0xff; 8765: } else { //クリア 8766: XEiJ.mpuCycleCount += 4; 8767: XEiJ.regRn[ea] &= ~0xff; 8768: } 8769: } else { //SNE.B <mem> 8770: XEiJ.mpuCycleCount += 8; 8771: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_NE << XEiJ.regCCR >> 31); 8772: } 8773: } //irpSne 8774: 8775: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8776: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8777: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8778: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8779: //SEQ.B <ea> |-|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr 8780: //SNNE.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr [SEQ.B <ea>] 8781: //SNNZ.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr [SEQ.B <ea>] 8782: //SZE.B <ea> |A|012346|-|--*--|-----|D M+-WXZ |0101_011_111_mmm_rrr [SEQ.B <ea>] 8783: //DBEQ.W Dr,<label> |-|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} 8784: //DBNNE.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} [DBEQ.W Dr,<label>] 8785: //DBNNZ.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} [DBEQ.W Dr,<label>] 8786: //DBZE.W Dr,<label> |A|012346|-|--*--|-----| |0101_011_111_001_rrr-{offset} [DBEQ.W Dr,<label>] 8787: public static void irpSeq () throws M68kException { 8788: int ea = XEiJ.regOC & 63; 8789: if (ea >> 3 == XEiJ.MMM_AR) { //DBEQ.W Dr,<label> 8790: if (XEiJ.MPU_CC_EQ << XEiJ.regCCR < 0) { 8791: //条件が成立しているので通過 8792: XEiJ.mpuCycleCount += 12; 8793: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8794: //リードを省略する 8795: } else { 8796: XEiJ.busRws (XEiJ.regPC); 8797: } 8798: XEiJ.regPC += 2; 8799: } else { 8800: //条件が成立していないのでデクリメント 8801: int rrr = XEiJ.regOC & 7; 8802: int t = XEiJ.regRn[rrr]; 8803: if ((short) t == 0) { //Drの下位16bitが0なので通過 8804: XEiJ.mpuCycleCount += 14; 8805: XEiJ.regRn[rrr] = t + 65535; 8806: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8807: //リードを省略する 8808: } else { 8809: XEiJ.busRws (XEiJ.regPC); 8810: } 8811: XEiJ.regPC += 2; 8812: } else { //Drの下位16bitが0でないのでジャンプ 8813: XEiJ.mpuCycleCount += 10; 8814: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8815: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8816: } 8817: } 8818: } else if (ea < XEiJ.EA_AR) { //SEQ.B Dr 8819: if (XEiJ.MPU_CC_EQ << XEiJ.regCCR < 0) { //セット 8820: XEiJ.mpuCycleCount += 6; 8821: XEiJ.regRn[ea] |= 0xff; 8822: } else { //クリア 8823: XEiJ.mpuCycleCount += 4; 8824: XEiJ.regRn[ea] &= ~0xff; 8825: } 8826: } else { //SEQ.B <mem> 8827: XEiJ.mpuCycleCount += 8; 8828: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_EQ << XEiJ.regCCR >> 31); 8829: } 8830: } //irpSeq 8831: 8832: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8833: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8834: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8835: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8836: //SVC.B <ea> |-|012346|-|---*-|-----|D M+-WXZ |0101_100_011_mmm_rrr 8837: //SNVS.B <ea> |A|012346|-|---*-|-----|D M+-WXZ |0101_100_011_mmm_rrr [SVC.B <ea>] 8838: //DBVC.W Dr,<label> |-|012346|-|---*-|-----| |0101_100_011_001_rrr-{offset} 8839: //DBNVS.W Dr,<label> |A|012346|-|---*-|-----| |0101_100_011_001_rrr-{offset} [DBVC.W Dr,<label>] 8840: public static void irpSvc () throws M68kException { 8841: int ea = XEiJ.regOC & 63; 8842: if (ea >> 3 == XEiJ.MMM_AR) { //DBVC.W Dr,<label> 8843: if (XEiJ.MPU_CC_VC << XEiJ.regCCR < 0) { 8844: //条件が成立しているので通過 8845: XEiJ.mpuCycleCount += 12; 8846: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8847: //リードを省略する 8848: } else { 8849: XEiJ.busRws (XEiJ.regPC); 8850: } 8851: XEiJ.regPC += 2; 8852: } else { 8853: //条件が成立していないのでデクリメント 8854: int rrr = XEiJ.regOC & 7; 8855: int t = XEiJ.regRn[rrr]; 8856: if ((short) t == 0) { //Drの下位16bitが0なので通過 8857: XEiJ.mpuCycleCount += 14; 8858: XEiJ.regRn[rrr] = t + 65535; 8859: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8860: //リードを省略する 8861: } else { 8862: XEiJ.busRws (XEiJ.regPC); 8863: } 8864: XEiJ.regPC += 2; 8865: } else { //Drの下位16bitが0でないのでジャンプ 8866: XEiJ.mpuCycleCount += 10; 8867: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8868: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8869: } 8870: } 8871: } else if (ea < XEiJ.EA_AR) { //SVC.B Dr 8872: if (XEiJ.MPU_CC_VC << XEiJ.regCCR < 0) { //セット 8873: XEiJ.mpuCycleCount += 6; 8874: XEiJ.regRn[ea] |= 0xff; 8875: } else { //クリア 8876: XEiJ.mpuCycleCount += 4; 8877: XEiJ.regRn[ea] &= ~0xff; 8878: } 8879: } else { //SVC.B <mem> 8880: XEiJ.mpuCycleCount += 8; 8881: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_VC << XEiJ.regCCR >> 31); 8882: } 8883: } //irpSvc 8884: 8885: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8886: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8887: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8888: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8889: //SVS.B <ea> |-|012346|-|---*-|-----|D M+-WXZ |0101_100_111_mmm_rrr 8890: //SNVC.B <ea> |A|012346|-|---*-|-----|D M+-WXZ |0101_100_111_mmm_rrr [SVS.B <ea>] 8891: //DBVS.W Dr,<label> |-|012346|-|---*-|-----| |0101_100_111_001_rrr-{offset} 8892: //DBNVC.W Dr,<label> |A|012346|-|---*-|-----| |0101_100_111_001_rrr-{offset} [DBVS.W Dr,<label>] 8893: public static void irpSvs () throws M68kException { 8894: int ea = XEiJ.regOC & 63; 8895: if (ea >> 3 == XEiJ.MMM_AR) { //DBVS.W Dr,<label> 8896: if (XEiJ.MPU_CC_VS << XEiJ.regCCR < 0) { 8897: //条件が成立しているので通過 8898: XEiJ.mpuCycleCount += 12; 8899: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8900: //リードを省略する 8901: } else { 8902: XEiJ.busRws (XEiJ.regPC); 8903: } 8904: XEiJ.regPC += 2; 8905: } else { 8906: //条件が成立していないのでデクリメント 8907: int rrr = XEiJ.regOC & 7; 8908: int t = XEiJ.regRn[rrr]; 8909: if ((short) t == 0) { //Drの下位16bitが0なので通過 8910: XEiJ.mpuCycleCount += 14; 8911: XEiJ.regRn[rrr] = t + 65535; 8912: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8913: //リードを省略する 8914: } else { 8915: XEiJ.busRws (XEiJ.regPC); 8916: } 8917: XEiJ.regPC += 2; 8918: } else { //Drの下位16bitが0でないのでジャンプ 8919: XEiJ.mpuCycleCount += 10; 8920: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8921: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8922: } 8923: } 8924: } else if (ea < XEiJ.EA_AR) { //SVS.B Dr 8925: if (XEiJ.MPU_CC_VS << XEiJ.regCCR < 0) { //セット 8926: XEiJ.mpuCycleCount += 6; 8927: XEiJ.regRn[ea] |= 0xff; 8928: } else { //クリア 8929: XEiJ.mpuCycleCount += 4; 8930: XEiJ.regRn[ea] &= ~0xff; 8931: } 8932: } else { //SVS.B <mem> 8933: XEiJ.mpuCycleCount += 8; 8934: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_VS << XEiJ.regCCR >> 31); 8935: } 8936: } //irpSvs 8937: 8938: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8939: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8940: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8941: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8942: //SPL.B <ea> |-|012346|-|-*---|-----|D M+-WXZ |0101_101_011_mmm_rrr 8943: //SNMI.B <ea> |A|012346|-|-*---|-----|D M+-WXZ |0101_101_011_mmm_rrr [SPL.B <ea>] 8944: //DBPL.W Dr,<label> |-|012346|-|-*---|-----| |0101_101_011_001_rrr-{offset} 8945: //DBNMI.W Dr,<label> |A|012346|-|-*---|-----| |0101_101_011_001_rrr-{offset} [DBPL.W Dr,<label>] 8946: public static void irpSpl () throws M68kException { 8947: int ea = XEiJ.regOC & 63; 8948: if (ea >> 3 == XEiJ.MMM_AR) { //DBPL.W Dr,<label> 8949: if (XEiJ.MPU_CC_PL << XEiJ.regCCR < 0) { 8950: //条件が成立しているので通過 8951: XEiJ.mpuCycleCount += 12; 8952: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8953: //リードを省略する 8954: } else { 8955: XEiJ.busRws (XEiJ.regPC); 8956: } 8957: XEiJ.regPC += 2; 8958: } else { 8959: //条件が成立していないのでデクリメント 8960: int rrr = XEiJ.regOC & 7; 8961: int t = XEiJ.regRn[rrr]; 8962: if ((short) t == 0) { //Drの下位16bitが0なので通過 8963: XEiJ.mpuCycleCount += 14; 8964: XEiJ.regRn[rrr] = t + 65535; 8965: if (XEiJ.MPU_OMIT_OFFSET_READ) { 8966: //リードを省略する 8967: } else { 8968: XEiJ.busRws (XEiJ.regPC); 8969: } 8970: XEiJ.regPC += 2; 8971: } else { //Drの下位16bitが0でないのでジャンプ 8972: XEiJ.mpuCycleCount += 10; 8973: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 8974: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 8975: } 8976: } 8977: } else if (ea < XEiJ.EA_AR) { //SPL.B Dr 8978: if (XEiJ.MPU_CC_PL << XEiJ.regCCR < 0) { //セット 8979: XEiJ.mpuCycleCount += 6; 8980: XEiJ.regRn[ea] |= 0xff; 8981: } else { //クリア 8982: XEiJ.mpuCycleCount += 4; 8983: XEiJ.regRn[ea] &= ~0xff; 8984: } 8985: } else { //SPL.B <mem> 8986: XEiJ.mpuCycleCount += 8; 8987: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_PL << XEiJ.regCCR >> 31); 8988: } 8989: } //irpSpl 8990: 8991: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8992: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 8993: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 8994: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 8995: //SMI.B <ea> |-|012346|-|-*---|-----|D M+-WXZ |0101_101_111_mmm_rrr 8996: //SNPL.B <ea> |A|012346|-|-*---|-----|D M+-WXZ |0101_101_111_mmm_rrr [SMI.B <ea>] 8997: //DBMI.W Dr,<label> |-|012346|-|-*---|-----| |0101_101_111_001_rrr-{offset} 8998: //DBNPL.W Dr,<label> |A|012346|-|-*---|-----| |0101_101_111_001_rrr-{offset} [DBMI.W Dr,<label>] 8999: public static void irpSmi () throws M68kException { 9000: int ea = XEiJ.regOC & 63; 9001: if (ea >> 3 == XEiJ.MMM_AR) { //DBMI.W Dr,<label> 9002: if (XEiJ.MPU_CC_MI << XEiJ.regCCR < 0) { 9003: //条件が成立しているので通過 9004: XEiJ.mpuCycleCount += 12; 9005: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9006: //リードを省略する 9007: } else { 9008: XEiJ.busRws (XEiJ.regPC); 9009: } 9010: XEiJ.regPC += 2; 9011: } else { 9012: //条件が成立していないのでデクリメント 9013: int rrr = XEiJ.regOC & 7; 9014: int t = XEiJ.regRn[rrr]; 9015: if ((short) t == 0) { //Drの下位16bitが0なので通過 9016: XEiJ.mpuCycleCount += 14; 9017: XEiJ.regRn[rrr] = t + 65535; 9018: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9019: //リードを省略する 9020: } else { 9021: XEiJ.busRws (XEiJ.regPC); 9022: } 9023: XEiJ.regPC += 2; 9024: } else { //Drの下位16bitが0でないのでジャンプ 9025: XEiJ.mpuCycleCount += 10; 9026: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 9027: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 9028: } 9029: } 9030: } else if (ea < XEiJ.EA_AR) { //SMI.B Dr 9031: if (XEiJ.MPU_CC_MI << XEiJ.regCCR < 0) { //セット 9032: XEiJ.mpuCycleCount += 6; 9033: XEiJ.regRn[ea] |= 0xff; 9034: } else { //クリア 9035: XEiJ.mpuCycleCount += 4; 9036: XEiJ.regRn[ea] &= ~0xff; 9037: } 9038: } else { //SMI.B <mem> 9039: XEiJ.mpuCycleCount += 8; 9040: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_MI << XEiJ.regCCR >> 31); 9041: } 9042: } //irpSmi 9043: 9044: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9045: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9046: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9047: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9048: //SGE.B <ea> |-|012346|-|-*-*-|-----|D M+-WXZ |0101_110_011_mmm_rrr 9049: //SNLT.B <ea> |A|012346|-|-*-*-|-----|D M+-WXZ |0101_110_011_mmm_rrr [SGE.B <ea>] 9050: //DBGE.W Dr,<label> |-|012346|-|-*-*-|-----| |0101_110_011_001_rrr-{offset} 9051: //DBNLT.W Dr,<label> |A|012346|-|-*-*-|-----| |0101_110_011_001_rrr-{offset} [DBGE.W Dr,<label>] 9052: public static void irpSge () throws M68kException { 9053: int ea = XEiJ.regOC & 63; 9054: if (ea >> 3 == XEiJ.MMM_AR) { //DBGE.W Dr,<label> 9055: if (XEiJ.MPU_CC_GE << XEiJ.regCCR < 0) { 9056: //条件が成立しているので通過 9057: XEiJ.mpuCycleCount += 12; 9058: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9059: //リードを省略する 9060: } else { 9061: XEiJ.busRws (XEiJ.regPC); 9062: } 9063: XEiJ.regPC += 2; 9064: } else { 9065: //条件が成立していないのでデクリメント 9066: int rrr = XEiJ.regOC & 7; 9067: int t = XEiJ.regRn[rrr]; 9068: if ((short) t == 0) { //Drの下位16bitが0なので通過 9069: XEiJ.mpuCycleCount += 14; 9070: XEiJ.regRn[rrr] = t + 65535; 9071: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9072: //リードを省略する 9073: } else { 9074: XEiJ.busRws (XEiJ.regPC); 9075: } 9076: XEiJ.regPC += 2; 9077: } else { //Drの下位16bitが0でないのでジャンプ 9078: XEiJ.mpuCycleCount += 10; 9079: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 9080: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 9081: } 9082: } 9083: } else if (ea < XEiJ.EA_AR) { //SGE.B Dr 9084: if (XEiJ.MPU_CC_GE << XEiJ.regCCR < 0) { //セット 9085: XEiJ.mpuCycleCount += 6; 9086: XEiJ.regRn[ea] |= 0xff; 9087: } else { //クリア 9088: XEiJ.mpuCycleCount += 4; 9089: XEiJ.regRn[ea] &= ~0xff; 9090: } 9091: } else { //SGE.B <mem> 9092: XEiJ.mpuCycleCount += 8; 9093: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_GE << XEiJ.regCCR >> 31); 9094: } 9095: } //irpSge 9096: 9097: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9098: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9099: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9100: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9101: //SLT.B <ea> |-|012346|-|-*-*-|-----|D M+-WXZ |0101_110_111_mmm_rrr 9102: //SNGE.B <ea> |A|012346|-|-*-*-|-----|D M+-WXZ |0101_110_111_mmm_rrr [SLT.B <ea>] 9103: //DBLT.W Dr,<label> |-|012346|-|-*-*-|-----| |0101_110_111_001_rrr-{offset} 9104: //DBNGE.W Dr,<label> |A|012346|-|-*-*-|-----| |0101_110_111_001_rrr-{offset} [DBLT.W Dr,<label>] 9105: public static void irpSlt () throws M68kException { 9106: int ea = XEiJ.regOC & 63; 9107: if (ea >> 3 == XEiJ.MMM_AR) { //DBLT.W Dr,<label> 9108: if (XEiJ.MPU_CC_LT << XEiJ.regCCR < 0) { 9109: //条件が成立しているので通過 9110: XEiJ.mpuCycleCount += 12; 9111: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9112: //リードを省略する 9113: } else { 9114: XEiJ.busRws (XEiJ.regPC); 9115: } 9116: XEiJ.regPC += 2; 9117: } else { 9118: //条件が成立していないのでデクリメント 9119: int rrr = XEiJ.regOC & 7; 9120: int t = XEiJ.regRn[rrr]; 9121: if ((short) t == 0) { //Drの下位16bitが0なので通過 9122: XEiJ.mpuCycleCount += 14; 9123: XEiJ.regRn[rrr] = t + 65535; 9124: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9125: //リードを省略する 9126: } else { 9127: XEiJ.busRws (XEiJ.regPC); 9128: } 9129: XEiJ.regPC += 2; 9130: } else { //Drの下位16bitが0でないのでジャンプ 9131: XEiJ.mpuCycleCount += 10; 9132: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 9133: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 9134: } 9135: } 9136: } else if (ea < XEiJ.EA_AR) { //SLT.B Dr 9137: if (XEiJ.MPU_CC_LT << XEiJ.regCCR < 0) { //セット 9138: XEiJ.mpuCycleCount += 6; 9139: XEiJ.regRn[ea] |= 0xff; 9140: } else { //クリア 9141: XEiJ.mpuCycleCount += 4; 9142: XEiJ.regRn[ea] &= ~0xff; 9143: } 9144: } else { //SLT.B <mem> 9145: XEiJ.mpuCycleCount += 8; 9146: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_LT << XEiJ.regCCR >> 31); 9147: } 9148: } //irpSlt 9149: 9150: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9151: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9152: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9153: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9154: //SGT.B <ea> |-|012346|-|-***-|-----|D M+-WXZ |0101_111_011_mmm_rrr 9155: //SNLE.B <ea> |A|012346|-|-***-|-----|D M+-WXZ |0101_111_011_mmm_rrr [SGT.B <ea>] 9156: //DBGT.W Dr,<label> |-|012346|-|-***-|-----| |0101_111_011_001_rrr-{offset} 9157: //DBNLE.W Dr,<label> |A|012346|-|-***-|-----| |0101_111_011_001_rrr-{offset} [DBGT.W Dr,<label>] 9158: public static void irpSgt () throws M68kException { 9159: int ea = XEiJ.regOC & 63; 9160: if (ea >> 3 == XEiJ.MMM_AR) { //DBGT.W Dr,<label> 9161: if (XEiJ.MPU_CC_GT << XEiJ.regCCR < 0) { 9162: //条件が成立しているので通過 9163: XEiJ.mpuCycleCount += 12; 9164: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9165: //リードを省略する 9166: } else { 9167: XEiJ.busRws (XEiJ.regPC); 9168: } 9169: XEiJ.regPC += 2; 9170: } else { 9171: //条件が成立していないのでデクリメント 9172: int rrr = XEiJ.regOC & 7; 9173: int t = XEiJ.regRn[rrr]; 9174: if ((short) t == 0) { //Drの下位16bitが0なので通過 9175: XEiJ.mpuCycleCount += 14; 9176: XEiJ.regRn[rrr] = t + 65535; 9177: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9178: //リードを省略する 9179: } else { 9180: XEiJ.busRws (XEiJ.regPC); 9181: } 9182: XEiJ.regPC += 2; 9183: } else { //Drの下位16bitが0でないのでジャンプ 9184: XEiJ.mpuCycleCount += 10; 9185: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 9186: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 9187: } 9188: } 9189: } else if (ea < XEiJ.EA_AR) { //SGT.B Dr 9190: if (XEiJ.MPU_CC_GT << XEiJ.regCCR < 0) { //セット 9191: XEiJ.mpuCycleCount += 6; 9192: XEiJ.regRn[ea] |= 0xff; 9193: } else { //クリア 9194: XEiJ.mpuCycleCount += 4; 9195: XEiJ.regRn[ea] &= ~0xff; 9196: } 9197: } else { //SGT.B <mem> 9198: XEiJ.mpuCycleCount += 8; 9199: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_GT << XEiJ.regCCR >> 31); 9200: } 9201: } //irpSgt 9202: 9203: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9204: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9205: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9206: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9207: //SLE.B <ea> |-|012346|-|-***-|-----|D M+-WXZ |0101_111_111_mmm_rrr 9208: //SNGT.B <ea> |A|012346|-|-***-|-----|D M+-WXZ |0101_111_111_mmm_rrr [SLE.B <ea>] 9209: //DBLE.W Dr,<label> |-|012346|-|-***-|-----| |0101_111_111_001_rrr-{offset} 9210: //DBNGT.W Dr,<label> |A|012346|-|-***-|-----| |0101_111_111_001_rrr-{offset} [DBLE.W Dr,<label>] 9211: public static void irpSle () throws M68kException { 9212: int ea = XEiJ.regOC & 63; 9213: if (ea >> 3 == XEiJ.MMM_AR) { //DBLE.W Dr,<label> 9214: if (XEiJ.MPU_CC_LE << XEiJ.regCCR < 0) { 9215: //条件が成立しているので通過 9216: XEiJ.mpuCycleCount += 12; 9217: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9218: //リードを省略する 9219: } else { 9220: XEiJ.busRws (XEiJ.regPC); 9221: } 9222: XEiJ.regPC += 2; 9223: } else { 9224: //条件が成立していないのでデクリメント 9225: int rrr = XEiJ.regOC & 7; 9226: int t = XEiJ.regRn[rrr]; 9227: if ((short) t == 0) { //Drの下位16bitが0なので通過 9228: XEiJ.mpuCycleCount += 14; 9229: XEiJ.regRn[rrr] = t + 65535; 9230: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9231: //リードを省略する 9232: } else { 9233: XEiJ.busRws (XEiJ.regPC); 9234: } 9235: XEiJ.regPC += 2; 9236: } else { //Drの下位16bitが0でないのでジャンプ 9237: XEiJ.mpuCycleCount += 10; 9238: XEiJ.regRn[rrr] = t - 1; //下位16bitが0でないので上位16bitは変化しない 9239: irpSetPC (XEiJ.regPC + XEiJ.busRws (XEiJ.regPC)); //pc==pc0+2 9240: } 9241: } 9242: } else if (ea < XEiJ.EA_AR) { //SLE.B Dr 9243: if (XEiJ.MPU_CC_LE << XEiJ.regCCR < 0) { //セット 9244: XEiJ.mpuCycleCount += 6; 9245: XEiJ.regRn[ea] |= 0xff; 9246: } else { //クリア 9247: XEiJ.mpuCycleCount += 4; 9248: XEiJ.regRn[ea] &= ~0xff; 9249: } 9250: } else { //SLE.B <mem> 9251: XEiJ.mpuCycleCount += 8; 9252: XEiJ.busWb (efaMltByte (ea), XEiJ.MPU_CC_LE << XEiJ.regCCR >> 31); 9253: } 9254: } //irpSle 9255: 9256: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9257: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9258: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9259: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9260: //BRA.W <label> |-|012346|-|-----|-----| |0110_000_000_000_000-{offset} 9261: //JBRA.W <label> |A|012346|-|-----|-----| |0110_000_000_000_000-{offset} [BRA.W <label>] 9262: //BRA.S <label> |-|012346|-|-----|-----| |0110_000_000_sss_sss (s is not equal to 0) 9263: //JBRA.S <label> |A|012346|-|-----|-----| |0110_000_000_sss_sss (s is not equal to 0) [BRA.S <label>] 9264: public static void irpBrasw () throws M68kException { 9265: XEiJ.mpuCycleCount += 10; 9266: int t = XEiJ.regPC; //pc0+2 9267: int s = (byte) XEiJ.regOC; //オフセット 9268: if (s == 0) { //BRA.W 9269: XEiJ.regPC = t + 2; 9270: s = XEiJ.busRwse (t); //pcws 9271: } else { //BRA.S 9272: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9273: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9274: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9275: //! 軽量化。リードを省略する 9276: } else { 9277: XEiJ.busRwse (t); //pcws 9278: } 9279: } 9280: irpSetPC (t + s); //pc0+2+オフセット 9281: } //irpBrasw 9282: 9283: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9284: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9285: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9286: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9287: //BRA.S <label> |-|012346|-|-----|-----| |0110_000_001_sss_sss 9288: //JBRA.S <label> |A|012346|-|-----|-----| |0110_000_001_sss_sss [BRA.S <label>] 9289: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9290: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9291: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9292: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9293: //BRA.S <label> |-|012346|-|-----|-----| |0110_000_010_sss_sss 9294: //JBRA.S <label> |A|012346|-|-----|-----| |0110_000_010_sss_sss [BRA.S <label>] 9295: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9296: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9297: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9298: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9299: //BRA.S <label> |-|01----|-|-----|-----| |0110_000_011_sss_sss 9300: //JBRA.S <label> |A|01----|-|-----|-----| |0110_000_011_sss_sss [BRA.S <label>] 9301: public static void irpBras () throws M68kException { 9302: XEiJ.mpuCycleCount += 10; 9303: int t = XEiJ.regPC; //pc0+2 9304: int s = (byte) XEiJ.regOC; //オフセット 9305: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9306: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9307: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9308: //! 軽量化。リードを省略する 9309: } else { 9310: XEiJ.busRwse (t); //pcws 9311: } 9312: irpSetPC (t + s); //pc0+2+オフセット 9313: } //irpBras 9314: 9315: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9316: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9317: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9318: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9319: //BSR.W <label> |-|012346|-|-----|-----| |0110_000_100_000_000-{offset} 9320: //JBSR.W <label> |A|012346|-|-----|-----| |0110_000_100_000_000-{offset} [BSR.W <label>] 9321: //BSR.S <label> |-|012346|-|-----|-----| |0110_000_100_sss_sss (s is not equal to 0) 9322: //JBSR.S <label> |A|012346|-|-----|-----| |0110_000_100_sss_sss (s is not equal to 0) [BSR.S <label>] 9323: public static void irpBsrsw () throws M68kException { 9324: XEiJ.mpuCycleCount += 18; 9325: int t = XEiJ.regPC; //pc0+2 9326: int s = (byte) XEiJ.regOC; //オフセット 9327: if (s == 0) { //BSR.W 9328: XEiJ.regPC = t + 2; 9329: s = XEiJ.busRwse (t); //pcws 9330: } else { //BSR.S 9331: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9332: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9333: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9334: //! 軽量化。リードを省略する 9335: } else { 9336: XEiJ.busRwse (t); //pcws 9337: } 9338: } 9339: XEiJ.busWl (XEiJ.regRn[15] -= 4, XEiJ.regPC); //pushl 9340: irpSetPC (t + s); //pc0+2+オフセット 9341: } //irpBsrsw 9342: 9343: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9344: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9345: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9346: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9347: //BSR.S <label> |-|012346|-|-----|-----| |0110_000_101_sss_sss 9348: //JBSR.S <label> |A|012346|-|-----|-----| |0110_000_101_sss_sss [BSR.S <label>] 9349: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9350: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9351: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9352: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9353: //BSR.S <label> |-|012346|-|-----|-----| |0110_000_110_sss_sss 9354: //JBSR.S <label> |A|012346|-|-----|-----| |0110_000_110_sss_sss [BSR.S <label>] 9355: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9356: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9357: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9358: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9359: //BSR.S <label> |-|01----|-|-----|-----| |0110_000_111_sss_sss 9360: //JBSR.S <label> |A|01----|-|-----|-----| |0110_000_111_sss_sss [BSR.S <label>] 9361: public static void irpBsrs () throws M68kException { 9362: XEiJ.mpuCycleCount += 18; 9363: int t = XEiJ.regPC; //pc0+2 9364: int s = (byte) XEiJ.regOC; //オフセット 9365: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9366: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9367: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9368: //! 軽量化。リードを省略する 9369: } else { 9370: XEiJ.busRwse (t); //pcws 9371: } 9372: XEiJ.busWl (XEiJ.regRn[15] -= 4, XEiJ.regPC); //pushl 9373: irpSetPC (t + s); //pc0+2+オフセット 9374: } //irpBsrs 9375: 9376: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9377: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9378: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9379: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9380: //BHI.W <label> |-|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} 9381: //BNLS.W <label> |A|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} [BHI.W <label>] 9382: //JBHI.W <label> |A|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} [BHI.W <label>] 9383: //JBNLS.W <label> |A|012346|-|--*-*|-----| |0110_001_000_000_000-{offset} [BHI.W <label>] 9384: //BHI.S <label> |-|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) 9385: //BNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) [BHI.S <label>] 9386: //JBHI.S <label> |A|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) [BHI.S <label>] 9387: //JBNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_000_sss_sss (s is not equal to 0) [BHI.S <label>] 9388: //JBLS.L <label> |A|012346|-|--*-*|-----| |0110_001_000_000_110-0100111011111001-{address} [BHI.S (*)+8;JMP <label>] 9389: //JBNHI.L <label> |A|012346|-|--*-*|-----| |0110_001_000_000_110-0100111011111001-{address} [BHI.S (*)+8;JMP <label>] 9390: public static void irpBhisw () throws M68kException { 9391: if (XEiJ.MPU_CC_HI << XEiJ.regCCR < 0) { //Bccでジャンプ 9392: XEiJ.mpuCycleCount += 10; 9393: int t = XEiJ.regPC; //pc0+2 9394: int s = (byte) XEiJ.regOC; //オフセット 9395: if (s == 0) { //Bcc.Wでジャンプ 9396: XEiJ.regPC = t + 2; 9397: s = XEiJ.busRwse (t); //pcws 9398: } else { //Bcc.Sでジャンプ 9399: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9400: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9401: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9402: //! 軽量化。リードを省略する 9403: } else { 9404: XEiJ.busRwse (t); //pcws 9405: } 9406: } 9407: irpSetPC (t + s); //pc0+2+オフセット 9408: } else if (XEiJ.regOC == 0x6200) { //Bcc.Wで通過 9409: XEiJ.mpuCycleCount += 12; 9410: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9411: //リードを省略する 9412: } else { 9413: XEiJ.busRws (XEiJ.regPC); 9414: } 9415: XEiJ.regPC += 2; 9416: } else { //Bcc.Sで通過 9417: XEiJ.mpuCycleCount += 8; 9418: } 9419: } //irpBhisw 9420: 9421: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9422: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9423: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9424: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9425: //BHI.S <label> |-|012346|-|--*-*|-----| |0110_001_001_sss_sss 9426: //BNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_001_sss_sss [BHI.S <label>] 9427: //JBHI.S <label> |A|012346|-|--*-*|-----| |0110_001_001_sss_sss [BHI.S <label>] 9428: //JBNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_001_sss_sss [BHI.S <label>] 9429: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9430: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9431: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9432: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9433: //BHI.S <label> |-|012346|-|--*-*|-----| |0110_001_010_sss_sss 9434: //BNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_010_sss_sss [BHI.S <label>] 9435: //JBHI.S <label> |A|012346|-|--*-*|-----| |0110_001_010_sss_sss [BHI.S <label>] 9436: //JBNLS.S <label> |A|012346|-|--*-*|-----| |0110_001_010_sss_sss [BHI.S <label>] 9437: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9438: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9439: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9440: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9441: //BHI.S <label> |-|01----|-|--*-*|-----| |0110_001_011_sss_sss 9442: //BNLS.S <label> |A|01----|-|--*-*|-----| |0110_001_011_sss_sss [BHI.S <label>] 9443: //JBHI.S <label> |A|01----|-|--*-*|-----| |0110_001_011_sss_sss [BHI.S <label>] 9444: //JBNLS.S <label> |A|01----|-|--*-*|-----| |0110_001_011_sss_sss [BHI.S <label>] 9445: public static void irpBhis () throws M68kException { 9446: if (XEiJ.MPU_CC_HI << XEiJ.regCCR < 0) { //Bcc.Sでジャンプ 9447: XEiJ.mpuCycleCount += 10; 9448: int t = XEiJ.regPC; //pc0+2 9449: int s = (byte) XEiJ.regOC; //オフセット 9450: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9451: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9452: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9453: //! 軽量化。リードを省略する 9454: } else { 9455: XEiJ.busRwse (t); //pcws 9456: } 9457: irpSetPC (t + s); //pc0+2+オフセット 9458: } else { //Bcc.Sで通過 9459: XEiJ.mpuCycleCount += 8; 9460: } 9461: } //irpBhis 9462: 9463: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9464: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9465: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9466: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9467: //BLS.W <label> |-|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} 9468: //BNHI.W <label> |A|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} [BLS.W <label>] 9469: //JBLS.W <label> |A|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} [BLS.W <label>] 9470: //JBNHI.W <label> |A|012346|-|--*-*|-----| |0110_001_100_000_000-{offset} [BLS.W <label>] 9471: //BLS.S <label> |-|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) 9472: //BNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) [BLS.S <label>] 9473: //JBLS.S <label> |A|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) [BLS.S <label>] 9474: //JBNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_100_sss_sss (s is not equal to 0) [BLS.S <label>] 9475: //JBHI.L <label> |A|012346|-|--*-*|-----| |0110_001_100_000_110-0100111011111001-{address} [BLS.S (*)+8;JMP <label>] 9476: //JBNLS.L <label> |A|012346|-|--*-*|-----| |0110_001_100_000_110-0100111011111001-{address} [BLS.S (*)+8;JMP <label>] 9477: public static void irpBlssw () throws M68kException { 9478: if (XEiJ.MPU_CC_LS << XEiJ.regCCR < 0) { //Bccでジャンプ 9479: XEiJ.mpuCycleCount += 10; 9480: int t = XEiJ.regPC; //pc0+2 9481: int s = (byte) XEiJ.regOC; //オフセット 9482: if (s == 0) { //Bcc.Wでジャンプ 9483: XEiJ.regPC = t + 2; 9484: s = XEiJ.busRwse (t); //pcws 9485: } else { //Bcc.Sでジャンプ 9486: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9487: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9488: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9489: //! 軽量化。リードを省略する 9490: } else { 9491: XEiJ.busRwse (t); //pcws 9492: } 9493: } 9494: irpSetPC (t + s); //pc0+2+オフセット 9495: } else if (XEiJ.regOC == 0x6300) { //Bcc.Wで通過 9496: XEiJ.mpuCycleCount += 12; 9497: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9498: //リードを省略する 9499: } else { 9500: XEiJ.busRws (XEiJ.regPC); 9501: } 9502: XEiJ.regPC += 2; 9503: } else { //Bcc.Sで通過 9504: XEiJ.mpuCycleCount += 8; 9505: } 9506: } //irpBlssw 9507: 9508: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9509: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9510: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9511: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9512: //BLS.S <label> |-|012346|-|--*-*|-----| |0110_001_101_sss_sss 9513: //BNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_101_sss_sss [BLS.S <label>] 9514: //JBLS.S <label> |A|012346|-|--*-*|-----| |0110_001_101_sss_sss [BLS.S <label>] 9515: //JBNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_101_sss_sss [BLS.S <label>] 9516: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9517: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9518: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9519: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9520: //BLS.S <label> |-|012346|-|--*-*|-----| |0110_001_110_sss_sss 9521: //BNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_110_sss_sss [BLS.S <label>] 9522: //JBLS.S <label> |A|012346|-|--*-*|-----| |0110_001_110_sss_sss [BLS.S <label>] 9523: //JBNHI.S <label> |A|012346|-|--*-*|-----| |0110_001_110_sss_sss [BLS.S <label>] 9524: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9525: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9526: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9527: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9528: //BLS.S <label> |-|01----|-|--*-*|-----| |0110_001_111_sss_sss 9529: //BNHI.S <label> |A|01----|-|--*-*|-----| |0110_001_111_sss_sss [BLS.S <label>] 9530: //JBLS.S <label> |A|01----|-|--*-*|-----| |0110_001_111_sss_sss [BLS.S <label>] 9531: //JBNHI.S <label> |A|01----|-|--*-*|-----| |0110_001_111_sss_sss [BLS.S <label>] 9532: public static void irpBlss () throws M68kException { 9533: if (XEiJ.MPU_CC_LS << XEiJ.regCCR < 0) { //Bcc.Sでジャンプ 9534: XEiJ.mpuCycleCount += 10; 9535: int t = XEiJ.regPC; //pc0+2 9536: int s = (byte) XEiJ.regOC; //オフセット 9537: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9538: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9539: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9540: //! 軽量化。リードを省略する 9541: } else { 9542: XEiJ.busRwse (t); //pcws 9543: } 9544: irpSetPC (t + s); //pc0+2+オフセット 9545: } else { //Bcc.Sで通過 9546: XEiJ.mpuCycleCount += 8; 9547: } 9548: } //irpBlss 9549: 9550: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9551: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9552: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9553: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9554: //BCC.W <label> |-|012346|-|----*|-----| |0110_010_000_000_000-{offset} 9555: //BHS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 9556: //BNCS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 9557: //BNLO.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 9558: //JBCC.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 9559: //JBHS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 9560: //JBNCS.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 9561: //JBNLO.W <label> |A|012346|-|----*|-----| |0110_010_000_000_000-{offset} [BCC.W <label>] 9562: //BCC.S <label> |-|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) 9563: //BHS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 9564: //BNCS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 9565: //BNLO.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 9566: //JBCC.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 9567: //JBHS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 9568: //JBNCS.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 9569: //JBNLO.S <label> |A|012346|-|----*|-----| |0110_010_000_sss_sss (s is not equal to 0) [BCC.S <label>] 9570: //JBCS.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 9571: //JBLO.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 9572: //JBNCC.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 9573: //JBNHS.L <label> |A|012346|-|----*|-----| |0110_010_000_000_110-0100111011111001-{address} [BCC.S (*)+8;JMP <label>] 9574: public static void irpBhssw () throws M68kException { 9575: if (XEiJ.MPU_CC_HS << XEiJ.regCCR < 0) { //Bccでジャンプ 9576: XEiJ.mpuCycleCount += 10; 9577: int t = XEiJ.regPC; //pc0+2 9578: int s = (byte) XEiJ.regOC; //オフセット 9579: if (s == 0) { //Bcc.Wでジャンプ 9580: XEiJ.regPC = t + 2; 9581: s = XEiJ.busRwse (t); //pcws 9582: } else { //Bcc.Sでジャンプ 9583: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9584: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9585: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9586: //! 軽量化。リードを省略する 9587: } else { 9588: XEiJ.busRwse (t); //pcws 9589: } 9590: } 9591: irpSetPC (t + s); //pc0+2+オフセット 9592: } else if (XEiJ.regOC == 0x6400) { //Bcc.Wで通過 9593: XEiJ.mpuCycleCount += 12; 9594: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9595: //リードを省略する 9596: } else { 9597: XEiJ.busRws (XEiJ.regPC); 9598: } 9599: XEiJ.regPC += 2; 9600: } else { //Bcc.Sで通過 9601: XEiJ.mpuCycleCount += 8; 9602: } 9603: } //irpBhssw 9604: 9605: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9606: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9607: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9608: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9609: //BCC.S <label> |-|012346|-|----*|-----| |0110_010_001_sss_sss 9610: //BHS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 9611: //BNCS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 9612: //BNLO.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 9613: //JBCC.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 9614: //JBHS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 9615: //JBNCS.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 9616: //JBNLO.S <label> |A|012346|-|----*|-----| |0110_010_001_sss_sss [BCC.S <label>] 9617: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9618: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9619: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9620: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9621: //BCC.S <label> |-|012346|-|----*|-----| |0110_010_010_sss_sss 9622: //BHS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 9623: //BNCS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 9624: //BNLO.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 9625: //JBCC.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 9626: //JBHS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 9627: //JBNCS.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 9628: //JBNLO.S <label> |A|012346|-|----*|-----| |0110_010_010_sss_sss [BCC.S <label>] 9629: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9630: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9631: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9632: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9633: //BCC.S <label> |-|01----|-|----*|-----| |0110_010_011_sss_sss 9634: //BHS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 9635: //BNCS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 9636: //BNLO.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 9637: //JBCC.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 9638: //JBHS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 9639: //JBNCS.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 9640: //JBNLO.S <label> |A|01----|-|----*|-----| |0110_010_011_sss_sss [BCC.S <label>] 9641: public static void irpBhss () throws M68kException { 9642: if (XEiJ.MPU_CC_HS << XEiJ.regCCR < 0) { //Bcc.Sでジャンプ 9643: XEiJ.mpuCycleCount += 10; 9644: int t = XEiJ.regPC; //pc0+2 9645: int s = (byte) XEiJ.regOC; //オフセット 9646: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9647: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9648: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9649: //! 軽量化。リードを省略する 9650: } else { 9651: XEiJ.busRwse (t); //pcws 9652: } 9653: irpSetPC (t + s); //pc0+2+オフセット 9654: } else { //Bcc.Sで通過 9655: XEiJ.mpuCycleCount += 8; 9656: } 9657: } //irpBhss 9658: 9659: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9660: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9661: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9662: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9663: //BCS.W <label> |-|012346|-|----*|-----| |0110_010_100_000_000-{offset} 9664: //BLO.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 9665: //BNCC.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 9666: //BNHS.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 9667: //JBCS.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 9668: //JBLO.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 9669: //JBNCC.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 9670: //JBNHS.W <label> |A|012346|-|----*|-----| |0110_010_100_000_000-{offset} [BCS.W <label>] 9671: //BCS.S <label> |-|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) 9672: //BLO.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 9673: //BNCC.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 9674: //BNHS.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 9675: //JBCS.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 9676: //JBLO.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 9677: //JBNCC.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 9678: //JBNHS.S <label> |A|012346|-|----*|-----| |0110_010_100_sss_sss (s is not equal to 0) [BCS.S <label>] 9679: //JBCC.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 9680: //JBHS.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 9681: //JBNCS.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 9682: //JBNLO.L <label> |A|012346|-|----*|-----| |0110_010_100_000_110-0100111011111001-{address} [BCS.S (*)+8;JMP <label>] 9683: public static void irpBlosw () throws M68kException { 9684: if (XEiJ.MPU_CC_LO << XEiJ.regCCR < 0) { //Bccでジャンプ 9685: XEiJ.mpuCycleCount += 10; 9686: int t = XEiJ.regPC; //pc0+2 9687: int s = (byte) XEiJ.regOC; //オフセット 9688: if (s == 0) { //Bcc.Wでジャンプ 9689: XEiJ.regPC = t + 2; 9690: s = XEiJ.busRwse (t); //pcws 9691: } else { //Bcc.Sでジャンプ 9692: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9693: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9694: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9695: //! 軽量化。リードを省略する 9696: } else { 9697: XEiJ.busRwse (t); //pcws 9698: } 9699: } 9700: irpSetPC (t + s); //pc0+2+オフセット 9701: } else if (XEiJ.regOC == 0x6500) { //Bcc.Wで通過 9702: XEiJ.mpuCycleCount += 12; 9703: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9704: //リードを省略する 9705: } else { 9706: XEiJ.busRws (XEiJ.regPC); 9707: } 9708: XEiJ.regPC += 2; 9709: } else { //Bcc.Sで通過 9710: XEiJ.mpuCycleCount += 8; 9711: } 9712: } //irpBlosw 9713: 9714: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9715: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9716: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9717: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9718: //BCS.S <label> |-|012346|-|----*|-----| |0110_010_101_sss_sss 9719: //BLO.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 9720: //BNCC.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 9721: //BNHS.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 9722: //JBCS.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 9723: //JBLO.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 9724: //JBNCC.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 9725: //JBNHS.S <label> |A|012346|-|----*|-----| |0110_010_101_sss_sss [BCS.S <label>] 9726: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9727: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9728: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9729: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9730: //BCS.S <label> |-|012346|-|----*|-----| |0110_010_110_sss_sss 9731: //BLO.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 9732: //BNCC.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 9733: //BNHS.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 9734: //JBCS.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 9735: //JBLO.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 9736: //JBNCC.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 9737: //JBNHS.S <label> |A|012346|-|----*|-----| |0110_010_110_sss_sss [BCS.S <label>] 9738: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9739: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9740: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9741: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9742: //BCS.S <label> |-|01----|-|----*|-----| |0110_010_111_sss_sss 9743: //BLO.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 9744: //BNCC.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 9745: //BNHS.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 9746: //JBCS.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 9747: //JBLO.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 9748: //JBNCC.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 9749: //JBNHS.S <label> |A|01----|-|----*|-----| |0110_010_111_sss_sss [BCS.S <label>] 9750: public static void irpBlos () throws M68kException { 9751: if (XEiJ.MPU_CC_LO << XEiJ.regCCR < 0) { //Bccでジャンプ 9752: XEiJ.mpuCycleCount += 10; 9753: int t = XEiJ.regPC; //pc0+2 9754: int s = (byte) XEiJ.regOC; //オフセット 9755: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9756: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9757: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9758: //! 軽量化。リードを省略する 9759: } else { 9760: XEiJ.busRwse (t); //pcws 9761: } 9762: irpSetPC (t + s); //pc0+2+オフセット 9763: } else { //Bcc.Sで通過 9764: XEiJ.mpuCycleCount += 8; 9765: } 9766: } //irpBlos 9767: 9768: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9769: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9770: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9771: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9772: //BNE.W <label> |-|012346|-|--*--|-----| |0110_011_000_000_000-{offset} 9773: //BNEQ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 9774: //BNZ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 9775: //BNZE.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 9776: //JBNE.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 9777: //JBNEQ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 9778: //JBNZ.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 9779: //JBNZE.W <label> |A|012346|-|--*--|-----| |0110_011_000_000_000-{offset} [BNE.W <label>] 9780: //BNE.S <label> |-|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) 9781: //BNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 9782: //BNZ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 9783: //BNZE.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 9784: //JBNE.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 9785: //JBNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 9786: //JBNZ.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 9787: //JBNZE.S <label> |A|012346|-|--*--|-----| |0110_011_000_sss_sss (s is not equal to 0) [BNE.S <label>] 9788: //JBEQ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 9789: //JBNEQ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 9790: //JBNNE.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 9791: //JBNNZ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 9792: //JBNZ.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 9793: //JBNZE.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 9794: //JBZE.L <label> |A|012346|-|--*--|-----| |0110_011_000_000_110-0100111011111001-{address} [BNE.S (*)+8;JMP <label>] 9795: public static void irpBnesw () throws M68kException { 9796: if (XEiJ.MPU_CC_NE << XEiJ.regCCR < 0) { //Bccでジャンプ 9797: XEiJ.mpuCycleCount += 10; 9798: int t = XEiJ.regPC; //pc0+2 9799: int s = (byte) XEiJ.regOC; //オフセット 9800: if (s == 0) { //Bcc.Wでジャンプ 9801: XEiJ.regPC = t + 2; 9802: s = XEiJ.busRwse (t); //pcws 9803: } else { //Bcc.Sでジャンプ 9804: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9805: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9806: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9807: //! 軽量化。リードを省略する 9808: } else { 9809: XEiJ.busRwse (t); //pcws 9810: } 9811: } 9812: irpSetPC (t + s); //pc0+2+オフセット 9813: } else if (XEiJ.regOC == 0x6600) { //Bcc.Wで通過 9814: XEiJ.mpuCycleCount += 12; 9815: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9816: //リードを省略する 9817: } else { 9818: XEiJ.busRws (XEiJ.regPC); 9819: } 9820: XEiJ.regPC += 2; 9821: } else { //Bcc.Sで通過 9822: XEiJ.mpuCycleCount += 8; 9823: } 9824: } //irpBnesw 9825: 9826: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9827: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9828: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9829: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9830: //BNE.S <label> |-|012346|-|--*--|-----| |0110_011_001_sss_sss 9831: //BNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 9832: //BNZ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 9833: //BNZE.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 9834: //JBNE.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 9835: //JBNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 9836: //JBNZ.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 9837: //JBNZE.S <label> |A|012346|-|--*--|-----| |0110_011_001_sss_sss [BNE.S <label>] 9838: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9839: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9840: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9841: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9842: //BNE.S <label> |-|012346|-|--*--|-----| |0110_011_010_sss_sss 9843: //BNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 9844: //BNZ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 9845: //BNZE.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 9846: //JBNE.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 9847: //JBNEQ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 9848: //JBNZ.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 9849: //JBNZE.S <label> |A|012346|-|--*--|-----| |0110_011_010_sss_sss [BNE.S <label>] 9850: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9851: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9852: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9853: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9854: //BNE.S <label> |-|01----|-|--*--|-----| |0110_011_011_sss_sss 9855: //BNEQ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 9856: //BNZ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 9857: //BNZE.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 9858: //JBNE.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 9859: //JBNEQ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 9860: //JBNZ.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 9861: //JBNZE.S <label> |A|01----|-|--*--|-----| |0110_011_011_sss_sss [BNE.S <label>] 9862: public static void irpBnes () throws M68kException { 9863: if (XEiJ.MPU_CC_NE << XEiJ.regCCR < 0) { //Bccでジャンプ 9864: XEiJ.mpuCycleCount += 10; 9865: int t = XEiJ.regPC; //pc0+2 9866: int s = (byte) XEiJ.regOC; //オフセット 9867: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9868: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9869: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9870: //! 軽量化。リードを省略する 9871: } else { 9872: XEiJ.busRwse (t); //pcws 9873: } 9874: irpSetPC (t + s); //pc0+2+オフセット 9875: } else { //Bcc.Sで通過 9876: XEiJ.mpuCycleCount += 8; 9877: } 9878: } //irpBnes 9879: 9880: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9881: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9882: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9883: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9884: //BEQ.W <label> |-|012346|-|--*--|-----| |0110_011_100_000_000-{offset} 9885: //BNNE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 9886: //BNNZ.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 9887: //BZE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 9888: //JBEQ.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 9889: //JBNNE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 9890: //JBNNZ.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 9891: //JBZE.W <label> |A|012346|-|--*--|-----| |0110_011_100_000_000-{offset} [BEQ.W <label>] 9892: //BEQ.S <label> |-|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) 9893: //BNNE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 9894: //BNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 9895: //BZE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 9896: //JBEQ.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 9897: //JBNNE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 9898: //JBNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 9899: //JBZE.S <label> |A|012346|-|--*--|-----| |0110_011_100_sss_sss (s is not equal to 0) [BEQ.S <label>] 9900: //JBNE.L <label> |A|012346|-|--*--|-----| |0110_011_100_000_110-0100111011111001-{address} [BEQ.S (*)+8;JMP <label>] 9901: public static void irpBeqsw () throws M68kException { 9902: if (XEiJ.MPU_CC_EQ << XEiJ.regCCR < 0) { //Bccでジャンプ 9903: XEiJ.mpuCycleCount += 10; 9904: int t = XEiJ.regPC; //pc0+2 9905: int s = (byte) XEiJ.regOC; //オフセット 9906: if (s == 0) { //Bcc.Wでジャンプ 9907: XEiJ.regPC = t + 2; 9908: s = XEiJ.busRwse (t); //pcws 9909: } else { //Bcc.Sでジャンプ 9910: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9911: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9912: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9913: //! 軽量化。リードを省略する 9914: } else { 9915: XEiJ.busRwse (t); //pcws 9916: } 9917: } 9918: irpSetPC (t + s); //pc0+2+オフセット 9919: } else if (XEiJ.regOC == 0x6700) { //Bcc.Wで通過 9920: XEiJ.mpuCycleCount += 12; 9921: if (XEiJ.MPU_OMIT_OFFSET_READ) { 9922: //リードを省略する 9923: } else { 9924: XEiJ.busRws (XEiJ.regPC); 9925: } 9926: XEiJ.regPC += 2; 9927: } else { //Bcc.Sで通過 9928: XEiJ.mpuCycleCount += 8; 9929: } 9930: } //irpBeqsw 9931: 9932: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9933: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9934: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9935: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9936: //BEQ.S <label> |-|012346|-|--*--|-----| |0110_011_101_sss_sss 9937: //BNNE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 9938: //BNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 9939: //BZE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 9940: //JBEQ.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 9941: //JBNNE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 9942: //JBNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 9943: //JBZE.S <label> |A|012346|-|--*--|-----| |0110_011_101_sss_sss [BEQ.S <label>] 9944: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9945: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9946: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9947: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9948: //BEQ.S <label> |-|012346|-|--*--|-----| |0110_011_110_sss_sss 9949: //BNNE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 9950: //BNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 9951: //BZE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 9952: //JBEQ.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 9953: //JBNNE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 9954: //JBNNZ.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 9955: //JBZE.S <label> |A|012346|-|--*--|-----| |0110_011_110_sss_sss [BEQ.S <label>] 9956: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9957: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9958: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9959: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9960: //BEQ.S <label> |-|01----|-|--*--|-----| |0110_011_111_sss_sss 9961: //BNNE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 9962: //BNNZ.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 9963: //BZE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 9964: //JBEQ.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 9965: //JBNNE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 9966: //JBNNZ.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 9967: //JBZE.S <label> |A|01----|-|--*--|-----| |0110_011_111_sss_sss [BEQ.S <label>] 9968: public static void irpBeqs () throws M68kException { 9969: if (XEiJ.MPU_CC_EQ << XEiJ.regCCR < 0) { //Bccでジャンプ 9970: XEiJ.mpuCycleCount += 10; 9971: int t = XEiJ.regPC; //pc0+2 9972: int s = (byte) XEiJ.regOC; //オフセット 9973: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 9974: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 9975: if (XEiJ.MPU_OMIT_EXTRA_READ) { 9976: //! 軽量化。リードを省略する 9977: } else { 9978: XEiJ.busRwse (t); //pcws 9979: } 9980: irpSetPC (t + s); //pc0+2+オフセット 9981: } else { //Bcc.Sで通過 9982: XEiJ.mpuCycleCount += 8; 9983: } 9984: } //irpBeqs 9985: 9986: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9987: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 9988: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 9989: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 9990: //BVC.W <label> |-|012346|-|---*-|-----| |0110_100_000_000_000-{offset} 9991: //BNVS.W <label> |A|012346|-|---*-|-----| |0110_100_000_000_000-{offset} [BVC.W <label>] 9992: //JBNVS.W <label> |A|012346|-|---*-|-----| |0110_100_000_000_000-{offset} [BVC.W <label>] 9993: //JBVC.W <label> |A|012346|-|---*-|-----| |0110_100_000_000_000-{offset} [BVC.W <label>] 9994: //BVC.S <label> |-|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) 9995: //BNVS.S <label> |A|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) [BVC.S <label>] 9996: //JBNVS.S <label> |A|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) [BVC.S <label>] 9997: //JBVC.S <label> |A|012346|-|---*-|-----| |0110_100_000_sss_sss (s is not equal to 0) [BVC.S <label>] 9998: //JBNVC.L <label> |A|012346|-|---*-|-----| |0110_100_000_000_110-0100111011111001-{address} [BVC.S (*)+8;JMP <label>] 9999: //JBVS.L <label> |A|012346|-|---*-|-----| |0110_100_000_000_110-0100111011111001-{address} [BVC.S (*)+8;JMP <label>] 10000: public static void irpBvcsw () throws M68kException { 10001: if (XEiJ.MPU_CC_VC << XEiJ.regCCR < 0) { //Bccでジャンプ 10002: XEiJ.mpuCycleCount += 10; 10003: int t = XEiJ.regPC; //pc0+2 10004: int s = (byte) XEiJ.regOC; //オフセット 10005: if (s == 0) { //Bcc.Wでジャンプ 10006: XEiJ.regPC = t + 2; 10007: s = XEiJ.busRwse (t); //pcws 10008: } else { //Bcc.Sでジャンプ 10009: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10010: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10011: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10012: //! 軽量化。リードを省略する 10013: } else { 10014: XEiJ.busRwse (t); //pcws 10015: } 10016: } 10017: irpSetPC (t + s); //pc0+2+オフセット 10018: } else if (XEiJ.regOC == 0x6800) { //Bcc.Wで通過 10019: XEiJ.mpuCycleCount += 12; 10020: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10021: //リードを省略する 10022: } else { 10023: XEiJ.busRws (XEiJ.regPC); 10024: } 10025: XEiJ.regPC += 2; 10026: } else { //Bcc.Sで通過 10027: XEiJ.mpuCycleCount += 8; 10028: } 10029: } //irpBvcsw 10030: 10031: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10032: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10033: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10034: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10035: //BVC.S <label> |-|012346|-|---*-|-----| |0110_100_001_sss_sss 10036: //BNVS.S <label> |A|012346|-|---*-|-----| |0110_100_001_sss_sss [BVC.S <label>] 10037: //JBNVS.S <label> |A|012346|-|---*-|-----| |0110_100_001_sss_sss [BVC.S <label>] 10038: //JBVC.S <label> |A|012346|-|---*-|-----| |0110_100_001_sss_sss [BVC.S <label>] 10039: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10040: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10041: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10042: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10043: //BVC.S <label> |-|012346|-|---*-|-----| |0110_100_010_sss_sss 10044: //BNVS.S <label> |A|012346|-|---*-|-----| |0110_100_010_sss_sss [BVC.S <label>] 10045: //JBNVS.S <label> |A|012346|-|---*-|-----| |0110_100_010_sss_sss [BVC.S <label>] 10046: //JBVC.S <label> |A|012346|-|---*-|-----| |0110_100_010_sss_sss [BVC.S <label>] 10047: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10048: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10049: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10050: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10051: //BVC.S <label> |-|01----|-|---*-|-----| |0110_100_011_sss_sss 10052: //BNVS.S <label> |A|01----|-|---*-|-----| |0110_100_011_sss_sss [BVC.S <label>] 10053: //JBNVS.S <label> |A|01----|-|---*-|-----| |0110_100_011_sss_sss [BVC.S <label>] 10054: //JBVC.S <label> |A|01----|-|---*-|-----| |0110_100_011_sss_sss [BVC.S <label>] 10055: public static void irpBvcs () throws M68kException { 10056: if (XEiJ.MPU_CC_VC << XEiJ.regCCR < 0) { //Bccでジャンプ 10057: XEiJ.mpuCycleCount += 10; 10058: int t = XEiJ.regPC; //pc0+2 10059: int s = (byte) XEiJ.regOC; //オフセット 10060: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10061: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10062: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10063: //! 軽量化。リードを省略する 10064: } else { 10065: XEiJ.busRwse (t); //pcws 10066: } 10067: irpSetPC (t + s); //pc0+2+オフセット 10068: } else { //Bcc.Sで通過 10069: XEiJ.mpuCycleCount += 8; 10070: } 10071: } //irpBvcs 10072: 10073: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10074: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10075: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10076: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10077: //BVS.W <label> |-|012346|-|---*-|-----| |0110_100_100_000_000-{offset} 10078: //BNVC.W <label> |A|012346|-|---*-|-----| |0110_100_100_000_000-{offset} [BVS.W <label>] 10079: //JBNVC.W <label> |A|012346|-|---*-|-----| |0110_100_100_000_000-{offset} [BVS.W <label>] 10080: //JBVS.W <label> |A|012346|-|---*-|-----| |0110_100_100_000_000-{offset} [BVS.W <label>] 10081: //BVS.S <label> |-|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) 10082: //BNVC.S <label> |A|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) [BVS.S <label>] 10083: //JBNVC.S <label> |A|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) [BVS.S <label>] 10084: //JBVS.S <label> |A|012346|-|---*-|-----| |0110_100_100_sss_sss (s is not equal to 0) [BVS.S <label>] 10085: //JBNVS.L <label> |A|012346|-|---*-|-----| |0110_100_100_000_110-0100111011111001-{address} [BVS.S (*)+8;JMP <label>] 10086: //JBVC.L <label> |A|012346|-|---*-|-----| |0110_100_100_000_110-0100111011111001-{address} [BVS.S (*)+8;JMP <label>] 10087: public static void irpBvssw () throws M68kException { 10088: if (XEiJ.MPU_CC_VS << XEiJ.regCCR < 0) { //Bccでジャンプ 10089: XEiJ.mpuCycleCount += 10; 10090: int t = XEiJ.regPC; //pc0+2 10091: int s = (byte) XEiJ.regOC; //オフセット 10092: if (s == 0) { //Bcc.Wでジャンプ 10093: XEiJ.regPC = t + 2; 10094: s = XEiJ.busRwse (t); //pcws 10095: } else { //Bcc.Sでジャンプ 10096: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10097: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10098: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10099: //! 軽量化。リードを省略する 10100: } else { 10101: XEiJ.busRwse (t); //pcws 10102: } 10103: } 10104: irpSetPC (t + s); //pc0+2+オフセット 10105: } else if (XEiJ.regOC == 0x6900) { //Bcc.Wで通過 10106: XEiJ.mpuCycleCount += 12; 10107: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10108: //リードを省略する 10109: } else { 10110: XEiJ.busRws (XEiJ.regPC); 10111: } 10112: XEiJ.regPC += 2; 10113: } else { //Bcc.Sで通過 10114: XEiJ.mpuCycleCount += 8; 10115: } 10116: } //irpBvssw 10117: 10118: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10119: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10120: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10121: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10122: //BVS.S <label> |-|012346|-|---*-|-----| |0110_100_101_sss_sss 10123: //BNVC.S <label> |A|012346|-|---*-|-----| |0110_100_101_sss_sss [BVS.S <label>] 10124: //JBNVC.S <label> |A|012346|-|---*-|-----| |0110_100_101_sss_sss [BVS.S <label>] 10125: //JBVS.S <label> |A|012346|-|---*-|-----| |0110_100_101_sss_sss [BVS.S <label>] 10126: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10127: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10128: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10129: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10130: //BVS.S <label> |-|012346|-|---*-|-----| |0110_100_110_sss_sss 10131: //BNVC.S <label> |A|012346|-|---*-|-----| |0110_100_110_sss_sss [BVS.S <label>] 10132: //JBNVC.S <label> |A|012346|-|---*-|-----| |0110_100_110_sss_sss [BVS.S <label>] 10133: //JBVS.S <label> |A|012346|-|---*-|-----| |0110_100_110_sss_sss [BVS.S <label>] 10134: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10135: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10136: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10137: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10138: //BVS.S <label> |-|01----|-|---*-|-----| |0110_100_111_sss_sss 10139: //BNVC.S <label> |A|01----|-|---*-|-----| |0110_100_111_sss_sss [BVS.S <label>] 10140: //JBNVC.S <label> |A|01----|-|---*-|-----| |0110_100_111_sss_sss [BVS.S <label>] 10141: //JBVS.S <label> |A|01----|-|---*-|-----| |0110_100_111_sss_sss [BVS.S <label>] 10142: public static void irpBvss () throws M68kException { 10143: if (XEiJ.MPU_CC_VS << XEiJ.regCCR < 0) { //Bccでジャンプ 10144: XEiJ.mpuCycleCount += 10; 10145: int t = XEiJ.regPC; //pc0+2 10146: int s = (byte) XEiJ.regOC; //オフセット 10147: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10148: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10149: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10150: //! 軽量化。リードを省略する 10151: } else { 10152: XEiJ.busRwse (t); //pcws 10153: } 10154: irpSetPC (t + s); //pc0+2+オフセット 10155: } else { //Bcc.Sで通過 10156: XEiJ.mpuCycleCount += 8; 10157: } 10158: } //irpBvss 10159: 10160: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10161: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10162: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10163: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10164: //BPL.W <label> |-|012346|-|-*---|-----| |0110_101_000_000_000-{offset} 10165: //BNMI.W <label> |A|012346|-|-*---|-----| |0110_101_000_000_000-{offset} [BPL.W <label>] 10166: //JBNMI.W <label> |A|012346|-|-*---|-----| |0110_101_000_000_000-{offset} [BPL.W <label>] 10167: //JBPL.W <label> |A|012346|-|-*---|-----| |0110_101_000_000_000-{offset} [BPL.W <label>] 10168: //BPL.S <label> |-|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) 10169: //BNMI.S <label> |A|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) [BPL.S <label>] 10170: //JBNMI.S <label> |A|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) [BPL.S <label>] 10171: //JBPL.S <label> |A|012346|-|-*---|-----| |0110_101_000_sss_sss (s is not equal to 0) [BPL.S <label>] 10172: //JBMI.L <label> |A|012346|-|-*---|-----| |0110_101_000_000_110-0100111011111001-{address} [BPL.S (*)+8;JMP <label>] 10173: //JBNPL.L <label> |A|012346|-|-*---|-----| |0110_101_000_000_110-0100111011111001-{address} [BPL.S (*)+8;JMP <label>] 10174: public static void irpBplsw () throws M68kException { 10175: if (XEiJ.MPU_CC_PL << XEiJ.regCCR < 0) { //Bccでジャンプ 10176: XEiJ.mpuCycleCount += 10; 10177: int t = XEiJ.regPC; //pc0+2 10178: int s = (byte) XEiJ.regOC; //オフセット 10179: if (s == 0) { //Bcc.Wでジャンプ 10180: XEiJ.regPC = t + 2; 10181: s = XEiJ.busRwse (t); //pcws 10182: } else { //Bcc.Sでジャンプ 10183: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10184: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10185: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10186: //! 軽量化。リードを省略する 10187: } else { 10188: XEiJ.busRwse (t); //pcws 10189: } 10190: } 10191: irpSetPC (t + s); //pc0+2+オフセット 10192: } else if (XEiJ.regOC == 0x6a00) { //Bcc.Wで通過 10193: XEiJ.mpuCycleCount += 12; 10194: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10195: //リードを省略する 10196: } else { 10197: XEiJ.busRws (XEiJ.regPC); 10198: } 10199: XEiJ.regPC += 2; 10200: } else { //Bcc.Sで通過 10201: XEiJ.mpuCycleCount += 8; 10202: } 10203: } //irpBplsw 10204: 10205: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10206: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10207: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10208: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10209: //BPL.S <label> |-|012346|-|-*---|-----| |0110_101_001_sss_sss 10210: //BNMI.S <label> |A|012346|-|-*---|-----| |0110_101_001_sss_sss [BPL.S <label>] 10211: //JBNMI.S <label> |A|012346|-|-*---|-----| |0110_101_001_sss_sss [BPL.S <label>] 10212: //JBPL.S <label> |A|012346|-|-*---|-----| |0110_101_001_sss_sss [BPL.S <label>] 10213: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10214: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10215: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10216: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10217: //BPL.S <label> |-|012346|-|-*---|-----| |0110_101_010_sss_sss 10218: //BNMI.S <label> |A|012346|-|-*---|-----| |0110_101_010_sss_sss [BPL.S <label>] 10219: //JBNMI.S <label> |A|012346|-|-*---|-----| |0110_101_010_sss_sss [BPL.S <label>] 10220: //JBPL.S <label> |A|012346|-|-*---|-----| |0110_101_010_sss_sss [BPL.S <label>] 10221: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10222: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10223: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10224: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10225: //BPL.S <label> |-|01----|-|-*---|-----| |0110_101_011_sss_sss 10226: //BNMI.S <label> |A|01----|-|-*---|-----| |0110_101_011_sss_sss [BPL.S <label>] 10227: //JBNMI.S <label> |A|01----|-|-*---|-----| |0110_101_011_sss_sss [BPL.S <label>] 10228: //JBPL.S <label> |A|01----|-|-*---|-----| |0110_101_011_sss_sss [BPL.S <label>] 10229: public static void irpBpls () throws M68kException { 10230: if (XEiJ.MPU_CC_PL << XEiJ.regCCR < 0) { //Bccでジャンプ 10231: XEiJ.mpuCycleCount += 10; 10232: int t = XEiJ.regPC; //pc0+2 10233: int s = (byte) XEiJ.regOC; //オフセット 10234: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10235: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10236: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10237: //! 軽量化。リードを省略する 10238: } else { 10239: XEiJ.busRwse (t); //pcws 10240: } 10241: irpSetPC (t + s); //pc0+2+オフセット 10242: } else { //Bcc.Sで通過 10243: XEiJ.mpuCycleCount += 8; 10244: } 10245: } //irpBpls 10246: 10247: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10248: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10249: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10250: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10251: //BMI.W <label> |-|012346|-|-*---|-----| |0110_101_100_000_000-{offset} 10252: //BNPL.W <label> |A|012346|-|-*---|-----| |0110_101_100_000_000-{offset} [BMI.W <label>] 10253: //JBMI.W <label> |A|012346|-|-*---|-----| |0110_101_100_000_000-{offset} [BMI.W <label>] 10254: //JBNPL.W <label> |A|012346|-|-*---|-----| |0110_101_100_000_000-{offset} [BMI.W <label>] 10255: //BMI.S <label> |-|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) 10256: //BNPL.S <label> |A|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) [BMI.S <label>] 10257: //JBMI.S <label> |A|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) [BMI.S <label>] 10258: //JBNPL.S <label> |A|012346|-|-*---|-----| |0110_101_100_sss_sss (s is not equal to 0) [BMI.S <label>] 10259: //JBNMI.L <label> |A|012346|-|-*---|-----| |0110_101_100_000_110-0100111011111001-{address} [BMI.S (*)+8;JMP <label>] 10260: //JBPL.L <label> |A|012346|-|-*---|-----| |0110_101_100_000_110-0100111011111001-{address} [BMI.S (*)+8;JMP <label>] 10261: public static void irpBmisw () throws M68kException { 10262: if (XEiJ.MPU_CC_MI << XEiJ.regCCR < 0) { //Bccでジャンプ 10263: XEiJ.mpuCycleCount += 10; 10264: int t = XEiJ.regPC; //pc0+2 10265: int s = (byte) XEiJ.regOC; //オフセット 10266: if (s == 0) { //Bcc.Wでジャンプ 10267: XEiJ.regPC = t + 2; 10268: s = XEiJ.busRwse (t); //pcws 10269: } else { //Bcc.Sでジャンプ 10270: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10271: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10272: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10273: //! 軽量化。リードを省略する 10274: } else { 10275: XEiJ.busRwse (t); //pcws 10276: } 10277: } 10278: irpSetPC (t + s); //pc0+2+オフセット 10279: } else if (XEiJ.regOC == 0x6b00) { //Bcc.Wで通過 10280: XEiJ.mpuCycleCount += 12; 10281: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10282: //リードを省略する 10283: } else { 10284: XEiJ.busRws (XEiJ.regPC); 10285: } 10286: XEiJ.regPC += 2; 10287: } else { //Bcc.Sで通過 10288: XEiJ.mpuCycleCount += 8; 10289: } 10290: } //irpBmisw 10291: 10292: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10293: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10294: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10295: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10296: //BMI.S <label> |-|012346|-|-*---|-----| |0110_101_101_sss_sss 10297: //BNPL.S <label> |A|012346|-|-*---|-----| |0110_101_101_sss_sss [BMI.S <label>] 10298: //JBMI.S <label> |A|012346|-|-*---|-----| |0110_101_101_sss_sss [BMI.S <label>] 10299: //JBNPL.S <label> |A|012346|-|-*---|-----| |0110_101_101_sss_sss [BMI.S <label>] 10300: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10301: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10302: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10303: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10304: //BMI.S <label> |-|012346|-|-*---|-----| |0110_101_110_sss_sss 10305: //BNPL.S <label> |A|012346|-|-*---|-----| |0110_101_110_sss_sss [BMI.S <label>] 10306: //JBMI.S <label> |A|012346|-|-*---|-----| |0110_101_110_sss_sss [BMI.S <label>] 10307: //JBNPL.S <label> |A|012346|-|-*---|-----| |0110_101_110_sss_sss [BMI.S <label>] 10308: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10309: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10310: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10311: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10312: //BMI.S <label> |-|01----|-|-*---|-----| |0110_101_111_sss_sss 10313: //BNPL.S <label> |A|01----|-|-*---|-----| |0110_101_111_sss_sss [BMI.S <label>] 10314: //JBMI.S <label> |A|01----|-|-*---|-----| |0110_101_111_sss_sss [BMI.S <label>] 10315: //JBNPL.S <label> |A|01----|-|-*---|-----| |0110_101_111_sss_sss [BMI.S <label>] 10316: public static void irpBmis () throws M68kException { 10317: if (XEiJ.MPU_CC_MI << XEiJ.regCCR < 0) { //Bccでジャンプ 10318: XEiJ.mpuCycleCount += 10; 10319: int t = XEiJ.regPC; //pc0+2 10320: int s = (byte) XEiJ.regOC; //オフセット 10321: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10322: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10323: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10324: //! 軽量化。リードを省略する 10325: } else { 10326: XEiJ.busRwse (t); //pcws 10327: } 10328: irpSetPC (t + s); //pc0+2+オフセット 10329: } else { //Bcc.Sで通過 10330: XEiJ.mpuCycleCount += 8; 10331: } 10332: } //irpBmis 10333: 10334: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10335: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10336: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10337: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10338: //BGE.W <label> |-|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} 10339: //BNLT.W <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} [BGE.W <label>] 10340: //JBGE.W <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} [BGE.W <label>] 10341: //JBNLT.W <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_000-{offset} [BGE.W <label>] 10342: //BGE.S <label> |-|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) 10343: //BNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) [BGE.S <label>] 10344: //JBGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) [BGE.S <label>] 10345: //JBNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_000_sss_sss (s is not equal to 0) [BGE.S <label>] 10346: //JBLT.L <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_110-0100111011111001-{address} [BGE.S (*)+8;JMP <label>] 10347: //JBNGE.L <label> |A|012346|-|-*-*-|-----| |0110_110_000_000_110-0100111011111001-{address} [BGE.S (*)+8;JMP <label>] 10348: public static void irpBgesw () throws M68kException { 10349: if (XEiJ.MPU_CC_GE << XEiJ.regCCR < 0) { //Bccでジャンプ 10350: XEiJ.mpuCycleCount += 10; 10351: int t = XEiJ.regPC; //pc0+2 10352: int s = (byte) XEiJ.regOC; //オフセット 10353: if (s == 0) { //Bcc.Wでジャンプ 10354: XEiJ.regPC = t + 2; 10355: s = XEiJ.busRwse (t); //pcws 10356: } else { //Bcc.Sでジャンプ 10357: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10358: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10359: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10360: //! 軽量化。リードを省略する 10361: } else { 10362: XEiJ.busRwse (t); //pcws 10363: } 10364: } 10365: irpSetPC (t + s); //pc0+2+オフセット 10366: } else if (XEiJ.regOC == 0x6c00) { //Bcc.Wで通過 10367: XEiJ.mpuCycleCount += 12; 10368: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10369: //リードを省略する 10370: } else { 10371: XEiJ.busRws (XEiJ.regPC); 10372: } 10373: XEiJ.regPC += 2; 10374: } else { //Bcc.Sで通過 10375: XEiJ.mpuCycleCount += 8; 10376: } 10377: } //irpBgesw 10378: 10379: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10380: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10381: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10382: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10383: //BGE.S <label> |-|012346|-|-*-*-|-----| |0110_110_001_sss_sss 10384: //BNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_001_sss_sss [BGE.S <label>] 10385: //JBGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_001_sss_sss [BGE.S <label>] 10386: //JBNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_001_sss_sss [BGE.S <label>] 10387: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10388: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10389: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10390: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10391: //BGE.S <label> |-|012346|-|-*-*-|-----| |0110_110_010_sss_sss 10392: //BNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_010_sss_sss [BGE.S <label>] 10393: //JBGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_010_sss_sss [BGE.S <label>] 10394: //JBNLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_010_sss_sss [BGE.S <label>] 10395: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10396: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10397: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10398: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10399: //BGE.S <label> |-|01----|-|-*-*-|-----| |0110_110_011_sss_sss 10400: //BNLT.S <label> |A|01----|-|-*-*-|-----| |0110_110_011_sss_sss [BGE.S <label>] 10401: //JBGE.S <label> |A|01----|-|-*-*-|-----| |0110_110_011_sss_sss [BGE.S <label>] 10402: //JBNLT.S <label> |A|01----|-|-*-*-|-----| |0110_110_011_sss_sss [BGE.S <label>] 10403: public static void irpBges () throws M68kException { 10404: if (XEiJ.MPU_CC_GE << XEiJ.regCCR < 0) { //Bccでジャンプ 10405: XEiJ.mpuCycleCount += 10; 10406: int t = XEiJ.regPC; //pc0+2 10407: int s = (byte) XEiJ.regOC; //オフセット 10408: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10409: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10410: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10411: //! 軽量化。リードを省略する 10412: } else { 10413: XEiJ.busRwse (t); //pcws 10414: } 10415: irpSetPC (t + s); //pc0+2+オフセット 10416: } else { //Bcc.Sで通過 10417: XEiJ.mpuCycleCount += 8; 10418: } 10419: } //irpBges 10420: 10421: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10422: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10423: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10424: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10425: //BLT.W <label> |-|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} 10426: //BNGE.W <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} [BLT.W <label>] 10427: //JBLT.W <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} [BLT.W <label>] 10428: //JBNGE.W <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_000-{offset} [BLT.W <label>] 10429: //BLT.S <label> |-|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) 10430: //BNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) [BLT.S <label>] 10431: //JBLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) [BLT.S <label>] 10432: //JBNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_100_sss_sss (s is not equal to 0) [BLT.S <label>] 10433: //JBGE.L <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_110-0100111011111001-{address} [BLT.S (*)+8;JMP <label>] 10434: //JBNLT.L <label> |A|012346|-|-*-*-|-----| |0110_110_100_000_110-0100111011111001-{address} [BLT.S (*)+8;JMP <label>] 10435: public static void irpBltsw () throws M68kException { 10436: if (XEiJ.MPU_CC_LT << XEiJ.regCCR < 0) { //Bccでジャンプ 10437: XEiJ.mpuCycleCount += 10; 10438: int t = XEiJ.regPC; //pc0+2 10439: int s = (byte) XEiJ.regOC; //オフセット 10440: if (s == 0) { //Bcc.Wでジャンプ 10441: XEiJ.regPC = t + 2; 10442: s = XEiJ.busRwse (t); //pcws 10443: } else { //Bcc.Sでジャンプ 10444: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10445: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10446: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10447: //! 軽量化。リードを省略する 10448: } else { 10449: XEiJ.busRwse (t); //pcws 10450: } 10451: } 10452: irpSetPC (t + s); //pc0+2+オフセット 10453: } else if (XEiJ.regOC == 0x6d00) { //Bcc.Wで通過 10454: XEiJ.mpuCycleCount += 12; 10455: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10456: //リードを省略する 10457: } else { 10458: XEiJ.busRws (XEiJ.regPC); 10459: } 10460: XEiJ.regPC += 2; 10461: } else { //Bcc.Sで通過 10462: XEiJ.mpuCycleCount += 8; 10463: } 10464: } //irpBltsw 10465: 10466: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10467: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10468: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10469: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10470: //BLT.S <label> |-|012346|-|-*-*-|-----| |0110_110_101_sss_sss 10471: //BNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_101_sss_sss [BLT.S <label>] 10472: //JBLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_101_sss_sss [BLT.S <label>] 10473: //JBNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_101_sss_sss [BLT.S <label>] 10474: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10475: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10476: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10477: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10478: //BLT.S <label> |-|012346|-|-*-*-|-----| |0110_110_110_sss_sss 10479: //BNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_110_sss_sss [BLT.S <label>] 10480: //JBLT.S <label> |A|012346|-|-*-*-|-----| |0110_110_110_sss_sss [BLT.S <label>] 10481: //JBNGE.S <label> |A|012346|-|-*-*-|-----| |0110_110_110_sss_sss [BLT.S <label>] 10482: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10483: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10484: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10485: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10486: //BLT.S <label> |-|01----|-|-*-*-|-----| |0110_110_111_sss_sss 10487: //BNGE.S <label> |A|01----|-|-*-*-|-----| |0110_110_111_sss_sss [BLT.S <label>] 10488: //JBLT.S <label> |A|01----|-|-*-*-|-----| |0110_110_111_sss_sss [BLT.S <label>] 10489: //JBNGE.S <label> |A|01----|-|-*-*-|-----| |0110_110_111_sss_sss [BLT.S <label>] 10490: public static void irpBlts () throws M68kException { 10491: if (XEiJ.MPU_CC_LT << XEiJ.regCCR < 0) { //Bccでジャンプ 10492: XEiJ.mpuCycleCount += 10; 10493: int t = XEiJ.regPC; //pc0+2 10494: int s = (byte) XEiJ.regOC; //オフセット 10495: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10496: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10497: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10498: //! 軽量化。リードを省略する 10499: } else { 10500: XEiJ.busRwse (t); //pcws 10501: } 10502: irpSetPC (t + s); //pc0+2+オフセット 10503: } else { //Bcc.Sで通過 10504: XEiJ.mpuCycleCount += 8; 10505: } 10506: } //irpBlts 10507: 10508: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10509: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10510: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10511: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10512: //BGT.W <label> |-|012346|-|-***-|-----| |0110_111_000_000_000-{offset} 10513: //BNLE.W <label> |A|012346|-|-***-|-----| |0110_111_000_000_000-{offset} [BGT.W <label>] 10514: //JBGT.W <label> |A|012346|-|-***-|-----| |0110_111_000_000_000-{offset} [BGT.W <label>] 10515: //JBNLE.W <label> |A|012346|-|-***-|-----| |0110_111_000_000_000-{offset} [BGT.W <label>] 10516: //BGT.S <label> |-|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) 10517: //BNLE.S <label> |A|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) [BGT.S <label>] 10518: //JBGT.S <label> |A|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) [BGT.S <label>] 10519: //JBNLE.S <label> |A|012346|-|-***-|-----| |0110_111_000_sss_sss (s is not equal to 0) [BGT.S <label>] 10520: //JBLE.L <label> |A|012346|-|-***-|-----| |0110_111_000_000_110-0100111011111001-{address} [BGT.S (*)+8;JMP <label>] 10521: //JBNGT.L <label> |A|012346|-|-***-|-----| |0110_111_000_000_110-0100111011111001-{address} [BGT.S (*)+8;JMP <label>] 10522: public static void irpBgtsw () throws M68kException { 10523: if (XEiJ.MPU_CC_GT << XEiJ.regCCR < 0) { //Bccでジャンプ 10524: XEiJ.mpuCycleCount += 10; 10525: int t = XEiJ.regPC; //pc0+2 10526: int s = (byte) XEiJ.regOC; //オフセット 10527: if (s == 0) { //Bcc.Wでジャンプ 10528: XEiJ.regPC = t + 2; 10529: s = XEiJ.busRwse (t); //pcws 10530: } else { //Bcc.Sでジャンプ 10531: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10532: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10533: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10534: //! 軽量化。リードを省略する 10535: } else { 10536: XEiJ.busRwse (t); //pcws 10537: } 10538: } 10539: irpSetPC (t + s); //pc0+2+オフセット 10540: } else if (XEiJ.regOC == 0x6e00) { //Bcc.Wで通過 10541: XEiJ.mpuCycleCount += 12; 10542: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10543: //リードを省略する 10544: } else { 10545: XEiJ.busRws (XEiJ.regPC); 10546: } 10547: XEiJ.regPC += 2; 10548: } else { //Bcc.Sで通過 10549: XEiJ.mpuCycleCount += 8; 10550: } 10551: } //irpBgtsw 10552: 10553: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10554: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10555: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10556: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10557: //BGT.S <label> |-|012346|-|-***-|-----| |0110_111_001_sss_sss 10558: //BNLE.S <label> |A|012346|-|-***-|-----| |0110_111_001_sss_sss [BGT.S <label>] 10559: //JBGT.S <label> |A|012346|-|-***-|-----| |0110_111_001_sss_sss [BGT.S <label>] 10560: //JBNLE.S <label> |A|012346|-|-***-|-----| |0110_111_001_sss_sss [BGT.S <label>] 10561: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10562: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10563: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10564: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10565: //BGT.S <label> |-|012346|-|-***-|-----| |0110_111_010_sss_sss 10566: //BNLE.S <label> |A|012346|-|-***-|-----| |0110_111_010_sss_sss [BGT.S <label>] 10567: //JBGT.S <label> |A|012346|-|-***-|-----| |0110_111_010_sss_sss [BGT.S <label>] 10568: //JBNLE.S <label> |A|012346|-|-***-|-----| |0110_111_010_sss_sss [BGT.S <label>] 10569: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10570: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10571: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10572: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10573: //BGT.S <label> |-|01----|-|-***-|-----| |0110_111_011_sss_sss 10574: //BNLE.S <label> |A|01----|-|-***-|-----| |0110_111_011_sss_sss [BGT.S <label>] 10575: //JBGT.S <label> |A|01----|-|-***-|-----| |0110_111_011_sss_sss [BGT.S <label>] 10576: //JBNLE.S <label> |A|01----|-|-***-|-----| |0110_111_011_sss_sss [BGT.S <label>] 10577: public static void irpBgts () throws M68kException { 10578: if (XEiJ.MPU_CC_GT << XEiJ.regCCR < 0) { //Bccでジャンプ 10579: XEiJ.mpuCycleCount += 10; 10580: int t = XEiJ.regPC; //pc0+2 10581: int s = (byte) XEiJ.regOC; //オフセット 10582: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10583: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10584: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10585: //! 軽量化。リードを省略する 10586: } else { 10587: XEiJ.busRwse (t); //pcws 10588: } 10589: irpSetPC (t + s); //pc0+2+オフセット 10590: } else { //Bcc.Sで通過 10591: XEiJ.mpuCycleCount += 8; 10592: } 10593: } //irpBgts 10594: 10595: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10596: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10597: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10598: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10599: //BLE.W <label> |-|012346|-|-***-|-----| |0110_111_100_000_000-{offset} 10600: //BNGT.W <label> |A|012346|-|-***-|-----| |0110_111_100_000_000-{offset} [BLE.W <label>] 10601: //JBLE.W <label> |A|012346|-|-***-|-----| |0110_111_100_000_000-{offset} [BLE.W <label>] 10602: //JBNGT.W <label> |A|012346|-|-***-|-----| |0110_111_100_000_000-{offset} [BLE.W <label>] 10603: //BLE.S <label> |-|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) 10604: //BNGT.S <label> |A|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) [BLE.S <label>] 10605: //JBLE.S <label> |A|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) [BLE.S <label>] 10606: //JBNGT.S <label> |A|012346|-|-***-|-----| |0110_111_100_sss_sss (s is not equal to 0) [BLE.S <label>] 10607: //JBGT.L <label> |A|012346|-|-***-|-----| |0110_111_100_000_110-0100111011111001-{address} [BLE.S (*)+8;JMP <label>] 10608: //JBNLE.L <label> |A|012346|-|-***-|-----| |0110_111_100_000_110-0100111011111001-{address} [BLE.S (*)+8;JMP <label>] 10609: public static void irpBlesw () throws M68kException { 10610: if (XEiJ.MPU_CC_LE << XEiJ.regCCR < 0) { //Bccでジャンプ 10611: XEiJ.mpuCycleCount += 10; 10612: int t = XEiJ.regPC; //pc0+2 10613: int s = (byte) XEiJ.regOC; //オフセット 10614: if (s == 0) { //Bcc.Wでジャンプ 10615: XEiJ.regPC = t + 2; 10616: s = XEiJ.busRwse (t); //pcws 10617: } else { //Bcc.Sでジャンプ 10618: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10619: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10620: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10621: //! 軽量化。リードを省略する 10622: } else { 10623: XEiJ.busRwse (t); //pcws 10624: } 10625: } 10626: irpSetPC (t + s); //pc0+2+オフセット 10627: } else if (XEiJ.regOC == 0x6f00) { //Bcc.Wで通過 10628: XEiJ.mpuCycleCount += 12; 10629: if (XEiJ.MPU_OMIT_OFFSET_READ) { 10630: //リードを省略する 10631: } else { 10632: XEiJ.busRws (XEiJ.regPC); 10633: } 10634: XEiJ.regPC += 2; 10635: } else { //Bcc.Sで通過 10636: XEiJ.mpuCycleCount += 8; 10637: } 10638: } //irpBlesw 10639: 10640: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10641: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10642: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10643: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10644: //BLE.S <label> |-|012346|-|-***-|-----| |0110_111_101_sss_sss 10645: //BNGT.S <label> |A|012346|-|-***-|-----| |0110_111_101_sss_sss [BLE.S <label>] 10646: //JBLE.S <label> |A|012346|-|-***-|-----| |0110_111_101_sss_sss [BLE.S <label>] 10647: //JBNGT.S <label> |A|012346|-|-***-|-----| |0110_111_101_sss_sss [BLE.S <label>] 10648: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10649: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10650: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10651: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10652: //BLE.S <label> |-|012346|-|-***-|-----| |0110_111_110_sss_sss 10653: //BNGT.S <label> |A|012346|-|-***-|-----| |0110_111_110_sss_sss [BLE.S <label>] 10654: //JBLE.S <label> |A|012346|-|-***-|-----| |0110_111_110_sss_sss [BLE.S <label>] 10655: //JBNGT.S <label> |A|012346|-|-***-|-----| |0110_111_110_sss_sss [BLE.S <label>] 10656: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10657: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10658: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10659: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10660: //BLE.S <label> |-|01----|-|-***-|-----| |0110_111_111_sss_sss 10661: //BNGT.S <label> |A|01----|-|-***-|-----| |0110_111_111_sss_sss [BLE.S <label>] 10662: //JBLE.S <label> |A|01----|-|-***-|-----| |0110_111_111_sss_sss [BLE.S <label>] 10663: //JBNGT.S <label> |A|01----|-|-***-|-----| |0110_111_111_sss_sss [BLE.S <label>] 10664: public static void irpBles () throws M68kException { 10665: if (XEiJ.MPU_CC_LE << XEiJ.regCCR < 0) { //Bccでジャンプ 10666: XEiJ.mpuCycleCount += 10; 10667: int t = XEiJ.regPC; //pc0+2 10668: int s = (byte) XEiJ.regOC; //オフセット 10669: //MC68000のBRA.S/BSR.S/Bcc.Sは分岐するとき分岐しない方の直後のワードをリードする 10670: // 2MB搭載機で$1FFFFEに無限ループ$60FE(BRA.S (*))を書いて飛び込むと$200000でバスエラーが出る 10671: if (XEiJ.MPU_OMIT_EXTRA_READ) { 10672: //! 軽量化。リードを省略する 10673: } else { 10674: XEiJ.busRwse (t); //pcws 10675: } 10676: irpSetPC (t + s); //pc0+2+オフセット 10677: } else { //Bcc.Sで通過 10678: XEiJ.mpuCycleCount += 8; 10679: } 10680: } //irpBles 10681: 10682: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10683: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10684: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10685: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10686: //IOCS <name> |A|012346|-|UUUUU|UUUUU| |0111_000_0dd_ddd_ddd-0100111001001111 [MOVEQ.L #<data>,D0;TRAP #15] 10687: //MOVEQ.L #<data>,Dq |-|012346|-|-UUUU|-**00| |0111_qqq_0dd_ddd_ddd 10688: public static void irpMoveq () throws M68kException { 10689: XEiJ.mpuCycleCount += 4; 10690: int z; 10691: XEiJ.regRn[XEiJ.regOC >> 9 & 7] = z = (byte) XEiJ.regOC; 10692: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 10693: } //irpMoveq 10694: 10695: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10696: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10697: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10698: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10699: //MVS.B <ea>,Dq |-|------|-|-UUUU|-**00|D M+-WXZPI|0111_qqq_100_mmm_rrr (ISA_B) 10700: // 10701: //MVS.B <ea>,Dq 10702: // バイトデータをロングに符号拡張してDqの全体を更新する 10703: public static void irpMvsByte () throws M68kException { 10704: XEiJ.mpuCycleCount += 4; 10705: int ea = XEiJ.regOC & 63; 10706: int z; 10707: XEiJ.regRn[XEiJ.regOC >> 9 & 7] = z = ea < XEiJ.EA_AR ? (byte) XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); 10708: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 10709: } //irpMvsByte 10710: 10711: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10712: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10713: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10714: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10715: //MVS.W <ea>,Dq |-|------|-|-UUUU|-**00|D M+-WXZPI|0111_qqq_101_mmm_rrr (ISA_B) 10716: // 10717: //MVS.W <ea>,Dq 10718: // ワードデータをロングに符号拡張してDqの全体を更新する 10719: public static void irpMvsWord () throws M68kException { 10720: XEiJ.mpuCycleCount += 4; 10721: int ea = XEiJ.regOC & 63; 10722: int z; 10723: XEiJ.regRn[XEiJ.regOC >> 9 & 7] = z = ea < XEiJ.EA_AR ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); 10724: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 10725: } //irpMvsWord 10726: 10727: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10728: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10729: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10730: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10731: //MVZ.B <ea>,Dq |-|------|-|-UUUU|-0*00|D M+-WXZPI|0111_qqq_110_mmm_rrr (ISA_B) 10732: // 10733: //MVZ.B <ea>,Dq 10734: // バイトデータをロングにゼロ拡張してDqの全体を更新する 10735: public static void irpMvzByte () throws M68kException { 10736: XEiJ.mpuCycleCount += 4; 10737: int ea = XEiJ.regOC & 63; 10738: int z; 10739: XEiJ.regRn[XEiJ.regOC >> 9 & 7] = z = ea < XEiJ.EA_AR ? 0xff & XEiJ.regRn[ea] : XEiJ.busRbz (efaAnyByte (ea)); 10740: XEiJ.regCCR = XEiJ.REG_CCR_X & XEiJ.regCCR | (z == 0 ? XEiJ.REG_CCR_Z : 0); 10741: } //irpMvzByte 10742: 10743: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10744: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10745: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10746: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10747: //MVZ.W <ea>,Dq |-|------|-|-UUUU|-0*00|D M+-WXZPI|0111_qqq_111_mmm_rrr (ISA_B) 10748: // 10749: //MVZ.W <ea>,Dq 10750: // ワードデータをロングにゼロ拡張してDqの全体を更新する 10751: public static void irpMvzWord () throws M68kException { 10752: XEiJ.mpuCycleCount += 4; 10753: int ea = XEiJ.regOC & 63; 10754: int z; 10755: XEiJ.regRn[XEiJ.regOC >> 9 & 7] = z = ea < XEiJ.EA_AR ? (char) XEiJ.regRn[ea] : XEiJ.busRwz (efaAnyWord (ea)); 10756: XEiJ.regCCR = XEiJ.REG_CCR_X & XEiJ.regCCR | (z == 0 ? XEiJ.REG_CCR_Z : 0); 10757: } //irpMvzWord 10758: 10759: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10760: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10761: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10762: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10763: //OR.B <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1000_qqq_000_mmm_rrr 10764: public static void irpOrToRegByte () throws M68kException { 10765: XEiJ.mpuCycleCount += 4; 10766: int ea = XEiJ.regOC & 63; 10767: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & (XEiJ.regRn[XEiJ.regOC >> 9 & 7] |= 255 & (ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea))))]; //ccr_tst_byte。0拡張してからOR 10768: } //irpOrToRegByte 10769: 10770: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10771: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10772: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10773: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10774: //OR.W <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1000_qqq_001_mmm_rrr 10775: public static void irpOrToRegWord () throws M68kException { 10776: XEiJ.mpuCycleCount += 4; 10777: int ea = XEiJ.regOC & 63; 10778: int z = (short) (XEiJ.regRn[XEiJ.regOC >> 9 & 7] |= ea < XEiJ.EA_AR ? (char) XEiJ.regRn[ea] : XEiJ.busRwz (efaAnyWord (ea))); //0拡張してからOR 10779: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 10780: } //irpOrToRegWord 10781: 10782: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10783: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10784: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10785: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10786: //OR.L <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1000_qqq_010_mmm_rrr 10787: public static void irpOrToRegLong () throws M68kException { 10788: int ea = XEiJ.regOC & 63; 10789: int qqq = XEiJ.regOC >> 9 & 7; 10790: int z; 10791: if (ea < XEiJ.EA_AR) { //OR.L Dr,Dq 10792: XEiJ.mpuCycleCount += 8; 10793: XEiJ.regRn[qqq] = z = XEiJ.regRn[qqq] | XEiJ.regRn[ea]; 10794: } else { //OR.L <mem>,Dq 10795: XEiJ.mpuCycleCount += ea == XEiJ.EA_IM ? 8 : 6; //ソースが#<data>のとき2増やす 10796: XEiJ.regRn[qqq] = z = XEiJ.regRn[qqq] | XEiJ.busRls (efaAnyLong (ea)); 10797: } 10798: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 10799: } //irpOrToRegLong 10800: 10801: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10802: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10803: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10804: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10805: //DIVU.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1000_qqq_011_mmm_rrr 10806: // 10807: //DIVU.W <ea>,Dq 10808: // M68000PRMでDIVU.Wのオーバーフローの条件が16bit符号あり整数と書かれているのは16bit符号なし整数の間違い 10809: public static void irpDivuWord () throws M68kException { 10810: // X 変化しない 10811: // N ゼロ除算またはオーバーフローのとき不定。商が負のときセット。それ以外はクリア 10812: // Z ゼロ除算またはオーバーフローのとき不定。商が0のときセット。それ以外はクリア 10813: // V ゼロ除算のとき不定。オーバーフローのときセット。それ以外はクリア 10814: // C 常にクリア 10815: int ea = XEiJ.regOC & 63; 10816: int qqq = XEiJ.regOC >> 9 & 7; 10817: int y = ea < XEiJ.EA_AR ? (char) XEiJ.regRn[ea] : XEiJ.busRwz (efaAnyWord (ea)); //除数 10818: int x = XEiJ.regRn[qqq]; //被除数 10819: XEiJ.mpuCycleCount += irpDivuCyclesModified (x, y); 10820: if (y == 0) { //ゼロ除算 10821: //Dqは変化しない 10822: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 10823: (x < 0 ? XEiJ.REG_CCR_N : 0) | //Nは被除数が負のときセット、さもなくばクリア 10824: (x >> 16 == 0 ? XEiJ.REG_CCR_Z : 0) | //Zは被除数が$0000xxxxのときセット、さもなくばクリア 10825: XEiJ.REG_CCR_V //Vは常にセット 10826: ); //Cは常にクリア 10827: M68kException.m6eNumber = M68kException.M6E_DIVIDE_BY_ZERO; 10828: throw M68kException.m6eSignal; 10829: } 10830: //無理にintで符号なし除算をやろうとするよりもdoubleにキャストしてから割ったほうが速い 10831: // intの除算をdoubleの除算器で行うプロセッサならばなおさら 10832: //被除数を符号なし32ビットとみなすためlongを経由してdoubleに変換する 10833: //doubleからlongやintへのキャストは小数点以下が切り捨てられ、オーバーフローは表現できる絶対値最大の値になる 10834: //doubleから直接intに戻しているので0xffffffff/0x0001=0xffffffffが絶対値最大の0x7fffffffになってしまうが、 10835: //DIVU.Wではオーバーフローになることに変わりはないのでよいことにする 10836: // 符号なし32ビットの0xffffffffにしたいときは戻すときもlongを経由すればよい 10837: int z = (int) ((double) ((long) x & 0xffffffffL) / (double) y); //商 10838: if (z >>> 16 != 0) { //オーバーフローあり 10839: //Dqは変化しない 10840: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 10841: (x < 0 ? XEiJ.REG_CCR_N : 0) | //Nは被除数が負のときセット、さもなくばクリア 10842: //Zは常にクリア 10843: XEiJ.REG_CCR_V //Vは常にセット 10844: ); //Cは常にクリア 10845: } else { //オーバーフローなし 10846: XEiJ.regRn[qqq] = x - y * z << 16 | z; //余り<<16|商 10847: z = (short) z; 10848: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 10849: (z < 0 ? XEiJ.REG_CCR_N : 0) | //Nは商が負のときセット、さもなくばクリア 10850: (z == 0 ? XEiJ.REG_CCR_Z : 0) //Zは商が0のときセット、さもなくばクリア 10851: //Vは常にクリア 10852: ); //Cは常にクリア 10853: } //if オーバーフローあり/オーバーフローなし 10854: } //irpDivuWord 10855: 10856: //DIVUの実行時間 10857: // 以下に実効アドレスの時間を加える 10858: // ゼロ除算のとき38 10859: // オーバーフローのとき10 10860: // 正常終了のとき76+ 10861: // 商のビット15~1について 10862: // 被除数のビット16が1で商が1のとき0 10863: // 被除数のビット16が0で商が1のとき2 10864: // 被除数のビット16が0で商が0のとき4 10865: // 補足 10866: // 商のビット0を計算に含めると最大140になりマニュアルと一致する 10867: // 参考 10868: // https://www.atari-forum.com/viewtopic.php?t=6484 10869: public static int irpDivuCyclesModified (int x, int y) { 10870: y &= 0xffff; //ゼロ拡張 10871: if (y == 0) { //ゼロ除算 10872: return 38; 10873: } 10874: int r = x >>> 16; //余り。符号なし右シフト 10875: if (y <= r) { //オーバーフロー 10876: return 10; 10877: } 10878: int c = 76; 10879: for (int i = 15; 0 < i; i--) { //ビット0を含まない 10880: r = r << 1 | ((x >> i) & 1); 10881: if (0x10000 <= r) { //被除数のビット16が1で商が1 10882: r -= y; 10883: } else if (y <= r) { //被除数のビット16が0で商が1 10884: r -= y; 10885: c += 2; 10886: } else { //被除数のビット16が0で商が0 10887: c += 4; 10888: } 10889: } 10890: return c; 10891: } 10892: 10893: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10894: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10895: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10896: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10897: //SBCD.B Dr,Dq |-|012346|-|UUUUU|*U*U*| |1000_qqq_100_000_rrr 10898: //SBCD.B -(Ar),-(Aq) |-|012346|-|UUUUU|*U*U*| |1000_qqq_100_001_rrr 10899: //OR.B Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1000_qqq_100_mmm_rrr 10900: public static void irpOrToMemByte () throws M68kException { 10901: int ea = XEiJ.regOC & 63; 10902: if (ea >= XEiJ.EA_MM) { //OR.B Dq,<ea> 10903: XEiJ.mpuCycleCount += 8; 10904: int a = efaMltByte (ea); 10905: int z = XEiJ.regRn[XEiJ.regOC >> 9 & 7] | XEiJ.busRbs (a); 10906: XEiJ.busWb (a, z); 10907: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 10908: } else if (ea < XEiJ.EA_AR) { //SBCD.B Dr,Dq 10909: int qqq = XEiJ.regOC >> 9 & 7; 10910: XEiJ.mpuCycleCount += 6; 10911: int x; 10912: XEiJ.regRn[qqq] = ~0xff & (x = XEiJ.regRn[qqq]) | irpSbcd (x, XEiJ.regRn[ea]); 10913: } else { //SBCD.B -(Ar),-(Aq) 10914: XEiJ.mpuCycleCount += 18; 10915: int y = XEiJ.busRbz (--XEiJ.regRn[ea]); //このr[ea]はアドレスレジスタ 10916: int a = --XEiJ.regRn[(XEiJ.regOC >> 9) - (64 - 8)]; 10917: XEiJ.busWb (a, irpSbcd (XEiJ.busRbz (a), y)); 10918: } 10919: } //irpOrToMemByte 10920: 10921: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10922: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10923: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10924: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10925: //OR.W Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1000_qqq_101_mmm_rrr 10926: public static void irpOrToMemWord () throws M68kException { 10927: XEiJ.mpuCycleCount += 8; 10928: int ea = XEiJ.regOC & 63; 10929: int a = efaMltWord (ea); 10930: int z = XEiJ.regRn[XEiJ.regOC >> 9 & 7] | XEiJ.busRws (a); 10931: XEiJ.busWw (a, z); 10932: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 10933: } //irpOrToMemWord 10934: 10935: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10936: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10937: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10938: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10939: //OR.L Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1000_qqq_110_mmm_rrr 10940: public static void irpOrToMemLong () throws M68kException { 10941: XEiJ.mpuCycleCount += 12; 10942: int ea = XEiJ.regOC & 63; 10943: int a = efaMltLong (ea); 10944: int z; 10945: XEiJ.busWl (a, z = XEiJ.regRn[XEiJ.regOC >> 9 & 7] | XEiJ.busRls (a)); 10946: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 10947: } //irpOrToMemLong 10948: 10949: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10950: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 10951: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 10952: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 10953: //DIVS.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1000_qqq_111_mmm_rrr 10954: // 10955: //DIVS.W <ea>,Dq 10956: // DIVSの余りの符号は被除数と一致 10957: // M68000PRMでDIVS.Wのアドレッシングモードがデータ可変と書かれているのはデータの間違い 10958: public static void irpDivsWord () throws M68kException { 10959: // X 変化しない 10960: // N ゼロ除算またはオーバーフローのとき不定。商が負のときセット。それ以外はクリア 10961: // Z ゼロ除算またはオーバーフローのとき不定。商が0のときセット。それ以外はクリア 10962: // V ゼロ除算のとき不定。オーバーフローのときセット。それ以外はクリア 10963: // C 常にクリア 10964: //divsの余りの符号は被除数と一致 10965: //Javaの除算演算子の挙動 10966: // 10 / 3 == 3 10 % 3 == 1 10 = 3 * 3 + 1 10967: // 10 / -3 == -3 10 % -3 == 1 10 = -3 * -3 + 1 10968: // -10 / 3 == -3 -10 % 3 == -1 -10 = 3 * -3 + -1 10969: // -10 / -3 == 3 -10 % -3 == -1 -10 = -3 * 3 + -1 10970: int ea = XEiJ.regOC & 63; 10971: int qqq = XEiJ.regOC >> 9 & 7; 10972: int y = ea < XEiJ.EA_AR ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //除数 10973: int x = XEiJ.regRn[qqq]; //被除数 10974: XEiJ.mpuCycleCount += irpDivsCycles (x, y); 10975: if (y == 0) { //ゼロ除算 10976: //Dqは変化しない 10977: //!!! MC68030はゼロ除算のときオペランド以外の要因でZとVが変化する。その要因がわからないとZとVを正確に再現することができない 10978: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 10979: //Nは常にクリア 10980: XEiJ.REG_CCR_Z | //Zは常にセット 10981: (x == 0x00008000 ? ~XEiJ.regCCR & XEiJ.REG_CCR_V : (0 <= x && x != 0x7fffffff) || x == 0x80000000 ? XEiJ.REG_CCR_V : XEiJ.regCCR & XEiJ.REG_CCR_V) //Vは被除数が$00008000のとき反転、被除数が$7fffffffを除く正または$80000000のときセット、さもなくば変化しない 10982: ); //Cは常にクリア 10983: M68kException.m6eNumber = M68kException.M6E_DIVIDE_BY_ZERO; 10984: throw M68kException.m6eSignal; 10985: } 10986: int z = x / y; //商 10987: if ((short) z != z) { //オーバーフローあり 10988: //Dqは変化しない 10989: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 10990: (x == 0x80000000 || (z & 0xffff0080) == 0x00000080 || (z & 0xffff0080) == 0xffff0080 ? XEiJ.REG_CCR_N : 0) | //Nは被除数が$80000000または商が$0000xxyyまたは$ffffxxyyでyyが負のときセット、さもなくばクリア 10991: (z == 0x00008000 || (((z & 0xffff00ff) == 0x00000000 || (z & 0xffff00ff) == 0xffff0000) && (z & 0x0000ff00) != 0) ? XEiJ.REG_CCR_Z : 0) | //Zは商が$00008000または商が$0000xxyyまたは$ffffxxyyでxxが0でなくてyyが0のときセット、さもなくばクリア 10992: XEiJ.REG_CCR_V //Vは常にセット 10993: ); //Cは常にクリア 10994: } else { //オーバーフローなし 10995: XEiJ.regRn[qqq] = x - y * z << 16 | (char) z; //Dqは余り<<16|商&$ffff 10996: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 10997: (z < 0 ? XEiJ.REG_CCR_N : 0) | //Nは商が負のときセット、さもなくばクリア 10998: (z == 0 ? XEiJ.REG_CCR_Z : 0) //Zは商が0のときセット、さもなくばクリア 10999: //Vは常にクリア 11000: ); //Cは常にクリア 11001: } //if オーバーフローあり/オーバーフローなし 11002: } //irpDivsWord 11003: 11004: //DIVSの実行時間 11005: // 以下に実効アドレスの時間を加える 11006: // ゼロ除算のとき38 11007: // 符号なしオーバーフローのとき 11008: // 被除数が正のとき16 11009: // 被除数が負のとき18 11010: // 正常終了または符号ありオーバーフローのとき 11011: // 被除数が正で除数が正のとき120+ 11012: // 被除数が正で除数が負のとき122+ 11013: // 被除数が負で除数が正のとき126+ 11014: // 被除数が負で除数が負のとき124+ 11015: // 符号なし商のビット15~1について 11016: // 符号なし商が1のとき0 11017: // 符号なし商が0のとき2 11018: // 補足 11019: // 符号なし商のビット0を計算に含めると最大158になりマニュアルと一致する 11020: // 参考 11021: // https://www.atari-forum.com/viewtopic.php?t=6484 11022: public static int irpDivsCycles (int x, int y) { 11023: y = (short) y; //符号拡張 11024: if (y == 0) { //ゼロ除算 11025: return 38; 11026: } 11027: //符号あり除算だと0x80000000/0xffffffffが0x00000000になる環境があるので 11028: //符号なし除算を用いる。JavaはInteger.divideUnsigned 11029: //符号なし商に0x80000000が含まれることに注意 11030: int q = Integer.divideUnsigned ((x < 0 ? -x : x), (y < 0 ? -y : y)); 11031: if ((q & 0xffff0000) != 0) { //符号なしオーバーフロー。0xffff<qは不可 11032: return x < 0 ? 18 : 16; 11033: } 11034: int t = ~q; 11035: t = (t & 0x5554) + ((t >> 1) & 0x5555); //0x5554に注意。ビット0を含まない 11036: t = (t & 0x3333) + ((t >> 2) & 0x3333); 11037: t = (t & 0x0F0F) + ((t >> 4) & 0x0F0F); 11038: t = (t & 0x00FF) + ((t >> 8) & 0x00FF); 11039: return (x < 0 ? y < 0 ? 124 : 126 : y < 0 ? 122 : 120) + (t << 1); 11040: } 11041: 11042: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11043: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11044: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11045: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11046: //SUB.B <ea>,Dq |-|012346|-|UUUUU|*****|D M+-WXZPI|1001_qqq_000_mmm_rrr 11047: public static void irpSubToRegByte () throws M68kException { 11048: XEiJ.mpuCycleCount += 4; 11049: int ea = XEiJ.regOC & 63; 11050: int qqq = XEiJ.regOC >> 9 & 7; 11051: int x, y, z; 11052: y = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); 11053: x = XEiJ.regRn[qqq]; 11054: z = x - y; 11055: XEiJ.regRn[qqq] = ~255 & x | 255 & z; 11056: XEiJ.regCCR = (XEiJ.MPU_TSTB_TABLE[255 & z] | 11057: ((x ^ y) & (x ^ z)) >> 6 & XEiJ.REG_CCR_V | 11058: (byte) (x & (y ^ z) ^ (y | z)) >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub_byte 11059: } //irpSubToRegByte 11060: 11061: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11062: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11063: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11064: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11065: //SUB.W <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1001_qqq_001_mmm_rrr 11066: public static void irpSubToRegWord () throws M68kException { 11067: XEiJ.mpuCycleCount += 4; 11068: int ea = XEiJ.regOC & 63; 11069: int qqq = XEiJ.regOC >> 9 & 7; 11070: int x, y, z; 11071: y = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 11072: x = XEiJ.regRn[qqq]; 11073: z = x - y; 11074: XEiJ.regRn[qqq] = ~65535 & x | (char) z; 11075: XEiJ.regCCR = (z >> 12 & XEiJ.REG_CCR_N | (char) z - 1 >> 14 & XEiJ.REG_CCR_Z | 11076: ((x ^ y) & (x ^ z)) >> 14 & XEiJ.REG_CCR_V | 11077: (short) (x & (y ^ z) ^ (y | z)) >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub_word 11078: } //irpSubToRegWord 11079: 11080: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11081: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11082: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11083: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11084: //SUB.L <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1001_qqq_010_mmm_rrr 11085: public static void irpSubToRegLong () throws M68kException { 11086: int ea = XEiJ.regOC & 63; 11087: int qqq = XEiJ.regOC >> 9 & 7; 11088: XEiJ.mpuCycleCount += ea < XEiJ.EA_MM || ea == XEiJ.EA_IM ? 8 : 6; //ソースが#<data>のとき2増やす 11089: int x, y, z; 11090: y = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 11091: x = XEiJ.regRn[qqq]; 11092: z = x - y; 11093: XEiJ.regRn[qqq] = z; 11094: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 11095: ((x ^ y) & (x ^ z)) >> 30 & XEiJ.REG_CCR_V | 11096: (x & (y ^ z) ^ (y | z)) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub 11097: } //irpSubToRegLong 11098: 11099: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11100: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11101: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11102: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11103: //SUBA.W <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_011_mmm_rrr 11104: //SUB.W <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_011_mmm_rrr [SUBA.W <ea>,Aq] 11105: //CLR.W Ar |A|012346|-|-----|-----| A |1001_rrr_011_001_rrr [SUBA.W Ar,Ar] 11106: // 11107: //SUBA.W <ea>,Aq 11108: // ソースを符号拡張してロングで減算する 11109: public static void irpSubaWord () throws M68kException { 11110: XEiJ.mpuCycleCount += 8; 11111: int ea = XEiJ.regOC & 63; 11112: int z = ea < XEiJ.EA_MM ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 11113: XEiJ.regRn[XEiJ.regOC >> 9 & 15] -= z; //r[op >> 9 & 15] -= ea < XEiJ.EA_MM ? (short) r[ea] : rws (efaAnyWord (ea));は不可 11114: //ccrは変化しない 11115: } //irpSubaWord 11116: 11117: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11118: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11119: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11120: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11121: //SUBX.B Dr,Dq |-|012346|-|*UUUU|*****| |1001_qqq_100_000_rrr 11122: //SUBX.B -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1001_qqq_100_001_rrr 11123: //SUB.B Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1001_qqq_100_mmm_rrr 11124: public static void irpSubToMemByte () throws M68kException { 11125: int ea = XEiJ.regOC & 63; 11126: int a, x, y, z; 11127: if (ea < XEiJ.EA_MM) { 11128: if (ea < XEiJ.EA_AR) { //SUBX.B Dr,Dq 11129: int qqq = XEiJ.regOC >> 9 & 7; 11130: XEiJ.mpuCycleCount += 4; 11131: y = XEiJ.regRn[ea]; 11132: x = XEiJ.regRn[qqq]; 11133: z = x - y - (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11134: XEiJ.regRn[qqq] = ~255 & x | 255 & z; 11135: } else { //SUBX.B -(Ar),-(Aq) 11136: XEiJ.mpuCycleCount += 18; 11137: y = XEiJ.busRbs (--XEiJ.regRn[ea]); //このr[ea]はアドレスレジスタ 11138: a = --XEiJ.regRn[XEiJ.regOC >> 9 & 15]; //1qqq=aqq 11139: x = XEiJ.busRbs (a); 11140: z = x - y - (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11141: XEiJ.busWb (a, z); 11142: } 11143: XEiJ.regCCR = (z >> 4 & XEiJ.REG_CCR_N | (255 & z) - 1 >> 6 & XEiJ.regCCR & XEiJ.REG_CCR_Z | //SUBXはZをクリアすることはあるがセットすることはない 11144: ((x ^ y) & (x ^ z)) >> 6 & XEiJ.REG_CCR_V | 11145: (byte) (x & (y ^ z) ^ (y | z)) >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_subx_byte 11146: } else { //SUB.B Dq,<ea> 11147: XEiJ.mpuCycleCount += 8; 11148: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7]; 11149: a = efaMltByte (ea); 11150: x = XEiJ.busRbs (a); 11151: z = x - y; 11152: XEiJ.busWb (a, z); 11153: XEiJ.regCCR = (XEiJ.MPU_TSTB_TABLE[255 & z] | 11154: ((x ^ y) & (x ^ z)) >> 6 & XEiJ.REG_CCR_V | 11155: (byte) (x & (y ^ z) ^ (y | z)) >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub_byte 11156: } 11157: } //irpSubToMemByte 11158: 11159: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11160: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11161: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11162: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11163: //SUBX.W Dr,Dq |-|012346|-|*UUUU|*****| |1001_qqq_101_000_rrr 11164: //SUBX.W -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1001_qqq_101_001_rrr 11165: //SUB.W Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1001_qqq_101_mmm_rrr 11166: public static void irpSubToMemWord () throws M68kException { 11167: int ea = XEiJ.regOC & 63; 11168: int a, x, y, z; 11169: if (ea < XEiJ.EA_MM) { 11170: if (ea < XEiJ.EA_AR) { //SUBX.W Dr,Dq 11171: int qqq = XEiJ.regOC >> 9 & 7; 11172: XEiJ.mpuCycleCount += 4; 11173: y = XEiJ.regRn[ea]; 11174: x = XEiJ.regRn[qqq]; 11175: z = x - y - (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11176: XEiJ.regRn[qqq] = ~65535 & x | (char) z; 11177: } else { //SUBX.W -(Ar),-(Aq) 11178: XEiJ.mpuCycleCount += 18; 11179: y = XEiJ.busRws (XEiJ.regRn[ea] -= 2); //このr[ea]はアドレスレジスタ 11180: a = XEiJ.regRn[XEiJ.regOC >> 9 & 15] -= 2; 11181: x = XEiJ.busRws (a); 11182: z = x - y - (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11183: XEiJ.busWw (a, z); 11184: } 11185: XEiJ.regCCR = (z >> 12 & XEiJ.REG_CCR_N | (char) z - 1 >> 14 & XEiJ.regCCR & XEiJ.REG_CCR_Z | //ADDXはZをクリアすることはあるがセットすることはない 11186: ((x ^ y) & (x ^ z)) >> 14 & XEiJ.REG_CCR_V | 11187: (short) (x & (y ^ z) ^ (y | z)) >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_subx_word 11188: } else { //SUB.W Dq,<ea> 11189: XEiJ.mpuCycleCount += 8; 11190: y = (short) XEiJ.regRn[XEiJ.regOC >> 9 & 7]; 11191: a = efaMltWord (ea); 11192: x = XEiJ.busRws (a); 11193: z = x - y; 11194: XEiJ.busWw (a, z); 11195: XEiJ.regCCR = (z >> 12 & XEiJ.REG_CCR_N | (char) z - 1 >> 14 & XEiJ.REG_CCR_Z | 11196: ((x ^ y) & (x ^ z)) >> 14 & XEiJ.REG_CCR_V | 11197: (short) (x & (y ^ z) ^ (y | z)) >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub_word 11198: } 11199: } //irpSubToMemWord 11200: 11201: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11202: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11203: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11204: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11205: //SUBX.L Dr,Dq |-|012346|-|*UUUU|*****| |1001_qqq_110_000_rrr 11206: //SUBX.L -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1001_qqq_110_001_rrr 11207: //SUB.L Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1001_qqq_110_mmm_rrr 11208: public static void irpSubToMemLong () throws M68kException { 11209: int ea = XEiJ.regOC & 63; 11210: if (ea < XEiJ.EA_MM) { 11211: int x; 11212: int y; 11213: int z; 11214: if (ea < XEiJ.EA_AR) { //SUBX.L Dr,Dq 11215: int qqq = XEiJ.regOC >> 9 & 7; 11216: XEiJ.mpuCycleCount += 8; 11217: XEiJ.regRn[qqq] = z = (x = XEiJ.regRn[qqq]) - (y = XEiJ.regRn[ea]) - (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11218: } else { //SUBX.L -(Ar),-(Aq) 11219: XEiJ.mpuCycleCount += 30; 11220: y = XEiJ.busRls (XEiJ.regRn[ea] -= 4); //このr[ea]はアドレスレジスタ 11221: int a = XEiJ.regRn[XEiJ.regOC >> 9 & 15] -= 4; 11222: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) - y - (XEiJ.regCCR >> 4)); //Xの左側はすべて0なのでCCR_X&を省略 11223: } 11224: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_Z : 0) | 11225: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11226: (x & (y ^ z) ^ (y | z)) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_subx 11227: } else { //SUB.L Dq,<ea> 11228: XEiJ.mpuCycleCount += 12; 11229: int a = efaMltLong (ea); 11230: int x; 11231: int y; 11232: int z; 11233: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) - (y = XEiJ.regRn[XEiJ.regOC >> 9 & 7])); 11234: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 11235: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11236: (x & (y ^ z) ^ (y | z)) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_sub 11237: } 11238: } //irpSubToMemLong 11239: 11240: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11241: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11242: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11243: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11244: //SUBA.L <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_111_mmm_rrr 11245: //SUB.L <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1001_qqq_111_mmm_rrr [SUBA.L <ea>,Aq] 11246: //CLR.L Ar |A|012346|-|-----|-----| A |1001_rrr_111_001_rrr [SUBA.L Ar,Ar] 11247: public static void irpSubaLong () throws M68kException { 11248: int ea = XEiJ.regOC & 63; 11249: XEiJ.mpuCycleCount += ea < XEiJ.EA_MM || ea == XEiJ.EA_IM ? 8 : 6; //Dr/Ar/#<data>のとき8+、それ以外は6+ 11250: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 11251: XEiJ.regRn[XEiJ.regOC >> 9 & 15] -= z; //r[op >> 9 & 15] -= ea < XEiJ.EA_MM ? r[ea] : rls (efaAnyLong (ea));は不可 11252: //ccrは変化しない 11253: } //irpSubaLong 11254: 11255: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11256: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11257: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11258: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11259: //SXCALL <name> |A|012346|-|UUUUU|*****| |1010_0dd_ddd_ddd_ddd [ALINE #<data>] 11260: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11261: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11262: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11263: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11264: //ALINE #<data> |-|012346|-|UUUUU|*****| |1010_ddd_ddd_ddd_ddd (line 1010 emulator) 11265: public static void irpAline () throws M68kException { 11266: XEiJ.mpuCycleCount += 34; 11267: if (XEiJ.MPU_INLINE_EXCEPTION) { 11268: int save_sr = XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR; 11269: int sp = XEiJ.regRn[15]; 11270: XEiJ.regSRT1 = XEiJ.mpuTraceFlag = 0; //srのTビットを消す 11271: if (XEiJ.regSRS == 0) { //ユーザモードのとき 11272: XEiJ.regSRS = XEiJ.REG_SR_S; //スーパーバイザモードへ移行する 11273: XEiJ.mpuUSP = sp; //USPを保存 11274: sp = XEiJ.mpuISP; //SSPを復元 11275: if (DataBreakPoint.DBP_ON) { 11276: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpSuperMap; //スーパーバイザメモリマップに切り替える 11277: } else { 11278: XEiJ.busMemoryMap = XEiJ.busSuperMap; //スーパーバイザメモリマップに切り替える 11279: } 11280: if (InstructionBreakPoint.IBP_ON) { 11281: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1SuperMap; 11282: } 11283: } 11284: int vectorOffset = M68kException.M6E_LINE_1010_EMULATOR << 2; //vector offset 11285: XEiJ.regRn[15] = sp -= 8; //short format 11286: XEiJ.busWw (sp + 6, 0x0000 | vectorOffset); //format and vector offset 11287: XEiJ.busWl (sp + 2, XEiJ.regPC0); //program counter 11288: XEiJ.busWw (sp, save_sr); //status register 11289: irpSetPC (XEiJ.busRlsf (XEiJ.mpuVBR + vectorOffset)); //例外ベクタを取り出してジャンプする 11290: } else { 11291: irpException (M68kException.M6E_LINE_1010_EMULATOR, XEiJ.regPC0, XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR); //pcは命令の先頭 11292: } 11293: } //irpAline 11294: 11295: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11296: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11297: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11298: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11299: //CMP.B <ea>,Dq |-|012346|-|-UUUU|-****|D M+-WXZPI|1011_qqq_000_mmm_rrr 11300: public static void irpCmpByte () throws M68kException { 11301: XEiJ.mpuCycleCount += 4; 11302: int ea = XEiJ.regOC & 63; 11303: int x; 11304: int y; 11305: int z = (byte) ((x = (byte) XEiJ.regRn[XEiJ.regOC >> 9 & 7]) - (y = ea < XEiJ.EA_AR ? (byte) XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)))); 11306: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11307: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11308: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11309: } //irpCmpByte 11310: 11311: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11312: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11313: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11314: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11315: //CMP.W <ea>,Dq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_001_mmm_rrr 11316: public static void irpCmpWord () throws M68kException { 11317: XEiJ.mpuCycleCount += 4; 11318: int ea = XEiJ.regOC & 63; 11319: int x; 11320: int y; 11321: int z = (short) ((x = (short) XEiJ.regRn[XEiJ.regOC >> 9 & 7]) - (y = ea < XEiJ.EA_MM ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)))); //このr[ea]はデータレジスタまたはアドレスレジスタ 11322: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11323: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11324: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11325: } //irpCmpWord 11326: 11327: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11328: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11329: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11330: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11331: //CMP.L <ea>,Dq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_010_mmm_rrr 11332: public static void irpCmpLong () throws M68kException { 11333: XEiJ.mpuCycleCount += 6; 11334: int ea = XEiJ.regOC & 63; 11335: int x; 11336: int y; 11337: int z = (x = XEiJ.regRn[XEiJ.regOC >> 9 & 7]) - (y = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea))); //このr[ea]はデータレジスタまたはアドレスレジスタ 11338: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11339: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11340: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11341: } //irpCmpLong 11342: 11343: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11344: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11345: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11346: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11347: //CMPA.W <ea>,Aq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_011_mmm_rrr 11348: //CMP.W <ea>,Aq |A|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_011_mmm_rrr [CMPA.W <ea>,Aq] 11349: // 11350: //CMPA.W <ea>,Aq 11351: // ソースを符号拡張してロングで比較する 11352: public static void irpCmpaWord () throws M68kException { 11353: XEiJ.mpuCycleCount += 6; 11354: int ea = XEiJ.regOC & 63; 11355: //ソースを符号拡張してからロングで比較する 11356: int y = ea < XEiJ.EA_MM ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 11357: int x; 11358: int z = (x = XEiJ.regRn[XEiJ.regOC >> 9 & 15]) - y; 11359: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11360: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11361: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11362: } //irpCmpaWord 11363: 11364: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11365: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11366: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11367: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11368: //EOR.B Dq,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |1011_qqq_100_mmm_rrr 11369: //CMPM.B (Ar)+,(Aq)+ |-|012346|-|-UUUU|-****| |1011_qqq_100_001_rrr 11370: public static void irpEorByte () throws M68kException { 11371: int ea = XEiJ.regOC & 63; 11372: if (ea >> 3 == XEiJ.MMM_AR) { //CMPM.B (Ar)+,(Aq)+ 11373: XEiJ.mpuCycleCount += 12; 11374: int y = XEiJ.busRbs (XEiJ.regRn[ea]++); //このr[ea]はアドレスレジスタ 11375: int x; 11376: int z = (byte) ((x = XEiJ.busRbs (XEiJ.regRn[XEiJ.regOC >> 9 & 15]++)) - y); 11377: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11378: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11379: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11380: } else { 11381: int qqq = XEiJ.regOC >> 9 & 7; 11382: int z; 11383: if (ea < XEiJ.EA_AR) { //EOR.B Dq,Dr 11384: XEiJ.mpuCycleCount += 4; 11385: z = XEiJ.regRn[ea] ^= 255 & XEiJ.regRn[qqq]; //0拡張してからEOR 11386: } else { //EOR.B Dq,<mem> 11387: XEiJ.mpuCycleCount += 8; 11388: int a = efaMltByte (ea); 11389: XEiJ.busWb (a, z = XEiJ.regRn[qqq] ^ XEiJ.busRbs (a)); 11390: } 11391: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 11392: } 11393: } //irpEorByte 11394: 11395: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11396: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11397: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11398: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11399: //EOR.W Dq,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |1011_qqq_101_mmm_rrr 11400: //CMPM.W (Ar)+,(Aq)+ |-|012346|-|-UUUU|-****| |1011_qqq_101_001_rrr 11401: public static void irpEorWord () throws M68kException { 11402: int ea = XEiJ.regOC & 63; 11403: int rrr = XEiJ.regOC & 7; 11404: int mmm = ea >> 3; 11405: if (mmm == XEiJ.MMM_AR) { //CMPM.W (Ar)+,(Aq)+ 11406: XEiJ.mpuCycleCount += 12; 11407: int y = XEiJ.busRws ((XEiJ.regRn[ea] += 2) - 2); //このr[ea]はアドレスレジスタ 11408: int x; 11409: int z = (short) ((x = XEiJ.busRws ((XEiJ.regRn[XEiJ.regOC >> 9 & 15] += 2) - 2)) - y); 11410: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11411: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11412: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11413: } else { 11414: int qqq = XEiJ.regOC >> 9 & 7; 11415: int z; 11416: if (ea < XEiJ.EA_AR) { //EOR.W Dq,Dr 11417: XEiJ.mpuCycleCount += 4; 11418: z = XEiJ.regRn[rrr] ^= (char) XEiJ.regRn[qqq]; //0拡張してからEOR 11419: } else { //EOR.W Dq,<mem> 11420: XEiJ.mpuCycleCount += 8; 11421: int a = efaMltWord (ea); 11422: XEiJ.busWw (a, z = XEiJ.regRn[qqq] ^ XEiJ.busRws (a)); 11423: } 11424: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 11425: } 11426: } //irpEorWord 11427: 11428: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11429: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11430: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11431: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11432: //EOR.L Dq,<ea> |-|012346|-|-UUUU|-**00|D M+-WXZ |1011_qqq_110_mmm_rrr 11433: //CMPM.L (Ar)+,(Aq)+ |-|012346|-|-UUUU|-****| |1011_qqq_110_001_rrr 11434: public static void irpEorLong () throws M68kException { 11435: int ea = XEiJ.regOC & 63; 11436: if (ea >> 3 == XEiJ.MMM_AR) { //CMPM.L (Ar)+,(Aq)+ 11437: XEiJ.mpuCycleCount += 20; 11438: int y = XEiJ.busRls ((XEiJ.regRn[ea] += 4) - 4); //このr[ea]はアドレスレジスタ 11439: int x; 11440: int z = (x = XEiJ.busRls ((XEiJ.regRn[XEiJ.regOC >> 9 & 15] += 4) - 4)) - y; 11441: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11442: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11443: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11444: } else { 11445: int qqq = XEiJ.regOC >> 9 & 7; 11446: int z; 11447: if (ea < XEiJ.EA_AR) { //EOR.L Dq,Dr 11448: XEiJ.mpuCycleCount += 8; 11449: XEiJ.regRn[ea] = z = XEiJ.regRn[ea] ^ XEiJ.regRn[qqq]; 11450: } else { //EOR.L Dq,<mem> 11451: XEiJ.mpuCycleCount += 12; 11452: int a = efaMltLong (ea); 11453: XEiJ.busWl (a, z = XEiJ.busRls (a) ^ XEiJ.regRn[qqq]); 11454: } 11455: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 11456: } 11457: } //irpEorLong 11458: 11459: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11460: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11461: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11462: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11463: //CMPA.L <ea>,Aq |-|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_111_mmm_rrr 11464: //CMP.L <ea>,Aq |A|012346|-|-UUUU|-****|DAM+-WXZPI|1011_qqq_111_mmm_rrr [CMPA.L <ea>,Aq] 11465: public static void irpCmpaLong () throws M68kException { 11466: XEiJ.mpuCycleCount += 6; 11467: int ea = XEiJ.regOC & 63; 11468: int y = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 11469: int x; 11470: int z = (x = XEiJ.regRn[XEiJ.regOC >> 9 & 15]) - y; 11471: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | 11472: ((x ^ y) & (x ^ z)) >>> 31 << 1 | 11473: (x & (y ^ z) ^ (y | z)) >>> 31); //ccr_cmp 11474: } //irpCmpaLong 11475: 11476: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11477: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11478: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11479: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11480: //AND.B <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1100_qqq_000_mmm_rrr 11481: public static void irpAndToRegByte () throws M68kException { 11482: XEiJ.mpuCycleCount += 4; 11483: int ea = XEiJ.regOC & 63; 11484: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & (XEiJ.regRn[XEiJ.regOC >> 9 & 7] &= ~255 | (ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea))))]; //ccr_tst_byte。1拡張してからAND 11485: } //irpAndToRegByte 11486: 11487: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11488: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11489: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11490: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11491: //AND.W <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1100_qqq_001_mmm_rrr 11492: public static void irpAndToRegWord () throws M68kException { 11493: XEiJ.mpuCycleCount += 4; 11494: int ea = XEiJ.regOC & 63; 11495: int z = XEiJ.regRn[XEiJ.regOC >> 9 & 7] &= ~65535 | (ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea))); //1拡張してからAND 11496: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 11497: } //irpAndToRegWord 11498: 11499: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11500: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11501: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11502: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11503: //AND.L <ea>,Dq |-|012346|-|-UUUU|-**00|D M+-WXZPI|1100_qqq_010_mmm_rrr 11504: public static void irpAndToRegLong () throws M68kException { 11505: int ea = XEiJ.regOC & 63; 11506: int qqq = XEiJ.regOC >> 9 & 7; 11507: int z; 11508: if (ea < XEiJ.EA_AR) { //AND.L Dr,Dq 11509: XEiJ.mpuCycleCount += 8; 11510: z = XEiJ.regRn[qqq] &= XEiJ.regRn[ea]; 11511: } else { //AND.L <mem>,Dq 11512: XEiJ.mpuCycleCount += ea == XEiJ.EA_IM ? 8 : 6; //ソースが#<data>のとき2増やす 11513: z = XEiJ.regRn[qqq] &= XEiJ.busRls (efaAnyLong (ea)); 11514: } 11515: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 11516: } //irpAndToRegLong 11517: 11518: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11519: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11520: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11521: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11522: //MULU.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1100_qqq_011_mmm_rrr 11523: public static void irpMuluWord () throws M68kException { 11524: int ea = XEiJ.regOC & 63; 11525: int qqq = XEiJ.regOC >> 9 & 7; 11526: int y = ea < XEiJ.EA_AR ? (char) XEiJ.regRn[ea] : XEiJ.busRwz (efaAnyWord (ea)); 11527: //muluの所要サイクル数は38+2n 11528: //nはソースに含まれる1の数 11529: int s = y & 0x5555; 11530: s += y - s >> 1; 11531: int t = s & 0x3333; 11532: t += s - t >> 2; 11533: t += t >> 4; 11534: XEiJ.mpuCycleCount += 38 + (((t & 15) + (t >> 8 & 15)) << 1); //38+2n 11535: //XEiJ.mpuCycleCount += 38 + (Integer.bitCount (y) << 1); //少し遅くなる 11536: int z; 11537: XEiJ.regRn[qqq] = z = (char) XEiJ.regRn[qqq] * y; //積の下位32ビット。オーバーフローは無視 11538: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 11539: } //irpMuluWord 11540: 11541: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11542: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11543: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11544: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11545: //ABCD.B Dr,Dq |-|012346|-|UUUUU|*U*U*| |1100_qqq_100_000_rrr 11546: //ABCD.B -(Ar),-(Aq) |-|012346|-|UUUUU|*U*U*| |1100_qqq_100_001_rrr 11547: //AND.B Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1100_qqq_100_mmm_rrr 11548: public static void irpAndToMemByte () throws M68kException { 11549: int ea = XEiJ.regOC & 63; 11550: if (ea >= XEiJ.EA_MM) { //AND.B Dq,<ea> 11551: XEiJ.mpuCycleCount += 8; 11552: int a = efaMltByte (ea); 11553: int z = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & XEiJ.busRbs (a); 11554: XEiJ.busWb (a, z); 11555: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.MPU_TSTB_TABLE[255 & z]; //ccr_tst_byte 11556: } else if (ea < XEiJ.EA_AR) { //ABCD.B Dr,Dq 11557: int qqq = XEiJ.regOC >> 9 & 7; 11558: XEiJ.mpuCycleCount += 6; 11559: XEiJ.regRn[qqq] = ~0xff & XEiJ.regRn[qqq] | irpAbcd (XEiJ.regRn[qqq], XEiJ.regRn[ea]); 11560: } else { //ABCD.B -(Ar),-(Aq) 11561: XEiJ.mpuCycleCount += 18; 11562: int y = XEiJ.busRbz (--XEiJ.regRn[ea]); //このr[ea]はアドレスレジスタ 11563: int a = --XEiJ.regRn[(XEiJ.regOC >> 9) - (96 - 8)]; 11564: XEiJ.busWb (a, irpAbcd (XEiJ.busRbz (a), y)); 11565: } 11566: } //irpAndToMemByte 11567: 11568: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11569: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11570: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11571: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11572: //EXG.L Dq,Dr |-|012346|-|-----|-----| |1100_qqq_101_000_rrr 11573: //EXG.L Aq,Ar |-|012346|-|-----|-----| |1100_qqq_101_001_rrr 11574: //AND.W Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1100_qqq_101_mmm_rrr 11575: public static void irpAndToMemWord () throws M68kException { 11576: int ea = XEiJ.regOC & 63; 11577: if (ea < XEiJ.EA_MM) { //EXG 11578: XEiJ.mpuCycleCount += 6; 11579: if (ea < XEiJ.EA_AR) { //EXG.L Dq,Dr 11580: int qqq = XEiJ.regOC >> 9 & 7; 11581: int t = XEiJ.regRn[qqq]; 11582: XEiJ.regRn[qqq] = XEiJ.regRn[ea]; 11583: XEiJ.regRn[ea] = t; 11584: } else { //EXG.L Aq,Ar 11585: int aqq = (XEiJ.regOC >> 9) - (96 - 8); 11586: int t = XEiJ.regRn[aqq]; 11587: XEiJ.regRn[aqq] = XEiJ.regRn[ea]; //このr[ea]アドレスレジスタ 11588: XEiJ.regRn[ea] = t; //このr[ea]はアドレスレジスタ 11589: } 11590: } else { //AND.W Dq,<ea> 11591: XEiJ.mpuCycleCount += 8; 11592: int a = efaMltWord (ea); 11593: int z = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & XEiJ.busRws (a); 11594: XEiJ.busWw (a, z); 11595: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (char) z - 1 >> 31 & XEiJ.REG_CCR_Z | ((short) z < 0 ? XEiJ.REG_CCR_N : 0); //ccr_tst_word 11596: } 11597: } //irpAndToMemWord 11598: 11599: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11600: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11601: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11602: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11603: //EXG.L Dq,Ar |-|012346|-|-----|-----| |1100_qqq_110_001_rrr 11604: //AND.L Dq,<ea> |-|012346|-|-UUUU|-**00| M+-WXZ |1100_qqq_110_mmm_rrr 11605: public static void irpAndToMemLong () throws M68kException { 11606: int ea = XEiJ.regOC & 63; 11607: int qqq = XEiJ.regOC >> 9 & 7; 11608: if (ea >> 3 == XEiJ.MMM_AR) { //EXG.L Dq,Ar 11609: XEiJ.mpuCycleCount += 6; 11610: int t = XEiJ.regRn[qqq]; 11611: XEiJ.regRn[qqq] = XEiJ.regRn[ea]; //このr[ea]はアドレスレジスタ 11612: XEiJ.regRn[ea] = t; //このr[ea]はアドレスレジスタ 11613: } else { //AND.L Dq,<ea> 11614: XEiJ.mpuCycleCount += 12; 11615: int a = efaMltLong (ea); 11616: int z; 11617: XEiJ.busWl (a, z = XEiJ.busRls (a) & XEiJ.regRn[qqq]); 11618: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 11619: } 11620: } //irpAndToMemLong 11621: 11622: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11623: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11624: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11625: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11626: //MULS.W <ea>,Dq |-|012346|-|-UUUU|-***0|D M+-WXZPI|1100_qqq_111_mmm_rrr 11627: public static void irpMulsWord () throws M68kException { 11628: int ea = XEiJ.regOC & 63; 11629: int qqq = XEiJ.regOC >> 9 & 7; 11630: int y = ea < XEiJ.EA_AR ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); 11631: int t = y << 1 ^ y; //右側が1である0と右側が0または末尾である1は1、それ以外は0。ソースは符号拡張されているので上位16ビットはすべて0 11632: //mulsの所要サイクル数は38+2n 11633: //nはソースの末尾に0を付け加えた17ビットに含まれる10または01の数 11634: int s = t & 0x5555; 11635: s += t - s >> 1; 11636: t = s & 0x3333; 11637: t += s - t >> 2; 11638: t += t >> 4; 11639: XEiJ.mpuCycleCount += 38 + (((t & 15) + (t >> 8 & 15)) << 1); //38+2n 11640: int z; 11641: XEiJ.regRn[qqq] = z = (short) XEiJ.regRn[qqq] * y; //積の下位32ビット。オーバーフローは無視 11642: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X); //ccr_tst 11643: } //irpMulsWord 11644: 11645: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11646: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11647: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11648: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11649: //ADD.B <ea>,Dq |-|012346|-|UUUUU|*****|D M+-WXZPI|1101_qqq_000_mmm_rrr 11650: public static void irpAddToRegByte () throws M68kException { 11651: XEiJ.mpuCycleCount += 4; 11652: int ea = XEiJ.regOC & 63; 11653: int qqq = XEiJ.regOC >> 9 & 7; 11654: int x, y, z; 11655: y = ea < XEiJ.EA_AR ? XEiJ.regRn[ea] : XEiJ.busRbs (efaAnyByte (ea)); 11656: x = XEiJ.regRn[qqq]; 11657: z = x + y; 11658: XEiJ.regRn[qqq] = ~255 & x | 255 & z; 11659: XEiJ.regCCR = (XEiJ.MPU_TSTB_TABLE[255 & z] | 11660: ((x ^ z) & (y ^ z)) >> 6 & XEiJ.REG_CCR_V | 11661: (byte) ((x | y) ^ (x ^ y) & z) >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add_byte 11662: } //irpAddToRegByte 11663: 11664: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11665: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11666: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11667: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11668: //ADD.W <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1101_qqq_001_mmm_rrr 11669: public static void irpAddToRegWord () throws M68kException { 11670: XEiJ.mpuCycleCount += 4; 11671: int ea = XEiJ.regOC & 63; 11672: int qqq = XEiJ.regOC >> 9 & 7; 11673: int x, y, z; 11674: y = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 11675: x = XEiJ.regRn[qqq]; 11676: z = x + y; 11677: XEiJ.regRn[qqq] = ~65535 & x | (char) z; 11678: XEiJ.regCCR = (z >> 12 & XEiJ.REG_CCR_N | (char) z - 1 >> 14 & XEiJ.REG_CCR_Z | 11679: ((x ^ z) & (y ^ z)) >> 14 & XEiJ.REG_CCR_V | 11680: (short) ((x | y) ^ (x ^ y) & z) >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add_word 11681: } //irpAddToRegWord 11682: 11683: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11684: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11685: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11686: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11687: //ADD.L <ea>,Dq |-|012346|-|UUUUU|*****|DAM+-WXZPI|1101_qqq_010_mmm_rrr 11688: public static void irpAddToRegLong () throws M68kException { 11689: int ea = XEiJ.regOC & 63; 11690: int qqq = XEiJ.regOC >> 9 & 7; 11691: XEiJ.mpuCycleCount += ea < XEiJ.EA_MM || ea == XEiJ.EA_IM ? 8 : 6; //ソースが#<data>のとき2増やす 11692: int x, y, z; 11693: y = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ 11694: x = XEiJ.regRn[qqq]; 11695: z = x + y; 11696: XEiJ.regRn[qqq] = z; 11697: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 11698: ((x ^ z) & (y ^ z)) >> 30 & XEiJ.REG_CCR_V | 11699: ((x | y) ^ (x ^ y) & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add 11700: } //irpAddToRegLong 11701: 11702: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11703: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11704: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11705: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11706: //ADDA.W <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_011_mmm_rrr 11707: //ADD.W <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_011_mmm_rrr [ADDA.W <ea>,Aq] 11708: // 11709: //ADDA.W <ea>,Aq 11710: // ソースを符号拡張してロングで加算する 11711: public static void irpAddaWord () throws M68kException { 11712: XEiJ.mpuCycleCount += 8; 11713: int ea = XEiJ.regOC & 63; 11714: int z = ea < XEiJ.EA_MM ? (short) XEiJ.regRn[ea] : XEiJ.busRws (efaAnyWord (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 11715: XEiJ.regRn[XEiJ.regOC >> 9 & 15] += z; //r[op >> 9 & 15] += ea < XEiJ.EA_MM ? (short) r[ea] : rws (efaAnyWord (ea));は不可 11716: //ccrは変化しない 11717: } //irpAddaWord 11718: 11719: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11720: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11721: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11722: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11723: //ADDX.B Dr,Dq |-|012346|-|*UUUU|*****| |1101_qqq_100_000_rrr 11724: //ADDX.B -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1101_qqq_100_001_rrr 11725: //ADD.B Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1101_qqq_100_mmm_rrr 11726: public static void irpAddToMemByte () throws M68kException { 11727: int ea = XEiJ.regOC & 63; 11728: int a, x, y, z; 11729: if (ea < XEiJ.EA_MM) { 11730: if (ea < XEiJ.EA_AR) { //ADDX.B Dr,Dq 11731: int qqq = XEiJ.regOC >> 9 & 7; 11732: XEiJ.mpuCycleCount += 4; 11733: y = XEiJ.regRn[ea]; 11734: x = XEiJ.regRn[qqq]; 11735: z = x + y + (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11736: XEiJ.regRn[qqq] = ~255 & x | 255 & z; 11737: } else { //ADDX.B -(Ar),-(Aq) 11738: XEiJ.mpuCycleCount += 18; 11739: y = XEiJ.busRbs (--XEiJ.regRn[ea]); //このr[ea]はアドレスレジスタ 11740: a = --XEiJ.regRn[XEiJ.regOC >> 9 & 15]; //1qqq=aqq 11741: x = XEiJ.busRbs (a); 11742: z = x + y + (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11743: XEiJ.busWb (a, z); 11744: } 11745: XEiJ.regCCR = (z >> 4 & XEiJ.REG_CCR_N | (255 & z) - 1 >> 6 & XEiJ.regCCR & XEiJ.REG_CCR_Z | //ADDXはZをクリアすることはあるがセットすることはない 11746: ((x ^ z) & (y ^ z)) >> 6 & XEiJ.REG_CCR_V | 11747: (byte) ((x | y) ^ (x ^ y) & z) >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_addx_byte 11748: } else { //ADD.B Dq,<ea> 11749: XEiJ.mpuCycleCount += 8; 11750: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7]; 11751: a = efaMltByte (ea); 11752: x = XEiJ.busRbs (a); 11753: z = x + y; 11754: XEiJ.busWb (a, z); 11755: XEiJ.regCCR = (XEiJ.MPU_TSTB_TABLE[255 & z] | 11756: ((x ^ z) & (y ^ z)) >> 6 & XEiJ.REG_CCR_V | 11757: (byte) ((x | y) ^ (x ^ y) & z) >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add_byte 11758: } 11759: } //irpAddToMemByte 11760: 11761: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11762: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11763: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11764: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11765: //ADDX.W Dr,Dq |-|012346|-|*UUUU|*****| |1101_qqq_101_000_rrr 11766: //ADDX.W -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1101_qqq_101_001_rrr 11767: //ADD.W Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1101_qqq_101_mmm_rrr 11768: public static void irpAddToMemWord () throws M68kException { 11769: int ea = XEiJ.regOC & 63; 11770: int a, x, y, z; 11771: if (ea < XEiJ.EA_MM) { 11772: if (ea < XEiJ.EA_AR) { //ADDX.W Dr,Dq 11773: int qqq = XEiJ.regOC >> 9 & 7; 11774: XEiJ.mpuCycleCount += 4; 11775: y = XEiJ.regRn[ea]; 11776: x = XEiJ.regRn[qqq]; 11777: z = x + y + (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11778: XEiJ.regRn[qqq] = ~65535 & x | (char) z; 11779: } else { //ADDX.W -(Ar),-(Aq) 11780: XEiJ.mpuCycleCount += 18; 11781: y = XEiJ.busRws (XEiJ.regRn[ea] -= 2); //このr[ea]はアドレスレジスタ 11782: a = XEiJ.regRn[XEiJ.regOC >> 9 & 15] -= 2; 11783: x = XEiJ.busRws (a); 11784: z = x + y + (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11785: XEiJ.busWw (a, z); 11786: } 11787: XEiJ.regCCR = (z >> 12 & XEiJ.REG_CCR_N | (char) z - 1 >> 14 & XEiJ.regCCR & XEiJ.REG_CCR_Z | //ADDXはZをクリアすることはあるがセットすることはない 11788: ((x ^ z) & (y ^ z)) >> 14 & XEiJ.REG_CCR_V | 11789: (short) ((x | y) ^ (x ^ y) & z) >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_addx_word 11790: } else { //ADD.W Dq,<ea> 11791: XEiJ.mpuCycleCount += 8; 11792: a = efaMltWord (ea); 11793: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7]; 11794: x = XEiJ.busRws (a); 11795: z = x + y; 11796: XEiJ.busWw (a, z); 11797: XEiJ.regCCR = (z >> 12 & XEiJ.REG_CCR_N | (char) z - 1 >> 14 & XEiJ.REG_CCR_Z | 11798: ((x ^ z) & (y ^ z)) >> 14 & XEiJ.REG_CCR_V | 11799: (short) ((x | y) ^ (x ^ y) & z) >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add_word 11800: } 11801: } //irpAddToMemWord 11802: 11803: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11804: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11805: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11806: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11807: //ADDX.L Dr,Dq |-|012346|-|*UUUU|*****| |1101_qqq_110_000_rrr 11808: //ADDX.L -(Ar),-(Aq) |-|012346|-|*UUUU|*****| |1101_qqq_110_001_rrr 11809: //ADD.L Dq,<ea> |-|012346|-|UUUUU|*****| M+-WXZ |1101_qqq_110_mmm_rrr 11810: public static void irpAddToMemLong () throws M68kException { 11811: int ea = XEiJ.regOC & 63; 11812: if (ea < XEiJ.EA_MM) { 11813: int x; 11814: int y; 11815: int z; 11816: if (ea < XEiJ.EA_AR) { //ADDX.L Dr,Dq 11817: int qqq = XEiJ.regOC >> 9 & 7; 11818: XEiJ.mpuCycleCount += 8; 11819: XEiJ.regRn[qqq] = z = (x = XEiJ.regRn[qqq]) + (y = XEiJ.regRn[ea]) + (XEiJ.regCCR >> 4); //Xの左側はすべて0なのでCCR_X&を省略 11820: } else { //ADDX.L -(Ar),-(Aq) 11821: XEiJ.mpuCycleCount += 30; 11822: y = XEiJ.busRls (XEiJ.regRn[ea] -= 4); //このr[ea]はアドレスレジスタ 11823: int a = XEiJ.regRn[XEiJ.regOC >> 9 & 15] -= 4; 11824: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) + y + (XEiJ.regCCR >> 4)); //Xの左側はすべて0なのでCCR_X&を省略 11825: } 11826: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_Z : 0) | 11827: ((x ^ z) & (y ^ z)) >>> 31 << 1 | 11828: ((x | y) ^ (x ^ y) & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_addx 11829: } else { //ADD.L Dq,<ea> 11830: XEiJ.mpuCycleCount += 12; 11831: int a = efaMltLong (ea); 11832: int x; 11833: int y; 11834: int z; 11835: XEiJ.busWl (a, z = (x = XEiJ.busRls (a)) + (y = XEiJ.regRn[XEiJ.regOC >> 9 & 7])); 11836: XEiJ.regCCR = (z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | 11837: ((x ^ z) & (y ^ z)) >>> 31 << 1 | 11838: ((x | y) ^ (x ^ y) & z) >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //ccr_add 11839: } 11840: } //irpAddToMemLong 11841: 11842: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11843: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11844: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11845: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11846: //ADDA.L <ea>,Aq |-|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_111_mmm_rrr 11847: //ADD.L <ea>,Aq |A|012346|-|-----|-----|DAM+-WXZPI|1101_qqq_111_mmm_rrr [ADDA.L <ea>,Aq] 11848: public static void irpAddaLong () throws M68kException { 11849: int ea = XEiJ.regOC & 63; 11850: XEiJ.mpuCycleCount += ea < XEiJ.EA_MM || ea == XEiJ.EA_IM ? 8 : 6; //Dr/Ar/#<data>のとき8+、それ以外は6+ 11851: int z = ea < XEiJ.EA_MM ? XEiJ.regRn[ea] : XEiJ.busRls (efaAnyLong (ea)); //このr[ea]はデータレジスタまたはアドレスレジスタ。ここでAqが変化する可能性があることに注意 11852: XEiJ.regRn[XEiJ.regOC >> 9 & 15] += z; //r[op >> 9 & 15] += ea < XEiJ.EA_MM ? r[ea] : rls (efaAnyLong (ea));は不可 11853: //ccrは変化しない 11854: } //irpAddaLong 11855: 11856: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11857: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 11858: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 11859: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 11860: //ASR.B #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_000_rrr 11861: //LSR.B #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_001_rrr 11862: //ROXR.B #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_000_010_rrr 11863: //ROR.B #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_000_011_rrr 11864: //ASR.B Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_100_rrr 11865: //LSR.B Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_000_101_rrr 11866: //ROXR.B Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_000_110_rrr 11867: //ROR.B Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_000_111_rrr 11868: //ASR.B Dr |A|012346|-|UUUUU|***0*| |1110_001_000_000_rrr [ASR.B #1,Dr] 11869: //LSR.B Dr |A|012346|-|UUUUU|***0*| |1110_001_000_001_rrr [LSR.B #1,Dr] 11870: //ROXR.B Dr |A|012346|-|*UUUU|***0*| |1110_001_000_010_rrr [ROXR.B #1,Dr] 11871: //ROR.B Dr |A|012346|-|-UUUU|-**0*| |1110_001_000_011_rrr [ROR.B #1,Dr] 11872: // 11873: //ASR.B #<data>,Dr 11874: //ASR.B Dq,Dr 11875: // 算術右シフトバイト 11876: // ........................アイウエオカキク XNZVC 11877: // 0 ........................アイウエオカキク Xア*00 Z=アイウエオカキク==0 11878: // 1 ........................アアイウエオカキ クア*0ク Z=アイウエオカキ==0 11879: // 2 ........................アアアイウエオカ キア*0キ Z=アイウエオカ==0 11880: // 3 ........................アアアアイウエオ カア*0カ Z=アイウエオ==0 11881: // 4 ........................アアアアアイウエ オア*0オ Z=アイウエ==0 11882: // 5 ........................アアアアアアイウ エア*0エ Z=アイウ==0 11883: // 6 ........................アアアアアアアイ ウア*0ウ Z=アイ==0 11884: // 7 ........................アアアアアアアア イア*0イ Z=ア==0 11885: // 8 ........................アアアアアアアア アア*0ア Z=ア==0 11886: // CCR 11887: // X countが0のとき変化しない。他は最後に押し出されたビット 11888: // N 結果の最上位ビット 11889: // Z 結果が0のときセット。他はクリア 11890: // V 常にクリア 11891: // C countが0のときクリア。他は最後に押し出されたビット 11892: // 11893: //LSR.B #<data>,Dr 11894: //LSR.B Dq,Dr 11895: // 論理右シフトバイト 11896: // ........................アイウエオカキク XNZVC 11897: // 0 ........................アイウエオカキク Xア*00 Z=アイウエオカキク==0 11898: // 1 ........................0アイウエオカキ ク0*0ク Z=アイウエオカキ==0 11899: // 2 ........................00アイウエオカ キ0*0キ Z=アイウエオカ==0 11900: // 3 ........................000アイウエオ カ0*0カ Z=アイウエオ==0 11901: // 4 ........................0000アイウエ オ0*0オ Z=アイウエ==0 11902: // 5 ........................00000アイウ エ0*0エ Z=アイウ==0 11903: // 6 ........................000000アイ ウ0*0ウ Z=アイ==0 11904: // 7 ........................0000000ア イ0*0イ Z=ア==0 11905: // 8 ........................00000000 ア010ア 11906: // 9 ........................00000000 00100 11907: // CCR 11908: // X countが0のとき変化しない。他は最後に押し出されたビット 11909: // N 結果の最上位ビット 11910: // Z 結果が0のときセット。他はクリア 11911: // V 常にクリア 11912: // C countが0のときクリア。他は最後に押し出されたビット 11913: // 11914: //ROR.B #<data>,Dr 11915: //ROR.B Dq,Dr 11916: // 右ローテートバイト 11917: // ........................アイウエオカキク XNZVC 11918: // 0 ........................アイウエオカキク Xア*00 Z=アイウエオカキク==0 11919: // 1 ........................クアイウエオカキ Xク*0ク Z=アイウエオカキク==0 11920: // : 11921: // 7 ........................イウエオカキクア Xイ*0イ Z=アイウエオカキク==0 11922: // 8 ........................アイウエオカキク Xア*0ア Z=アイウエオカキク==0 11923: // CCR 11924: // X 常に変化しない 11925: // N 結果の最上位ビット 11926: // Z 結果が0のときセット。他はクリア 11927: // V 常にクリア 11928: // C countが0のときクリア。他は結果の最上位ビット 11929: // 11930: //ROXR.B #<data>,Dr 11931: //ROXR.B Dq,Dr 11932: // 拡張右ローテートバイト 11933: // ........................アイウエオカキク XNZVC 11934: // 0 ........................アイウエオカキク Xア*0X Z=アイウエオカキク==0 11935: // 1 ........................Xアイウエオカキ クX*0ク Z=アイウエオカキX==0 11936: // 2 ........................クXアイウエオカ キク*0キ Z=アイウエオカクX==0 11937: // 3 ........................キクXアイウエオ カキ*0カ Z=アイウエオキクX==0 11938: // 4 ........................カキクXアイウエ オカ*0オ Z=アイウエカキクX==0 11939: // 5 ........................オカキクXアイウ エオ*0エ Z=アイウオカキクX==0 11940: // 6 ........................エオカキクXアイ ウエ*0ウ Z=アイエオカキクX==0 11941: // 7 ........................ウエオカキクXア イウ*0イ Z=アウエオカキクX==0 11942: // 8 ........................イウエオカキクX アイ*0ア Z=イウエオカキクX==0 11943: // 9 ........................アイウエオカキク Xア*0X Z=アイウエオカキク==0 11944: // CCR 11945: // X countが0のとき変化しない。他は最後に押し出されたビット 11946: // N 結果の最上位ビット 11947: // Z 結果が0のときセット。他はクリア 11948: // V 常にクリア 11949: // C countが0のときXのコピー。他は最後に押し出されたビット 11950: public static void irpXxrToRegByte () throws M68kException { 11951: int rrr; 11952: int x = XEiJ.regRn[rrr = XEiJ.regOC & 7]; 11953: int y; 11954: int z; 11955: int t; 11956: switch (XEiJ.regOC >> 3 & 0b111_000 >> 3) { 11957: case 0b000_000 >> 3: //ASR.B #<data>,Dr 11958: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 11959: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (t = (byte) x >> y) >> 1); 11960: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 11961: break; 11962: case 0b001_000 >> 3: //LSR.B #<data>,Dr 11963: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 11964: XEiJ.regRn[rrr] = ~0xff & x | (z = (t = (0xff & x) >>> y) >>> 1); 11965: XEiJ.regCCR = (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 11966: break; 11967: case 0b010_000 >> 3: //ROXR.B #<data>,Dr 11968: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 11969: z = (XEiJ.regCCR & XEiJ.REG_CCR_X) << 7 - 4 | (0xff & x) >>> 1; 11970: if (y == 1 - 1) { //y=data-1=1-1 11971: t = x; 11972: } else { //y=data-1=2-1~8-1 11973: z = x << 9 - 1 - y | (t = z >>> y - (2 - 1)) >>> 1; 11974: } 11975: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) z); 11976: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 11977: break; 11978: case 0b011_000 >> 3: //ROR.B #<data>,Dr 11979: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 11980: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) (x << 7 - y | (0xff & x) >>> y + 1)); 11981: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | z >>> 7 & 1; //Xは変化しない。Cは結果の最上位ビット 11982: break; 11983: case 0b100_000 >> 3: //ASR.B Dq,Dr 11984: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 11985: XEiJ.mpuCycleCount += 6 + (y << 1); 11986: if (y == 0) { //y=data=0 11987: z = (byte) x; 11988: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。Cはクリア 11989: } else { //y=data=1~63 11990: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (t = (byte) x >> (y <= 8 ? y - 1 : 7)) >> 1); 11991: t = -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 11992: } 11993: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 11994: break; 11995: case 0b101_000 >> 3: //LSR.B Dq,Dr 11996: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 11997: XEiJ.mpuCycleCount += 6 + (y << 1); 11998: if (y == 0) { //y=data=0 11999: z = (byte) x; 12000: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (z < 0 ? XEiJ.REG_CCR_N : z == 0 ? XEiJ.REG_CCR_Z : 0); //Xは変化しない。Cはクリア 12001: } else { //y=data=1~63 12002: XEiJ.regRn[rrr] = ~0xff & x | (z = (t = y <= 8 ? (0xff & x) >>> y - 1 : 0) >>> 1); 12003: XEiJ.regCCR = (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12004: } 12005: break; 12006: case 0b110_000 >> 3: //ROXR.B Dq,Dr 12007: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12008: XEiJ.mpuCycleCount += 6 + (y << 1); 12009: //y %= 9; 12010: y = (y & 7) - (y >> 3); //y=data=-7~7 12011: y += y >> 3 & 9; //y=data=0~8 12012: if (y == 0) { //y=data=0 12013: z = (byte) x; 12014: t = -(XEiJ.regCCR >> 4 & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //Xは変化しない。CはXのコピー 12015: } else { //y=data=1~8 12016: z = (XEiJ.regCCR & XEiJ.REG_CCR_X) << 7 - 4 | (0xff & x) >>> 1; 12017: if (y == 1) { //y=data=1 12018: t = x; //Cは最後に押し出されたビット 12019: } else { //y=data=2~8 12020: z = x << 9 - y | (t = z >>> y - 2) >>> 1; 12021: } 12022: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) z); 12023: t = -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12024: } 12025: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12026: break; 12027: case 0b111_000 >> 3: //ROR.B Dq,Dr 12028: default: 12029: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12030: XEiJ.mpuCycleCount += 6 + (y << 1); 12031: if (y == 0) { 12032: z = (byte) x; 12033: t = 0; //Cはクリア 12034: } else { 12035: y &= 7; //y=data=0~7 12036: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) (x << 8 - y | (0xff & x) >>> y)); 12037: t = z >>> 7 & 1; //Cは結果の最上位ビット 12038: } 12039: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | t; //Xは変化しない 12040: } 12041: } //irpXxrToRegByte 12042: 12043: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12044: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 12045: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 12046: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12047: //ASR.W #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_000_rrr 12048: //LSR.W #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_001_rrr 12049: //ROXR.W #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_001_010_rrr 12050: //ROR.W #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_001_011_rrr 12051: //ASR.W Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_100_rrr 12052: //LSR.W Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_001_101_rrr 12053: //ROXR.W Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_001_110_rrr 12054: //ROR.W Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_001_111_rrr 12055: //ASR.W Dr |A|012346|-|UUUUU|***0*| |1110_001_001_000_rrr [ASR.W #1,Dr] 12056: //LSR.W Dr |A|012346|-|UUUUU|***0*| |1110_001_001_001_rrr [LSR.W #1,Dr] 12057: //ROXR.W Dr |A|012346|-|*UUUU|***0*| |1110_001_001_010_rrr [ROXR.W #1,Dr] 12058: //ROR.W Dr |A|012346|-|-UUUU|-**0*| |1110_001_001_011_rrr [ROR.W #1,Dr] 12059: // 12060: //ASR.W #<data>,Dr 12061: //ASR.W Dq,Dr 12062: //ASR.W <ea> 12063: // 算術右シフトワード 12064: // ................アイウエオカキクケコサシスセソタ XNZVC 12065: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12066: // 1 ................アアイウエオカキクケコサシスセソ タア*0タ Z=アイウエオカキクケコサシスセソ==0 12067: // : 12068: // 15 ................アアアアアアアアアアアアアアアア イア*0イ Z=ア==0 12069: // 16 ................アアアアアアアアアアアアアアアア アア*0ア Z=ア==0 12070: // CCR 12071: // X countが0のとき変化しない。他は最後に押し出されたビット 12072: // N 結果の最上位ビット 12073: // Z 結果が0のときセット。他はクリア 12074: // V 常にクリア 12075: // C countが0のときクリア。他は最後に押し出されたビット 12076: // 12077: //LSR.W #<data>,Dr 12078: //LSR.W Dq,Dr 12079: //LSR.W <ea> 12080: // 論理右シフトワード 12081: // ................アイウエオカキクケコサシスセソタ XNZVC 12082: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12083: // 1 ................0アイウエオカキクケコサシスセソ タ0*0タ Z=アイウエオカキクケコサシスセソ==0 12084: // : 12085: // 15 ................000000000000000ア イ0*0イ Z=ア==0 12086: // 16 ................0000000000000000 ア010ア 12087: // 17 ................0000000000000000 00100 12088: // CCR 12089: // X countが0のとき変化しない。他は最後に押し出されたビット 12090: // N 結果の最上位ビット 12091: // Z 結果が0のときセット。他はクリア 12092: // V 常にクリア 12093: // C countが0のときクリア。他は最後に押し出されたビット 12094: // 12095: //ROR.W #<data>,Dr 12096: //ROR.W Dq,Dr 12097: //ROR.W <ea> 12098: // 右ローテートワード 12099: // ................アイウエオカキクケコサシスセソタ XNZVC 12100: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12101: // 1 ................タアイウエオカキクケコサシスセソ Xタ*0タ Z=アイウエオカキクケコサシスセソタ==0 12102: // : 12103: // 15 ................イウエオカキクケコサシスセソタア Xイ*0イ Z=アイウエオカキクケコサシスセソタ==0 12104: // 16 ................アイウエオカキクケコサシスセソタ Xア*0ア Z=アイウエオカキクケコサシスセソタ==0 12105: // CCR 12106: // X 常に変化しない 12107: // N 結果の最上位ビット 12108: // Z 結果が0のときセット。他はクリア 12109: // V 常にクリア 12110: // C countが0のときクリア。他は結果の最上位ビット 12111: // 12112: //ROXR.W #<data>,Dr 12113: //ROXR.W Dq,Dr 12114: //ROXR.W <ea> 12115: // 拡張右ローテートワード 12116: // ................アイウエオカキクケコサシスセソタ XNZVC 12117: // 0 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 12118: // 1 ................Xアイウエオカキクケコサシスセソ タX*0タ Z=アイウエオカキクケコサシスセソX==0 12119: // 2 ................タXアイウエオカキクケコサシスセ ソタ*0ソ Z=アイウエオカキクケコサシスセタX==0 12120: // : 12121: // 15 ................ウエオカキクケコサシスセソタXア イウ*0イ Z=アウエオカキクケコサシスセソタX==0 12122: // 16 ................イウエオカキクケコサシスセソタX アイ*0ア Z=イウエオカキクケコサシスセソタX==0 12123: // 17 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 12124: // CCR 12125: // X countが0のとき変化しない。他は最後に押し出されたビット 12126: // N 結果の最上位ビット 12127: // Z 結果が0のときセット。他はクリア 12128: // V 常にクリア 12129: // C countが0のときXのコピー。他は最後に押し出されたビット 12130: public static void irpXxrToRegWord () throws M68kException { 12131: int rrr; 12132: int x = XEiJ.regRn[rrr = XEiJ.regOC & 7]; 12133: int y; 12134: int z; 12135: int t; 12136: switch (XEiJ.regOC >> 3 & 0b111_000 >> 3) { 12137: case 0b000_000 >> 3: //ASR.W #<data>,Dr 12138: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12139: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (t = (short) x >> y) >> 1); 12140: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12141: break; 12142: case 0b001_000 >> 3: //LSR.W #<data>,Dr 12143: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12144: XEiJ.regRn[rrr] = ~0xffff & x | (z = (t = (char) x >>> y) >>> 1); 12145: XEiJ.regCCR = (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12146: break; 12147: case 0b010_000 >> 3: //ROXR.W #<data>,Dr 12148: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12149: z = (XEiJ.regCCR & XEiJ.REG_CCR_X) << 15 - 4 | (char) x >>> 1; 12150: if (y == 1 - 1) { //y=data-1=1-1 12151: t = x; 12152: } else { //y=data-1=2-1~8-1 12153: z = x << 17 - 1 - y | (t = z >>> y - (2 - 1)) >>> 1; 12154: } 12155: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) z); 12156: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12157: break; 12158: case 0b011_000 >> 3: //ROR.W #<data>,Dr 12159: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12160: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) (x << 16 - 1 - y | (char) x >>> y + 1)); 12161: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | z >>> 15 & 1; //Xは変化しない。Cは結果の最上位ビット 12162: break; 12163: case 0b100_000 >> 3: //ASR.W Dq,Dr 12164: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12165: XEiJ.mpuCycleCount += 6 + (y << 1); 12166: if (y == 0) { //y=data=0 12167: z = (short) x; 12168: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。Cはクリア 12169: } else { //y=data=1~63 12170: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (t = (short) x >> (y <= 16 ? y - 1 : 15)) >> 1); 12171: t = -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12172: } 12173: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12174: break; 12175: case 0b101_000 >> 3: //LSR.W Dq,Dr 12176: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12177: XEiJ.mpuCycleCount += 6 + (y << 1); 12178: if (y == 0) { //y=data=0 12179: z = (short) x; 12180: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (z < 0 ? XEiJ.REG_CCR_N : z == 0 ? XEiJ.REG_CCR_Z : 0); //Xは変化しない。Cはクリア 12181: } else { //y=data=1~63 12182: XEiJ.regRn[rrr] = ~0xffff & x | (z = (t = y <= 16 ? (char) x >>> y - 1 : 0) >>> 1); 12183: XEiJ.regCCR = (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12184: } 12185: break; 12186: case 0b110_000 >> 3: //ROXR.W Dq,Dr 12187: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12188: XEiJ.mpuCycleCount += 6 + (y << 1); 12189: //y %= 17; 12190: y = (y & 15) - (y >> 4); //y=data=-3~15 12191: y += y >> 4 & 17; //y=data=0~16 12192: if (y == 0) { //y=data=0 12193: z = (short) x; 12194: t = -(XEiJ.regCCR >> 4 & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //Xは変化しない。CはXのコピー 12195: } else { //y=data=1~16 12196: z = (XEiJ.regCCR & XEiJ.REG_CCR_X) << 15 - 4 | (char) x >>> 1; 12197: if (y == 1) { //y=data=1 12198: t = x; //Cは最後に押し出されたビット 12199: } else { //y=data=2~16 12200: z = x << 17 - y | (t = z >>> y - 2) >>> 1; 12201: } 12202: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) z); 12203: t = -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12204: } 12205: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12206: break; 12207: case 0b111_000 >> 3: //ROR.W Dq,Dr 12208: default: 12209: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12210: XEiJ.mpuCycleCount += 6 + (y << 1); 12211: if (y == 0) { 12212: z = (short) x; 12213: t = 0; //Cはクリア 12214: } else { 12215: y &= 15; //y=data=0~15 12216: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) (x << 16 - y | (char) x >>> y)); 12217: t = z >>> 15 & 1; //Cは結果の最上位ビット 12218: } 12219: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | t; //Xは変化しない 12220: } 12221: } //irpXxrToRegWord 12222: 12223: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12224: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 12225: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 12226: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12227: //ASR.L #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_000_rrr 12228: //LSR.L #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_001_rrr 12229: //ROXR.L #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_010_010_rrr 12230: //ROR.L #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_010_011_rrr 12231: //ASR.L Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_100_rrr 12232: //LSR.L Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_010_101_rrr 12233: //ROXR.L Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_010_110_rrr 12234: //ROR.L Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_010_111_rrr 12235: //ASR.L Dr |A|012346|-|UUUUU|***0*| |1110_001_010_000_rrr [ASR.L #1,Dr] 12236: //LSR.L Dr |A|012346|-|UUUUU|***0*| |1110_001_010_001_rrr [LSR.L #1,Dr] 12237: //ROXR.L Dr |A|012346|-|*UUUU|***0*| |1110_001_010_010_rrr [ROXR.L #1,Dr] 12238: //ROR.L Dr |A|012346|-|-UUUU|-**0*| |1110_001_010_011_rrr [ROR.L #1,Dr] 12239: // 12240: //ASR.L #<data>,Dr 12241: //ASR.L Dq,Dr 12242: // 算術右シフトロング 12243: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12244: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*00 Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12245: // 1 アアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ ミア*0ミ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ==0 12246: // : 12247: // 31 アアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアア イア*0イ Z=ア==0 12248: // 32 アアアアアアアアアアアアアアアアアアアアアアアアアアアアアアアア アア*0ア Z=ア==0 12249: // CCR 12250: // X countが0のとき変化しない。他は最後に押し出されたビット 12251: // N 結果の最上位ビット 12252: // Z 結果が0のときセット。他はクリア 12253: // V 常にクリア 12254: // C countが0のときクリア。他は最後に押し出されたビット 12255: // 12256: //LSR.L #<data>,Dr 12257: //LSR.L Dq,Dr 12258: // 論理右シフトロング 12259: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12260: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*00 Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12261: // 1 0アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ ミ0*0ミ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ==0 12262: // : 12263: // 31 0000000000000000000000000000000ア イ0*0イ Z=ア==0 12264: // 32 00000000000000000000000000000000 ア010ア 12265: // 33 00000000000000000000000000000000 00100 12266: // CCR 12267: // X countが0のとき変化しない。他は最後に押し出されたビット 12268: // N 結果の最上位ビット 12269: // Z 結果が0のときセット。他はクリア 12270: // V 常にクリア 12271: // C countが0のときクリア。他は最後に押し出されたビット 12272: // 12273: //ROR.L #<data>,Dr 12274: //ROR.L Dq,Dr 12275: // 右ローテートロング 12276: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12277: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*00 Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12278: // 1 ミアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ Xミ*0ミ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12279: // : 12280: // 31 イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミア Xイ*0イ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12281: // 32 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*0ア Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12282: // CCR 12283: // X 常に変化しない 12284: // N 結果の最上位ビット 12285: // Z 結果が0のときセット。他はクリア 12286: // V 常にクリア 12287: // C countが0のときクリア。他は結果の最上位ビット 12288: // 12289: //ROXR.L #<data>,Dr 12290: //ROXR.L Dq,Dr 12291: // 拡張右ローテートロング 12292: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12293: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*0X Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12294: // 1 Xアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ ミX*0ミ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマX==0 12295: // 2 ミXアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホ マミ*0マ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホミX==0 12296: // : 12297: // 31 ウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミXア イウ*0イ Z=アウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミX==0 12298: // 32 イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミX アイ*0ア Z=イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミX==0 12299: // 33 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*0X Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12300: // CCR 12301: // X countが0のとき変化しない。他は最後に押し出されたビット 12302: // N 結果の最上位ビット 12303: // Z 結果が0のときセット。他はクリア 12304: // V 常にクリア 12305: // C countが0のときXのコピー。他は最後に押し出されたビット 12306: public static void irpXxrToRegLong () throws M68kException { 12307: int rrr; 12308: int x = XEiJ.regRn[rrr = XEiJ.regOC & 7]; 12309: int y; 12310: int z; 12311: int t; 12312: switch (XEiJ.regOC >> 3 & 0b111_000 >> 3) { 12313: case 0b000_000 >> 3: //ASR.L #<data>,Dr 12314: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12315: XEiJ.regRn[rrr] = z = (t = x >> y) >> 1; 12316: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12317: break; 12318: case 0b001_000 >> 3: //LSR.L #<data>,Dr 12319: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12320: XEiJ.regRn[rrr] = z = (t = x >>> y) >>> 1; 12321: XEiJ.regCCR = (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12322: break; 12323: case 0b010_000 >> 3: //ROXR.L #<data>,Dr 12324: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12325: z = (XEiJ.regCCR & XEiJ.REG_CCR_X) << 31 - 4 | x >>> 1; 12326: if (y == 1 - 1) { //y=data-1=1-1 12327: t = x; 12328: } else { //y=data-1=2-1~8-1 12329: z = x << -y | (t = z >>> y - (2 - 1)) >>> 1; //Javaのシフト演算子は5ビットでマスクされるので33-1-yを-yに省略 12330: } 12331: XEiJ.regRn[rrr] = z; 12332: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12333: break; 12334: case 0b011_000 >> 3: //ROR.L #<data>,Dr 12335: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12336: XEiJ.regRn[rrr] = z = x << ~y | x >>> y + 1; //Javaのシフト演算子は5ビットでマスクされるので32-1-yを~yに省略 12337: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | z >>> 31; //Xは変化しない。Cは結果の最上位ビット 12338: break; 12339: case 0b100_000 >> 3: //ASR.L Dq,Dr 12340: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12341: XEiJ.mpuCycleCount += 8 + (y << 1); 12342: if (y == 0) { //y=data=0 12343: z = x; 12344: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。Cはクリア 12345: } else { //y=data=1~63 12346: XEiJ.regRn[rrr] = z = (t = x >> (y <= 32 ? y - 1 : 31)) >> 1; 12347: t = -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12348: } 12349: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12350: break; 12351: case 0b101_000 >> 3: //LSR.L Dq,Dr 12352: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12353: XEiJ.mpuCycleCount += 8 + (y << 1); 12354: if (y == 0) { //y=data=0 12355: z = x; 12356: XEiJ.regCCR = XEiJ.regCCR & XEiJ.REG_CCR_X | (z < 0 ? XEiJ.REG_CCR_N : z == 0 ? XEiJ.REG_CCR_Z : 0); //Xは変化しない。Cはクリア 12357: } else { //y=data=1~63 12358: XEiJ.regRn[rrr] = z = (t = y <= 32 ? x >>> y - 1 : 0) >>> 1; 12359: XEiJ.regCCR = (z == 0 ? XEiJ.REG_CCR_Z : 0) | -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12360: } 12361: break; 12362: case 0b110_000 >> 3: //ROXR.L Dq,Dr 12363: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12364: XEiJ.mpuCycleCount += 8 + (y << 1); 12365: //y %= 33; 12366: y -= 32 - y >> 6 & 33; //y=data=0~32 12367: if (y == 0) { //y=data=0 12368: z = x; 12369: t = -(XEiJ.regCCR >> 4 & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //Xは変化しない。CはXのコピー 12370: } else { //y=data=1~32 12371: z = (XEiJ.regCCR & XEiJ.REG_CCR_X) << 31 - 4 | x >>> 1; 12372: if (y == 1) { //y=data=1 12373: t = x; //Cは最後に押し出されたビット 12374: } else { //y=data=2~32 12375: z = x << 33 - y | (t = z >>> y - 2) >>> 1; 12376: } 12377: XEiJ.regRn[rrr] = z; 12378: t = -(t & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12379: } 12380: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12381: break; 12382: case 0b111_000 >> 3: //ROR.L Dq,Dr 12383: default: 12384: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12385: XEiJ.mpuCycleCount += 8 + (y << 1); 12386: if (y == 0) { 12387: z = x; 12388: t = 0; //Cはクリア 12389: } else { 12390: y &= 31; //y=data=0~31 12391: XEiJ.regRn[rrr] = z = x << -y | x >>> y; //Javaのシフト演算子は5ビットでマスクされるので32-yを-yに省略。y=32のときx|xになるが問題ない 12392: t = z >>> 31; //Cは結果の最上位ビット 12393: } 12394: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | t; //Xは変化しない 12395: } 12396: } //irpXxrToRegLong 12397: 12398: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12399: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 12400: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 12401: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12402: //ASR.W <ea> |-|012346|-|UUUUU|***0*| M+-WXZ |1110_000_011_mmm_rrr 12403: // 12404: //ASR.W #<data>,Dr 12405: //ASR.W Dq,Dr 12406: //ASR.W <ea> 12407: // 算術右シフトワード 12408: // ................アイウエオカキクケコサシスセソタ XNZVC 12409: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12410: // 1 ................アアイウエオカキクケコサシスセソ タア*0タ Z=アイウエオカキクケコサシスセソ==0 12411: // : 12412: // 15 ................アアアアアアアアアアアアアアアア イア*0イ Z=ア==0 12413: // 16 ................アアアアアアアアアアアアアアアア アア*0ア Z=ア==0 12414: // CCR 12415: // X countが0のとき変化しない。他は最後に押し出されたビット 12416: // N 結果の最上位ビット 12417: // Z 結果が0のときセット。他はクリア 12418: // V 常にクリア 12419: // C countが0のときクリア。他は最後に押し出されたビット 12420: public static void irpAsrToMem () throws M68kException { 12421: XEiJ.mpuCycleCount += 8; 12422: int ea = XEiJ.regOC & 63; 12423: int a = efaMltWord (ea); 12424: int x = XEiJ.busRws (a); 12425: int z = x >> 1; 12426: XEiJ.busWw (a, z); 12427: XEiJ.regCCR = ((z < 0 ? XEiJ.REG_CCR_N : 0) | 12428: (z == 0 ? XEiJ.REG_CCR_Z : 0) | 12429: -(x & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //XとCは最後に押し出されたビット 12430: } //irpAsrToMem 12431: 12432: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12433: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 12434: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 12435: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12436: //ASL.B #<data>,Dr |-|012346|-|UUUUU|*****| |1110_qqq_100_000_rrr 12437: //LSL.B #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_100_001_rrr 12438: //ROXL.B #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_100_010_rrr 12439: //ROL.B #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_100_011_rrr 12440: //ASL.B Dq,Dr |-|012346|-|UUUUU|*****| |1110_qqq_100_100_rrr 12441: //LSL.B Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_100_101_rrr 12442: //ROXL.B Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_100_110_rrr 12443: //ROL.B Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_100_111_rrr 12444: //ASL.B Dr |A|012346|-|UUUUU|*****| |1110_001_100_000_rrr [ASL.B #1,Dr] 12445: //LSL.B Dr |A|012346|-|UUUUU|***0*| |1110_001_100_001_rrr [LSL.B #1,Dr] 12446: //ROXL.B Dr |A|012346|-|*UUUU|***0*| |1110_001_100_010_rrr [ROXL.B #1,Dr] 12447: //ROL.B Dr |A|012346|-|-UUUU|-**0*| |1110_001_100_011_rrr [ROL.B #1,Dr] 12448: // 12449: //ASL.B #<data>,Dr 12450: //ASL.B Dq,Dr 12451: // 算術左シフトバイト 12452: // ........................アイウエオカキク XNZVC 12453: // 0 ........................アイウエオカキク Xア*00 Z=アイウエオカキク==0 12454: // 1 ........................イウエオカキク0 アイ**ア Z=イウエオカキク==0,V=アイ!=0/-1 12455: // : 12456: // 7 ........................ク0000000 キク**キ Z=ク==0,V=アイウエオカキク!=0/-1 12457: // 8 ........................00000000 ク01*ク V=アイウエオカキク!=0 12458: // 9 ........................00000000 001*0 V=アイウエオカキク!=0 12459: // CCR 12460: // X countが0のとき変化しない。他は最後に押し出されたビット 12461: // N 結果の最上位ビット 12462: // Z 結果が0のときセット。他はクリア 12463: // V ASRで元に戻せないときセット。他はクリア 12464: // C countが0のときクリア。他は最後に押し出されたビット 12465: // 12466: //LSL.B #<data>,Dr 12467: //LSL.B Dq,Dr 12468: // 論理左シフトバイト 12469: // ........................アイウエオカキク XNZVC 12470: // 0 ........................アイウエオカキク Xア*00 Z=アイウエオカキク==0 12471: // 1 ........................イウエオカキク0 アイ*0ア Z=イウエオカキク==0 12472: // : 12473: // 7 ........................ク0000000 キク*0キ Z=ク==0 12474: // 8 ........................00000000 ク010ク 12475: // 9 ........................00000000 00100 12476: // CCR 12477: // X countが0のとき変化しない。他は最後に押し出されたビット 12478: // N 結果の最上位ビット 12479: // Z 結果が0のときセット。他はクリア 12480: // V 常にクリア 12481: // C countが0のときクリア。他は最後に押し出されたビット 12482: // 12483: //ROL.B #<data>,Dr 12484: //ROL.B Dq,Dr 12485: // 左ローテートバイト 12486: // ........................アイウエオカキク XNZVC 12487: // 0 ........................アイウエオカキク Xア*00 Z=アイウエオカキク==0 12488: // 1 ........................イウエオカキクア Xイ*0ア Z=アイウエオカキク==0 12489: // : 12490: // 7 ........................クアイウエオカキ Xク*0キ Z=アイウエオカキク==0 12491: // 8 ........................アイウエオカキク Xア*0ク Z=アイウエオカキク==0 12492: // CCR 12493: // X 常に変化しない 12494: // N 結果の最上位ビット 12495: // Z 結果が0のときセット。他はクリア 12496: // V 常にクリア 12497: // C countが0のときクリア。他は結果の最下位ビット 12498: // 12499: //ROXL.B #<data>,Dr 12500: //ROXL.B Dq,Dr 12501: // 拡張左ローテートバイト 12502: // ........................アイウエオカキク XNZVC 12503: // 0 ........................アイウエオカキク Xア*0X Z=アイウエオカキク==0 12504: // 1 ........................イウエオカキクX アイ*0ア Z=イウエオカキクX==0 12505: // 2 ........................ウエオカキクXア イウ*0イ Z=アウエオカキクX==0 12506: // : 12507: // 7 ........................クXアイウエオカ キク*0キ Z=アイウエオカクX==0 12508: // 8 ........................Xアイウエオカキ クX*0ク Z=アイウエオカキX==0 12509: // 9 ........................アイウエオカキク Xア*0X Z=アイウエオカキク==0 12510: // CCR 12511: // X countが0のとき変化しない。他は最後に押し出されたビット 12512: // N 結果の最上位ビット 12513: // Z 結果が0のときセット。他はクリア 12514: // V 常にクリア 12515: // C countが0のときXのコピー。他は最後に押し出されたビット 12516: public static void irpXxlToRegByte () throws M68kException { 12517: int rrr; 12518: int x = XEiJ.regRn[rrr = XEiJ.regOC & 7]; 12519: int y; 12520: int z; 12521: int t; 12522: switch (XEiJ.regOC >> 3 & 0b111_000 >> 3) { 12523: case 0b000_000 >> 3: //ASL.B #<data>,Dr 12524: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12525: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) ((t = x << y) << 1)); 12526: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | (z >> y + 1 != (byte) x ? XEiJ.REG_CCR_V : 0) | (byte) t >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //VはASRで元に戻せないときセット。XとCは最後に押し出されたビット 12527: break; 12528: case 0b001_000 >> 3: //LSL.B #<data>,Dr 12529: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12530: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) ((t = x << y) << 1)); 12531: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | (byte) t >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12532: break; 12533: case 0b010_000 >> 3: //ROXL.B #<data>,Dr 12534: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12535: z = x << 1 | XEiJ.regCCR >> 4 & 1; 12536: if (y == 1 - 1) { //y=data-1=1-1 12537: t = x; 12538: } else { //y=data-1=2-1~8-1 12539: z = (t = z << y - (2 - 1)) << 1 | (0xff & x) >>> 9 - 1 - y; 12540: } 12541: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) z); 12542: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | (byte) t >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12543: break; 12544: case 0b011_000 >> 3: //ROL.B #<data>,Dr 12545: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12546: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) (x << y + 1 | (0xff & x) >>> 7 - y)); 12547: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | z & 1; //Xは変化しない。Cは結果の最下位ビット 12548: break; 12549: case 0b100_000 >> 3: //ASL.B Dq,Dr 12550: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12551: XEiJ.mpuCycleCount += 6 + (y << 1); 12552: if (y <= 7) { //y=data=0~7 12553: if (y == 0) { //y=data=0 12554: z = (byte) x; 12555: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。VとCはクリア 12556: } else { //y=data=1~7 12557: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) ((t = x << y - 1) << 1)); 12558: t = (z >> y != (byte) x ? XEiJ.REG_CCR_V : 0) | (byte) t >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //VはASRで元に戻せないときセット。XとCは最後に押し出されたビット 12559: } 12560: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12561: } else { //y=data=8~63 12562: XEiJ.regRn[rrr] = ~0xff & x; 12563: XEiJ.regCCR = XEiJ.REG_CCR_Z | ((byte) x != 0 ? XEiJ.REG_CCR_V : 0) | (y == 8 ? -(x & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C) : 0); 12564: } 12565: break; 12566: case 0b101_000 >> 3: //LSL.B Dq,Dr 12567: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12568: XEiJ.mpuCycleCount += 6 + (y << 1); 12569: if (y == 0) { //y=data=0 12570: z = (byte) x; 12571: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。Cはクリア 12572: } else { //y=data=1~63 12573: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) ((t = y <= 8 ? x << y - 1 : 0) << 1)); 12574: t = (byte) t >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12575: } 12576: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12577: break; 12578: case 0b110_000 >> 3: //ROXL.B Dq,Dr 12579: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12580: XEiJ.mpuCycleCount += 6 + (y << 1); 12581: //y %= 9; 12582: y = (y & 7) - (y >> 3); //y=data=-7~7 12583: y += y >> 3 & 9; //y=data=0~8 12584: if (y == 0) { //y=data=0 12585: z = (byte) x; 12586: t = -(XEiJ.regCCR >> 4 & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //Xは変化しない。CはXのコピー 12587: } else { //y=data=1~8 12588: z = x << 1 | XEiJ.regCCR >> 4 & 1; 12589: if (y == 1) { //y=data=1 12590: t = x; //Cは最後に押し出されたビット 12591: } else { //y=data=2~8 12592: z = (t = z << y - 2) << 1 | (0xff & x) >>> 9 - y; 12593: } 12594: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) z); 12595: t = (byte) t >> 7 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12596: } 12597: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12598: break; 12599: case 0b111_000 >> 3: //ROL.B Dq,Dr 12600: default: 12601: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12602: XEiJ.mpuCycleCount += 6 + (y << 1); 12603: if (y == 0) { 12604: z = (byte) x; 12605: t = 0; //Cはクリア 12606: } else { 12607: y &= 7; //y=data=0~7 12608: XEiJ.regRn[rrr] = ~0xff & x | 0xff & (z = (byte) (x << y | (0xff & x) >>> 8 - y)); 12609: t = z & 1; //Cは結果の最下位ビット 12610: } 12611: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | t; //Xは変化しない 12612: } 12613: } //irpXxlToRegByte 12614: 12615: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12616: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 12617: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 12618: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12619: //ASL.W #<data>,Dr |-|012346|-|UUUUU|*****| |1110_qqq_101_000_rrr 12620: //LSL.W #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_101_001_rrr 12621: //ROXL.W #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_101_010_rrr 12622: //ROL.W #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_101_011_rrr 12623: //ASL.W Dq,Dr |-|012346|-|UUUUU|*****| |1110_qqq_101_100_rrr 12624: //LSL.W Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_101_101_rrr 12625: //ROXL.W Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_101_110_rrr 12626: //ROL.W Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_101_111_rrr 12627: //ASL.W Dr |A|012346|-|UUUUU|*****| |1110_001_101_000_rrr [ASL.W #1,Dr] 12628: //LSL.W Dr |A|012346|-|UUUUU|***0*| |1110_001_101_001_rrr [LSL.W #1,Dr] 12629: //ROXL.W Dr |A|012346|-|*UUUU|***0*| |1110_001_101_010_rrr [ROXL.W #1,Dr] 12630: //ROL.W Dr |A|012346|-|-UUUU|-**0*| |1110_001_101_011_rrr [ROL.W #1,Dr] 12631: // 12632: //ASL.W #<data>,Dr 12633: //ASL.W Dq,Dr 12634: //ASL.W <ea> 12635: // 算術左シフトワード 12636: // ................アイウエオカキクケコサシスセソタ XNZVC 12637: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12638: // 1 ................イウエオカキクケコサシスセソタ0 アイ**ア Z=イウエオカキクケコサシスセソタ==0,V=アイ!=0/-1 12639: // : 12640: // 15 ................タ000000000000000 ソタ**ソ Z=タ==0,V=アイウエオカキクケコサシスセソタ!=0/-1 12641: // 16 ................0000000000000000 タ01*タ V=アイウエオカキクケコサシスセソタ!=0 12642: // 17 ................0000000000000000 001*0 V=アイウエオカキクケコサシスセソタ!=0 12643: // CCR 12644: // X countが0のとき変化しない。他は最後に押し出されたビット 12645: // N 結果の最上位ビット 12646: // Z 結果が0のときセット。他はクリア 12647: // V ASRで元に戻せないときセット。他はクリア 12648: // C countが0のときクリア。他は最後に押し出されたビット 12649: // 12650: //LSL.W #<data>,Dr 12651: //LSL.W Dq,Dr 12652: //LSL.W <ea> 12653: // 論理左シフトワード 12654: // ................アイウエオカキクケコサシスセソタ XNZVC 12655: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12656: // 1 ................イウエオカキクケコサシスセソタ0 アイ*0ア Z=イウエオカキクケコサシスセソタ==0 12657: // : 12658: // 15 ................タ000000000000000 ソタ*0ソ Z=タ==0 12659: // 16 ................0000000000000000 タ010タ 12660: // 17 ................0000000000000000 00100 12661: // CCR 12662: // X countが0のとき変化しない。他は最後に押し出されたビット 12663: // N 結果の最上位ビット 12664: // Z 結果が0のときセット。他はクリア 12665: // V 常にクリア 12666: // C countが0のときクリア。他は最後に押し出されたビット 12667: // 12668: //ROL.W #<data>,Dr 12669: //ROL.W Dq,Dr 12670: //ROL.W <ea> 12671: // 左ローテートワード 12672: // ................アイウエオカキクケコサシスセソタ XNZVC 12673: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12674: // 1 ................イウエオカキクケコサシスセソタア Xイ*0ア Z=アイウエオカキクケコサシスセソタ==0 12675: // : 12676: // 15 ................タアイウエオカキクケコサシスセソ Xタ*0ソ Z=アイウエオカキクケコサシスセソタ==0 12677: // 16 ................アイウエオカキクケコサシスセソタ Xア*0タ Z=アイウエオカキクケコサシスセソタ==0 12678: // CCR 12679: // X 常に変化しない 12680: // N 結果の最上位ビット 12681: // Z 結果が0のときセット。他はクリア 12682: // V 常にクリア 12683: // C countが0のときクリア。他は結果の最下位ビット 12684: // 12685: //ROXL.W #<data>,Dr 12686: //ROXL.W Dq,Dr 12687: //ROXL.W <ea> 12688: // 拡張左ローテートワード 12689: // ................アイウエオカキクケコサシスセソタ XNZVC 12690: // 0 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 12691: // 1 ................イウエオカキクケコサシスセソタX アイ*0ア Z=イウエオカキクケコサシスセソタX==0 12692: // 2 ................ウエオカキクケコサシスセソタXア イウ*0イ Z=アウエオカキクケコサシスセソタX==0 12693: // : 12694: // 15 ................タXアイウエオカキクケコサシスセ ソタ*0ソ Z=アイウエオカキクケコサシスセタX==0 12695: // 16 ................Xアイウエオカキクケコサシスセソ タX*0タ Z=アイウエオカキクケコサシスセソX==0 12696: // 17 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 12697: // CCR 12698: // X countが0のとき変化しない。他は最後に押し出されたビット 12699: // N 結果の最上位ビット 12700: // Z 結果が0のときセット。他はクリア 12701: // V 常にクリア 12702: // C countが0のときXのコピー。他は最後に押し出されたビット 12703: public static void irpXxlToRegWord () throws M68kException { 12704: int rrr; 12705: int x = XEiJ.regRn[rrr = XEiJ.regOC & 7]; 12706: int y; 12707: int z; 12708: int t; 12709: switch (XEiJ.regOC >> 3 & 0b111_000 >> 3) { 12710: case 0b000_000 >> 3: //ASL.W #<data>,Dr 12711: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12712: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) ((t = x << y) << 1)); 12713: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | (z >> y + 1 != (short) x ? XEiJ.REG_CCR_V : 0) | (short) t >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //VはASRで元に戻せないときセット。XとCは最後に押し出されたビット 12714: break; 12715: case 0b001_000 >> 3: //LSL.W #<data>,Dr 12716: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12717: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) ((t = x << y) << 1)); 12718: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | (short) t >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12719: break; 12720: case 0b010_000 >> 3: //ROXL.W #<data>,Dr 12721: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12722: z = x << 1 | XEiJ.regCCR >> 4 & 1; 12723: if (y == 1 - 1) { //y=data-1=1-1 12724: t = x; 12725: } else { //y=data-1=2-1~8-1 12726: z = (t = z << y - (2 - 1)) << 1 | (char) x >>> 17 - 1 - y; 12727: } 12728: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) z); 12729: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | (short) t >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12730: break; 12731: case 0b011_000 >> 3: //ROL.W #<data>,Dr 12732: XEiJ.mpuCycleCount += 6 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12733: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) (x << y + 1 | (char) x >>> 16 - 1 - y)); 12734: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | z & 1; //Xは変化しない。Cは結果の最下位ビット 12735: break; 12736: case 0b100_000 >> 3: //ASL.W Dq,Dr 12737: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12738: XEiJ.mpuCycleCount += 6 + (y << 1); 12739: if (y <= 15) { //y=data=0~15 12740: if (y == 0) { //y=data=0 12741: z = (short) x; 12742: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。VとCはクリア 12743: } else { //y=data=1~15 12744: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) ((t = x << y - 1) << 1)); 12745: t = (z >> y != (short) x ? XEiJ.REG_CCR_V : 0) | (short) t >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //VはASRで元に戻せないときセット。XとCは最後に押し出されたビット 12746: } 12747: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12748: } else { //y=data=16~63 12749: XEiJ.regRn[rrr] = ~0xffff & x; 12750: XEiJ.regCCR = XEiJ.REG_CCR_Z | ((short) x != 0 ? XEiJ.REG_CCR_V : 0) | (y == 16 ? -(x & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C) : 0); 12751: } 12752: break; 12753: case 0b101_000 >> 3: //LSL.W Dq,Dr 12754: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12755: XEiJ.mpuCycleCount += 6 + (y << 1); 12756: if (y == 0) { //y=data=0 12757: z = (short) x; 12758: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。Cはクリア 12759: } else { //y=data=1~63 12760: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) ((t = y <= 16 ? x << y - 1 : 0) << 1)); 12761: t = (short) t >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12762: } 12763: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12764: break; 12765: case 0b110_000 >> 3: //ROXL.W Dq,Dr 12766: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12767: XEiJ.mpuCycleCount += 6 + (y << 1); 12768: //y %= 17; 12769: y = (y & 15) - (y >> 4); //y=data=-3~15 12770: y += y >> 4 & 17; //y=data=0~16 12771: if (y == 0) { //y=data=0 12772: z = (short) x; 12773: t = -(XEiJ.regCCR >> 4 & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //Xは変化しない。CはXのコピー 12774: } else { //y=data=1~16 12775: z = x << 1 | XEiJ.regCCR >> 4 & 1; 12776: if (y == 1) { //y=data=1 12777: t = x; //Cは最後に押し出されたビット 12778: } else { //y=data=2~16 12779: z = (t = z << y - 2) << 1 | (char) x >>> 17 - y; 12780: } 12781: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) z); 12782: t = (short) t >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12783: } 12784: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12785: break; 12786: case 0b111_000 >> 3: //ROL.W Dq,Dr 12787: default: 12788: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12789: XEiJ.mpuCycleCount += 6 + (y << 1); 12790: if (y == 0) { 12791: z = (short) x; 12792: t = 0; //Cはクリア 12793: } else { 12794: y &= 15; //y=data=0~15 12795: XEiJ.regRn[rrr] = ~0xffff & x | (char) (z = (short) (x << y | (char) x >>> 16 - y)); 12796: t = z & 1; //Cは結果の最下位ビット 12797: } 12798: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | t; //Xは変化しない 12799: } 12800: } //irpXxlToRegWord 12801: 12802: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12803: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 12804: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 12805: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12806: //ASL.L #<data>,Dr |-|012346|-|UUUUU|*****| |1110_qqq_110_000_rrr 12807: //LSL.L #<data>,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_110_001_rrr 12808: //ROXL.L #<data>,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_110_010_rrr 12809: //ROL.L #<data>,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_110_011_rrr 12810: //ASL.L Dq,Dr |-|012346|-|UUUUU|*****| |1110_qqq_110_100_rrr 12811: //LSL.L Dq,Dr |-|012346|-|UUUUU|***0*| |1110_qqq_110_101_rrr 12812: //ROXL.L Dq,Dr |-|012346|-|*UUUU|***0*| |1110_qqq_110_110_rrr 12813: //ROL.L Dq,Dr |-|012346|-|-UUUU|-**0*| |1110_qqq_110_111_rrr 12814: //ASL.L Dr |A|012346|-|UUUUU|*****| |1110_001_110_000_rrr [ASL.L #1,Dr] 12815: //LSL.L Dr |A|012346|-|UUUUU|***0*| |1110_001_110_001_rrr [LSL.L #1,Dr] 12816: //ROXL.L Dr |A|012346|-|*UUUU|***0*| |1110_001_110_010_rrr [ROXL.L #1,Dr] 12817: //ROL.L Dr |A|012346|-|-UUUU|-**0*| |1110_001_110_011_rrr [ROL.L #1,Dr] 12818: // 12819: //ASL.L #<data>,Dr 12820: //ASL.L Dq,Dr 12821: // 算術左シフトロング 12822: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12823: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア**0 Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12824: // 1 イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ0 アイ**ア Z=イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0,V=アイ!=0/-1 12825: // : 12826: // 31 ミ0000000000000000000000000000000 マミ**マ Z=ミ==0,V=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ!=0/-1 12827: // 32 00000000000000000000000000000000 ミ01*ミ V=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ!=0 12828: // 33 00000000000000000000000000000000 001*0 V=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ!=0 12829: // CCR 12830: // X countが0のとき変化しない。他は最後に押し出されたビット 12831: // N 結果の最上位ビット 12832: // Z 結果が0のときセット。他はクリア 12833: // V ASRで元に戻せないときセット。他はクリア 12834: // C countが0のときクリア。他は最後に押し出されたビット 12835: // 12836: //LSL.L #<data>,Dr 12837: //LSL.L Dq,Dr 12838: // 論理左シフトロング 12839: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12840: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*00 Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12841: // 1 イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ0 アイ*0ア Z=イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12842: // : 12843: // 31 ミ0000000000000000000000000000000 マミ*0マ Z=ミ==0 12844: // 32 00000000000000000000000000000000 ミ010ミ 12845: // 33 00000000000000000000000000000000 00100 12846: // CCR 12847: // X countが0のとき変化しない。他は最後に押し出されたビット 12848: // N 結果の最上位ビット 12849: // Z 結果が0のときセット。他はクリア 12850: // V 常にクリア 12851: // C countが0のときクリア。他は最後に押し出されたビット 12852: // 12853: //ROL.L #<data>,Dr 12854: //ROL.L Dq,Dr 12855: // 左ローテートロング 12856: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12857: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*00 Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12858: // 1 イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミア Xイ*0ア Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12859: // : 12860: // 31 ミアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ Xミ*0マ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12861: // 32 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*0ミ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12862: // CCR 12863: // X 常に変化しない 12864: // N 結果の最上位ビット 12865: // Z 結果が0のときセット。他はクリア 12866: // V 常にクリア 12867: // C countが0のときクリア。他は結果の最下位ビット 12868: // 12869: //ROXL.L #<data>,Dr 12870: //ROXL.L Dq,Dr 12871: // 拡張左ローテートロング 12872: // アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ XNZVC 12873: // 0 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*0X Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12874: // 1 イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミX アイ*0ア Z=イウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミX==0 12875: // 2 ウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミXア イウ*0イ Z=アウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミX==0 12876: // : 12877: // 31 ミXアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホ マミ*0マ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホミX==0 12878: // 32 Xアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマ ミX*0ミ Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマX==0 12879: // 33 アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ Xア*0X Z=アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミ==0 12880: // CCR 12881: // X countが0のとき変化しない。他は最後に押し出されたビット 12882: // N 結果の最上位ビット 12883: // Z 結果が0のときセット。他はクリア 12884: // V 常にクリア 12885: // C countが0のときXのコピー。他は最後に押し出されたビット 12886: public static void irpXxlToRegLong () throws M68kException { 12887: int rrr; 12888: int x = XEiJ.regRn[rrr = XEiJ.regOC & 7]; 12889: int y; 12890: int z; 12891: int t; 12892: switch (XEiJ.regOC >> 3 & 0b111_000 >> 3) { 12893: case 0b000_000 >> 3: //ASL.L #<data>,Dr 12894: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12895: XEiJ.regRn[rrr] = z = (t = x << y) << 1; 12896: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | (z >> y + 1 != x ? XEiJ.REG_CCR_V : 0) | t >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //VはASRで元に戻せないときセット。XとCは最後に押し出されたビット 12897: break; 12898: case 0b001_000 >> 3: //LSL.L #<data>,Dr 12899: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12900: XEiJ.regRn[rrr] = z = (t = x << y) << 1; 12901: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12902: break; 12903: case 0b010_000 >> 3: //ROXL.L #<data>,Dr 12904: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12905: z = x << 1 | XEiJ.regCCR >> 4 & 1; 12906: if (y == 1 - 1) { //y=data-1=1-1 12907: t = x; 12908: } else { //y=data-1=2-1~8-1 12909: z = (t = z << y - (2 - 1)) << 1 | x >>> -y; //Javaのシフト演算子は5ビットでマスクされるので33-1-yを-yに省略 12910: } 12911: XEiJ.regRn[rrr] = z; 12912: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12913: break; 12914: case 0b011_000 >> 3: //ROL.L #<data>,Dr 12915: XEiJ.mpuCycleCount += 8 + 2 + ((y = (XEiJ.regOC >> 9) - 1 & 7) << 1); //y=data-1=1-1~8-1 12916: XEiJ.regRn[rrr] = z = x << y + 1 | x >>> ~y; //Javaのシフト演算子は5ビットでマスクされるので32-1-yを~yに省略 12917: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | z & 1; //Xは変化しない。Cは結果の最下位ビット 12918: break; 12919: case 0b100_000 >> 3: //ASL.L Dq,Dr 12920: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12921: XEiJ.mpuCycleCount += 8 + (y << 1); 12922: if (y <= 31) { //y=data=0~31 12923: if (y == 0) { //y=data=0 12924: z = x; 12925: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。VとCはクリア 12926: } else { //y=data=1~31 12927: XEiJ.regRn[rrr] = z = (t = x << y - 1) << 1; 12928: t = (z >> y != x ? XEiJ.REG_CCR_V : 0) | t >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //VはASRで元に戻せないときセット。XとCは最後に押し出されたビット 12929: } 12930: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12931: } else { //y=data=32~63 12932: XEiJ.regRn[rrr] = 0; 12933: XEiJ.regCCR = XEiJ.REG_CCR_Z | (x != 0 ? XEiJ.REG_CCR_V : 0) | (y == 32 ? -(x & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C) : 0); 12934: } 12935: break; 12936: case 0b101_000 >> 3: //LSL.L Dq,Dr 12937: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12938: XEiJ.mpuCycleCount += 8 + (y << 1); 12939: if (y == 0) { //y=data=0 12940: z = x; 12941: t = XEiJ.regCCR & XEiJ.REG_CCR_X; //Xは変化しない。Cはクリア 12942: } else { //y=data=1~63 12943: XEiJ.regRn[rrr] = z = (t = y <= 32 ? x << y - 1 : 0) << 1; 12944: t = t >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12945: } 12946: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12947: break; 12948: case 0b110_000 >> 3: //ROXL.L Dq,Dr 12949: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12950: XEiJ.mpuCycleCount += 8 + (y << 1); 12951: //y %= 33; 12952: y -= 32 - y >> 6 & 33; //y=data=0~32 12953: if (y == 0) { //y=data=0 12954: z = x; 12955: t = -(XEiJ.regCCR >> 4 & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //Xは変化しない。CはXのコピー 12956: } else { //y=data=1~32 12957: z = x << 1 | XEiJ.regCCR >> 4 & 1; 12958: if (y == 1) { //y=data=1 12959: t = x; //Cは最後に押し出されたビット 12960: } else { //y=data=2~32 12961: z = (t = z << y - 2) << 1 | x >>> 33 - y; 12962: } 12963: XEiJ.regRn[rrr] = z; 12964: t = t >> 31 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); //XとCは最後に押し出されたビット 12965: } 12966: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.REG_CCR_Z : 0) | t; 12967: break; 12968: case 0b111_000 >> 3: //ROL.L Dq,Dr 12969: default: 12970: y = XEiJ.regRn[XEiJ.regOC >> 9 & 7] & 63; //y=0~63。Javaのシフト演算子は5ビットでマスクされることに注意 12971: XEiJ.mpuCycleCount += 8 + (y << 1); 12972: if (y == 0) { 12973: z = x; 12974: t = 0; //Cはクリア 12975: } else { 12976: XEiJ.regRn[rrr] = z = x << y | x >>> -y; //Javaのシフト演算子は5ビットでマスクされるのでy&31をyに、32-(y&31)を-yに省略。y=32のときx|xになるが問題ない 12977: t = z & 1; 12978: } 12979: XEiJ.regCCR = z >> 28 & XEiJ.REG_CCR_N | (z == 0 ? XEiJ.regCCR & XEiJ.REG_CCR_X | XEiJ.REG_CCR_Z : XEiJ.regCCR & XEiJ.REG_CCR_X) | t; //Xは変化しない 12980: } 12981: } //irpXxlToRegLong 12982: 12983: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12984: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 12985: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 12986: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 12987: //ASL.W <ea> |-|012346|-|UUUUU|*****| M+-WXZ |1110_000_111_mmm_rrr 12988: // 12989: //ASL.W #<data>,Dr 12990: //ASL.W Dq,Dr 12991: //ASL.W <ea> 12992: // 算術左シフトワード 12993: // ................アイウエオカキクケコサシスセソタ XNZVC 12994: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 12995: // 1 ................イウエオカキクケコサシスセソタ0 アイ**ア Z=イウエオカキクケコサシスセソタ==0,V=アイ!=0/-1 12996: // : 12997: // 15 ................タ000000000000000 ソタ**ソ Z=タ==0,V=アイウエオカキクケコサシスセソタ!=0/-1 12998: // 16 ................0000000000000000 タ01*タ V=アイウエオカキクケコサシスセソタ!=0 12999: // 17 ................0000000000000000 001*0 V=アイウエオカキクケコサシスセソタ!=0 13000: // CCR 13001: // X countが0のとき変化しない。他は最後に押し出されたビット 13002: // N 結果の最上位ビット 13003: // Z 結果が0のときセット。他はクリア 13004: // V ASRで元に戻せないときセット。他はクリア 13005: // C countが0のときクリア。他は最後に押し出されたビット 13006: public static void irpAslToMem () throws M68kException { 13007: XEiJ.mpuCycleCount += 8; 13008: int ea = XEiJ.regOC & 63; 13009: int a = efaMltWord (ea); 13010: int x = XEiJ.busRws (a); 13011: int z = (short) (x << 1); 13012: XEiJ.busWw (a, z); 13013: XEiJ.regCCR = ((z < 0 ? XEiJ.REG_CCR_N : 0) | 13014: (z == 0 ? XEiJ.REG_CCR_Z : 0) | 13015: (x ^ z) >>> 31 << 1 | //Vは最上位ビットが変化したときセット 13016: x >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //XとCは最後に押し出されたビット 13017: } //irpAslToMem 13018: 13019: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13020: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13021: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13022: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13023: //LSR.W <ea> |-|012346|-|UUUUU|*0*0*| M+-WXZ |1110_001_011_mmm_rrr 13024: // 13025: //LSR.W #<data>,Dr 13026: //LSR.W Dq,Dr 13027: //LSR.W <ea> 13028: // 論理右シフトワード 13029: // ................アイウエオカキクケコサシスセソタ XNZVC 13030: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 13031: // 1 ................0アイウエオカキクケコサシスセソ タ0*0タ Z=アイウエオカキクケコサシスセソ==0 13032: // : 13033: // 15 ................000000000000000ア イ0*0イ Z=ア==0 13034: // 16 ................0000000000000000 ア010ア 13035: // 17 ................0000000000000000 00100 13036: // CCR 13037: // X countが0のとき変化しない。他は最後に押し出されたビット 13038: // N 結果の最上位ビット 13039: // Z 結果が0のときセット。他はクリア 13040: // V 常にクリア 13041: // C countが0のときクリア。他は最後に押し出されたビット 13042: public static void irpLsrToMem () throws M68kException { 13043: XEiJ.mpuCycleCount += 8; 13044: int ea = XEiJ.regOC & 63; 13045: int a = efaMltWord (ea); 13046: int x = XEiJ.busRwz (a); 13047: int z = x >>> 1; 13048: XEiJ.busWw (a, z); 13049: XEiJ.regCCR = ((z == 0 ? XEiJ.REG_CCR_Z : 0) | 13050: -(x & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //XとCは最後に押し出されたビット 13051: } //irpLsrToMem 13052: 13053: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13054: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13055: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13056: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13057: //LSL.W <ea> |-|012346|-|UUUUU|***0*| M+-WXZ |1110_001_111_mmm_rrr 13058: // 13059: //LSL.W #<data>,Dr 13060: //LSL.W Dq,Dr 13061: //LSL.W <ea> 13062: // 論理左シフトワード 13063: // ................アイウエオカキクケコサシスセソタ XNZVC 13064: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 13065: // 1 ................イウエオカキクケコサシスセソタ0 アイ*0ア Z=イウエオカキクケコサシスセソタ==0 13066: // : 13067: // 15 ................タ000000000000000 ソタ*0ソ Z=タ==0 13068: // 16 ................0000000000000000 タ010タ 13069: // 17 ................0000000000000000 00100 13070: // CCR 13071: // X countが0のとき変化しない。他は最後に押し出されたビット 13072: // N 結果の最上位ビット 13073: // Z 結果が0のときセット。他はクリア 13074: // V 常にクリア 13075: // C countが0のときクリア。他は最後に押し出されたビット 13076: public static void irpLslToMem () throws M68kException { 13077: XEiJ.mpuCycleCount += 8; 13078: int ea = XEiJ.regOC & 63; 13079: int a = efaMltWord (ea); 13080: int x = XEiJ.busRws (a); 13081: int z = (short) (x << 1); 13082: XEiJ.busWw (a, z); 13083: XEiJ.regCCR = ((z < 0 ? XEiJ.REG_CCR_N : 0) | 13084: (z == 0 ? XEiJ.REG_CCR_Z : 0) | 13085: x >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //XとCは最後に押し出されたビット 13086: } //irpLslToMem 13087: 13088: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13089: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13090: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13091: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13092: //ROXR.W <ea> |-|012346|-|*UUUU|***0*| M+-WXZ |1110_010_011_mmm_rrr 13093: // 13094: //ROXR.W #<data>,Dr 13095: //ROXR.W Dq,Dr 13096: //ROXR.W <ea> 13097: // 拡張右ローテートワード 13098: // ................アイウエオカキクケコサシスセソタ XNZVC 13099: // 0 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 13100: // 1 ................Xアイウエオカキクケコサシスセソ タX*0タ Z=アイウエオカキクケコサシスセソX==0 13101: // 2 ................タXアイウエオカキクケコサシスセ ソタ*0ソ Z=アイウエオカキクケコサシスセタX==0 13102: // : 13103: // 15 ................ウエオカキクケコサシスセソタXア イウ*0イ Z=アウエオカキクケコサシスセソタX==0 13104: // 16 ................イウエオカキクケコサシスセソタX アイ*0ア Z=イウエオカキクケコサシスセソタX==0 13105: // 17 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 13106: // CCR 13107: // X countが0のとき変化しない。他は最後に押し出されたビット 13108: // N 結果の最上位ビット 13109: // Z 結果が0のときセット。他はクリア 13110: // V 常にクリア 13111: // C countが0のときXのコピー。他は最後に押し出されたビット 13112: public static void irpRoxrToMem () throws M68kException { 13113: XEiJ.mpuCycleCount += 8; 13114: int ea = XEiJ.regOC & 63; 13115: int a = efaMltWord (ea); 13116: int x = XEiJ.busRwz (a); 13117: int z = -(XEiJ.regCCR & XEiJ.REG_CCR_X) << 15 - 4 | x >>> 1; 13118: XEiJ.busWw (a, z); 13119: XEiJ.regCCR = ((z < 0 ? XEiJ.REG_CCR_N : 0) | 13120: (z == 0 ? XEiJ.REG_CCR_Z : 0) | 13121: -(x & 1) & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //XとCは最後に押し出されたビット 13122: } //irpRoxrToMem 13123: 13124: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13125: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13126: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13127: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13128: //ROXL.W <ea> |-|012346|-|*UUUU|***0*| M+-WXZ |1110_010_111_mmm_rrr 13129: // 13130: //ROXL.W #<data>,Dr 13131: //ROXL.W Dq,Dr 13132: //ROXL.W <ea> 13133: // 拡張左ローテートワード 13134: // ................アイウエオカキクケコサシスセソタ XNZVC 13135: // 0 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 13136: // 1 ................イウエオカキクケコサシスセソタX アイ*0ア Z=イウエオカキクケコサシスセソタX==0 13137: // 2 ................ウエオカキクケコサシスセソタXア イウ*0イ Z=アウエオカキクケコサシスセソタX==0 13138: // : 13139: // 15 ................タXアイウエオカキクケコサシスセ ソタ*0ソ Z=アイウエオカキクケコサシスセタX==0 13140: // 16 ................Xアイウエオカキクケコサシスセソ タX*0タ Z=アイウエオカキクケコサシスセソX==0 13141: // 17 ................アイウエオカキクケコサシスセソタ Xア*0X Z=アイウエオカキクケコサシスセソタ==0 13142: // CCR 13143: // X countが0のとき変化しない。他は最後に押し出されたビット 13144: // N 結果の最上位ビット 13145: // Z 結果が0のときセット。他はクリア 13146: // V 常にクリア 13147: // C countが0のときXのコピー。他は最後に押し出されたビット 13148: public static void irpRoxlToMem () throws M68kException { 13149: XEiJ.mpuCycleCount += 8; 13150: int ea = XEiJ.regOC & 63; 13151: int a = efaMltWord (ea); 13152: int x = XEiJ.busRws (a); 13153: int z = (short) (x << 1 | XEiJ.regCCR >> 4 & 1); 13154: XEiJ.busWw (a, z); 13155: XEiJ.regCCR = ((z < 0 ? XEiJ.REG_CCR_N : 0) | 13156: (z == 0 ? XEiJ.REG_CCR_Z : 0) | 13157: x >> 15 & (XEiJ.REG_CCR_X | XEiJ.REG_CCR_C)); //XとCは最後に押し出されたビット 13158: } //irpRoxlToMem 13159: 13160: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13161: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13162: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13163: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13164: //ROR.W <ea> |-|012346|-|-UUUU|-**0*| M+-WXZ |1110_011_011_mmm_rrr 13165: // 13166: //ROR.W #<data>,Dr 13167: //ROR.W Dq,Dr 13168: //ROR.W <ea> 13169: // 右ローテートワード 13170: // ................アイウエオカキクケコサシスセソタ XNZVC 13171: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 13172: // 1 ................タアイウエオカキクケコサシスセソ Xタ*0タ Z=アイウエオカキクケコサシスセソタ==0 13173: // : 13174: // 15 ................イウエオカキクケコサシスセソタア Xイ*0イ Z=アイウエオカキクケコサシスセソタ==0 13175: // 16 ................アイウエオカキクケコサシスセソタ Xア*0ア Z=アイウエオカキクケコサシスセソタ==0 13176: // CCR 13177: // X 常に変化しない 13178: // N 結果の最上位ビット 13179: // Z 結果が0のときセット。他はクリア 13180: // V 常にクリア 13181: // C countが0のときクリア。他は結果の最上位ビット 13182: public static void irpRorToMem () throws M68kException { 13183: XEiJ.mpuCycleCount += 8; 13184: int ea = XEiJ.regOC & 63; 13185: int a = efaMltWord (ea); 13186: int x = XEiJ.busRwz (a); 13187: int z = (short) (x << 15 | x >>> 1); 13188: XEiJ.busWw (a, z); 13189: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 13190: (z < 0 ? XEiJ.REG_CCR_N : 0) | 13191: (z == 0 ? XEiJ.REG_CCR_Z : 0) | 13192: z >>> 31); //Cは結果の最上位ビット 13193: } //irpRorToMem 13194: 13195: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13196: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13197: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13198: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13199: //ROL.W <ea> |-|012346|-|-UUUU|-**0*| M+-WXZ |1110_011_111_mmm_rrr 13200: // 13201: //ROL.W #<data>,Dr 13202: //ROL.W Dq,Dr 13203: //ROL.W <ea> 13204: // 左ローテートワード 13205: // ................アイウエオカキクケコサシスセソタ XNZVC 13206: // 0 ................アイウエオカキクケコサシスセソタ Xア*00 Z=アイウエオカキクケコサシスセソタ==0 13207: // 1 ................イウエオカキクケコサシスセソタア Xイ*0ア Z=アイウエオカキクケコサシスセソタ==0 13208: // : 13209: // 15 ................タアイウエオカキクケコサシスセソ Xタ*0ソ Z=アイウエオカキクケコサシスセソタ==0 13210: // 16 ................アイウエオカキクケコサシスセソタ Xア*0タ Z=アイウエオカキクケコサシスセソタ==0 13211: // CCR 13212: // X 常に変化しない 13213: // N 結果の最上位ビット 13214: // Z 結果が0のときセット。他はクリア 13215: // V 常にクリア 13216: // C countが0のときクリア。他は結果の最下位ビット 13217: public static void irpRolToMem () throws M68kException { 13218: XEiJ.mpuCycleCount += 8; 13219: int ea = XEiJ.regOC & 63; 13220: int a = efaMltWord (ea); 13221: int x = XEiJ.busRwz (a); 13222: int z = (short) (x << 1 | x >>> 15); 13223: XEiJ.busWw (a, z); 13224: XEiJ.regCCR = (XEiJ.regCCR & XEiJ.REG_CCR_X | //Xは変化しない 13225: (z < 0 ? XEiJ.REG_CCR_N : 0) | 13226: (z == 0 ? XEiJ.REG_CCR_Z : 0) | 13227: z & 1); //Cは結果の最下位ビット 13228: } //irpRolToMem 13229: 13230: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13231: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13232: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13233: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13234: //FPACK <data> |A|012346|-|UUUUU|*****| |1111_111_0dd_ddd_ddd [FLINE #<data>] 13235: public static void irpFpack () throws M68kException { 13236: if (!MainMemory.mmrFEfuncActivated) { 13237: irpFline (); 13238: return; 13239: } 13240: StringBuilder sb; 13241: int a0; 13242: if (FEFunction.FPK_DEBUG_TRACE) { 13243: sb = new StringBuilder (); 13244: String name = Disassembler.DIS_FPACK_NAME[XEiJ.regOC & 255]; 13245: if (name.length () == 0) { 13246: XEiJ.fmtHex4 (sb.append ('$'), XEiJ.regOC); 13247: } else { 13248: sb.append (name); 13249: } 13250: sb.append ('\n'); 13251: XEiJ.fmtHex8 (XEiJ.fmtHex8 (XEiJ.fmtHex8 (XEiJ.fmtHex8 (sb.append (" D0="), XEiJ.regRn[0]).append (" D1="), XEiJ.regRn[1]).append (" D2="), XEiJ.regRn[2]).append (" D3="), XEiJ.regRn[3]); 13252: a0 = XEiJ.regRn[8]; 13253: MainMemory.mmrRstr (sb.append (" (A0)=\""), a0, MainMemory.mmrStrlen (a0, 20)).append ("\"\n"); 13254: } 13255: XEiJ.mpuCycleCount += FEFunction.FPK_CLOCK; //一律にFEFunction.FPK_CLOCKサイクルかかることにする 13256: switch (XEiJ.regOC & 255) { 13257: case 0x00: FEFunction.fpkLMUL (); break; 13258: case 0x01: FEFunction.fpkLDIV (); break; 13259: case 0x02: FEFunction.fpkLMOD (); break; 13260: //case 0x03: break; 13261: case 0x04: FEFunction.fpkUMUL (); break; 13262: case 0x05: FEFunction.fpkUDIV (); break; 13263: case 0x06: FEFunction.fpkUMOD (); break; 13264: //case 0x07: break; 13265: case 0x08: FEFunction.fpkIMUL (); break; 13266: case 0x09: FEFunction.fpkIDIV (); break; 13267: //case 0x0a: break; 13268: //case 0x0b: break; 13269: case 0x0c: FEFunction.fpkRANDOMIZE (); break; 13270: case 0x0d: FEFunction.fpkSRAND (); break; 13271: case 0x0e: FEFunction.fpkRAND (); break; 13272: //case 0x0f: break; 13273: case 0x10: FEFunction.fpkSTOL (); break; 13274: case 0x11: FEFunction.fpkLTOS (); break; 13275: case 0x12: FEFunction.fpkSTOH (); break; 13276: case 0x13: FEFunction.fpkHTOS (); break; 13277: case 0x14: FEFunction.fpkSTOO (); break; 13278: case 0x15: FEFunction.fpkOTOS (); break; 13279: case 0x16: FEFunction.fpkSTOB (); break; 13280: case 0x17: FEFunction.fpkBTOS (); break; 13281: case 0x18: FEFunction.fpkIUSING (); break; 13282: //case 0x19: break; 13283: case 0x1a: FEFunction.fpkLTOD (); break; 13284: case 0x1b: FEFunction.fpkDTOL (); break; 13285: case 0x1c: FEFunction.fpkLTOF (); break; 13286: case 0x1d: FEFunction.fpkFTOL (); break; 13287: case 0x1e: FEFunction.fpkFTOD (); break; 13288: case 0x1f: FEFunction.fpkDTOF (); break; 13289: case 0x20: FEFunction.fpkVAL (); break; 13290: case 0x21: FEFunction.fpkUSING (); break; 13291: case 0x22: FEFunction.fpkSTOD (); break; 13292: case 0x23: FEFunction.fpkDTOS (); break; 13293: case 0x24: FEFunction.fpkECVT (); break; 13294: case 0x25: FEFunction.fpkFCVT (); break; 13295: case 0x26: FEFunction.fpkGCVT (); break; 13296: //case 0x27: break; 13297: case 0x28: FEFunction.fpkDTST (); break; 13298: case 0x29: FEFunction.fpkDCMP (); break; 13299: case 0x2a: FEFunction.fpkDNEG (); break; 13300: case 0x2b: FEFunction.fpkDADD (); break; 13301: case 0x2c: FEFunction.fpkDSUB (); break; 13302: case 0x2d: FEFunction.fpkDMUL (); break; 13303: case 0x2e: FEFunction.fpkDDIV (); break; 13304: case 0x2f: FEFunction.fpkDMOD (); break; 13305: case 0x30: FEFunction.fpkDABS (); break; 13306: case 0x31: FEFunction.fpkDCEIL (); break; 13307: case 0x32: FEFunction.fpkDFIX (); break; 13308: case 0x33: FEFunction.fpkDFLOOR (); break; 13309: case 0x34: FEFunction.fpkDFRAC (); break; 13310: case 0x35: FEFunction.fpkDSGN (); break; 13311: case 0x36: FEFunction.fpkSIN (); break; 13312: case 0x37: FEFunction.fpkCOS (); break; 13313: case 0x38: FEFunction.fpkTAN (); break; 13314: case 0x39: FEFunction.fpkATAN (); break; 13315: case 0x3a: FEFunction.fpkLOG (); break; 13316: case 0x3b: FEFunction.fpkEXP (); break; 13317: case 0x3c: FEFunction.fpkSQR (); break; 13318: case 0x3d: FEFunction.fpkPI (); break; 13319: case 0x3e: FEFunction.fpkNPI (); break; 13320: case 0x3f: FEFunction.fpkPOWER (); break; 13321: case 0x40: FEFunction.fpkRND (); break; 13322: case 0x41: FEFunction.fpkSINH (); break; 13323: case 0x42: FEFunction.fpkCOSH (); break; 13324: case 0x43: FEFunction.fpkTANH (); break; 13325: case 0x44: FEFunction.fpkATANH (); break; 13326: case 0x45: FEFunction.fpkASIN (); break; 13327: case 0x46: FEFunction.fpkACOS (); break; 13328: case 0x47: FEFunction.fpkLOG10 (); break; 13329: case 0x48: FEFunction.fpkLOG2 (); break; 13330: case 0x49: FEFunction.fpkDFREXP (); break; 13331: case 0x4a: FEFunction.fpkDLDEXP (); break; 13332: case 0x4b: FEFunction.fpkDADDONE (); break; 13333: case 0x4c: FEFunction.fpkDSUBONE (); break; 13334: case 0x4d: FEFunction.fpkDDIVTWO (); break; 13335: case 0x4e: FEFunction.fpkDIEECNV (); break; 13336: case 0x4f: FEFunction.fpkIEEDCNV (); break; 13337: case 0x50: FEFunction.fpkFVAL (); break; 13338: case 0x51: FEFunction.fpkFUSING (); break; 13339: case 0x52: FEFunction.fpkSTOF (); break; 13340: case 0x53: FEFunction.fpkFTOS (); break; 13341: case 0x54: FEFunction.fpkFECVT (); break; 13342: case 0x55: FEFunction.fpkFFCVT (); break; 13343: case 0x56: FEFunction.fpkFGCVT (); break; 13344: //case 0x57: break; 13345: case 0x58: FEFunction.fpkFTST (); break; 13346: case 0x59: FEFunction.fpkFCMP (); break; 13347: case 0x5a: FEFunction.fpkFNEG (); break; 13348: case 0x5b: FEFunction.fpkFADD (); break; 13349: case 0x5c: FEFunction.fpkFSUB (); break; 13350: case 0x5d: FEFunction.fpkFMUL (); break; 13351: case 0x5e: FEFunction.fpkFDIV (); break; 13352: case 0x5f: FEFunction.fpkFMOD (); break; 13353: case 0x60: FEFunction.fpkFABS (); break; 13354: case 0x61: FEFunction.fpkFCEIL (); break; 13355: case 0x62: FEFunction.fpkFFIX (); break; 13356: case 0x63: FEFunction.fpkFFLOOR (); break; 13357: case 0x64: FEFunction.fpkFFRAC (); break; 13358: case 0x65: FEFunction.fpkFSGN (); break; 13359: case 0x66: FEFunction.fpkFSIN (); break; 13360: case 0x67: FEFunction.fpkFCOS (); break; 13361: case 0x68: FEFunction.fpkFTAN (); break; 13362: case 0x69: FEFunction.fpkFATAN (); break; 13363: case 0x6a: FEFunction.fpkFLOG (); break; 13364: case 0x6b: FEFunction.fpkFEXP (); break; 13365: case 0x6c: FEFunction.fpkFSQR (); break; 13366: case 0x6d: FEFunction.fpkFPI (); break; 13367: case 0x6e: FEFunction.fpkFNPI (); break; 13368: case 0x6f: FEFunction.fpkFPOWER (); break; 13369: case 0x70: FEFunction.fpkFRND (); break; 13370: case 0x71: FEFunction.fpkFSINH (); break; 13371: case 0x72: FEFunction.fpkFCOSH (); break; 13372: case 0x73: FEFunction.fpkFTANH (); break; 13373: case 0x74: FEFunction.fpkFATANH (); break; 13374: case 0x75: FEFunction.fpkFASIN (); break; 13375: case 0x76: FEFunction.fpkFACOS (); break; 13376: case 0x77: FEFunction.fpkFLOG10 (); break; 13377: case 0x78: FEFunction.fpkFLOG2 (); break; 13378: case 0x79: FEFunction.fpkFFREXP (); break; 13379: case 0x7a: FEFunction.fpkFLDEXP (); break; 13380: case 0x7b: FEFunction.fpkFADDONE (); break; 13381: case 0x7c: FEFunction.fpkFSUBONE (); break; 13382: case 0x7d: FEFunction.fpkFDIVTWO (); break; 13383: case 0x7e: FEFunction.fpkFIEECNV (); break; 13384: case 0x7f: FEFunction.fpkIEEFCNV (); break; 13385: //case 0x80: break; 13386: //case 0x81: break; 13387: //case 0x82: break; 13388: //case 0x83: break; 13389: //case 0x84: break; 13390: //case 0x85: break; 13391: //case 0x86: break; 13392: //case 0x87: break; 13393: //case 0x88: break; 13394: //case 0x89: break; 13395: //case 0x8a: break; 13396: //case 0x8b: break; 13397: //case 0x8c: break; 13398: //case 0x8d: break; 13399: //case 0x8e: break; 13400: //case 0x8f: break; 13401: //case 0x90: break; 13402: //case 0x91: break; 13403: //case 0x92: break; 13404: //case 0x93: break; 13405: //case 0x94: break; 13406: //case 0x95: break; 13407: //case 0x96: break; 13408: //case 0x97: break; 13409: //case 0x98: break; 13410: //case 0x99: break; 13411: //case 0x9a: break; 13412: //case 0x9b: break; 13413: //case 0x9c: break; 13414: //case 0x9d: break; 13415: //case 0x9e: break; 13416: //case 0x9f: break; 13417: //case 0xa0: break; 13418: //case 0xa1: break; 13419: //case 0xa2: break; 13420: //case 0xa3: break; 13421: //case 0xa4: break; 13422: //case 0xa5: break; 13423: //case 0xa6: break; 13424: //case 0xa7: break; 13425: //case 0xa8: break; 13426: //case 0xa9: break; 13427: //case 0xaa: break; 13428: //case 0xab: break; 13429: //case 0xac: break; 13430: //case 0xad: break; 13431: //case 0xae: break; 13432: //case 0xaf: break; 13433: //case 0xb0: break; 13434: //case 0xb1: break; 13435: //case 0xb2: break; 13436: //case 0xb3: break; 13437: //case 0xb4: break; 13438: //case 0xb5: break; 13439: //case 0xb6: break; 13440: //case 0xb7: break; 13441: //case 0xb8: break; 13442: //case 0xb9: break; 13443: //case 0xba: break; 13444: //case 0xbb: break; 13445: //case 0xbc: break; 13446: //case 0xbd: break; 13447: //case 0xbe: break; 13448: //case 0xbf: break; 13449: //case 0xc0: break; 13450: //case 0xc1: break; 13451: //case 0xc2: break; 13452: //case 0xc3: break; 13453: //case 0xc4: break; 13454: //case 0xc5: break; 13455: //case 0xc6: break; 13456: //case 0xc7: break; 13457: //case 0xc8: break; 13458: //case 0xc9: break; 13459: //case 0xca: break; 13460: //case 0xcb: break; 13461: //case 0xcc: break; 13462: //case 0xcd: break; 13463: //case 0xce: break; 13464: //case 0xcf: break; 13465: //case 0xd0: break; 13466: //case 0xd1: break; 13467: //case 0xd2: break; 13468: //case 0xd3: break; 13469: //case 0xd4: break; 13470: //case 0xd5: break; 13471: //case 0xd6: break; 13472: //case 0xd7: break; 13473: //case 0xd8: break; 13474: //case 0xd9: break; 13475: //case 0xda: break; 13476: //case 0xdb: break; 13477: //case 0xdc: break; 13478: //case 0xdd: break; 13479: //case 0xde: break; 13480: //case 0xdf: break; 13481: case 0xe0: FEFunction.fpkCLMUL (); break; 13482: case 0xe1: FEFunction.fpkCLDIV (); break; 13483: case 0xe2: FEFunction.fpkCLMOD (); break; 13484: case 0xe3: FEFunction.fpkCUMUL (); break; 13485: case 0xe4: FEFunction.fpkCUDIV (); break; 13486: case 0xe5: FEFunction.fpkCUMOD (); break; 13487: case 0xe6: FEFunction.fpkCLTOD (); break; 13488: case 0xe7: FEFunction.fpkCDTOL (); break; 13489: case 0xe8: FEFunction.fpkCLTOF (); break; 13490: case 0xe9: FEFunction.fpkCFTOL (); break; 13491: case 0xea: FEFunction.fpkCFTOD (); break; 13492: case 0xeb: FEFunction.fpkCDTOF (); break; 13493: case 0xec: FEFunction.fpkCDCMP (); break; 13494: case 0xed: FEFunction.fpkCDADD (); break; 13495: case 0xee: FEFunction.fpkCDSUB (); break; 13496: case 0xef: FEFunction.fpkCDMUL (); break; 13497: case 0xf0: FEFunction.fpkCDDIV (); break; 13498: case 0xf1: FEFunction.fpkCDMOD (); break; 13499: case 0xf2: FEFunction.fpkCFCMP (); break; 13500: case 0xf3: FEFunction.fpkCFADD (); break; 13501: case 0xf4: FEFunction.fpkCFSUB (); break; 13502: case 0xf5: FEFunction.fpkCFMUL (); break; 13503: case 0xf6: FEFunction.fpkCFDIV (); break; 13504: case 0xf7: FEFunction.fpkCFMOD (); break; 13505: case 0xf8: FEFunction.fpkCDTST (); break; 13506: case 0xf9: FEFunction.fpkCFTST (); break; 13507: case 0xfa: FEFunction.fpkCDINC (); break; 13508: case 0xfb: FEFunction.fpkCFINC (); break; 13509: case 0xfc: FEFunction.fpkCDDEC (); break; 13510: case 0xfd: FEFunction.fpkCFDEC (); break; 13511: case 0xfe: FEFunction.fpkFEVARG (); break; 13512: //case 0xff: FEFunction.fpkFEVECS (); break; //FLOATn.Xに処理させる 13513: default: 13514: XEiJ.mpuCycleCount -= FEFunction.FPK_CLOCK; //戻す 13515: irpFline (); 13516: } 13517: if (FEFunction.FPK_DEBUG_TRACE) { 13518: int i = sb.length (); 13519: XEiJ.fmtHex8 (XEiJ.fmtHex8 (XEiJ.fmtHex8 (XEiJ.fmtHex8 (sb.append (" D0="), XEiJ.regRn[0]).append (" D1="), XEiJ.regRn[1]).append (" D2="), XEiJ.regRn[2]).append (" D3="), XEiJ.regRn[3]); 13520: int l = MainMemory.mmrStrlen (a0, 20); 13521: sb.append (" (A0)=\""); 13522: i = sb.length () - i; 13523: MainMemory.mmrRstr (sb, a0, l).append ("\"\n"); 13524: if (a0 <= XEiJ.regRn[8] && XEiJ.regRn[8] <= a0 + l) { 13525: for (i += sb.length () + XEiJ.regRn[8] - a0; sb.length () < i; ) { 13526: sb.append (' '); 13527: } 13528: sb.append ('^'); 13529: } 13530: System.out.println (sb.toString ()); 13531: } 13532: } //irpFpack 13533: 13534: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13535: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13536: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13537: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13538: //DOS <data> |A|012346|-|UUUUU|UUUUU| |1111_111_1dd_ddd_ddd [FLINE #<data>] 13539: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13540: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13541: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13542: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13543: //FLINE #<data> |-|012346|-|UUUUU|UUUUU| |1111_ddd_ddd_ddd_ddd (line 1111 emulator) 13544: public static void irpFline () throws M68kException { 13545: XEiJ.mpuCycleCount += 34; 13546: if (XEiJ.MPU_INLINE_EXCEPTION) { 13547: int save_sr = XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR; 13548: int sp = XEiJ.regRn[15]; 13549: XEiJ.regSRT1 = XEiJ.mpuTraceFlag = 0; //srのTビットを消す 13550: if (XEiJ.regSRS == 0) { //ユーザモードのとき 13551: XEiJ.regSRS = XEiJ.REG_SR_S; //スーパーバイザモードへ移行する 13552: XEiJ.mpuUSP = sp; //USPを保存 13553: sp = XEiJ.mpuISP; //SSPを復元 13554: if (DataBreakPoint.DBP_ON) { 13555: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpSuperMap; //スーパーバイザメモリマップに切り替える 13556: } else { 13557: XEiJ.busMemoryMap = XEiJ.busSuperMap; //スーパーバイザメモリマップに切り替える 13558: } 13559: if (InstructionBreakPoint.IBP_ON) { 13560: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1SuperMap; 13561: } 13562: } 13563: int vectorOffset = M68kException.M6E_LINE_1111_EMULATOR << 2; //vector offset 13564: XEiJ.regRn[15] = sp -= 8; //short format 13565: XEiJ.busWw (sp + 6, 0x0000 | vectorOffset); //format and vector offset 13566: XEiJ.busWl (sp + 2, XEiJ.regPC0); //program counter 13567: XEiJ.busWw (sp, save_sr); //status register 13568: irpSetPC (XEiJ.busRlsf (XEiJ.mpuVBR + vectorOffset)); //例外ベクタを取り出してジャンプする 13569: } else { 13570: irpException (M68kException.M6E_LINE_1111_EMULATOR, XEiJ.regPC0, XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR); //pcは命令の先頭 13571: } 13572: } //irpFline 13573: 13574: //irpIllegal () 13575: // オペコードの上位10bitで分類されなかった未実装命令 13576: // 0x4afcのILLEGAL命令はここには来ない 13577: public static void irpIllegal () throws M68kException { 13578: if (true) { 13579: XEiJ.mpuCycleCount += 34; 13580: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 13581: throw M68kException.m6eSignal; 13582: } 13583: } //irpIllegal 13584: 13585: //z = irpAbcd (x, y) 13586: // ABCD 13587: public static int irpAbcd (int x, int y) { 13588: int c = XEiJ.regCCR >> 4; 13589: int t = (x & 0xff) + (y & 0xff) + c; //仮の結果 13590: int z = t; //結果 13591: if (0x0a <= (x & 0x0f) + (y & 0x0f) + c) { //ハーフキャリー 13592: z += 0x10 - 0x0a; 13593: } 13594: //XとCはキャリーがあるときセット、さもなくばクリア 13595: if (0xa0 <= z) { //キャリー 13596: z += 0x100 - 0xa0; 13597: XEiJ.regCCR |= XEiJ.REG_CCR_X | XEiJ.REG_CCR_C; 13598: } else { 13599: XEiJ.regCCR &= ~(XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); 13600: } 13601: //Zは結果が0でないときクリア、さもなくば変化しない 13602: z &= 0xff; 13603: if (z != 0x00) { 13604: XEiJ.regCCR &= ~XEiJ.REG_CCR_Z; 13605: } 13606: if (true) { 13607: //000/030のときNは結果の最上位ビット 13608: if ((z & 0x80) != 0) { 13609: XEiJ.regCCR |= XEiJ.REG_CCR_N; 13610: } else { 13611: XEiJ.regCCR &= ~XEiJ.REG_CCR_N; 13612: } 13613: //000のときVは補正値の加算でオーバーフローしたときセット、さもなくばクリア 13614: int a = z - t; //補正値 13615: if ((((t ^ z) & (a ^ z)) & 0x80) != 0) { 13616: XEiJ.regCCR |= XEiJ.REG_CCR_V; 13617: } else { 13618: XEiJ.regCCR &= ~XEiJ.REG_CCR_V; 13619: } 13620: } else if (false) { 13621: //000/030のときNは結果の最上位ビット 13622: if ((z & 0x80) != 0) { 13623: XEiJ.regCCR |= XEiJ.REG_CCR_N; 13624: } else { 13625: XEiJ.regCCR &= ~XEiJ.REG_CCR_N; 13626: } 13627: //030のときVはクリア 13628: XEiJ.regCCR &= ~XEiJ.REG_CCR_V; 13629: } else { 13630: //060のときNとVは変化しない 13631: } 13632: return z; 13633: } //irpAbcd 13634: 13635: //z = irpSbcd (x, y) 13636: // SBCD 13637: public static int irpSbcd (int x, int y) { 13638: int b = XEiJ.regCCR >> 4; 13639: int t = (x & 0xff) - (y & 0xff) - b; //仮の結果 13640: int z = t; //結果 13641: if ((x & 0x0f) - (y & 0x0f) - b < 0) { //ハーフボロー 13642: z -= 0x10 - 0x0a; 13643: } 13644: //XとCはボローがあるときセット、さもなくばクリア 13645: if (z < 0) { //ボロー 13646: if (t < 0) { 13647: z -= 0x100 - 0xa0; 13648: } 13649: XEiJ.regCCR |= XEiJ.REG_CCR_X | XEiJ.REG_CCR_C; 13650: } else { 13651: XEiJ.regCCR &= ~(XEiJ.REG_CCR_X | XEiJ.REG_CCR_C); 13652: } 13653: //Zは結果が0でないときクリア、さもなくば変化しない 13654: z &= 0xff; 13655: if (z != 0x00) { 13656: XEiJ.regCCR &= ~XEiJ.REG_CCR_Z; 13657: } 13658: if (true) { 13659: //000/030のときNは結果の最上位ビット 13660: if ((z & 0x80) != 0) { 13661: XEiJ.regCCR |= XEiJ.REG_CCR_N; 13662: } else { 13663: XEiJ.regCCR &= ~XEiJ.REG_CCR_N; 13664: } 13665: //000のときVは補正値の加算でオーバーフローしたときセット、さもなくばクリア 13666: int a = z - t; //補正値 13667: if ((((t ^ z) & (a ^ z)) & 0x80) != 0) { 13668: XEiJ.regCCR |= XEiJ.REG_CCR_V; 13669: } else { 13670: XEiJ.regCCR &= ~XEiJ.REG_CCR_V; 13671: } 13672: } else if (false) { 13673: //000/030のときNは結果の最上位ビット 13674: if ((z & 0x80) != 0) { 13675: XEiJ.regCCR |= XEiJ.REG_CCR_N; 13676: } else { 13677: XEiJ.regCCR &= ~XEiJ.REG_CCR_N; 13678: } 13679: //030のときVはクリア 13680: XEiJ.regCCR &= ~XEiJ.REG_CCR_V; 13681: } else { 13682: //060のときNとVは変化しない 13683: } 13684: return z; 13685: } //irpSbcd 13686: 13687: 13688: 13689: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13690: // | | MPU | |CCin |CCout|addressing| 1st opcode 2nd opcode 13691: // A:alias P:privileged |A|012346|P|XNZVC|XNZVC|DAM+-WXZPI|bbbb_bbb_bbb_bbb_bbb-bbbbbbbbbbbbbbbb 13692: //------------------------------------------------+-+------+-+-----+-----+----------+------------------------------------- 13693: //HFSBOOT |-|012346|-|-----|-----| |0100_111_000_000_000 13694: //HFSINST |-|012346|-|-----|-----| |0100_111_000_000_001 13695: //HFSSTR |-|012346|-|-----|-----| |0100_111_000_000_010 13696: //HFSINT |-|012346|-|-----|-----| |0100_111_000_000_011 13697: //EMXNOP |-|012346|-|-----|-----| |0100_111_000_000_100 13698: // エミュレータ拡張命令 13699: public static void irpEmx () throws M68kException { 13700: switch (XEiJ.regOC & 63) { 13701: case XEiJ.EMX_OPCODE_HFSBOOT & 63: 13702: XEiJ.mpuCycleCount += 40; 13703: if (HFS.hfsIPLBoot ()) { 13704: //JMP $6800.W 13705: irpSetPC (0x00006800); 13706: } 13707: break; 13708: case XEiJ.EMX_OPCODE_HFSINST & 63: 13709: XEiJ.mpuCycleCount += 40; 13710: HFS.hfsInstall (); 13711: break; 13712: case XEiJ.EMX_OPCODE_HFSSTR & 63: 13713: XEiJ.mpuCycleCount += 40; 13714: HFS.hfsStrategy (); 13715: break; 13716: case XEiJ.EMX_OPCODE_HFSINT & 63: 13717: XEiJ.mpuCycleCount += 40; 13718: //XEiJ.mpuClockTime += (int) (TMR_FREQ / 100000L); //0.01ms 13719: if (HFS.hfsInterrupt ()) { 13720: //WAIT 13721: XEiJ.mpuTraceFlag = 0; //トレース例外を発生させない 13722: XEiJ.regPC = XEiJ.regPC0; //ループ 13723: XEiJ.mpuClockTime += XEiJ.TMR_FREQ * 4 / 1000000; //4μs。10MHzのとき40clk 13724: XEiJ.mpuLastNano += 4000L; 13725: } 13726: break; 13727: case XEiJ.EMX_OPCODE_EMXNOP & 63: 13728: XEiJ.emxNop (); 13729: break; 13730: case XEiJ.EMX_OPCODE_EMXWAIT & 63: 13731: WaitInstruction.execute (); //待機命令を実行する 13732: break; 13733: default: 13734: XEiJ.mpuCycleCount += 34; 13735: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 13736: throw M68kException.m6eSignal; 13737: } 13738: } //irpEmx 13739: 13740: 13741: 13742: //irpSetPC (a) 13743: // pcへデータを書き込む 13744: // 奇数のときはアドレスエラーが発生する 13745: public static void irpSetPC (int a) throws M68kException { 13746: if (XEiJ.TEST_BIT_0_SHIFT ? a << 31 - 0 < 0 : (a & 1) != 0) { 13747: M68kException.m6eNumber = M68kException.M6E_ADDRESS_ERROR; 13748: M68kException.m6eAddress = a; 13749: M68kException.m6eDirection = XEiJ.MPU_WR_READ; 13750: M68kException.m6eSize = XEiJ.MPU_SS_LONG; 13751: throw M68kException.m6eSignal; 13752: } 13753: if (BranchLog.BLG_ON) { 13754: //BranchLog.blgJump (a); //分岐ログに分岐レコードを追加する 13755: if (BranchLog.blgPrevHeadSuper != (BranchLog.blgHead | BranchLog.blgSuper) || BranchLog.blgPrevTail != XEiJ.regPC0) { //前回のレコードと異なるとき 13756: int i = (char) BranchLog.blgNewestRecord++ << BranchLog.BLG_RECORD_SHIFT; 13757: BranchLog.blgArray[i] = BranchLog.blgPrevHeadSuper = BranchLog.blgHead | BranchLog.blgSuper; 13758: BranchLog.blgArray[i + 1] = BranchLog.blgPrevTail = XEiJ.regPC0; 13759: } 13760: BranchLog.blgHead = XEiJ.regPC = a; 13761: BranchLog.blgSuper = XEiJ.regSRS >>> 13; 13762: } else { 13763: XEiJ.regPC = a; 13764: } 13765: } //irpSetPC 13766: 13767: //irpSetSR (newSr) 13768: // srへデータを書き込む 13769: // ori to sr/andi to sr/eori to sr/move to sr/stop/rteで使用される 13770: // スーパーバイザモードになっていることを確認してから呼び出すこと 13771: // rteではr[15]が指すアドレスからsrとpcを取り出してr[15]を更新してから呼び出すこと 13772: // スーパーバイザモード→ユーザモードのときは移行のための処理を行う 13773: // 新しい割り込みマスクレベルよりも高い割り込み処理の終了をデバイスに通知する 13774: public static void irpSetSR (int newSr) { 13775: XEiJ.regSRT1 = XEiJ.REG_SR_T1 & newSr; 13776: if ((XEiJ.regSRS = XEiJ.REG_SR_S & newSr) == 0) { //スーパーバイザモード→ユーザモード 13777: XEiJ.mpuISP = XEiJ.regRn[15]; //XEiJ.mpuISPを保存 13778: XEiJ.regRn[15] = XEiJ.mpuUSP; //XEiJ.mpuUSPを復元 13779: if (DataBreakPoint.DBP_ON) { 13780: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpUserMap; //ユーザメモリマップに切り替える 13781: } else { 13782: XEiJ.busMemoryMap = XEiJ.busUserMap; //ユーザメモリマップに切り替える 13783: } 13784: if (InstructionBreakPoint.IBP_ON) { 13785: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1UserMap; 13786: } 13787: } 13788: int t = (XEiJ.mpuIMR = 0x7f >> ((XEiJ.regSRI = XEiJ.REG_SR_I & newSr) >> 8)) & XEiJ.mpuISR; //XEiJ.mpuISRで1→0とするビット 13789: if (t != 0) { //終了する割り込みがあるとき 13790: XEiJ.mpuISR ^= t; 13791: //デバイスに割り込み処理の終了を通知する 13792: if (t == XEiJ.MPU_MFP_INTERRUPT_MASK) { //MFPのみ 13793: MC68901.mfpDone (); 13794: } else if (t == XEiJ.MPU_DMA_INTERRUPT_MASK) { //DMAのみ 13795: HD63450.dmaDone (); 13796: } else if (t == XEiJ.MPU_SCC_INTERRUPT_MASK) { //SCCのみ 13797: Z8530.sccDone (); 13798: } else if (t == XEiJ.MPU_IOI_INTERRUPT_MASK) { //IOIのみ 13799: IOInterrupt.ioiDone (); 13800: } else if (t == XEiJ.MPU_EB2_INTERRUPT_MASK) { //EB2のみ 13801: XEiJ.eb2Done (); 13802: } else { //SYSのみまたは複数 13803: if (XEiJ.TEST_BIT_1_SHIFT ? t << 24 + XEiJ.MPU_MFP_INTERRUPT_LEVEL < 0 : (t & XEiJ.MPU_MFP_INTERRUPT_MASK) != 0) { 13804: MC68901.mfpDone (); 13805: } 13806: if (t << 24 + XEiJ.MPU_DMA_INTERRUPT_LEVEL < 0) { //(t & XEiJ.MPU_DMA_INTERRUPT_MASK) != 0 13807: HD63450.dmaDone (); 13808: } 13809: if (XEiJ.TEST_BIT_2_SHIFT ? t << 24 + XEiJ.MPU_SCC_INTERRUPT_LEVEL < 0 : (t & XEiJ.MPU_SCC_INTERRUPT_MASK) != 0) { 13810: Z8530.sccDone (); 13811: } 13812: if (t << 24 + XEiJ.MPU_IOI_INTERRUPT_LEVEL < 0) { //(t & XEiJ.MPU_IOI_INTERRUPT_MASK) != 0 13813: IOInterrupt.ioiDone (); 13814: } 13815: if (t << 24 + XEiJ.MPU_EB2_INTERRUPT_LEVEL < 0) { //(t & XEiJ.MPU_EB2_INTERRUPT_MASK) != 0 13816: XEiJ.eb2Done (); 13817: } 13818: if (XEiJ.TEST_BIT_0_SHIFT ? t << 24 + XEiJ.MPU_SYS_INTERRUPT_LEVEL < 0 : (t & XEiJ.MPU_SYS_INTERRUPT_MASK) != 0) { 13819: XEiJ.sysDone (); 13820: } 13821: } 13822: } 13823: XEiJ.mpuIMR |= ~XEiJ.mpuISR & XEiJ.MPU_SYS_INTERRUPT_MASK; //割り込みマスクレベルが7のときレベル7割り込みの処理中でなければレベル7割り込みを許可する 13824: XEiJ.regCCR = XEiJ.REG_CCR_MASK & newSr; 13825: } //irpSetSR 13826: 13827: //irpInterrupt (vectorNumber, level) 13828: // 割り込み処理を開始する 13829: public static void irpInterrupt (int vectorNumber, int level) throws M68kException { 13830: if (XEiJ.regOC == 0b0100_111_001_110_010) { //最後に実行した命令はSTOP命令 13831: XEiJ.regPC = XEiJ.regPC0 + 4; //次の命令に進む 13832: } 13833: XEiJ.mpuClockTime += XEiJ.mpuModifiedUnit * 44; 13834: int save_sr = XEiJ.regSRT1 | XEiJ.regSRS | XEiJ.regSRI | XEiJ.regCCR; 13835: XEiJ.regSRI = level << 8; //割り込みマスクを要求されたレベルに変更する 13836: XEiJ.mpuIMR = 0x7f >> level; 13837: XEiJ.mpuISR |= 0x80 >> level; 13838: int sp = XEiJ.regRn[15]; 13839: XEiJ.regSRT1 = 0; //srのTビットを消す 13840: if (XEiJ.regSRS == 0) { //ユーザモードのとき 13841: XEiJ.regSRS = XEiJ.REG_SR_S; //スーパーバイザモードへ移行する 13842: XEiJ.mpuUSP = sp; //USPを保存 13843: sp = XEiJ.mpuISP; //SSPを復元 13844: if (DataBreakPoint.DBP_ON) { 13845: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpSuperMap; //スーパーバイザメモリマップに切り替える 13846: } else { 13847: XEiJ.busMemoryMap = XEiJ.busSuperMap; //スーパーバイザメモリマップに切り替える 13848: } 13849: if (InstructionBreakPoint.IBP_ON) { 13850: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1SuperMap; 13851: } 13852: } 13853: int vectorOffset = vectorNumber << 2; //vector offset 13854: XEiJ.regRn[15] = sp -= 8; //short format 13855: XEiJ.busWw (sp + 6, 0x0000 | vectorOffset); //format and vector offset 13856: XEiJ.busWl (sp + 2, XEiJ.regPC); //program counter 13857: XEiJ.busWw (sp, save_sr); //status register 13858: if (BranchLog.BLG_ON) { 13859: XEiJ.regPC0 = XEiJ.regPC; //rteによる割り込み終了と同時に次の割り込みを受け付けたとき間でpc0を更新しないと2番目の分岐レコードの終了アドレスが1番目と同じになっておかしな分岐レコードができてしまう 13860: } 13861: irpSetPC (XEiJ.busRlsf (XEiJ.mpuVBR + vectorOffset)); //例外ベクタを取り出してジャンプする 13862: } //irpInterrupt 13863: 13864: //irpException (vectorNumber, save_pc, save_sr) 13865: // 例外処理を開始する 13866: // スタックへのプッシュ、ベクタの取り出し、ジャンプのいずれかでバスエラーまたはアドレスエラーが発生する場合がある 13867: public static void irpException (int vectorNumber, int save_pc, int save_sr) throws M68kException { 13868: int sp = XEiJ.regRn[15]; 13869: XEiJ.regSRT1 = XEiJ.mpuTraceFlag = 0; //srのTビットを消す 13870: if (XEiJ.regSRS == 0) { //ユーザモードのとき 13871: XEiJ.regSRS = XEiJ.REG_SR_S; //スーパーバイザモードへ移行する 13872: XEiJ.mpuUSP = sp; //USPを保存 13873: sp = XEiJ.mpuISP; //SSPを復元 13874: if (DataBreakPoint.DBP_ON) { 13875: DataBreakPoint.dbpMemoryMap = DataBreakPoint.dbpSuperMap; //スーパーバイザメモリマップに切り替える 13876: } else { 13877: XEiJ.busMemoryMap = XEiJ.busSuperMap; //スーパーバイザメモリマップに切り替える 13878: } 13879: if (InstructionBreakPoint.IBP_ON) { 13880: InstructionBreakPoint.ibpOp1MemoryMap = InstructionBreakPoint.ibpOp1SuperMap; 13881: } 13882: } 13883: int vectorOffset = vectorNumber << 2; //vector offset 13884: XEiJ.regRn[15] = sp -= 8; //short format 13885: XEiJ.busWw (sp + 6, 0x0000 | vectorOffset); //format and vector offset 13886: XEiJ.busWl (sp + 2, save_pc); //program counter 13887: XEiJ.busWw (sp, save_sr); //status register 13888: irpSetPC (XEiJ.busRlsf (XEiJ.mpuVBR + vectorOffset)); //例外ベクタを取り出してジャンプする 13889: } //irpException 13890: 13891: 13892: 13893: //a = efaAnyByte (ea) //| M+-WXZPI| 13894: // 任意のモードのバイトオペランドの実効アドレスを求める 13895: // (A7)+と-(A7)はA7を奇偶に関わらず2変化させ、跨いだワードの上位バイト(アドレスの小さい方)を参照する 13896: // #<data>はオペコードに続くワードの下位バイトを参照する。上位バイトは不定なので参照してはならない 13897: @SuppressWarnings ("fallthrough") public static int efaAnyByte (int ea) throws M68kException { 13898: int t, w; 13899: switch (ea) { 13900: case 0b010_000: //(A0) 13901: if (XEiJ.EFA_SEPARATE_AR) { 13902: XEiJ.mpuCycleCount += 4; 13903: return XEiJ.regRn[ 8]; 13904: } 13905: //fallthrough 13906: case 0b010_001: //(A1) 13907: if (XEiJ.EFA_SEPARATE_AR) { 13908: XEiJ.mpuCycleCount += 4; 13909: return XEiJ.regRn[ 9]; 13910: } 13911: //fallthrough 13912: case 0b010_010: //(A2) 13913: if (XEiJ.EFA_SEPARATE_AR) { 13914: XEiJ.mpuCycleCount += 4; 13915: return XEiJ.regRn[10]; 13916: } 13917: //fallthrough 13918: case 0b010_011: //(A3) 13919: if (XEiJ.EFA_SEPARATE_AR) { 13920: XEiJ.mpuCycleCount += 4; 13921: return XEiJ.regRn[11]; 13922: } 13923: //fallthrough 13924: case 0b010_100: //(A4) 13925: if (XEiJ.EFA_SEPARATE_AR) { 13926: XEiJ.mpuCycleCount += 4; 13927: return XEiJ.regRn[12]; 13928: } 13929: //fallthrough 13930: case 0b010_101: //(A5) 13931: if (XEiJ.EFA_SEPARATE_AR) { 13932: XEiJ.mpuCycleCount += 4; 13933: return XEiJ.regRn[13]; 13934: } 13935: //fallthrough 13936: case 0b010_110: //(A6) 13937: if (XEiJ.EFA_SEPARATE_AR) { 13938: XEiJ.mpuCycleCount += 4; 13939: return XEiJ.regRn[14]; 13940: } 13941: //fallthrough 13942: case 0b010_111: //(A7) 13943: if (XEiJ.EFA_SEPARATE_AR) { 13944: XEiJ.mpuCycleCount += 4; 13945: return XEiJ.regRn[15]; 13946: } else { 13947: XEiJ.mpuCycleCount += 4; 13948: return XEiJ.regRn[ea - (0b010_000 - 8)]; 13949: } 13950: case 0b011_000: //(A0)+ 13951: if (XEiJ.EFA_SEPARATE_AR) { 13952: XEiJ.mpuCycleCount += 4; 13953: return XEiJ.regRn[ 8]++; 13954: } 13955: //fallthrough 13956: case 0b011_001: //(A1)+ 13957: if (XEiJ.EFA_SEPARATE_AR) { 13958: XEiJ.mpuCycleCount += 4; 13959: return XEiJ.regRn[ 9]++; 13960: } 13961: //fallthrough 13962: case 0b011_010: //(A2)+ 13963: if (XEiJ.EFA_SEPARATE_AR) { 13964: XEiJ.mpuCycleCount += 4; 13965: return XEiJ.regRn[10]++; 13966: } 13967: //fallthrough 13968: case 0b011_011: //(A3)+ 13969: if (XEiJ.EFA_SEPARATE_AR) { 13970: XEiJ.mpuCycleCount += 4; 13971: return XEiJ.regRn[11]++; 13972: } 13973: //fallthrough 13974: case 0b011_100: //(A4)+ 13975: if (XEiJ.EFA_SEPARATE_AR) { 13976: XEiJ.mpuCycleCount += 4; 13977: return XEiJ.regRn[12]++; 13978: } 13979: //fallthrough 13980: case 0b011_101: //(A5)+ 13981: if (XEiJ.EFA_SEPARATE_AR) { 13982: XEiJ.mpuCycleCount += 4; 13983: return XEiJ.regRn[13]++; 13984: } 13985: //fallthrough 13986: case 0b011_110: //(A6)+ 13987: if (XEiJ.EFA_SEPARATE_AR) { 13988: XEiJ.mpuCycleCount += 4; 13989: return XEiJ.regRn[14]++; 13990: } else { 13991: XEiJ.mpuCycleCount += 4; 13992: return XEiJ.regRn[ea - (0b011_000 - 8)]++; 13993: } 13994: case 0b011_111: //(A7)+ 13995: XEiJ.mpuCycleCount += 4; 13996: return (XEiJ.regRn[15] += 2) - 2; 13997: case 0b100_000: //-(A0) 13998: if (XEiJ.EFA_SEPARATE_AR) { 13999: XEiJ.mpuCycleCount += 6; 14000: return --XEiJ.regRn[ 8]; 14001: } 14002: //fallthrough 14003: case 0b100_001: //-(A1) 14004: if (XEiJ.EFA_SEPARATE_AR) { 14005: XEiJ.mpuCycleCount += 6; 14006: return --XEiJ.regRn[ 9]; 14007: } 14008: //fallthrough 14009: case 0b100_010: //-(A2) 14010: if (XEiJ.EFA_SEPARATE_AR) { 14011: XEiJ.mpuCycleCount += 6; 14012: return --XEiJ.regRn[10]; 14013: } 14014: //fallthrough 14015: case 0b100_011: //-(A3) 14016: if (XEiJ.EFA_SEPARATE_AR) { 14017: XEiJ.mpuCycleCount += 6; 14018: return --XEiJ.regRn[11]; 14019: } 14020: //fallthrough 14021: case 0b100_100: //-(A4) 14022: if (XEiJ.EFA_SEPARATE_AR) { 14023: XEiJ.mpuCycleCount += 6; 14024: return --XEiJ.regRn[12]; 14025: } 14026: //fallthrough 14027: case 0b100_101: //-(A5) 14028: if (XEiJ.EFA_SEPARATE_AR) { 14029: XEiJ.mpuCycleCount += 6; 14030: return --XEiJ.regRn[13]; 14031: } 14032: //fallthrough 14033: case 0b100_110: //-(A6) 14034: if (XEiJ.EFA_SEPARATE_AR) { 14035: XEiJ.mpuCycleCount += 6; 14036: return --XEiJ.regRn[14]; 14037: } else { 14038: XEiJ.mpuCycleCount += 6; 14039: return --XEiJ.regRn[ea - (0b100_000 - 8)]; 14040: } 14041: case 0b100_111: //-(A7) 14042: XEiJ.mpuCycleCount += 6; 14043: return XEiJ.regRn[15] -= 2; 14044: case 0b101_000: //(d16,A0) 14045: case 0b101_001: //(d16,A1) 14046: case 0b101_010: //(d16,A2) 14047: case 0b101_011: //(d16,A3) 14048: case 0b101_100: //(d16,A4) 14049: case 0b101_101: //(d16,A5) 14050: case 0b101_110: //(d16,A6) 14051: case 0b101_111: //(d16,A7) 14052: XEiJ.mpuCycleCount += 8; 14053: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14054: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14055: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 14056: } else { 14057: t = XEiJ.regPC; 14058: XEiJ.regPC = t + 2; 14059: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14060: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14061: } 14062: case 0b110_000: //(d8,A0,Rn.wl) 14063: case 0b110_001: //(d8,A1,Rn.wl) 14064: case 0b110_010: //(d8,A2,Rn.wl) 14065: case 0b110_011: //(d8,A3,Rn.wl) 14066: case 0b110_100: //(d8,A4,Rn.wl) 14067: case 0b110_101: //(d8,A5,Rn.wl) 14068: case 0b110_110: //(d8,A6,Rn.wl) 14069: case 0b110_111: //(d8,A7,Rn.wl) 14070: XEiJ.mpuCycleCount += 10; 14071: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14072: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 14073: } else { 14074: w = XEiJ.regPC; 14075: XEiJ.regPC = w + 2; 14076: w = XEiJ.busRwze (w); //pcwz。拡張ワード 14077: } 14078: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 14079: + (byte) w //バイトディスプレースメント 14080: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14081: XEiJ.regRn[w >> 12])); //ロングインデックス 14082: case 0b111_000: //(xxx).W 14083: XEiJ.mpuCycleCount += 8; 14084: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 14085: case 0b111_001: //(xxx).L 14086: XEiJ.mpuCycleCount += 12; 14087: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 14088: case 0b111_010: //(d16,PC) 14089: XEiJ.mpuCycleCount += 8; 14090: t = XEiJ.regPC; 14091: XEiJ.regPC = t + 2; 14092: return (t //ベースレジスタ 14093: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14094: case 0b111_011: //(d8,PC,Rn.wl) 14095: XEiJ.mpuCycleCount += 10; 14096: t = XEiJ.regPC; 14097: XEiJ.regPC = t + 2; 14098: w = XEiJ.busRwze (t); //pcwz。拡張ワード 14099: return (t //ベースレジスタ 14100: + (byte) w //バイトディスプレースメント 14101: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14102: XEiJ.regRn[w >> 12])); //ロングインデックス 14103: case 0b111_100: //#<data> 14104: XEiJ.mpuCycleCount += 4; 14105: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14106: return (XEiJ.regPC += 2) - 1; //下位バイト 14107: } else { 14108: t = XEiJ.regPC; 14109: XEiJ.regPC = t + 2; 14110: return t + 1; //下位バイト 14111: } 14112: } //switch 14113: XEiJ.mpuCycleCount += 34; 14114: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 14115: throw M68kException.m6eSignal; 14116: } //efaAnyByte 14117: 14118: //a = efaMemByte (ea) //| M+-WXZP | 14119: // メモリモードのバイトオペランドの実効アドレスを求める 14120: // efaAnyByteとの違いは#<data>がないこと 14121: @SuppressWarnings ("fallthrough") public static int efaMemByte (int ea) throws M68kException { 14122: int t, w; 14123: switch (ea) { 14124: case 0b010_000: //(A0) 14125: if (XEiJ.EFA_SEPARATE_AR) { 14126: XEiJ.mpuCycleCount += 4; 14127: return XEiJ.regRn[ 8]; 14128: } 14129: //fallthrough 14130: case 0b010_001: //(A1) 14131: if (XEiJ.EFA_SEPARATE_AR) { 14132: XEiJ.mpuCycleCount += 4; 14133: return XEiJ.regRn[ 9]; 14134: } 14135: //fallthrough 14136: case 0b010_010: //(A2) 14137: if (XEiJ.EFA_SEPARATE_AR) { 14138: XEiJ.mpuCycleCount += 4; 14139: return XEiJ.regRn[10]; 14140: } 14141: //fallthrough 14142: case 0b010_011: //(A3) 14143: if (XEiJ.EFA_SEPARATE_AR) { 14144: XEiJ.mpuCycleCount += 4; 14145: return XEiJ.regRn[11]; 14146: } 14147: //fallthrough 14148: case 0b010_100: //(A4) 14149: if (XEiJ.EFA_SEPARATE_AR) { 14150: XEiJ.mpuCycleCount += 4; 14151: return XEiJ.regRn[12]; 14152: } 14153: //fallthrough 14154: case 0b010_101: //(A5) 14155: if (XEiJ.EFA_SEPARATE_AR) { 14156: XEiJ.mpuCycleCount += 4; 14157: return XEiJ.regRn[13]; 14158: } 14159: //fallthrough 14160: case 0b010_110: //(A6) 14161: if (XEiJ.EFA_SEPARATE_AR) { 14162: XEiJ.mpuCycleCount += 4; 14163: return XEiJ.regRn[14]; 14164: } 14165: //fallthrough 14166: case 0b010_111: //(A7) 14167: if (XEiJ.EFA_SEPARATE_AR) { 14168: XEiJ.mpuCycleCount += 4; 14169: return XEiJ.regRn[15]; 14170: } else { 14171: XEiJ.mpuCycleCount += 4; 14172: return XEiJ.regRn[ea - (0b010_000 - 8)]; 14173: } 14174: case 0b011_000: //(A0)+ 14175: if (XEiJ.EFA_SEPARATE_AR) { 14176: XEiJ.mpuCycleCount += 4; 14177: return XEiJ.regRn[ 8]++; 14178: } 14179: //fallthrough 14180: case 0b011_001: //(A1)+ 14181: if (XEiJ.EFA_SEPARATE_AR) { 14182: XEiJ.mpuCycleCount += 4; 14183: return XEiJ.regRn[ 9]++; 14184: } 14185: //fallthrough 14186: case 0b011_010: //(A2)+ 14187: if (XEiJ.EFA_SEPARATE_AR) { 14188: XEiJ.mpuCycleCount += 4; 14189: return XEiJ.regRn[10]++; 14190: } 14191: //fallthrough 14192: case 0b011_011: //(A3)+ 14193: if (XEiJ.EFA_SEPARATE_AR) { 14194: XEiJ.mpuCycleCount += 4; 14195: return XEiJ.regRn[11]++; 14196: } 14197: //fallthrough 14198: case 0b011_100: //(A4)+ 14199: if (XEiJ.EFA_SEPARATE_AR) { 14200: XEiJ.mpuCycleCount += 4; 14201: return XEiJ.regRn[12]++; 14202: } 14203: //fallthrough 14204: case 0b011_101: //(A5)+ 14205: if (XEiJ.EFA_SEPARATE_AR) { 14206: XEiJ.mpuCycleCount += 4; 14207: return XEiJ.regRn[13]++; 14208: } 14209: //fallthrough 14210: case 0b011_110: //(A6)+ 14211: if (XEiJ.EFA_SEPARATE_AR) { 14212: XEiJ.mpuCycleCount += 4; 14213: return XEiJ.regRn[14]++; 14214: } else { 14215: XEiJ.mpuCycleCount += 4; 14216: return XEiJ.regRn[ea - (0b011_000 - 8)]++; 14217: } 14218: case 0b011_111: //(A7)+ 14219: XEiJ.mpuCycleCount += 4; 14220: return (XEiJ.regRn[15] += 2) - 2; 14221: case 0b100_000: //-(A0) 14222: if (XEiJ.EFA_SEPARATE_AR) { 14223: XEiJ.mpuCycleCount += 6; 14224: return --XEiJ.regRn[ 8]; 14225: } 14226: //fallthrough 14227: case 0b100_001: //-(A1) 14228: if (XEiJ.EFA_SEPARATE_AR) { 14229: XEiJ.mpuCycleCount += 6; 14230: return --XEiJ.regRn[ 9]; 14231: } 14232: //fallthrough 14233: case 0b100_010: //-(A2) 14234: if (XEiJ.EFA_SEPARATE_AR) { 14235: XEiJ.mpuCycleCount += 6; 14236: return --XEiJ.regRn[10]; 14237: } 14238: //fallthrough 14239: case 0b100_011: //-(A3) 14240: if (XEiJ.EFA_SEPARATE_AR) { 14241: XEiJ.mpuCycleCount += 6; 14242: return --XEiJ.regRn[11]; 14243: } 14244: //fallthrough 14245: case 0b100_100: //-(A4) 14246: if (XEiJ.EFA_SEPARATE_AR) { 14247: XEiJ.mpuCycleCount += 6; 14248: return --XEiJ.regRn[12]; 14249: } 14250: //fallthrough 14251: case 0b100_101: //-(A5) 14252: if (XEiJ.EFA_SEPARATE_AR) { 14253: XEiJ.mpuCycleCount += 6; 14254: return --XEiJ.regRn[13]; 14255: } 14256: //fallthrough 14257: case 0b100_110: //-(A6) 14258: if (XEiJ.EFA_SEPARATE_AR) { 14259: XEiJ.mpuCycleCount += 6; 14260: return --XEiJ.regRn[14]; 14261: } else { 14262: XEiJ.mpuCycleCount += 6; 14263: return --XEiJ.regRn[ea - (0b100_000 - 8)]; 14264: } 14265: case 0b100_111: //-(A7) 14266: XEiJ.mpuCycleCount += 6; 14267: return XEiJ.regRn[15] -= 2; 14268: case 0b101_000: //(d16,A0) 14269: case 0b101_001: //(d16,A1) 14270: case 0b101_010: //(d16,A2) 14271: case 0b101_011: //(d16,A3) 14272: case 0b101_100: //(d16,A4) 14273: case 0b101_101: //(d16,A5) 14274: case 0b101_110: //(d16,A6) 14275: case 0b101_111: //(d16,A7) 14276: XEiJ.mpuCycleCount += 8; 14277: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14278: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14279: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 14280: } else { 14281: t = XEiJ.regPC; 14282: XEiJ.regPC = t + 2; 14283: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14284: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14285: } 14286: case 0b110_000: //(d8,A0,Rn.wl) 14287: case 0b110_001: //(d8,A1,Rn.wl) 14288: case 0b110_010: //(d8,A2,Rn.wl) 14289: case 0b110_011: //(d8,A3,Rn.wl) 14290: case 0b110_100: //(d8,A4,Rn.wl) 14291: case 0b110_101: //(d8,A5,Rn.wl) 14292: case 0b110_110: //(d8,A6,Rn.wl) 14293: case 0b110_111: //(d8,A7,Rn.wl) 14294: XEiJ.mpuCycleCount += 10; 14295: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14296: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 14297: } else { 14298: w = XEiJ.regPC; 14299: XEiJ.regPC = w + 2; 14300: w = XEiJ.busRwze (w); //pcwz。拡張ワード 14301: } 14302: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 14303: + (byte) w //バイトディスプレースメント 14304: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14305: XEiJ.regRn[w >> 12])); //ロングインデックス 14306: case 0b111_000: //(xxx).W 14307: XEiJ.mpuCycleCount += 8; 14308: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 14309: case 0b111_001: //(xxx).L 14310: XEiJ.mpuCycleCount += 12; 14311: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 14312: case 0b111_010: //(d16,PC) 14313: XEiJ.mpuCycleCount += 8; 14314: t = XEiJ.regPC; 14315: XEiJ.regPC = t + 2; 14316: return (t //ベースレジスタ 14317: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14318: case 0b111_011: //(d8,PC,Rn.wl) 14319: XEiJ.mpuCycleCount += 10; 14320: t = XEiJ.regPC; 14321: XEiJ.regPC = t + 2; 14322: w = XEiJ.busRwze (t); //pcwz。拡張ワード 14323: return (t //ベースレジスタ 14324: + (byte) w //バイトディスプレースメント 14325: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14326: XEiJ.regRn[w >> 12])); //ロングインデックス 14327: } //switch 14328: XEiJ.mpuCycleCount += 34; 14329: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 14330: throw M68kException.m6eSignal; 14331: } //efaMemByte 14332: 14333: //a = efaMltByte (ea) //| M+-WXZ | 14334: // メモリ可変モードのバイトオペランドの実効アドレスを求める 14335: // efaMemByteとの違いは(d16,PC)と(d8,PC,Rn.wl)がないこと 14336: @SuppressWarnings ("fallthrough") public static int efaMltByte (int ea) throws M68kException { 14337: int t, w; 14338: switch (ea) { 14339: case 0b010_000: //(A0) 14340: if (XEiJ.EFA_SEPARATE_AR) { 14341: XEiJ.mpuCycleCount += 4; 14342: return XEiJ.regRn[ 8]; 14343: } 14344: //fallthrough 14345: case 0b010_001: //(A1) 14346: if (XEiJ.EFA_SEPARATE_AR) { 14347: XEiJ.mpuCycleCount += 4; 14348: return XEiJ.regRn[ 9]; 14349: } 14350: //fallthrough 14351: case 0b010_010: //(A2) 14352: if (XEiJ.EFA_SEPARATE_AR) { 14353: XEiJ.mpuCycleCount += 4; 14354: return XEiJ.regRn[10]; 14355: } 14356: //fallthrough 14357: case 0b010_011: //(A3) 14358: if (XEiJ.EFA_SEPARATE_AR) { 14359: XEiJ.mpuCycleCount += 4; 14360: return XEiJ.regRn[11]; 14361: } 14362: //fallthrough 14363: case 0b010_100: //(A4) 14364: if (XEiJ.EFA_SEPARATE_AR) { 14365: XEiJ.mpuCycleCount += 4; 14366: return XEiJ.regRn[12]; 14367: } 14368: //fallthrough 14369: case 0b010_101: //(A5) 14370: if (XEiJ.EFA_SEPARATE_AR) { 14371: XEiJ.mpuCycleCount += 4; 14372: return XEiJ.regRn[13]; 14373: } 14374: //fallthrough 14375: case 0b010_110: //(A6) 14376: if (XEiJ.EFA_SEPARATE_AR) { 14377: XEiJ.mpuCycleCount += 4; 14378: return XEiJ.regRn[14]; 14379: } 14380: //fallthrough 14381: case 0b010_111: //(A7) 14382: if (XEiJ.EFA_SEPARATE_AR) { 14383: XEiJ.mpuCycleCount += 4; 14384: return XEiJ.regRn[15]; 14385: } else { 14386: XEiJ.mpuCycleCount += 4; 14387: return XEiJ.regRn[ea - (0b010_000 - 8)]; 14388: } 14389: case 0b011_000: //(A0)+ 14390: if (XEiJ.EFA_SEPARATE_AR) { 14391: XEiJ.mpuCycleCount += 4; 14392: return XEiJ.regRn[ 8]++; 14393: } 14394: //fallthrough 14395: case 0b011_001: //(A1)+ 14396: if (XEiJ.EFA_SEPARATE_AR) { 14397: XEiJ.mpuCycleCount += 4; 14398: return XEiJ.regRn[ 9]++; 14399: } 14400: //fallthrough 14401: case 0b011_010: //(A2)+ 14402: if (XEiJ.EFA_SEPARATE_AR) { 14403: XEiJ.mpuCycleCount += 4; 14404: return XEiJ.regRn[10]++; 14405: } 14406: //fallthrough 14407: case 0b011_011: //(A3)+ 14408: if (XEiJ.EFA_SEPARATE_AR) { 14409: XEiJ.mpuCycleCount += 4; 14410: return XEiJ.regRn[11]++; 14411: } 14412: //fallthrough 14413: case 0b011_100: //(A4)+ 14414: if (XEiJ.EFA_SEPARATE_AR) { 14415: XEiJ.mpuCycleCount += 4; 14416: return XEiJ.regRn[12]++; 14417: } 14418: //fallthrough 14419: case 0b011_101: //(A5)+ 14420: if (XEiJ.EFA_SEPARATE_AR) { 14421: XEiJ.mpuCycleCount += 4; 14422: return XEiJ.regRn[13]++; 14423: } 14424: //fallthrough 14425: case 0b011_110: //(A6)+ 14426: if (XEiJ.EFA_SEPARATE_AR) { 14427: XEiJ.mpuCycleCount += 4; 14428: return XEiJ.regRn[14]++; 14429: } else { 14430: XEiJ.mpuCycleCount += 4; 14431: return XEiJ.regRn[ea - (0b011_000 - 8)]++; 14432: } 14433: case 0b011_111: //(A7)+ 14434: XEiJ.mpuCycleCount += 4; 14435: return (XEiJ.regRn[15] += 2) - 2; 14436: case 0b100_000: //-(A0) 14437: if (XEiJ.EFA_SEPARATE_AR) { 14438: XEiJ.mpuCycleCount += 6; 14439: return --XEiJ.regRn[ 8]; 14440: } 14441: //fallthrough 14442: case 0b100_001: //-(A1) 14443: if (XEiJ.EFA_SEPARATE_AR) { 14444: XEiJ.mpuCycleCount += 6; 14445: return --XEiJ.regRn[ 9]; 14446: } 14447: //fallthrough 14448: case 0b100_010: //-(A2) 14449: if (XEiJ.EFA_SEPARATE_AR) { 14450: XEiJ.mpuCycleCount += 6; 14451: return --XEiJ.regRn[10]; 14452: } 14453: //fallthrough 14454: case 0b100_011: //-(A3) 14455: if (XEiJ.EFA_SEPARATE_AR) { 14456: XEiJ.mpuCycleCount += 6; 14457: return --XEiJ.regRn[11]; 14458: } 14459: //fallthrough 14460: case 0b100_100: //-(A4) 14461: if (XEiJ.EFA_SEPARATE_AR) { 14462: XEiJ.mpuCycleCount += 6; 14463: return --XEiJ.regRn[12]; 14464: } 14465: //fallthrough 14466: case 0b100_101: //-(A5) 14467: if (XEiJ.EFA_SEPARATE_AR) { 14468: XEiJ.mpuCycleCount += 6; 14469: return --XEiJ.regRn[13]; 14470: } 14471: //fallthrough 14472: case 0b100_110: //-(A6) 14473: if (XEiJ.EFA_SEPARATE_AR) { 14474: XEiJ.mpuCycleCount += 6; 14475: return --XEiJ.regRn[14]; 14476: } else { 14477: XEiJ.mpuCycleCount += 6; 14478: return --XEiJ.regRn[ea - (0b100_000 - 8)]; 14479: } 14480: case 0b100_111: //-(A7) 14481: XEiJ.mpuCycleCount += 6; 14482: return XEiJ.regRn[15] -= 2; 14483: case 0b101_000: //(d16,A0) 14484: case 0b101_001: //(d16,A1) 14485: case 0b101_010: //(d16,A2) 14486: case 0b101_011: //(d16,A3) 14487: case 0b101_100: //(d16,A4) 14488: case 0b101_101: //(d16,A5) 14489: case 0b101_110: //(d16,A6) 14490: case 0b101_111: //(d16,A7) 14491: XEiJ.mpuCycleCount += 8; 14492: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14493: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14494: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 14495: } else { 14496: t = XEiJ.regPC; 14497: XEiJ.regPC = t + 2; 14498: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14499: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14500: } 14501: case 0b110_000: //(d8,A0,Rn.wl) 14502: case 0b110_001: //(d8,A1,Rn.wl) 14503: case 0b110_010: //(d8,A2,Rn.wl) 14504: case 0b110_011: //(d8,A3,Rn.wl) 14505: case 0b110_100: //(d8,A4,Rn.wl) 14506: case 0b110_101: //(d8,A5,Rn.wl) 14507: case 0b110_110: //(d8,A6,Rn.wl) 14508: case 0b110_111: //(d8,A7,Rn.wl) 14509: XEiJ.mpuCycleCount += 10; 14510: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14511: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 14512: } else { 14513: w = XEiJ.regPC; 14514: XEiJ.regPC = w + 2; 14515: w = XEiJ.busRwze (w); //pcwz。拡張ワード 14516: } 14517: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 14518: + (byte) w //バイトディスプレースメント 14519: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14520: XEiJ.regRn[w >> 12])); //ロングインデックス 14521: case 0b111_000: //(xxx).W 14522: XEiJ.mpuCycleCount += 8; 14523: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 14524: case 0b111_001: //(xxx).L 14525: XEiJ.mpuCycleCount += 12; 14526: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 14527: } //switch 14528: XEiJ.mpuCycleCount += 34; 14529: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 14530: throw M68kException.m6eSignal; 14531: } //efaMltByte 14532: 14533: //a = efaCntByte (ea) //| M WXZP | 14534: // 制御モードのロングオペランドの実効アドレスを求める 14535: // efaMemByteとの違いは(Ar)+と-(Ar)がないこと 14536: @SuppressWarnings ("fallthrough") public static int efaCntByte (int ea) throws M68kException { 14537: int t, w; 14538: switch (ea) { 14539: case 0b010_000: //(A0) 14540: if (XEiJ.EFA_SEPARATE_AR) { 14541: XEiJ.mpuCycleCount += 4; 14542: return XEiJ.regRn[ 8]; 14543: } 14544: //fallthrough 14545: case 0b010_001: //(A1) 14546: if (XEiJ.EFA_SEPARATE_AR) { 14547: XEiJ.mpuCycleCount += 4; 14548: return XEiJ.regRn[ 9]; 14549: } 14550: //fallthrough 14551: case 0b010_010: //(A2) 14552: if (XEiJ.EFA_SEPARATE_AR) { 14553: XEiJ.mpuCycleCount += 4; 14554: return XEiJ.regRn[10]; 14555: } 14556: //fallthrough 14557: case 0b010_011: //(A3) 14558: if (XEiJ.EFA_SEPARATE_AR) { 14559: XEiJ.mpuCycleCount += 4; 14560: return XEiJ.regRn[11]; 14561: } 14562: //fallthrough 14563: case 0b010_100: //(A4) 14564: if (XEiJ.EFA_SEPARATE_AR) { 14565: XEiJ.mpuCycleCount += 4; 14566: return XEiJ.regRn[12]; 14567: } 14568: //fallthrough 14569: case 0b010_101: //(A5) 14570: if (XEiJ.EFA_SEPARATE_AR) { 14571: XEiJ.mpuCycleCount += 4; 14572: return XEiJ.regRn[13]; 14573: } 14574: //fallthrough 14575: case 0b010_110: //(A6) 14576: if (XEiJ.EFA_SEPARATE_AR) { 14577: XEiJ.mpuCycleCount += 4; 14578: return XEiJ.regRn[14]; 14579: } 14580: //fallthrough 14581: case 0b010_111: //(A7) 14582: if (XEiJ.EFA_SEPARATE_AR) { 14583: XEiJ.mpuCycleCount += 4; 14584: return XEiJ.regRn[15]; 14585: } else { 14586: XEiJ.mpuCycleCount += 4; 14587: return XEiJ.regRn[ea - (0b010_000 - 8)]; 14588: } 14589: case 0b101_000: //(d16,A0) 14590: case 0b101_001: //(d16,A1) 14591: case 0b101_010: //(d16,A2) 14592: case 0b101_011: //(d16,A3) 14593: case 0b101_100: //(d16,A4) 14594: case 0b101_101: //(d16,A5) 14595: case 0b101_110: //(d16,A6) 14596: case 0b101_111: //(d16,A7) 14597: XEiJ.mpuCycleCount += 8; 14598: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14599: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14600: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 14601: } else { 14602: t = XEiJ.regPC; 14603: XEiJ.regPC = t + 2; 14604: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14605: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14606: } 14607: case 0b110_000: //(d8,A0,Rn.wl) 14608: case 0b110_001: //(d8,A1,Rn.wl) 14609: case 0b110_010: //(d8,A2,Rn.wl) 14610: case 0b110_011: //(d8,A3,Rn.wl) 14611: case 0b110_100: //(d8,A4,Rn.wl) 14612: case 0b110_101: //(d8,A5,Rn.wl) 14613: case 0b110_110: //(d8,A6,Rn.wl) 14614: case 0b110_111: //(d8,A7,Rn.wl) 14615: XEiJ.mpuCycleCount += 10; 14616: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14617: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 14618: } else { 14619: w = XEiJ.regPC; 14620: XEiJ.regPC = w + 2; 14621: w = XEiJ.busRwze (w); //pcwz。拡張ワード 14622: } 14623: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 14624: + (byte) w //バイトディスプレースメント 14625: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14626: XEiJ.regRn[w >> 12])); //ロングインデックス 14627: case 0b111_000: //(xxx).W 14628: XEiJ.mpuCycleCount += 8; 14629: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 14630: case 0b111_001: //(xxx).L 14631: XEiJ.mpuCycleCount += 12; 14632: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 14633: case 0b111_010: //(d16,PC) 14634: XEiJ.mpuCycleCount += 8; 14635: t = XEiJ.regPC; 14636: XEiJ.regPC = t + 2; 14637: return (t //ベースレジスタ 14638: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14639: case 0b111_011: //(d8,PC,Rn.wl) 14640: XEiJ.mpuCycleCount += 10; 14641: t = XEiJ.regPC; 14642: XEiJ.regPC = t + 2; 14643: w = XEiJ.busRwze (t); //pcwz。拡張ワード 14644: return (t //ベースレジスタ 14645: + (byte) w //バイトディスプレースメント 14646: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14647: XEiJ.regRn[w >> 12])); //ロングインデックス 14648: } //switch 14649: XEiJ.mpuCycleCount += 34; 14650: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 14651: throw M68kException.m6eSignal; 14652: } //efaCntByte 14653: 14654: //a = efaAnyWord (ea) //| M+-WXZPI| 14655: // 任意のモードのワードオペランドの実効アドレスを求める 14656: // efaAnyByteとの違いは(Ar)+と-(Ar)がArを2変化させることと、(A7)+と-(A7)と#<data>の特別な動作がないこと 14657: @SuppressWarnings ("fallthrough") public static int efaAnyWord (int ea) throws M68kException { 14658: int t, w; 14659: switch (ea) { 14660: case 0b010_000: //(A0) 14661: if (XEiJ.EFA_SEPARATE_AR) { 14662: XEiJ.mpuCycleCount += 4; 14663: return XEiJ.regRn[ 8]; 14664: } 14665: //fallthrough 14666: case 0b010_001: //(A1) 14667: if (XEiJ.EFA_SEPARATE_AR) { 14668: XEiJ.mpuCycleCount += 4; 14669: return XEiJ.regRn[ 9]; 14670: } 14671: //fallthrough 14672: case 0b010_010: //(A2) 14673: if (XEiJ.EFA_SEPARATE_AR) { 14674: XEiJ.mpuCycleCount += 4; 14675: return XEiJ.regRn[10]; 14676: } 14677: //fallthrough 14678: case 0b010_011: //(A3) 14679: if (XEiJ.EFA_SEPARATE_AR) { 14680: XEiJ.mpuCycleCount += 4; 14681: return XEiJ.regRn[11]; 14682: } 14683: //fallthrough 14684: case 0b010_100: //(A4) 14685: if (XEiJ.EFA_SEPARATE_AR) { 14686: XEiJ.mpuCycleCount += 4; 14687: return XEiJ.regRn[12]; 14688: } 14689: //fallthrough 14690: case 0b010_101: //(A5) 14691: if (XEiJ.EFA_SEPARATE_AR) { 14692: XEiJ.mpuCycleCount += 4; 14693: return XEiJ.regRn[13]; 14694: } 14695: //fallthrough 14696: case 0b010_110: //(A6) 14697: if (XEiJ.EFA_SEPARATE_AR) { 14698: XEiJ.mpuCycleCount += 4; 14699: return XEiJ.regRn[14]; 14700: } 14701: //fallthrough 14702: case 0b010_111: //(A7) 14703: if (XEiJ.EFA_SEPARATE_AR) { 14704: XEiJ.mpuCycleCount += 4; 14705: return XEiJ.regRn[15]; 14706: } else { 14707: XEiJ.mpuCycleCount += 4; 14708: return XEiJ.regRn[ea - (0b010_000 - 8)]; 14709: } 14710: case 0b011_000: //(A0)+ 14711: if (XEiJ.EFA_SEPARATE_AR) { 14712: XEiJ.mpuCycleCount += 4; 14713: return (XEiJ.regRn[ 8] += 2) - 2; 14714: } 14715: //fallthrough 14716: case 0b011_001: //(A1)+ 14717: if (XEiJ.EFA_SEPARATE_AR) { 14718: XEiJ.mpuCycleCount += 4; 14719: return (XEiJ.regRn[ 9] += 2) - 2; 14720: } 14721: //fallthrough 14722: case 0b011_010: //(A2)+ 14723: if (XEiJ.EFA_SEPARATE_AR) { 14724: XEiJ.mpuCycleCount += 4; 14725: return (XEiJ.regRn[10] += 2) - 2; 14726: } 14727: //fallthrough 14728: case 0b011_011: //(A3)+ 14729: if (XEiJ.EFA_SEPARATE_AR) { 14730: XEiJ.mpuCycleCount += 4; 14731: return (XEiJ.regRn[11] += 2) - 2; 14732: } 14733: //fallthrough 14734: case 0b011_100: //(A4)+ 14735: if (XEiJ.EFA_SEPARATE_AR) { 14736: XEiJ.mpuCycleCount += 4; 14737: return (XEiJ.regRn[12] += 2) - 2; 14738: } 14739: //fallthrough 14740: case 0b011_101: //(A5)+ 14741: if (XEiJ.EFA_SEPARATE_AR) { 14742: XEiJ.mpuCycleCount += 4; 14743: return (XEiJ.regRn[13] += 2) - 2; 14744: } 14745: //fallthrough 14746: case 0b011_110: //(A6)+ 14747: if (XEiJ.EFA_SEPARATE_AR) { 14748: XEiJ.mpuCycleCount += 4; 14749: return (XEiJ.regRn[14] += 2) - 2; 14750: } 14751: //fallthrough 14752: case 0b011_111: //(A7)+ 14753: if (XEiJ.EFA_SEPARATE_AR) { 14754: XEiJ.mpuCycleCount += 4; 14755: return (XEiJ.regRn[15] += 2) - 2; 14756: } else { 14757: XEiJ.mpuCycleCount += 4; 14758: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 2) - 2; 14759: } 14760: case 0b100_000: //-(A0) 14761: if (XEiJ.EFA_SEPARATE_AR) { 14762: XEiJ.mpuCycleCount += 6; 14763: return XEiJ.regRn[ 8] -= 2; 14764: } 14765: //fallthrough 14766: case 0b100_001: //-(A1) 14767: if (XEiJ.EFA_SEPARATE_AR) { 14768: XEiJ.mpuCycleCount += 6; 14769: return XEiJ.regRn[ 9] -= 2; 14770: } 14771: //fallthrough 14772: case 0b100_010: //-(A2) 14773: if (XEiJ.EFA_SEPARATE_AR) { 14774: XEiJ.mpuCycleCount += 6; 14775: return XEiJ.regRn[10] -= 2; 14776: } 14777: //fallthrough 14778: case 0b100_011: //-(A3) 14779: if (XEiJ.EFA_SEPARATE_AR) { 14780: XEiJ.mpuCycleCount += 6; 14781: return XEiJ.regRn[11] -= 2; 14782: } 14783: //fallthrough 14784: case 0b100_100: //-(A4) 14785: if (XEiJ.EFA_SEPARATE_AR) { 14786: XEiJ.mpuCycleCount += 6; 14787: return XEiJ.regRn[12] -= 2; 14788: } 14789: //fallthrough 14790: case 0b100_101: //-(A5) 14791: if (XEiJ.EFA_SEPARATE_AR) { 14792: XEiJ.mpuCycleCount += 6; 14793: return XEiJ.regRn[13] -= 2; 14794: } 14795: //fallthrough 14796: case 0b100_110: //-(A6) 14797: if (XEiJ.EFA_SEPARATE_AR) { 14798: XEiJ.mpuCycleCount += 6; 14799: return XEiJ.regRn[14] -= 2; 14800: } 14801: //fallthrough 14802: case 0b100_111: //-(A7) 14803: if (XEiJ.EFA_SEPARATE_AR) { 14804: XEiJ.mpuCycleCount += 6; 14805: return XEiJ.regRn[15] -= 2; 14806: } else { 14807: XEiJ.mpuCycleCount += 6; 14808: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 2; 14809: } 14810: case 0b101_000: //(d16,A0) 14811: case 0b101_001: //(d16,A1) 14812: case 0b101_010: //(d16,A2) 14813: case 0b101_011: //(d16,A3) 14814: case 0b101_100: //(d16,A4) 14815: case 0b101_101: //(d16,A5) 14816: case 0b101_110: //(d16,A6) 14817: case 0b101_111: //(d16,A7) 14818: XEiJ.mpuCycleCount += 8; 14819: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14820: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14821: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 14822: } else { 14823: t = XEiJ.regPC; 14824: XEiJ.regPC = t + 2; 14825: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 14826: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14827: } 14828: case 0b110_000: //(d8,A0,Rn.wl) 14829: case 0b110_001: //(d8,A1,Rn.wl) 14830: case 0b110_010: //(d8,A2,Rn.wl) 14831: case 0b110_011: //(d8,A3,Rn.wl) 14832: case 0b110_100: //(d8,A4,Rn.wl) 14833: case 0b110_101: //(d8,A5,Rn.wl) 14834: case 0b110_110: //(d8,A6,Rn.wl) 14835: case 0b110_111: //(d8,A7,Rn.wl) 14836: XEiJ.mpuCycleCount += 10; 14837: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14838: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 14839: } else { 14840: w = XEiJ.regPC; 14841: XEiJ.regPC = w + 2; 14842: w = XEiJ.busRwze (w); //pcwz。拡張ワード 14843: } 14844: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 14845: + (byte) w //バイトディスプレースメント 14846: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14847: XEiJ.regRn[w >> 12])); //ロングインデックス 14848: case 0b111_000: //(xxx).W 14849: XEiJ.mpuCycleCount += 8; 14850: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 14851: case 0b111_001: //(xxx).L 14852: XEiJ.mpuCycleCount += 12; 14853: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 14854: case 0b111_010: //(d16,PC) 14855: XEiJ.mpuCycleCount += 8; 14856: t = XEiJ.regPC; 14857: XEiJ.regPC = t + 2; 14858: return (t //ベースレジスタ 14859: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 14860: case 0b111_011: //(d8,PC,Rn.wl) 14861: XEiJ.mpuCycleCount += 10; 14862: t = XEiJ.regPC; 14863: XEiJ.regPC = t + 2; 14864: w = XEiJ.busRwze (t); //pcwz。拡張ワード 14865: return (t //ベースレジスタ 14866: + (byte) w //バイトディスプレースメント 14867: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 14868: XEiJ.regRn[w >> 12])); //ロングインデックス 14869: case 0b111_100: //#<data> 14870: XEiJ.mpuCycleCount += 4; 14871: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 14872: return (XEiJ.regPC += 2) - 2; 14873: } else { 14874: t = XEiJ.regPC; 14875: XEiJ.regPC = t + 2; 14876: return t; 14877: } 14878: } //switch 14879: XEiJ.mpuCycleCount += 34; 14880: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 14881: throw M68kException.m6eSignal; 14882: } //efaAnyWord 14883: 14884: //a = efaMemWord (ea) //| M+-WXZP | 14885: // メモリモードのワードオペランドの実効アドレスを求める 14886: // efaAnyWordとの違いは#<data>がないこと 14887: @SuppressWarnings ("fallthrough") public static int efaMemWord (int ea) throws M68kException { 14888: int t, w; 14889: switch (ea) { 14890: case 0b010_000: //(A0) 14891: if (XEiJ.EFA_SEPARATE_AR) { 14892: XEiJ.mpuCycleCount += 4; 14893: return XEiJ.regRn[ 8]; 14894: } 14895: //fallthrough 14896: case 0b010_001: //(A1) 14897: if (XEiJ.EFA_SEPARATE_AR) { 14898: XEiJ.mpuCycleCount += 4; 14899: return XEiJ.regRn[ 9]; 14900: } 14901: //fallthrough 14902: case 0b010_010: //(A2) 14903: if (XEiJ.EFA_SEPARATE_AR) { 14904: XEiJ.mpuCycleCount += 4; 14905: return XEiJ.regRn[10]; 14906: } 14907: //fallthrough 14908: case 0b010_011: //(A3) 14909: if (XEiJ.EFA_SEPARATE_AR) { 14910: XEiJ.mpuCycleCount += 4; 14911: return XEiJ.regRn[11]; 14912: } 14913: //fallthrough 14914: case 0b010_100: //(A4) 14915: if (XEiJ.EFA_SEPARATE_AR) { 14916: XEiJ.mpuCycleCount += 4; 14917: return XEiJ.regRn[12]; 14918: } 14919: //fallthrough 14920: case 0b010_101: //(A5) 14921: if (XEiJ.EFA_SEPARATE_AR) { 14922: XEiJ.mpuCycleCount += 4; 14923: return XEiJ.regRn[13]; 14924: } 14925: //fallthrough 14926: case 0b010_110: //(A6) 14927: if (XEiJ.EFA_SEPARATE_AR) { 14928: XEiJ.mpuCycleCount += 4; 14929: return XEiJ.regRn[14]; 14930: } 14931: //fallthrough 14932: case 0b010_111: //(A7) 14933: if (XEiJ.EFA_SEPARATE_AR) { 14934: XEiJ.mpuCycleCount += 4; 14935: return XEiJ.regRn[15]; 14936: } else { 14937: XEiJ.mpuCycleCount += 4; 14938: return XEiJ.regRn[ea - (0b010_000 - 8)]; 14939: } 14940: case 0b011_000: //(A0)+ 14941: if (XEiJ.EFA_SEPARATE_AR) { 14942: XEiJ.mpuCycleCount += 4; 14943: return (XEiJ.regRn[ 8] += 2) - 2; 14944: } 14945: //fallthrough 14946: case 0b011_001: //(A1)+ 14947: if (XEiJ.EFA_SEPARATE_AR) { 14948: XEiJ.mpuCycleCount += 4; 14949: return (XEiJ.regRn[ 9] += 2) - 2; 14950: } 14951: //fallthrough 14952: case 0b011_010: //(A2)+ 14953: if (XEiJ.EFA_SEPARATE_AR) { 14954: XEiJ.mpuCycleCount += 4; 14955: return (XEiJ.regRn[10] += 2) - 2; 14956: } 14957: //fallthrough 14958: case 0b011_011: //(A3)+ 14959: if (XEiJ.EFA_SEPARATE_AR) { 14960: XEiJ.mpuCycleCount += 4; 14961: return (XEiJ.regRn[11] += 2) - 2; 14962: } 14963: //fallthrough 14964: case 0b011_100: //(A4)+ 14965: if (XEiJ.EFA_SEPARATE_AR) { 14966: XEiJ.mpuCycleCount += 4; 14967: return (XEiJ.regRn[12] += 2) - 2; 14968: } 14969: //fallthrough 14970: case 0b011_101: //(A5)+ 14971: if (XEiJ.EFA_SEPARATE_AR) { 14972: XEiJ.mpuCycleCount += 4; 14973: return (XEiJ.regRn[13] += 2) - 2; 14974: } 14975: //fallthrough 14976: case 0b011_110: //(A6)+ 14977: if (XEiJ.EFA_SEPARATE_AR) { 14978: XEiJ.mpuCycleCount += 4; 14979: return (XEiJ.regRn[14] += 2) - 2; 14980: } 14981: //fallthrough 14982: case 0b011_111: //(A7)+ 14983: if (XEiJ.EFA_SEPARATE_AR) { 14984: XEiJ.mpuCycleCount += 4; 14985: return (XEiJ.regRn[15] += 2) - 2; 14986: } else { 14987: XEiJ.mpuCycleCount += 4; 14988: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 2) - 2; 14989: } 14990: case 0b100_000: //-(A0) 14991: if (XEiJ.EFA_SEPARATE_AR) { 14992: XEiJ.mpuCycleCount += 6; 14993: return XEiJ.regRn[ 8] -= 2; 14994: } 14995: //fallthrough 14996: case 0b100_001: //-(A1) 14997: if (XEiJ.EFA_SEPARATE_AR) { 14998: XEiJ.mpuCycleCount += 6; 14999: return XEiJ.regRn[ 9] -= 2; 15000: } 15001: //fallthrough 15002: case 0b100_010: //-(A2) 15003: if (XEiJ.EFA_SEPARATE_AR) { 15004: XEiJ.mpuCycleCount += 6; 15005: return XEiJ.regRn[10] -= 2; 15006: } 15007: //fallthrough 15008: case 0b100_011: //-(A3) 15009: if (XEiJ.EFA_SEPARATE_AR) { 15010: XEiJ.mpuCycleCount += 6; 15011: return XEiJ.regRn[11] -= 2; 15012: } 15013: //fallthrough 15014: case 0b100_100: //-(A4) 15015: if (XEiJ.EFA_SEPARATE_AR) { 15016: XEiJ.mpuCycleCount += 6; 15017: return XEiJ.regRn[12] -= 2; 15018: } 15019: //fallthrough 15020: case 0b100_101: //-(A5) 15021: if (XEiJ.EFA_SEPARATE_AR) { 15022: XEiJ.mpuCycleCount += 6; 15023: return XEiJ.regRn[13] -= 2; 15024: } 15025: //fallthrough 15026: case 0b100_110: //-(A6) 15027: if (XEiJ.EFA_SEPARATE_AR) { 15028: XEiJ.mpuCycleCount += 6; 15029: return XEiJ.regRn[14] -= 2; 15030: } 15031: //fallthrough 15032: case 0b100_111: //-(A7) 15033: if (XEiJ.EFA_SEPARATE_AR) { 15034: XEiJ.mpuCycleCount += 6; 15035: return XEiJ.regRn[15] -= 2; 15036: } else { 15037: XEiJ.mpuCycleCount += 6; 15038: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 2; 15039: } 15040: case 0b101_000: //(d16,A0) 15041: case 0b101_001: //(d16,A1) 15042: case 0b101_010: //(d16,A2) 15043: case 0b101_011: //(d16,A3) 15044: case 0b101_100: //(d16,A4) 15045: case 0b101_101: //(d16,A5) 15046: case 0b101_110: //(d16,A6) 15047: case 0b101_111: //(d16,A7) 15048: XEiJ.mpuCycleCount += 8; 15049: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15050: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15051: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 15052: } else { 15053: t = XEiJ.regPC; 15054: XEiJ.regPC = t + 2; 15055: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15056: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15057: } 15058: case 0b110_000: //(d8,A0,Rn.wl) 15059: case 0b110_001: //(d8,A1,Rn.wl) 15060: case 0b110_010: //(d8,A2,Rn.wl) 15061: case 0b110_011: //(d8,A3,Rn.wl) 15062: case 0b110_100: //(d8,A4,Rn.wl) 15063: case 0b110_101: //(d8,A5,Rn.wl) 15064: case 0b110_110: //(d8,A6,Rn.wl) 15065: case 0b110_111: //(d8,A7,Rn.wl) 15066: XEiJ.mpuCycleCount += 10; 15067: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15068: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 15069: } else { 15070: w = XEiJ.regPC; 15071: XEiJ.regPC = w + 2; 15072: w = XEiJ.busRwze (w); //pcwz。拡張ワード 15073: } 15074: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 15075: + (byte) w //バイトディスプレースメント 15076: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15077: XEiJ.regRn[w >> 12])); //ロングインデックス 15078: case 0b111_000: //(xxx).W 15079: XEiJ.mpuCycleCount += 8; 15080: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 15081: case 0b111_001: //(xxx).L 15082: XEiJ.mpuCycleCount += 12; 15083: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 15084: case 0b111_010: //(d16,PC) 15085: XEiJ.mpuCycleCount += 8; 15086: t = XEiJ.regPC; 15087: XEiJ.regPC = t + 2; 15088: return (t //ベースレジスタ 15089: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15090: case 0b111_011: //(d8,PC,Rn.wl) 15091: XEiJ.mpuCycleCount += 10; 15092: t = XEiJ.regPC; 15093: XEiJ.regPC = t + 2; 15094: w = XEiJ.busRwze (t); //pcwz。拡張ワード 15095: return (t //ベースレジスタ 15096: + (byte) w //バイトディスプレースメント 15097: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15098: XEiJ.regRn[w >> 12])); //ロングインデックス 15099: } //switch 15100: XEiJ.mpuCycleCount += 34; 15101: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 15102: throw M68kException.m6eSignal; 15103: } //efaMemWord 15104: 15105: //a = efaMltWord (ea) //| M+-WXZ | 15106: // メモリ可変モードのワードオペランドの実効アドレスを求める 15107: // efaMemWordとの違いは(d16,PC)と(d8,PC,Rn.wl)がないこと 15108: @SuppressWarnings ("fallthrough") public static int efaMltWord (int ea) throws M68kException { 15109: int t, w; 15110: switch (ea) { 15111: case 0b010_000: //(A0) 15112: if (XEiJ.EFA_SEPARATE_AR) { 15113: XEiJ.mpuCycleCount += 4; 15114: return XEiJ.regRn[ 8]; 15115: } 15116: //fallthrough 15117: case 0b010_001: //(A1) 15118: if (XEiJ.EFA_SEPARATE_AR) { 15119: XEiJ.mpuCycleCount += 4; 15120: return XEiJ.regRn[ 9]; 15121: } 15122: //fallthrough 15123: case 0b010_010: //(A2) 15124: if (XEiJ.EFA_SEPARATE_AR) { 15125: XEiJ.mpuCycleCount += 4; 15126: return XEiJ.regRn[10]; 15127: } 15128: //fallthrough 15129: case 0b010_011: //(A3) 15130: if (XEiJ.EFA_SEPARATE_AR) { 15131: XEiJ.mpuCycleCount += 4; 15132: return XEiJ.regRn[11]; 15133: } 15134: //fallthrough 15135: case 0b010_100: //(A4) 15136: if (XEiJ.EFA_SEPARATE_AR) { 15137: XEiJ.mpuCycleCount += 4; 15138: return XEiJ.regRn[12]; 15139: } 15140: //fallthrough 15141: case 0b010_101: //(A5) 15142: if (XEiJ.EFA_SEPARATE_AR) { 15143: XEiJ.mpuCycleCount += 4; 15144: return XEiJ.regRn[13]; 15145: } 15146: //fallthrough 15147: case 0b010_110: //(A6) 15148: if (XEiJ.EFA_SEPARATE_AR) { 15149: XEiJ.mpuCycleCount += 4; 15150: return XEiJ.regRn[14]; 15151: } 15152: //fallthrough 15153: case 0b010_111: //(A7) 15154: if (XEiJ.EFA_SEPARATE_AR) { 15155: XEiJ.mpuCycleCount += 4; 15156: return XEiJ.regRn[15]; 15157: } else { 15158: XEiJ.mpuCycleCount += 4; 15159: return XEiJ.regRn[ea - (0b010_000 - 8)]; 15160: } 15161: case 0b011_000: //(A0)+ 15162: if (XEiJ.EFA_SEPARATE_AR) { 15163: XEiJ.mpuCycleCount += 4; 15164: return (XEiJ.regRn[ 8] += 2) - 2; 15165: } 15166: //fallthrough 15167: case 0b011_001: //(A1)+ 15168: if (XEiJ.EFA_SEPARATE_AR) { 15169: XEiJ.mpuCycleCount += 4; 15170: return (XEiJ.regRn[ 9] += 2) - 2; 15171: } 15172: //fallthrough 15173: case 0b011_010: //(A2)+ 15174: if (XEiJ.EFA_SEPARATE_AR) { 15175: XEiJ.mpuCycleCount += 4; 15176: return (XEiJ.regRn[10] += 2) - 2; 15177: } 15178: //fallthrough 15179: case 0b011_011: //(A3)+ 15180: if (XEiJ.EFA_SEPARATE_AR) { 15181: XEiJ.mpuCycleCount += 4; 15182: return (XEiJ.regRn[11] += 2) - 2; 15183: } 15184: //fallthrough 15185: case 0b011_100: //(A4)+ 15186: if (XEiJ.EFA_SEPARATE_AR) { 15187: XEiJ.mpuCycleCount += 4; 15188: return (XEiJ.regRn[12] += 2) - 2; 15189: } 15190: //fallthrough 15191: case 0b011_101: //(A5)+ 15192: if (XEiJ.EFA_SEPARATE_AR) { 15193: XEiJ.mpuCycleCount += 4; 15194: return (XEiJ.regRn[13] += 2) - 2; 15195: } 15196: //fallthrough 15197: case 0b011_110: //(A6)+ 15198: if (XEiJ.EFA_SEPARATE_AR) { 15199: XEiJ.mpuCycleCount += 4; 15200: return (XEiJ.regRn[14] += 2) - 2; 15201: } 15202: //fallthrough 15203: case 0b011_111: //(A7)+ 15204: if (XEiJ.EFA_SEPARATE_AR) { 15205: XEiJ.mpuCycleCount += 4; 15206: return (XEiJ.regRn[15] += 2) - 2; 15207: } else { 15208: XEiJ.mpuCycleCount += 4; 15209: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 2) - 2; 15210: } 15211: case 0b100_000: //-(A0) 15212: if (XEiJ.EFA_SEPARATE_AR) { 15213: XEiJ.mpuCycleCount += 6; 15214: return XEiJ.regRn[ 8] -= 2; 15215: } 15216: //fallthrough 15217: case 0b100_001: //-(A1) 15218: if (XEiJ.EFA_SEPARATE_AR) { 15219: XEiJ.mpuCycleCount += 6; 15220: return XEiJ.regRn[ 9] -= 2; 15221: } 15222: //fallthrough 15223: case 0b100_010: //-(A2) 15224: if (XEiJ.EFA_SEPARATE_AR) { 15225: XEiJ.mpuCycleCount += 6; 15226: return XEiJ.regRn[10] -= 2; 15227: } 15228: //fallthrough 15229: case 0b100_011: //-(A3) 15230: if (XEiJ.EFA_SEPARATE_AR) { 15231: XEiJ.mpuCycleCount += 6; 15232: return XEiJ.regRn[11] -= 2; 15233: } 15234: //fallthrough 15235: case 0b100_100: //-(A4) 15236: if (XEiJ.EFA_SEPARATE_AR) { 15237: XEiJ.mpuCycleCount += 6; 15238: return XEiJ.regRn[12] -= 2; 15239: } 15240: //fallthrough 15241: case 0b100_101: //-(A5) 15242: if (XEiJ.EFA_SEPARATE_AR) { 15243: XEiJ.mpuCycleCount += 6; 15244: return XEiJ.regRn[13] -= 2; 15245: } 15246: //fallthrough 15247: case 0b100_110: //-(A6) 15248: if (XEiJ.EFA_SEPARATE_AR) { 15249: XEiJ.mpuCycleCount += 6; 15250: return XEiJ.regRn[14] -= 2; 15251: } 15252: //fallthrough 15253: case 0b100_111: //-(A7) 15254: if (XEiJ.EFA_SEPARATE_AR) { 15255: XEiJ.mpuCycleCount += 6; 15256: return XEiJ.regRn[15] -= 2; 15257: } else { 15258: XEiJ.mpuCycleCount += 6; 15259: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 2; 15260: } 15261: case 0b101_000: //(d16,A0) 15262: case 0b101_001: //(d16,A1) 15263: case 0b101_010: //(d16,A2) 15264: case 0b101_011: //(d16,A3) 15265: case 0b101_100: //(d16,A4) 15266: case 0b101_101: //(d16,A5) 15267: case 0b101_110: //(d16,A6) 15268: case 0b101_111: //(d16,A7) 15269: XEiJ.mpuCycleCount += 8; 15270: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15271: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15272: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 15273: } else { 15274: t = XEiJ.regPC; 15275: XEiJ.regPC = t + 2; 15276: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15277: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15278: } 15279: case 0b110_000: //(d8,A0,Rn.wl) 15280: case 0b110_001: //(d8,A1,Rn.wl) 15281: case 0b110_010: //(d8,A2,Rn.wl) 15282: case 0b110_011: //(d8,A3,Rn.wl) 15283: case 0b110_100: //(d8,A4,Rn.wl) 15284: case 0b110_101: //(d8,A5,Rn.wl) 15285: case 0b110_110: //(d8,A6,Rn.wl) 15286: case 0b110_111: //(d8,A7,Rn.wl) 15287: XEiJ.mpuCycleCount += 10; 15288: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15289: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 15290: } else { 15291: w = XEiJ.regPC; 15292: XEiJ.regPC = w + 2; 15293: w = XEiJ.busRwze (w); //pcwz。拡張ワード 15294: } 15295: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 15296: + (byte) w //バイトディスプレースメント 15297: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15298: XEiJ.regRn[w >> 12])); //ロングインデックス 15299: case 0b111_000: //(xxx).W 15300: XEiJ.mpuCycleCount += 8; 15301: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 15302: case 0b111_001: //(xxx).L 15303: XEiJ.mpuCycleCount += 12; 15304: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 15305: } //switch 15306: XEiJ.mpuCycleCount += 34; 15307: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 15308: throw M68kException.m6eSignal; 15309: } //efaMltWord 15310: 15311: //a = efaCntWord (ea) //| M WXZP | 15312: // 制御モードのワードオペランドの実効アドレスを求める 15313: // efaMemWordとの違いは(Ar)+と-(Ar)がないこと 15314: @SuppressWarnings ("fallthrough") public static int efaCntWord (int ea) throws M68kException { 15315: int t, w; 15316: switch (ea) { 15317: case 0b010_000: //(A0) 15318: if (XEiJ.EFA_SEPARATE_AR) { 15319: XEiJ.mpuCycleCount += 4; 15320: return XEiJ.regRn[ 8]; 15321: } 15322: //fallthrough 15323: case 0b010_001: //(A1) 15324: if (XEiJ.EFA_SEPARATE_AR) { 15325: XEiJ.mpuCycleCount += 4; 15326: return XEiJ.regRn[ 9]; 15327: } 15328: //fallthrough 15329: case 0b010_010: //(A2) 15330: if (XEiJ.EFA_SEPARATE_AR) { 15331: XEiJ.mpuCycleCount += 4; 15332: return XEiJ.regRn[10]; 15333: } 15334: //fallthrough 15335: case 0b010_011: //(A3) 15336: if (XEiJ.EFA_SEPARATE_AR) { 15337: XEiJ.mpuCycleCount += 4; 15338: return XEiJ.regRn[11]; 15339: } 15340: //fallthrough 15341: case 0b010_100: //(A4) 15342: if (XEiJ.EFA_SEPARATE_AR) { 15343: XEiJ.mpuCycleCount += 4; 15344: return XEiJ.regRn[12]; 15345: } 15346: //fallthrough 15347: case 0b010_101: //(A5) 15348: if (XEiJ.EFA_SEPARATE_AR) { 15349: XEiJ.mpuCycleCount += 4; 15350: return XEiJ.regRn[13]; 15351: } 15352: //fallthrough 15353: case 0b010_110: //(A6) 15354: if (XEiJ.EFA_SEPARATE_AR) { 15355: XEiJ.mpuCycleCount += 4; 15356: return XEiJ.regRn[14]; 15357: } 15358: //fallthrough 15359: case 0b010_111: //(A7) 15360: if (XEiJ.EFA_SEPARATE_AR) { 15361: XEiJ.mpuCycleCount += 4; 15362: return XEiJ.regRn[15]; 15363: } else { 15364: XEiJ.mpuCycleCount += 4; 15365: return XEiJ.regRn[ea - (0b010_000 - 8)]; 15366: } 15367: case 0b101_000: //(d16,A0) 15368: case 0b101_001: //(d16,A1) 15369: case 0b101_010: //(d16,A2) 15370: case 0b101_011: //(d16,A3) 15371: case 0b101_100: //(d16,A4) 15372: case 0b101_101: //(d16,A5) 15373: case 0b101_110: //(d16,A6) 15374: case 0b101_111: //(d16,A7) 15375: XEiJ.mpuCycleCount += 8; 15376: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15377: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15378: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 15379: } else { 15380: t = XEiJ.regPC; 15381: XEiJ.regPC = t + 2; 15382: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15383: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15384: } 15385: case 0b110_000: //(d8,A0,Rn.wl) 15386: case 0b110_001: //(d8,A1,Rn.wl) 15387: case 0b110_010: //(d8,A2,Rn.wl) 15388: case 0b110_011: //(d8,A3,Rn.wl) 15389: case 0b110_100: //(d8,A4,Rn.wl) 15390: case 0b110_101: //(d8,A5,Rn.wl) 15391: case 0b110_110: //(d8,A6,Rn.wl) 15392: case 0b110_111: //(d8,A7,Rn.wl) 15393: XEiJ.mpuCycleCount += 10; 15394: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15395: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 15396: } else { 15397: w = XEiJ.regPC; 15398: XEiJ.regPC = w + 2; 15399: w = XEiJ.busRwze (w); //pcwz。拡張ワード 15400: } 15401: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 15402: + (byte) w //バイトディスプレースメント 15403: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15404: XEiJ.regRn[w >> 12])); //ロングインデックス 15405: case 0b111_000: //(xxx).W 15406: XEiJ.mpuCycleCount += 8; 15407: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 15408: case 0b111_001: //(xxx).L 15409: XEiJ.mpuCycleCount += 12; 15410: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 15411: case 0b111_010: //(d16,PC) 15412: XEiJ.mpuCycleCount += 8; 15413: t = XEiJ.regPC; 15414: XEiJ.regPC = t + 2; 15415: return (t //ベースレジスタ 15416: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15417: case 0b111_011: //(d8,PC,Rn.wl) 15418: XEiJ.mpuCycleCount += 10; 15419: t = XEiJ.regPC; 15420: XEiJ.regPC = t + 2; 15421: w = XEiJ.busRwze (t); //pcwz。拡張ワード 15422: return (t //ベースレジスタ 15423: + (byte) w //バイトディスプレースメント 15424: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15425: XEiJ.regRn[w >> 12])); //ロングインデックス 15426: } //switch 15427: XEiJ.mpuCycleCount += 34; 15428: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 15429: throw M68kException.m6eSignal; 15430: } //efaCntWord 15431: 15432: //a = efaCltWord (ea) //| M WXZ | 15433: // 制御可変モードのワードオペランドの実効アドレスを求める 15434: // efaCntWordとの違いは(d16,PC)と(d8,PC,Rn.wl)がないこと 15435: @SuppressWarnings ("fallthrough") public static int efaCltWord (int ea) throws M68kException { 15436: int t, w; 15437: switch (ea) { 15438: case 0b010_000: //(A0) 15439: if (XEiJ.EFA_SEPARATE_AR) { 15440: XEiJ.mpuCycleCount += 4; 15441: return XEiJ.regRn[ 8]; 15442: } 15443: //fallthrough 15444: case 0b010_001: //(A1) 15445: if (XEiJ.EFA_SEPARATE_AR) { 15446: XEiJ.mpuCycleCount += 4; 15447: return XEiJ.regRn[ 9]; 15448: } 15449: //fallthrough 15450: case 0b010_010: //(A2) 15451: if (XEiJ.EFA_SEPARATE_AR) { 15452: XEiJ.mpuCycleCount += 4; 15453: return XEiJ.regRn[10]; 15454: } 15455: //fallthrough 15456: case 0b010_011: //(A3) 15457: if (XEiJ.EFA_SEPARATE_AR) { 15458: XEiJ.mpuCycleCount += 4; 15459: return XEiJ.regRn[11]; 15460: } 15461: //fallthrough 15462: case 0b010_100: //(A4) 15463: if (XEiJ.EFA_SEPARATE_AR) { 15464: XEiJ.mpuCycleCount += 4; 15465: return XEiJ.regRn[12]; 15466: } 15467: //fallthrough 15468: case 0b010_101: //(A5) 15469: if (XEiJ.EFA_SEPARATE_AR) { 15470: XEiJ.mpuCycleCount += 4; 15471: return XEiJ.regRn[13]; 15472: } 15473: //fallthrough 15474: case 0b010_110: //(A6) 15475: if (XEiJ.EFA_SEPARATE_AR) { 15476: XEiJ.mpuCycleCount += 4; 15477: return XEiJ.regRn[14]; 15478: } 15479: //fallthrough 15480: case 0b010_111: //(A7) 15481: if (XEiJ.EFA_SEPARATE_AR) { 15482: XEiJ.mpuCycleCount += 4; 15483: return XEiJ.regRn[15]; 15484: } else { 15485: XEiJ.mpuCycleCount += 4; 15486: return XEiJ.regRn[ea - (0b010_000 - 8)]; 15487: } 15488: case 0b101_000: //(d16,A0) 15489: case 0b101_001: //(d16,A1) 15490: case 0b101_010: //(d16,A2) 15491: case 0b101_011: //(d16,A3) 15492: case 0b101_100: //(d16,A4) 15493: case 0b101_101: //(d16,A5) 15494: case 0b101_110: //(d16,A6) 15495: case 0b101_111: //(d16,A7) 15496: XEiJ.mpuCycleCount += 8; 15497: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15498: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15499: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 15500: } else { 15501: t = XEiJ.regPC; 15502: XEiJ.regPC = t + 2; 15503: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15504: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15505: } 15506: case 0b110_000: //(d8,A0,Rn.wl) 15507: case 0b110_001: //(d8,A1,Rn.wl) 15508: case 0b110_010: //(d8,A2,Rn.wl) 15509: case 0b110_011: //(d8,A3,Rn.wl) 15510: case 0b110_100: //(d8,A4,Rn.wl) 15511: case 0b110_101: //(d8,A5,Rn.wl) 15512: case 0b110_110: //(d8,A6,Rn.wl) 15513: case 0b110_111: //(d8,A7,Rn.wl) 15514: XEiJ.mpuCycleCount += 10; 15515: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15516: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 15517: } else { 15518: w = XEiJ.regPC; 15519: XEiJ.regPC = w + 2; 15520: w = XEiJ.busRwze (w); //pcwz。拡張ワード 15521: } 15522: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 15523: + (byte) w //バイトディスプレースメント 15524: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15525: XEiJ.regRn[w >> 12])); //ロングインデックス 15526: case 0b111_000: //(xxx).W 15527: XEiJ.mpuCycleCount += 8; 15528: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 15529: case 0b111_001: //(xxx).L 15530: XEiJ.mpuCycleCount += 12; 15531: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 15532: } //switch 15533: XEiJ.mpuCycleCount += 34; 15534: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 15535: throw M68kException.m6eSignal; 15536: } //efaCltWord 15537: 15538: //a = efaAnyLong (ea) //| M+-WXZPI| 15539: // 任意のモードのロングオペランドの実効アドレスを求める 15540: // efaAnyWordとの違いは(Ar)+と-(Ar)がArを4変化させることと、#<data>がPCを4変化させることと、 15541: // オペランドのアクセスが1ワード増える分の4サイクルが追加されていること 15542: @SuppressWarnings ("fallthrough") public static int efaAnyLong (int ea) throws M68kException { 15543: int t, w; 15544: switch (ea) { 15545: case 0b010_000: //(A0) 15546: if (XEiJ.EFA_SEPARATE_AR) { 15547: XEiJ.mpuCycleCount += 8; 15548: return XEiJ.regRn[ 8]; 15549: } 15550: //fallthrough 15551: case 0b010_001: //(A1) 15552: if (XEiJ.EFA_SEPARATE_AR) { 15553: XEiJ.mpuCycleCount += 8; 15554: return XEiJ.regRn[ 9]; 15555: } 15556: //fallthrough 15557: case 0b010_010: //(A2) 15558: if (XEiJ.EFA_SEPARATE_AR) { 15559: XEiJ.mpuCycleCount += 8; 15560: return XEiJ.regRn[10]; 15561: } 15562: //fallthrough 15563: case 0b010_011: //(A3) 15564: if (XEiJ.EFA_SEPARATE_AR) { 15565: XEiJ.mpuCycleCount += 8; 15566: return XEiJ.regRn[11]; 15567: } 15568: //fallthrough 15569: case 0b010_100: //(A4) 15570: if (XEiJ.EFA_SEPARATE_AR) { 15571: XEiJ.mpuCycleCount += 8; 15572: return XEiJ.regRn[12]; 15573: } 15574: //fallthrough 15575: case 0b010_101: //(A5) 15576: if (XEiJ.EFA_SEPARATE_AR) { 15577: XEiJ.mpuCycleCount += 8; 15578: return XEiJ.regRn[13]; 15579: } 15580: //fallthrough 15581: case 0b010_110: //(A6) 15582: if (XEiJ.EFA_SEPARATE_AR) { 15583: XEiJ.mpuCycleCount += 8; 15584: return XEiJ.regRn[14]; 15585: } 15586: //fallthrough 15587: case 0b010_111: //(A7) 15588: if (XEiJ.EFA_SEPARATE_AR) { 15589: XEiJ.mpuCycleCount += 8; 15590: return XEiJ.regRn[15]; 15591: } else { 15592: XEiJ.mpuCycleCount += 8; 15593: return XEiJ.regRn[ea - (0b010_000 - 8)]; 15594: } 15595: case 0b011_000: //(A0)+ 15596: if (XEiJ.EFA_SEPARATE_AR) { 15597: XEiJ.mpuCycleCount += 8; 15598: return (XEiJ.regRn[ 8] += 4) - 4; 15599: } 15600: //fallthrough 15601: case 0b011_001: //(A1)+ 15602: if (XEiJ.EFA_SEPARATE_AR) { 15603: XEiJ.mpuCycleCount += 8; 15604: return (XEiJ.regRn[ 9] += 4) - 4; 15605: } 15606: //fallthrough 15607: case 0b011_010: //(A2)+ 15608: if (XEiJ.EFA_SEPARATE_AR) { 15609: XEiJ.mpuCycleCount += 8; 15610: return (XEiJ.regRn[10] += 4) - 4; 15611: } 15612: //fallthrough 15613: case 0b011_011: //(A3)+ 15614: if (XEiJ.EFA_SEPARATE_AR) { 15615: XEiJ.mpuCycleCount += 8; 15616: return (XEiJ.regRn[11] += 4) - 4; 15617: } 15618: //fallthrough 15619: case 0b011_100: //(A4)+ 15620: if (XEiJ.EFA_SEPARATE_AR) { 15621: XEiJ.mpuCycleCount += 8; 15622: return (XEiJ.regRn[12] += 4) - 4; 15623: } 15624: //fallthrough 15625: case 0b011_101: //(A5)+ 15626: if (XEiJ.EFA_SEPARATE_AR) { 15627: XEiJ.mpuCycleCount += 8; 15628: return (XEiJ.regRn[13] += 4) - 4; 15629: } 15630: //fallthrough 15631: case 0b011_110: //(A6)+ 15632: if (XEiJ.EFA_SEPARATE_AR) { 15633: XEiJ.mpuCycleCount += 8; 15634: return (XEiJ.regRn[14] += 4) - 4; 15635: } 15636: //fallthrough 15637: case 0b011_111: //(A7)+ 15638: if (XEiJ.EFA_SEPARATE_AR) { 15639: XEiJ.mpuCycleCount += 8; 15640: return (XEiJ.regRn[15] += 4) - 4; 15641: } else { 15642: XEiJ.mpuCycleCount += 8; 15643: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 4) - 4; 15644: } 15645: case 0b100_000: //-(A0) 15646: if (XEiJ.EFA_SEPARATE_AR) { 15647: XEiJ.mpuCycleCount += 10; 15648: return XEiJ.regRn[ 8] -= 4; 15649: } 15650: //fallthrough 15651: case 0b100_001: //-(A1) 15652: if (XEiJ.EFA_SEPARATE_AR) { 15653: XEiJ.mpuCycleCount += 10; 15654: return XEiJ.regRn[ 9] -= 4; 15655: } 15656: //fallthrough 15657: case 0b100_010: //-(A2) 15658: if (XEiJ.EFA_SEPARATE_AR) { 15659: XEiJ.mpuCycleCount += 10; 15660: return XEiJ.regRn[10] -= 4; 15661: } 15662: //fallthrough 15663: case 0b100_011: //-(A3) 15664: if (XEiJ.EFA_SEPARATE_AR) { 15665: XEiJ.mpuCycleCount += 10; 15666: return XEiJ.regRn[11] -= 4; 15667: } 15668: //fallthrough 15669: case 0b100_100: //-(A4) 15670: if (XEiJ.EFA_SEPARATE_AR) { 15671: XEiJ.mpuCycleCount += 10; 15672: return XEiJ.regRn[12] -= 4; 15673: } 15674: //fallthrough 15675: case 0b100_101: //-(A5) 15676: if (XEiJ.EFA_SEPARATE_AR) { 15677: XEiJ.mpuCycleCount += 10; 15678: return XEiJ.regRn[13] -= 4; 15679: } 15680: //fallthrough 15681: case 0b100_110: //-(A6) 15682: if (XEiJ.EFA_SEPARATE_AR) { 15683: XEiJ.mpuCycleCount += 10; 15684: return XEiJ.regRn[14] -= 4; 15685: } 15686: //fallthrough 15687: case 0b100_111: //-(A7) 15688: if (XEiJ.EFA_SEPARATE_AR) { 15689: XEiJ.mpuCycleCount += 10; 15690: return XEiJ.regRn[15] -= 4; 15691: } else { 15692: XEiJ.mpuCycleCount += 10; 15693: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 4; 15694: } 15695: case 0b101_000: //(d16,A0) 15696: case 0b101_001: //(d16,A1) 15697: case 0b101_010: //(d16,A2) 15698: case 0b101_011: //(d16,A3) 15699: case 0b101_100: //(d16,A4) 15700: case 0b101_101: //(d16,A5) 15701: case 0b101_110: //(d16,A6) 15702: case 0b101_111: //(d16,A7) 15703: XEiJ.mpuCycleCount += 12; 15704: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15705: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15706: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 15707: } else { 15708: t = XEiJ.regPC; 15709: XEiJ.regPC = t + 2; 15710: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15711: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15712: } 15713: case 0b110_000: //(d8,A0,Rn.wl) 15714: case 0b110_001: //(d8,A1,Rn.wl) 15715: case 0b110_010: //(d8,A2,Rn.wl) 15716: case 0b110_011: //(d8,A3,Rn.wl) 15717: case 0b110_100: //(d8,A4,Rn.wl) 15718: case 0b110_101: //(d8,A5,Rn.wl) 15719: case 0b110_110: //(d8,A6,Rn.wl) 15720: case 0b110_111: //(d8,A7,Rn.wl) 15721: XEiJ.mpuCycleCount += 14; 15722: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15723: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 15724: } else { 15725: w = XEiJ.regPC; 15726: XEiJ.regPC = w + 2; 15727: w = XEiJ.busRwze (w); //pcwz。拡張ワード 15728: } 15729: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 15730: + (byte) w //バイトディスプレースメント 15731: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15732: XEiJ.regRn[w >> 12])); //ロングインデックス 15733: case 0b111_000: //(xxx).W 15734: XEiJ.mpuCycleCount += 12; 15735: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 15736: case 0b111_001: //(xxx).L 15737: XEiJ.mpuCycleCount += 16; 15738: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 15739: case 0b111_010: //(d16,PC) 15740: XEiJ.mpuCycleCount += 12; 15741: t = XEiJ.regPC; 15742: XEiJ.regPC = t + 2; 15743: return (t //ベースレジスタ 15744: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15745: case 0b111_011: //(d8,PC,Rn.wl) 15746: XEiJ.mpuCycleCount += 14; 15747: t = XEiJ.regPC; 15748: XEiJ.regPC = t + 2; 15749: w = XEiJ.busRwze (t); //pcwz。拡張ワード 15750: return (t //ベースレジスタ 15751: + (byte) w //バイトディスプレースメント 15752: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15753: XEiJ.regRn[w >> 12])); //ロングインデックス 15754: case 0b111_100: //#<data> 15755: XEiJ.mpuCycleCount += 8; 15756: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15757: return (XEiJ.regPC += 4) - 4; 15758: } else { 15759: t = XEiJ.regPC; 15760: XEiJ.regPC = t + 4; 15761: return t; 15762: } 15763: } //switch 15764: XEiJ.mpuCycleCount += 34; 15765: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 15766: throw M68kException.m6eSignal; 15767: } //efaAnyLong 15768: 15769: //a = efaMemLong (ea) //| M+-WXZP | 15770: // メモリモードのロングオペランドの実効アドレスを求める 15771: // efaAnyLongとの違いは#<data>がないこと 15772: @SuppressWarnings ("fallthrough") public static int efaMemLong (int ea) throws M68kException { 15773: int t, w; 15774: switch (ea) { 15775: case 0b010_000: //(A0) 15776: if (XEiJ.EFA_SEPARATE_AR) { 15777: XEiJ.mpuCycleCount += 8; 15778: return XEiJ.regRn[ 8]; 15779: } 15780: //fallthrough 15781: case 0b010_001: //(A1) 15782: if (XEiJ.EFA_SEPARATE_AR) { 15783: XEiJ.mpuCycleCount += 8; 15784: return XEiJ.regRn[ 9]; 15785: } 15786: //fallthrough 15787: case 0b010_010: //(A2) 15788: if (XEiJ.EFA_SEPARATE_AR) { 15789: XEiJ.mpuCycleCount += 8; 15790: return XEiJ.regRn[10]; 15791: } 15792: //fallthrough 15793: case 0b010_011: //(A3) 15794: if (XEiJ.EFA_SEPARATE_AR) { 15795: XEiJ.mpuCycleCount += 8; 15796: return XEiJ.regRn[11]; 15797: } 15798: //fallthrough 15799: case 0b010_100: //(A4) 15800: if (XEiJ.EFA_SEPARATE_AR) { 15801: XEiJ.mpuCycleCount += 8; 15802: return XEiJ.regRn[12]; 15803: } 15804: //fallthrough 15805: case 0b010_101: //(A5) 15806: if (XEiJ.EFA_SEPARATE_AR) { 15807: XEiJ.mpuCycleCount += 8; 15808: return XEiJ.regRn[13]; 15809: } 15810: //fallthrough 15811: case 0b010_110: //(A6) 15812: if (XEiJ.EFA_SEPARATE_AR) { 15813: XEiJ.mpuCycleCount += 8; 15814: return XEiJ.regRn[14]; 15815: } 15816: //fallthrough 15817: case 0b010_111: //(A7) 15818: if (XEiJ.EFA_SEPARATE_AR) { 15819: XEiJ.mpuCycleCount += 8; 15820: return XEiJ.regRn[15]; 15821: } else { 15822: XEiJ.mpuCycleCount += 8; 15823: return XEiJ.regRn[ea - (0b010_000 - 8)]; 15824: } 15825: case 0b011_000: //(A0)+ 15826: if (XEiJ.EFA_SEPARATE_AR) { 15827: XEiJ.mpuCycleCount += 8; 15828: return (XEiJ.regRn[ 8] += 4) - 4; 15829: } 15830: //fallthrough 15831: case 0b011_001: //(A1)+ 15832: if (XEiJ.EFA_SEPARATE_AR) { 15833: XEiJ.mpuCycleCount += 8; 15834: return (XEiJ.regRn[ 9] += 4) - 4; 15835: } 15836: //fallthrough 15837: case 0b011_010: //(A2)+ 15838: if (XEiJ.EFA_SEPARATE_AR) { 15839: XEiJ.mpuCycleCount += 8; 15840: return (XEiJ.regRn[10] += 4) - 4; 15841: } 15842: //fallthrough 15843: case 0b011_011: //(A3)+ 15844: if (XEiJ.EFA_SEPARATE_AR) { 15845: XEiJ.mpuCycleCount += 8; 15846: return (XEiJ.regRn[11] += 4) - 4; 15847: } 15848: //fallthrough 15849: case 0b011_100: //(A4)+ 15850: if (XEiJ.EFA_SEPARATE_AR) { 15851: XEiJ.mpuCycleCount += 8; 15852: return (XEiJ.regRn[12] += 4) - 4; 15853: } 15854: //fallthrough 15855: case 0b011_101: //(A5)+ 15856: if (XEiJ.EFA_SEPARATE_AR) { 15857: XEiJ.mpuCycleCount += 8; 15858: return (XEiJ.regRn[13] += 4) - 4; 15859: } 15860: //fallthrough 15861: case 0b011_110: //(A6)+ 15862: if (XEiJ.EFA_SEPARATE_AR) { 15863: XEiJ.mpuCycleCount += 8; 15864: return (XEiJ.regRn[14] += 4) - 4; 15865: } 15866: //fallthrough 15867: case 0b011_111: //(A7)+ 15868: if (XEiJ.EFA_SEPARATE_AR) { 15869: XEiJ.mpuCycleCount += 8; 15870: return (XEiJ.regRn[15] += 4) - 4; 15871: } else { 15872: XEiJ.mpuCycleCount += 8; 15873: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 4) - 4; 15874: } 15875: case 0b100_000: //-(A0) 15876: if (XEiJ.EFA_SEPARATE_AR) { 15877: XEiJ.mpuCycleCount += 10; 15878: return XEiJ.regRn[ 8] -= 4; 15879: } 15880: //fallthrough 15881: case 0b100_001: //-(A1) 15882: if (XEiJ.EFA_SEPARATE_AR) { 15883: XEiJ.mpuCycleCount += 10; 15884: return XEiJ.regRn[ 9] -= 4; 15885: } 15886: //fallthrough 15887: case 0b100_010: //-(A2) 15888: if (XEiJ.EFA_SEPARATE_AR) { 15889: XEiJ.mpuCycleCount += 10; 15890: return XEiJ.regRn[10] -= 4; 15891: } 15892: //fallthrough 15893: case 0b100_011: //-(A3) 15894: if (XEiJ.EFA_SEPARATE_AR) { 15895: XEiJ.mpuCycleCount += 10; 15896: return XEiJ.regRn[11] -= 4; 15897: } 15898: //fallthrough 15899: case 0b100_100: //-(A4) 15900: if (XEiJ.EFA_SEPARATE_AR) { 15901: XEiJ.mpuCycleCount += 10; 15902: return XEiJ.regRn[12] -= 4; 15903: } 15904: //fallthrough 15905: case 0b100_101: //-(A5) 15906: if (XEiJ.EFA_SEPARATE_AR) { 15907: XEiJ.mpuCycleCount += 10; 15908: return XEiJ.regRn[13] -= 4; 15909: } 15910: //fallthrough 15911: case 0b100_110: //-(A6) 15912: if (XEiJ.EFA_SEPARATE_AR) { 15913: XEiJ.mpuCycleCount += 10; 15914: return XEiJ.regRn[14] -= 4; 15915: } 15916: //fallthrough 15917: case 0b100_111: //-(A7) 15918: if (XEiJ.EFA_SEPARATE_AR) { 15919: XEiJ.mpuCycleCount += 10; 15920: return XEiJ.regRn[15] -= 4; 15921: } else { 15922: XEiJ.mpuCycleCount += 10; 15923: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 4; 15924: } 15925: case 0b101_000: //(d16,A0) 15926: case 0b101_001: //(d16,A1) 15927: case 0b101_010: //(d16,A2) 15928: case 0b101_011: //(d16,A3) 15929: case 0b101_100: //(d16,A4) 15930: case 0b101_101: //(d16,A5) 15931: case 0b101_110: //(d16,A6) 15932: case 0b101_111: //(d16,A7) 15933: XEiJ.mpuCycleCount += 12; 15934: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15935: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15936: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 15937: } else { 15938: t = XEiJ.regPC; 15939: XEiJ.regPC = t + 2; 15940: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 15941: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15942: } 15943: case 0b110_000: //(d8,A0,Rn.wl) 15944: case 0b110_001: //(d8,A1,Rn.wl) 15945: case 0b110_010: //(d8,A2,Rn.wl) 15946: case 0b110_011: //(d8,A3,Rn.wl) 15947: case 0b110_100: //(d8,A4,Rn.wl) 15948: case 0b110_101: //(d8,A5,Rn.wl) 15949: case 0b110_110: //(d8,A6,Rn.wl) 15950: case 0b110_111: //(d8,A7,Rn.wl) 15951: XEiJ.mpuCycleCount += 14; 15952: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 15953: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 15954: } else { 15955: w = XEiJ.regPC; 15956: XEiJ.regPC = w + 2; 15957: w = XEiJ.busRwze (w); //pcwz。拡張ワード 15958: } 15959: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 15960: + (byte) w //バイトディスプレースメント 15961: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15962: XEiJ.regRn[w >> 12])); //ロングインデックス 15963: case 0b111_000: //(xxx).W 15964: XEiJ.mpuCycleCount += 12; 15965: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 15966: case 0b111_001: //(xxx).L 15967: XEiJ.mpuCycleCount += 16; 15968: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 15969: case 0b111_010: //(d16,PC) 15970: XEiJ.mpuCycleCount += 12; 15971: t = XEiJ.regPC; 15972: XEiJ.regPC = t + 2; 15973: return (t //ベースレジスタ 15974: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 15975: case 0b111_011: //(d8,PC,Rn.wl) 15976: XEiJ.mpuCycleCount += 14; 15977: t = XEiJ.regPC; 15978: XEiJ.regPC = t + 2; 15979: w = XEiJ.busRwze (t); //pcwz。拡張ワード 15980: return (t //ベースレジスタ 15981: + (byte) w //バイトディスプレースメント 15982: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 15983: XEiJ.regRn[w >> 12])); //ロングインデックス 15984: } //switch 15985: XEiJ.mpuCycleCount += 34; 15986: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 15987: throw M68kException.m6eSignal; 15988: } //efaMemLong 15989: 15990: //a = efaMltLong (ea) //| M+-WXZ | 15991: // メモリ可変モードのロングオペランドの実効アドレスを求める 15992: // efaMemLongとの違いは(d16,PC)と(d8,PC,Rn.wl)がないこと 15993: @SuppressWarnings ("fallthrough") public static int efaMltLong (int ea) throws M68kException { 15994: int t, w; 15995: switch (ea) { 15996: case 0b010_000: //(A0) 15997: if (XEiJ.EFA_SEPARATE_AR) { 15998: XEiJ.mpuCycleCount += 8; 15999: return XEiJ.regRn[ 8]; 16000: } 16001: //fallthrough 16002: case 0b010_001: //(A1) 16003: if (XEiJ.EFA_SEPARATE_AR) { 16004: XEiJ.mpuCycleCount += 8; 16005: return XEiJ.regRn[ 9]; 16006: } 16007: //fallthrough 16008: case 0b010_010: //(A2) 16009: if (XEiJ.EFA_SEPARATE_AR) { 16010: XEiJ.mpuCycleCount += 8; 16011: return XEiJ.regRn[10]; 16012: } 16013: //fallthrough 16014: case 0b010_011: //(A3) 16015: if (XEiJ.EFA_SEPARATE_AR) { 16016: XEiJ.mpuCycleCount += 8; 16017: return XEiJ.regRn[11]; 16018: } 16019: //fallthrough 16020: case 0b010_100: //(A4) 16021: if (XEiJ.EFA_SEPARATE_AR) { 16022: XEiJ.mpuCycleCount += 8; 16023: return XEiJ.regRn[12]; 16024: } 16025: //fallthrough 16026: case 0b010_101: //(A5) 16027: if (XEiJ.EFA_SEPARATE_AR) { 16028: XEiJ.mpuCycleCount += 8; 16029: return XEiJ.regRn[13]; 16030: } 16031: //fallthrough 16032: case 0b010_110: //(A6) 16033: if (XEiJ.EFA_SEPARATE_AR) { 16034: XEiJ.mpuCycleCount += 8; 16035: return XEiJ.regRn[14]; 16036: } 16037: //fallthrough 16038: case 0b010_111: //(A7) 16039: if (XEiJ.EFA_SEPARATE_AR) { 16040: XEiJ.mpuCycleCount += 8; 16041: return XEiJ.regRn[15]; 16042: } else { 16043: XEiJ.mpuCycleCount += 8; 16044: return XEiJ.regRn[ea - (0b010_000 - 8)]; 16045: } 16046: case 0b011_000: //(A0)+ 16047: if (XEiJ.EFA_SEPARATE_AR) { 16048: XEiJ.mpuCycleCount += 8; 16049: return (XEiJ.regRn[ 8] += 4) - 4; 16050: } 16051: //fallthrough 16052: case 0b011_001: //(A1)+ 16053: if (XEiJ.EFA_SEPARATE_AR) { 16054: XEiJ.mpuCycleCount += 8; 16055: return (XEiJ.regRn[ 9] += 4) - 4; 16056: } 16057: //fallthrough 16058: case 0b011_010: //(A2)+ 16059: if (XEiJ.EFA_SEPARATE_AR) { 16060: XEiJ.mpuCycleCount += 8; 16061: return (XEiJ.regRn[10] += 4) - 4; 16062: } 16063: //fallthrough 16064: case 0b011_011: //(A3)+ 16065: if (XEiJ.EFA_SEPARATE_AR) { 16066: XEiJ.mpuCycleCount += 8; 16067: return (XEiJ.regRn[11] += 4) - 4; 16068: } 16069: //fallthrough 16070: case 0b011_100: //(A4)+ 16071: if (XEiJ.EFA_SEPARATE_AR) { 16072: XEiJ.mpuCycleCount += 8; 16073: return (XEiJ.regRn[12] += 4) - 4; 16074: } 16075: //fallthrough 16076: case 0b011_101: //(A5)+ 16077: if (XEiJ.EFA_SEPARATE_AR) { 16078: XEiJ.mpuCycleCount += 8; 16079: return (XEiJ.regRn[13] += 4) - 4; 16080: } 16081: //fallthrough 16082: case 0b011_110: //(A6)+ 16083: if (XEiJ.EFA_SEPARATE_AR) { 16084: XEiJ.mpuCycleCount += 8; 16085: return (XEiJ.regRn[14] += 4) - 4; 16086: } 16087: //fallthrough 16088: case 0b011_111: //(A7)+ 16089: if (XEiJ.EFA_SEPARATE_AR) { 16090: XEiJ.mpuCycleCount += 8; 16091: return (XEiJ.regRn[15] += 4) - 4; 16092: } else { 16093: XEiJ.mpuCycleCount += 8; 16094: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 4) - 4; 16095: } 16096: case 0b100_000: //-(A0) 16097: if (XEiJ.EFA_SEPARATE_AR) { 16098: XEiJ.mpuCycleCount += 10; 16099: return XEiJ.regRn[ 8] -= 4; 16100: } 16101: //fallthrough 16102: case 0b100_001: //-(A1) 16103: if (XEiJ.EFA_SEPARATE_AR) { 16104: XEiJ.mpuCycleCount += 10; 16105: return XEiJ.regRn[ 9] -= 4; 16106: } 16107: //fallthrough 16108: case 0b100_010: //-(A2) 16109: if (XEiJ.EFA_SEPARATE_AR) { 16110: XEiJ.mpuCycleCount += 10; 16111: return XEiJ.regRn[10] -= 4; 16112: } 16113: //fallthrough 16114: case 0b100_011: //-(A3) 16115: if (XEiJ.EFA_SEPARATE_AR) { 16116: XEiJ.mpuCycleCount += 10; 16117: return XEiJ.regRn[11] -= 4; 16118: } 16119: //fallthrough 16120: case 0b100_100: //-(A4) 16121: if (XEiJ.EFA_SEPARATE_AR) { 16122: XEiJ.mpuCycleCount += 10; 16123: return XEiJ.regRn[12] -= 4; 16124: } 16125: //fallthrough 16126: case 0b100_101: //-(A5) 16127: if (XEiJ.EFA_SEPARATE_AR) { 16128: XEiJ.mpuCycleCount += 10; 16129: return XEiJ.regRn[13] -= 4; 16130: } 16131: //fallthrough 16132: case 0b100_110: //-(A6) 16133: if (XEiJ.EFA_SEPARATE_AR) { 16134: XEiJ.mpuCycleCount += 10; 16135: return XEiJ.regRn[14] -= 4; 16136: } 16137: //fallthrough 16138: case 0b100_111: //-(A7) 16139: if (XEiJ.EFA_SEPARATE_AR) { 16140: XEiJ.mpuCycleCount += 10; 16141: return XEiJ.regRn[15] -= 4; 16142: } else { 16143: XEiJ.mpuCycleCount += 10; 16144: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 4; 16145: } 16146: case 0b101_000: //(d16,A0) 16147: case 0b101_001: //(d16,A1) 16148: case 0b101_010: //(d16,A2) 16149: case 0b101_011: //(d16,A3) 16150: case 0b101_100: //(d16,A4) 16151: case 0b101_101: //(d16,A5) 16152: case 0b101_110: //(d16,A6) 16153: case 0b101_111: //(d16,A7) 16154: XEiJ.mpuCycleCount += 12; 16155: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16156: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16157: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 16158: } else { 16159: t = XEiJ.regPC; 16160: XEiJ.regPC = t + 2; 16161: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16162: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 16163: } 16164: case 0b110_000: //(d8,A0,Rn.wl) 16165: case 0b110_001: //(d8,A1,Rn.wl) 16166: case 0b110_010: //(d8,A2,Rn.wl) 16167: case 0b110_011: //(d8,A3,Rn.wl) 16168: case 0b110_100: //(d8,A4,Rn.wl) 16169: case 0b110_101: //(d8,A5,Rn.wl) 16170: case 0b110_110: //(d8,A6,Rn.wl) 16171: case 0b110_111: //(d8,A7,Rn.wl) 16172: XEiJ.mpuCycleCount += 14; 16173: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16174: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 16175: } else { 16176: w = XEiJ.regPC; 16177: XEiJ.regPC = w + 2; 16178: w = XEiJ.busRwze (w); //pcwz。拡張ワード 16179: } 16180: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 16181: + (byte) w //バイトディスプレースメント 16182: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 16183: XEiJ.regRn[w >> 12])); //ロングインデックス 16184: case 0b111_000: //(xxx).W 16185: XEiJ.mpuCycleCount += 12; 16186: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 16187: case 0b111_001: //(xxx).L 16188: XEiJ.mpuCycleCount += 16; 16189: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 16190: } //switch 16191: XEiJ.mpuCycleCount += 34; 16192: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 16193: throw M68kException.m6eSignal; 16194: } //efaMltLong 16195: 16196: //a = efaCntLong (ea) //| M WXZP | 16197: // 制御モードのロングオペランドの実効アドレスを求める 16198: // efaMemLongとの違いは(Ar)+と-(Ar)がないこと 16199: @SuppressWarnings ("fallthrough") public static int efaCntLong (int ea) throws M68kException { 16200: int t, w; 16201: switch (ea) { 16202: case 0b010_000: //(A0) 16203: if (XEiJ.EFA_SEPARATE_AR) { 16204: XEiJ.mpuCycleCount += 8; 16205: return XEiJ.regRn[ 8]; 16206: } 16207: //fallthrough 16208: case 0b010_001: //(A1) 16209: if (XEiJ.EFA_SEPARATE_AR) { 16210: XEiJ.mpuCycleCount += 8; 16211: return XEiJ.regRn[ 9]; 16212: } 16213: //fallthrough 16214: case 0b010_010: //(A2) 16215: if (XEiJ.EFA_SEPARATE_AR) { 16216: XEiJ.mpuCycleCount += 8; 16217: return XEiJ.regRn[10]; 16218: } 16219: //fallthrough 16220: case 0b010_011: //(A3) 16221: if (XEiJ.EFA_SEPARATE_AR) { 16222: XEiJ.mpuCycleCount += 8; 16223: return XEiJ.regRn[11]; 16224: } 16225: //fallthrough 16226: case 0b010_100: //(A4) 16227: if (XEiJ.EFA_SEPARATE_AR) { 16228: XEiJ.mpuCycleCount += 8; 16229: return XEiJ.regRn[12]; 16230: } 16231: //fallthrough 16232: case 0b010_101: //(A5) 16233: if (XEiJ.EFA_SEPARATE_AR) { 16234: XEiJ.mpuCycleCount += 8; 16235: return XEiJ.regRn[13]; 16236: } 16237: //fallthrough 16238: case 0b010_110: //(A6) 16239: if (XEiJ.EFA_SEPARATE_AR) { 16240: XEiJ.mpuCycleCount += 8; 16241: return XEiJ.regRn[14]; 16242: } 16243: //fallthrough 16244: case 0b010_111: //(A7) 16245: if (XEiJ.EFA_SEPARATE_AR) { 16246: XEiJ.mpuCycleCount += 8; 16247: return XEiJ.regRn[15]; 16248: } else { 16249: XEiJ.mpuCycleCount += 8; 16250: return XEiJ.regRn[ea - (0b010_000 - 8)]; 16251: } 16252: case 0b101_000: //(d16,A0) 16253: case 0b101_001: //(d16,A1) 16254: case 0b101_010: //(d16,A2) 16255: case 0b101_011: //(d16,A3) 16256: case 0b101_100: //(d16,A4) 16257: case 0b101_101: //(d16,A5) 16258: case 0b101_110: //(d16,A6) 16259: case 0b101_111: //(d16,A7) 16260: XEiJ.mpuCycleCount += 12; 16261: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16262: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16263: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 16264: } else { 16265: t = XEiJ.regPC; 16266: XEiJ.regPC = t + 2; 16267: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16268: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 16269: } 16270: case 0b110_000: //(d8,A0,Rn.wl) 16271: case 0b110_001: //(d8,A1,Rn.wl) 16272: case 0b110_010: //(d8,A2,Rn.wl) 16273: case 0b110_011: //(d8,A3,Rn.wl) 16274: case 0b110_100: //(d8,A4,Rn.wl) 16275: case 0b110_101: //(d8,A5,Rn.wl) 16276: case 0b110_110: //(d8,A6,Rn.wl) 16277: case 0b110_111: //(d8,A7,Rn.wl) 16278: XEiJ.mpuCycleCount += 14; 16279: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16280: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 16281: } else { 16282: w = XEiJ.regPC; 16283: XEiJ.regPC = w + 2; 16284: w = XEiJ.busRwze (w); //pcwz。拡張ワード 16285: } 16286: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 16287: + (byte) w //バイトディスプレースメント 16288: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 16289: XEiJ.regRn[w >> 12])); //ロングインデックス 16290: case 0b111_000: //(xxx).W 16291: XEiJ.mpuCycleCount += 12; 16292: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 16293: case 0b111_001: //(xxx).L 16294: XEiJ.mpuCycleCount += 16; 16295: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 16296: case 0b111_010: //(d16,PC) 16297: XEiJ.mpuCycleCount += 12; 16298: t = XEiJ.regPC; 16299: XEiJ.regPC = t + 2; 16300: return (t //ベースレジスタ 16301: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 16302: case 0b111_011: //(d8,PC,Rn.wl) 16303: XEiJ.mpuCycleCount += 14; 16304: t = XEiJ.regPC; 16305: XEiJ.regPC = t + 2; 16306: w = XEiJ.busRwze (t); //pcwz。拡張ワード 16307: return (t //ベースレジスタ 16308: + (byte) w //バイトディスプレースメント 16309: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 16310: XEiJ.regRn[w >> 12])); //ロングインデックス 16311: } //switch 16312: XEiJ.mpuCycleCount += 34; 16313: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 16314: throw M68kException.m6eSignal; 16315: } //efaCntLong 16316: 16317: //a = efaCltLong (ea) //| M WXZ | 16318: // 制御可変モードのワードオペランドの実効アドレスを求める 16319: // efaCntLongとの違いは(d16,PC)と(d8,PC,Rn.wl)がないこと 16320: @SuppressWarnings ("fallthrough") public static int efaCltLong (int ea) throws M68kException { 16321: int t, w; 16322: switch (ea) { 16323: case 0b010_000: //(A0) 16324: if (XEiJ.EFA_SEPARATE_AR) { 16325: XEiJ.mpuCycleCount += 8; 16326: return XEiJ.regRn[ 8]; 16327: } 16328: //fallthrough 16329: case 0b010_001: //(A1) 16330: if (XEiJ.EFA_SEPARATE_AR) { 16331: XEiJ.mpuCycleCount += 8; 16332: return XEiJ.regRn[ 9]; 16333: } 16334: //fallthrough 16335: case 0b010_010: //(A2) 16336: if (XEiJ.EFA_SEPARATE_AR) { 16337: XEiJ.mpuCycleCount += 8; 16338: return XEiJ.regRn[10]; 16339: } 16340: //fallthrough 16341: case 0b010_011: //(A3) 16342: if (XEiJ.EFA_SEPARATE_AR) { 16343: XEiJ.mpuCycleCount += 8; 16344: return XEiJ.regRn[11]; 16345: } 16346: //fallthrough 16347: case 0b010_100: //(A4) 16348: if (XEiJ.EFA_SEPARATE_AR) { 16349: XEiJ.mpuCycleCount += 8; 16350: return XEiJ.regRn[12]; 16351: } 16352: //fallthrough 16353: case 0b010_101: //(A5) 16354: if (XEiJ.EFA_SEPARATE_AR) { 16355: XEiJ.mpuCycleCount += 8; 16356: return XEiJ.regRn[13]; 16357: } 16358: //fallthrough 16359: case 0b010_110: //(A6) 16360: if (XEiJ.EFA_SEPARATE_AR) { 16361: XEiJ.mpuCycleCount += 8; 16362: return XEiJ.regRn[14]; 16363: } 16364: //fallthrough 16365: case 0b010_111: //(A7) 16366: if (XEiJ.EFA_SEPARATE_AR) { 16367: XEiJ.mpuCycleCount += 8; 16368: return XEiJ.regRn[15]; 16369: } else { 16370: XEiJ.mpuCycleCount += 8; 16371: return XEiJ.regRn[ea - (0b010_000 - 8)]; 16372: } 16373: case 0b101_000: //(d16,A0) 16374: case 0b101_001: //(d16,A1) 16375: case 0b101_010: //(d16,A2) 16376: case 0b101_011: //(d16,A3) 16377: case 0b101_100: //(d16,A4) 16378: case 0b101_101: //(d16,A5) 16379: case 0b101_110: //(d16,A6) 16380: case 0b101_111: //(d16,A7) 16381: XEiJ.mpuCycleCount += 12; 16382: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16383: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16384: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 16385: } else { 16386: t = XEiJ.regPC; 16387: XEiJ.regPC = t + 2; 16388: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16389: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 16390: } 16391: case 0b110_000: //(d8,A0,Rn.wl) 16392: case 0b110_001: //(d8,A1,Rn.wl) 16393: case 0b110_010: //(d8,A2,Rn.wl) 16394: case 0b110_011: //(d8,A3,Rn.wl) 16395: case 0b110_100: //(d8,A4,Rn.wl) 16396: case 0b110_101: //(d8,A5,Rn.wl) 16397: case 0b110_110: //(d8,A6,Rn.wl) 16398: case 0b110_111: //(d8,A7,Rn.wl) 16399: XEiJ.mpuCycleCount += 14; 16400: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16401: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 16402: } else { 16403: w = XEiJ.regPC; 16404: XEiJ.regPC = w + 2; 16405: w = XEiJ.busRwze (w); //pcwz。拡張ワード 16406: } 16407: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 16408: + (byte) w //バイトディスプレースメント 16409: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 16410: XEiJ.regRn[w >> 12])); //ロングインデックス 16411: case 0b111_000: //(xxx).W 16412: XEiJ.mpuCycleCount += 12; 16413: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 16414: case 0b111_001: //(xxx).L 16415: XEiJ.mpuCycleCount += 16; 16416: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 16417: } //switch 16418: XEiJ.mpuCycleCount += 34; 16419: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 16420: throw M68kException.m6eSignal; 16421: } //efaCltLong 16422: 16423: //a = efaAnyQuad (ea) //| M+-WXZPI| 16424: // 任意のモードのクワッドオペランドの実効アドレスを求める 16425: // efaAnyLongとの違いは(Ar)+と-(Ar)がArを8変化させることと、#<data>がPCを8変化させることと、 16426: // オペランドのアクセスが2ワード増える分の8サイクルが追加されていること 16427: @SuppressWarnings ("fallthrough") public static int efaAnyQuad (int ea) throws M68kException { 16428: int t, w; 16429: switch (ea) { 16430: case 0b010_000: //(A0) 16431: if (XEiJ.EFA_SEPARATE_AR) { 16432: XEiJ.mpuCycleCount += 16; 16433: return XEiJ.regRn[ 8]; 16434: } 16435: //fallthrough 16436: case 0b010_001: //(A1) 16437: if (XEiJ.EFA_SEPARATE_AR) { 16438: XEiJ.mpuCycleCount += 16; 16439: return XEiJ.regRn[ 9]; 16440: } 16441: //fallthrough 16442: case 0b010_010: //(A2) 16443: if (XEiJ.EFA_SEPARATE_AR) { 16444: XEiJ.mpuCycleCount += 16; 16445: return XEiJ.regRn[10]; 16446: } 16447: //fallthrough 16448: case 0b010_011: //(A3) 16449: if (XEiJ.EFA_SEPARATE_AR) { 16450: XEiJ.mpuCycleCount += 16; 16451: return XEiJ.regRn[11]; 16452: } 16453: //fallthrough 16454: case 0b010_100: //(A4) 16455: if (XEiJ.EFA_SEPARATE_AR) { 16456: XEiJ.mpuCycleCount += 16; 16457: return XEiJ.regRn[12]; 16458: } 16459: //fallthrough 16460: case 0b010_101: //(A5) 16461: if (XEiJ.EFA_SEPARATE_AR) { 16462: XEiJ.mpuCycleCount += 16; 16463: return XEiJ.regRn[13]; 16464: } 16465: //fallthrough 16466: case 0b010_110: //(A6) 16467: if (XEiJ.EFA_SEPARATE_AR) { 16468: XEiJ.mpuCycleCount += 16; 16469: return XEiJ.regRn[14]; 16470: } 16471: //fallthrough 16472: case 0b010_111: //(A7) 16473: if (XEiJ.EFA_SEPARATE_AR) { 16474: XEiJ.mpuCycleCount += 16; 16475: return XEiJ.regRn[15]; 16476: } else { 16477: XEiJ.mpuCycleCount += 16; 16478: return XEiJ.regRn[ea - (0b010_000 - 8)]; 16479: } 16480: case 0b011_000: //(A0)+ 16481: if (XEiJ.EFA_SEPARATE_AR) { 16482: XEiJ.mpuCycleCount += 16; 16483: return (XEiJ.regRn[ 8] += 8) - 8; 16484: } 16485: //fallthrough 16486: case 0b011_001: //(A1)+ 16487: if (XEiJ.EFA_SEPARATE_AR) { 16488: XEiJ.mpuCycleCount += 16; 16489: return (XEiJ.regRn[ 9] += 8) - 8; 16490: } 16491: //fallthrough 16492: case 0b011_010: //(A2)+ 16493: if (XEiJ.EFA_SEPARATE_AR) { 16494: XEiJ.mpuCycleCount += 16; 16495: return (XEiJ.regRn[10] += 8) - 8; 16496: } 16497: //fallthrough 16498: case 0b011_011: //(A3)+ 16499: if (XEiJ.EFA_SEPARATE_AR) { 16500: XEiJ.mpuCycleCount += 16; 16501: return (XEiJ.regRn[11] += 8) - 8; 16502: } 16503: //fallthrough 16504: case 0b011_100: //(A4)+ 16505: if (XEiJ.EFA_SEPARATE_AR) { 16506: XEiJ.mpuCycleCount += 16; 16507: return (XEiJ.regRn[12] += 8) - 8; 16508: } 16509: //fallthrough 16510: case 0b011_101: //(A5)+ 16511: if (XEiJ.EFA_SEPARATE_AR) { 16512: XEiJ.mpuCycleCount += 16; 16513: return (XEiJ.regRn[13] += 8) - 8; 16514: } 16515: //fallthrough 16516: case 0b011_110: //(A6)+ 16517: if (XEiJ.EFA_SEPARATE_AR) { 16518: XEiJ.mpuCycleCount += 16; 16519: return (XEiJ.regRn[14] += 8) - 8; 16520: } 16521: //fallthrough 16522: case 0b011_111: //(A7)+ 16523: if (XEiJ.EFA_SEPARATE_AR) { 16524: XEiJ.mpuCycleCount += 16; 16525: return (XEiJ.regRn[15] += 8) - 8; 16526: } else { 16527: XEiJ.mpuCycleCount += 16; 16528: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 8) - 8; 16529: } 16530: case 0b100_000: //-(A0) 16531: if (XEiJ.EFA_SEPARATE_AR) { 16532: XEiJ.mpuCycleCount += 18; 16533: return XEiJ.regRn[ 8] -= 8; 16534: } 16535: //fallthrough 16536: case 0b100_001: //-(A1) 16537: if (XEiJ.EFA_SEPARATE_AR) { 16538: XEiJ.mpuCycleCount += 18; 16539: return XEiJ.regRn[ 9] -= 8; 16540: } 16541: //fallthrough 16542: case 0b100_010: //-(A2) 16543: if (XEiJ.EFA_SEPARATE_AR) { 16544: XEiJ.mpuCycleCount += 18; 16545: return XEiJ.regRn[10] -= 8; 16546: } 16547: //fallthrough 16548: case 0b100_011: //-(A3) 16549: if (XEiJ.EFA_SEPARATE_AR) { 16550: XEiJ.mpuCycleCount += 18; 16551: return XEiJ.regRn[11] -= 8; 16552: } 16553: //fallthrough 16554: case 0b100_100: //-(A4) 16555: if (XEiJ.EFA_SEPARATE_AR) { 16556: XEiJ.mpuCycleCount += 18; 16557: return XEiJ.regRn[12] -= 8; 16558: } 16559: //fallthrough 16560: case 0b100_101: //-(A5) 16561: if (XEiJ.EFA_SEPARATE_AR) { 16562: XEiJ.mpuCycleCount += 18; 16563: return XEiJ.regRn[13] -= 8; 16564: } 16565: //fallthrough 16566: case 0b100_110: //-(A6) 16567: if (XEiJ.EFA_SEPARATE_AR) { 16568: XEiJ.mpuCycleCount += 18; 16569: return XEiJ.regRn[14] -= 8; 16570: } 16571: //fallthrough 16572: case 0b100_111: //-(A7) 16573: if (XEiJ.EFA_SEPARATE_AR) { 16574: XEiJ.mpuCycleCount += 18; 16575: return XEiJ.regRn[15] -= 8; 16576: } else { 16577: XEiJ.mpuCycleCount += 18; 16578: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 8; 16579: } 16580: case 0b101_000: //(d16,A0) 16581: case 0b101_001: //(d16,A1) 16582: case 0b101_010: //(d16,A2) 16583: case 0b101_011: //(d16,A3) 16584: case 0b101_100: //(d16,A4) 16585: case 0b101_101: //(d16,A5) 16586: case 0b101_110: //(d16,A6) 16587: case 0b101_111: //(d16,A7) 16588: XEiJ.mpuCycleCount += 20; 16589: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16590: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16591: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 16592: } else { 16593: t = XEiJ.regPC; 16594: XEiJ.regPC = t + 2; 16595: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16596: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 16597: } 16598: case 0b110_000: //(d8,A0,Rn.wl) 16599: case 0b110_001: //(d8,A1,Rn.wl) 16600: case 0b110_010: //(d8,A2,Rn.wl) 16601: case 0b110_011: //(d8,A3,Rn.wl) 16602: case 0b110_100: //(d8,A4,Rn.wl) 16603: case 0b110_101: //(d8,A5,Rn.wl) 16604: case 0b110_110: //(d8,A6,Rn.wl) 16605: case 0b110_111: //(d8,A7,Rn.wl) 16606: XEiJ.mpuCycleCount += 22; 16607: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16608: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 16609: } else { 16610: w = XEiJ.regPC; 16611: XEiJ.regPC = w + 2; 16612: w = XEiJ.busRwze (w); //pcwz。拡張ワード 16613: } 16614: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 16615: + (byte) w //バイトディスプレースメント 16616: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 16617: XEiJ.regRn[w >> 12])); //ロングインデックス 16618: case 0b111_000: //(xxx).W 16619: XEiJ.mpuCycleCount += 20; 16620: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 16621: case 0b111_001: //(xxx).L 16622: XEiJ.mpuCycleCount += 24; 16623: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 16624: case 0b111_010: //(d16,PC) 16625: XEiJ.mpuCycleCount += 20; 16626: t = XEiJ.regPC; 16627: XEiJ.regPC = t + 2; 16628: return (t //ベースレジスタ 16629: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 16630: case 0b111_011: //(d8,PC,Rn.wl) 16631: XEiJ.mpuCycleCount += 22; 16632: t = XEiJ.regPC; 16633: XEiJ.regPC = t + 2; 16634: w = XEiJ.busRwze (t); //pcwz。拡張ワード 16635: return (t //ベースレジスタ 16636: + (byte) w //バイトディスプレースメント 16637: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 16638: XEiJ.regRn[w >> 12])); //ロングインデックス 16639: case 0b111_100: //#<data> 16640: XEiJ.mpuCycleCount += 16; 16641: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16642: return (XEiJ.regPC += 8) - 8; 16643: } else { 16644: t = XEiJ.regPC; 16645: XEiJ.regPC = t + 8; 16646: return t; 16647: } 16648: } //switch 16649: XEiJ.mpuCycleCount += 34; 16650: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 16651: throw M68kException.m6eSignal; 16652: } //efaAnyQuad 16653: 16654: //a = efaMltQuad (ea) //| M+-WXZ | 16655: // メモリ可変モードのクワッドオペランドの実効アドレスを求める 16656: // efaMltLongとの違いは(Ar)+と-(Ar)がArを8変化させることと、#<data>がPCを8変化させることと、 16657: // オペランドのアクセスが2ワード増える分の8サイクルが追加されていること 16658: @SuppressWarnings ("fallthrough") public static int efaMltQuad (int ea) throws M68kException { 16659: int t, w; 16660: switch (ea) { 16661: case 0b010_000: //(A0) 16662: if (XEiJ.EFA_SEPARATE_AR) { 16663: XEiJ.mpuCycleCount += 16; 16664: return XEiJ.regRn[ 8]; 16665: } 16666: //fallthrough 16667: case 0b010_001: //(A1) 16668: if (XEiJ.EFA_SEPARATE_AR) { 16669: XEiJ.mpuCycleCount += 16; 16670: return XEiJ.regRn[ 9]; 16671: } 16672: //fallthrough 16673: case 0b010_010: //(A2) 16674: if (XEiJ.EFA_SEPARATE_AR) { 16675: XEiJ.mpuCycleCount += 16; 16676: return XEiJ.regRn[10]; 16677: } 16678: //fallthrough 16679: case 0b010_011: //(A3) 16680: if (XEiJ.EFA_SEPARATE_AR) { 16681: XEiJ.mpuCycleCount += 16; 16682: return XEiJ.regRn[11]; 16683: } 16684: //fallthrough 16685: case 0b010_100: //(A4) 16686: if (XEiJ.EFA_SEPARATE_AR) { 16687: XEiJ.mpuCycleCount += 16; 16688: return XEiJ.regRn[12]; 16689: } 16690: //fallthrough 16691: case 0b010_101: //(A5) 16692: if (XEiJ.EFA_SEPARATE_AR) { 16693: XEiJ.mpuCycleCount += 16; 16694: return XEiJ.regRn[13]; 16695: } 16696: //fallthrough 16697: case 0b010_110: //(A6) 16698: if (XEiJ.EFA_SEPARATE_AR) { 16699: XEiJ.mpuCycleCount += 16; 16700: return XEiJ.regRn[14]; 16701: } 16702: //fallthrough 16703: case 0b010_111: //(A7) 16704: if (XEiJ.EFA_SEPARATE_AR) { 16705: XEiJ.mpuCycleCount += 16; 16706: return XEiJ.regRn[15]; 16707: } else { 16708: XEiJ.mpuCycleCount += 16; 16709: return XEiJ.regRn[ea - (0b010_000 - 8)]; 16710: } 16711: case 0b011_000: //(A0)+ 16712: if (XEiJ.EFA_SEPARATE_AR) { 16713: XEiJ.mpuCycleCount += 16; 16714: return (XEiJ.regRn[ 8] += 8) - 8; 16715: } 16716: //fallthrough 16717: case 0b011_001: //(A1)+ 16718: if (XEiJ.EFA_SEPARATE_AR) { 16719: XEiJ.mpuCycleCount += 16; 16720: return (XEiJ.regRn[ 9] += 8) - 8; 16721: } 16722: //fallthrough 16723: case 0b011_010: //(A2)+ 16724: if (XEiJ.EFA_SEPARATE_AR) { 16725: XEiJ.mpuCycleCount += 16; 16726: return (XEiJ.regRn[10] += 8) - 8; 16727: } 16728: //fallthrough 16729: case 0b011_011: //(A3)+ 16730: if (XEiJ.EFA_SEPARATE_AR) { 16731: XEiJ.mpuCycleCount += 16; 16732: return (XEiJ.regRn[11] += 8) - 8; 16733: } 16734: //fallthrough 16735: case 0b011_100: //(A4)+ 16736: if (XEiJ.EFA_SEPARATE_AR) { 16737: XEiJ.mpuCycleCount += 16; 16738: return (XEiJ.regRn[12] += 8) - 8; 16739: } 16740: //fallthrough 16741: case 0b011_101: //(A5)+ 16742: if (XEiJ.EFA_SEPARATE_AR) { 16743: XEiJ.mpuCycleCount += 16; 16744: return (XEiJ.regRn[13] += 8) - 8; 16745: } 16746: //fallthrough 16747: case 0b011_110: //(A6)+ 16748: if (XEiJ.EFA_SEPARATE_AR) { 16749: XEiJ.mpuCycleCount += 16; 16750: return (XEiJ.regRn[14] += 8) - 8; 16751: } 16752: //fallthrough 16753: case 0b011_111: //(A7)+ 16754: if (XEiJ.EFA_SEPARATE_AR) { 16755: XEiJ.mpuCycleCount += 16; 16756: return (XEiJ.regRn[15] += 8) - 8; 16757: } else { 16758: XEiJ.mpuCycleCount += 16; 16759: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 8) - 8; 16760: } 16761: case 0b100_000: //-(A0) 16762: if (XEiJ.EFA_SEPARATE_AR) { 16763: XEiJ.mpuCycleCount += 18; 16764: return XEiJ.regRn[ 8] -= 8; 16765: } 16766: //fallthrough 16767: case 0b100_001: //-(A1) 16768: if (XEiJ.EFA_SEPARATE_AR) { 16769: XEiJ.mpuCycleCount += 18; 16770: return XEiJ.regRn[ 9] -= 8; 16771: } 16772: //fallthrough 16773: case 0b100_010: //-(A2) 16774: if (XEiJ.EFA_SEPARATE_AR) { 16775: XEiJ.mpuCycleCount += 18; 16776: return XEiJ.regRn[10] -= 8; 16777: } 16778: //fallthrough 16779: case 0b100_011: //-(A3) 16780: if (XEiJ.EFA_SEPARATE_AR) { 16781: XEiJ.mpuCycleCount += 18; 16782: return XEiJ.regRn[11] -= 8; 16783: } 16784: //fallthrough 16785: case 0b100_100: //-(A4) 16786: if (XEiJ.EFA_SEPARATE_AR) { 16787: XEiJ.mpuCycleCount += 18; 16788: return XEiJ.regRn[12] -= 8; 16789: } 16790: //fallthrough 16791: case 0b100_101: //-(A5) 16792: if (XEiJ.EFA_SEPARATE_AR) { 16793: XEiJ.mpuCycleCount += 18; 16794: return XEiJ.regRn[13] -= 8; 16795: } 16796: //fallthrough 16797: case 0b100_110: //-(A6) 16798: if (XEiJ.EFA_SEPARATE_AR) { 16799: XEiJ.mpuCycleCount += 18; 16800: return XEiJ.regRn[14] -= 8; 16801: } 16802: //fallthrough 16803: case 0b100_111: //-(A7) 16804: if (XEiJ.EFA_SEPARATE_AR) { 16805: XEiJ.mpuCycleCount += 18; 16806: return XEiJ.regRn[15] -= 8; 16807: } else { 16808: XEiJ.mpuCycleCount += 18; 16809: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 8; 16810: } 16811: case 0b101_000: //(d16,A0) 16812: case 0b101_001: //(d16,A1) 16813: case 0b101_010: //(d16,A2) 16814: case 0b101_011: //(d16,A3) 16815: case 0b101_100: //(d16,A4) 16816: case 0b101_101: //(d16,A5) 16817: case 0b101_110: //(d16,A6) 16818: case 0b101_111: //(d16,A7) 16819: XEiJ.mpuCycleCount += 20; 16820: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16821: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16822: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 16823: } else { 16824: t = XEiJ.regPC; 16825: XEiJ.regPC = t + 2; 16826: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 16827: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 16828: } 16829: case 0b110_000: //(d8,A0,Rn.wl) 16830: case 0b110_001: //(d8,A1,Rn.wl) 16831: case 0b110_010: //(d8,A2,Rn.wl) 16832: case 0b110_011: //(d8,A3,Rn.wl) 16833: case 0b110_100: //(d8,A4,Rn.wl) 16834: case 0b110_101: //(d8,A5,Rn.wl) 16835: case 0b110_110: //(d8,A6,Rn.wl) 16836: case 0b110_111: //(d8,A7,Rn.wl) 16837: XEiJ.mpuCycleCount += 22; 16838: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 16839: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 16840: } else { 16841: w = XEiJ.regPC; 16842: XEiJ.regPC = w + 2; 16843: w = XEiJ.busRwze (w); //pcwz。拡張ワード 16844: } 16845: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 16846: + (byte) w //バイトディスプレースメント 16847: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 16848: XEiJ.regRn[w >> 12])); //ロングインデックス 16849: case 0b111_000: //(xxx).W 16850: XEiJ.mpuCycleCount += 20; 16851: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 16852: case 0b111_001: //(xxx).L 16853: XEiJ.mpuCycleCount += 24; 16854: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 16855: } //switch 16856: XEiJ.mpuCycleCount += 34; 16857: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 16858: throw M68kException.m6eSignal; 16859: } //efaMltQuad 16860: 16861: //a = efaAnyExtd (ea) //| M+-WXZPI| 16862: // 任意のモードのエクステンデッドオペランドの実効アドレスを求める 16863: // efaAnyQuadとの違いは(Ar)+と-(Ar)がArを12変化させることと、#<data>がPCを12変化させることと、 16864: // オペランドのアクセスが2ワード増える分の8サイクルが追加されていること 16865: @SuppressWarnings ("fallthrough") public static int efaAnyExtd (int ea) throws M68kException { 16866: int t, w; 16867: switch (ea) { 16868: case 0b010_000: //(A0) 16869: if (XEiJ.EFA_SEPARATE_AR) { 16870: XEiJ.mpuCycleCount += 24; 16871: return XEiJ.regRn[ 8]; 16872: } 16873: //fallthrough 16874: case 0b010_001: //(A1) 16875: if (XEiJ.EFA_SEPARATE_AR) { 16876: XEiJ.mpuCycleCount += 24; 16877: return XEiJ.regRn[ 9]; 16878: } 16879: //fallthrough 16880: case 0b010_010: //(A2) 16881: if (XEiJ.EFA_SEPARATE_AR) { 16882: XEiJ.mpuCycleCount += 24; 16883: return XEiJ.regRn[10]; 16884: } 16885: //fallthrough 16886: case 0b010_011: //(A3) 16887: if (XEiJ.EFA_SEPARATE_AR) { 16888: XEiJ.mpuCycleCount += 24; 16889: return XEiJ.regRn[11]; 16890: } 16891: //fallthrough 16892: case 0b010_100: //(A4) 16893: if (XEiJ.EFA_SEPARATE_AR) { 16894: XEiJ.mpuCycleCount += 24; 16895: return XEiJ.regRn[12]; 16896: } 16897: //fallthrough 16898: case 0b010_101: //(A5) 16899: if (XEiJ.EFA_SEPARATE_AR) { 16900: XEiJ.mpuCycleCount += 24; 16901: return XEiJ.regRn[13]; 16902: } 16903: //fallthrough 16904: case 0b010_110: //(A6) 16905: if (XEiJ.EFA_SEPARATE_AR) { 16906: XEiJ.mpuCycleCount += 24; 16907: return XEiJ.regRn[14]; 16908: } 16909: //fallthrough 16910: case 0b010_111: //(A7) 16911: if (XEiJ.EFA_SEPARATE_AR) { 16912: XEiJ.mpuCycleCount += 24; 16913: return XEiJ.regRn[15]; 16914: } else { 16915: XEiJ.mpuCycleCount += 24; 16916: return XEiJ.regRn[ea - (0b010_000 - 8)]; 16917: } 16918: case 0b011_000: //(A0)+ 16919: if (XEiJ.EFA_SEPARATE_AR) { 16920: XEiJ.mpuCycleCount += 24; 16921: return (XEiJ.regRn[ 8] += 12) - 12; 16922: } 16923: //fallthrough 16924: case 0b011_001: //(A1)+ 16925: if (XEiJ.EFA_SEPARATE_AR) { 16926: XEiJ.mpuCycleCount += 24; 16927: return (XEiJ.regRn[ 9] += 12) - 12; 16928: } 16929: //fallthrough 16930: case 0b011_010: //(A2)+ 16931: if (XEiJ.EFA_SEPARATE_AR) { 16932: XEiJ.mpuCycleCount += 24; 16933: return (XEiJ.regRn[10] += 12) - 12; 16934: } 16935: //fallthrough 16936: case 0b011_011: //(A3)+ 16937: if (XEiJ.EFA_SEPARATE_AR) { 16938: XEiJ.mpuCycleCount += 24; 16939: return (XEiJ.regRn[11] += 12) - 12; 16940: } 16941: //fallthrough 16942: case 0b011_100: //(A4)+ 16943: if (XEiJ.EFA_SEPARATE_AR) { 16944: XEiJ.mpuCycleCount += 24; 16945: return (XEiJ.regRn[12] += 12) - 12; 16946: } 16947: //fallthrough 16948: case 0b011_101: //(A5)+ 16949: if (XEiJ.EFA_SEPARATE_AR) { 16950: XEiJ.mpuCycleCount += 24; 16951: return (XEiJ.regRn[13] += 12) - 12; 16952: } 16953: //fallthrough 16954: case 0b011_110: //(A6)+ 16955: if (XEiJ.EFA_SEPARATE_AR) { 16956: XEiJ.mpuCycleCount += 24; 16957: return (XEiJ.regRn[14] += 12) - 12; 16958: } 16959: //fallthrough 16960: case 0b011_111: //(A7)+ 16961: if (XEiJ.EFA_SEPARATE_AR) { 16962: XEiJ.mpuCycleCount += 24; 16963: return (XEiJ.regRn[15] += 12) - 12; 16964: } else { 16965: XEiJ.mpuCycleCount += 24; 16966: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 12) - 12; 16967: } 16968: case 0b100_000: //-(A0) 16969: if (XEiJ.EFA_SEPARATE_AR) { 16970: XEiJ.mpuCycleCount += 26; 16971: return XEiJ.regRn[ 8] -= 12; 16972: } 16973: //fallthrough 16974: case 0b100_001: //-(A1) 16975: if (XEiJ.EFA_SEPARATE_AR) { 16976: XEiJ.mpuCycleCount += 26; 16977: return XEiJ.regRn[ 9] -= 12; 16978: } 16979: //fallthrough 16980: case 0b100_010: //-(A2) 16981: if (XEiJ.EFA_SEPARATE_AR) { 16982: XEiJ.mpuCycleCount += 26; 16983: return XEiJ.regRn[10] -= 12; 16984: } 16985: //fallthrough 16986: case 0b100_011: //-(A3) 16987: if (XEiJ.EFA_SEPARATE_AR) { 16988: XEiJ.mpuCycleCount += 26; 16989: return XEiJ.regRn[11] -= 12; 16990: } 16991: //fallthrough 16992: case 0b100_100: //-(A4) 16993: if (XEiJ.EFA_SEPARATE_AR) { 16994: XEiJ.mpuCycleCount += 26; 16995: return XEiJ.regRn[12] -= 12; 16996: } 16997: //fallthrough 16998: case 0b100_101: //-(A5) 16999: if (XEiJ.EFA_SEPARATE_AR) { 17000: XEiJ.mpuCycleCount += 26; 17001: return XEiJ.regRn[13] -= 12; 17002: } 17003: //fallthrough 17004: case 0b100_110: //-(A6) 17005: if (XEiJ.EFA_SEPARATE_AR) { 17006: XEiJ.mpuCycleCount += 26; 17007: return XEiJ.regRn[14] -= 12; 17008: } 17009: //fallthrough 17010: case 0b100_111: //-(A7) 17011: if (XEiJ.EFA_SEPARATE_AR) { 17012: XEiJ.mpuCycleCount += 26; 17013: return XEiJ.regRn[15] -= 12; 17014: } else { 17015: XEiJ.mpuCycleCount += 26; 17016: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 12; 17017: } 17018: case 0b101_000: //(d16,A0) 17019: case 0b101_001: //(d16,A1) 17020: case 0b101_010: //(d16,A2) 17021: case 0b101_011: //(d16,A3) 17022: case 0b101_100: //(d16,A4) 17023: case 0b101_101: //(d16,A5) 17024: case 0b101_110: //(d16,A6) 17025: case 0b101_111: //(d16,A7) 17026: XEiJ.mpuCycleCount += 28; 17027: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17028: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17029: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 17030: } else { 17031: t = XEiJ.regPC; 17032: XEiJ.regPC = t + 2; 17033: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17034: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 17035: } 17036: case 0b110_000: //(d8,A0,Rn.wl) 17037: case 0b110_001: //(d8,A1,Rn.wl) 17038: case 0b110_010: //(d8,A2,Rn.wl) 17039: case 0b110_011: //(d8,A3,Rn.wl) 17040: case 0b110_100: //(d8,A4,Rn.wl) 17041: case 0b110_101: //(d8,A5,Rn.wl) 17042: case 0b110_110: //(d8,A6,Rn.wl) 17043: case 0b110_111: //(d8,A7,Rn.wl) 17044: XEiJ.mpuCycleCount += 30; 17045: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17046: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 17047: } else { 17048: w = XEiJ.regPC; 17049: XEiJ.regPC = w + 2; 17050: w = XEiJ.busRwze (w); //pcwz。拡張ワード 17051: } 17052: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 17053: + (byte) w //バイトディスプレースメント 17054: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 17055: XEiJ.regRn[w >> 12])); //ロングインデックス 17056: case 0b111_000: //(xxx).W 17057: XEiJ.mpuCycleCount += 28; 17058: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 17059: case 0b111_001: //(xxx).L 17060: XEiJ.mpuCycleCount += 32; 17061: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 17062: case 0b111_010: //(d16,PC) 17063: XEiJ.mpuCycleCount += 28; 17064: t = XEiJ.regPC; 17065: XEiJ.regPC = t + 2; 17066: return (t //ベースレジスタ 17067: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 17068: case 0b111_011: //(d8,PC,Rn.wl) 17069: XEiJ.mpuCycleCount += 30; 17070: t = XEiJ.regPC; 17071: XEiJ.regPC = t + 2; 17072: w = XEiJ.busRwze (t); //pcwz。拡張ワード 17073: return (t //ベースレジスタ 17074: + (byte) w //バイトディスプレースメント 17075: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 17076: XEiJ.regRn[w >> 12])); //ロングインデックス 17077: case 0b111_100: //#<data> 17078: XEiJ.mpuCycleCount += 24; 17079: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17080: return (XEiJ.regPC += 12) - 12; 17081: } else { 17082: t = XEiJ.regPC; 17083: XEiJ.regPC = t + 12; 17084: return t; 17085: } 17086: } //switch 17087: XEiJ.mpuCycleCount += 34; 17088: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 17089: throw M68kException.m6eSignal; 17090: } //efaAnyExtd 17091: 17092: //a = efaMltExtd (ea) //| M+-WXZ | 17093: // メモリ可変モードのエクステンデッドオペランドの実効アドレスを求める 17094: // efaMltQuadとの違いは(Ar)+と-(Ar)がArを12変化させることと、#<data>がPCを12変化させることと、 17095: // オペランドのアクセスが2ワード増える分の8サイクルが追加されていること 17096: @SuppressWarnings ("fallthrough") public static int efaMltExtd (int ea) throws M68kException { 17097: int t, w; 17098: switch (ea) { 17099: case 0b010_000: //(A0) 17100: if (XEiJ.EFA_SEPARATE_AR) { 17101: XEiJ.mpuCycleCount += 24; 17102: return XEiJ.regRn[ 8]; 17103: } 17104: //fallthrough 17105: case 0b010_001: //(A1) 17106: if (XEiJ.EFA_SEPARATE_AR) { 17107: XEiJ.mpuCycleCount += 24; 17108: return XEiJ.regRn[ 9]; 17109: } 17110: //fallthrough 17111: case 0b010_010: //(A2) 17112: if (XEiJ.EFA_SEPARATE_AR) { 17113: XEiJ.mpuCycleCount += 24; 17114: return XEiJ.regRn[10]; 17115: } 17116: //fallthrough 17117: case 0b010_011: //(A3) 17118: if (XEiJ.EFA_SEPARATE_AR) { 17119: XEiJ.mpuCycleCount += 24; 17120: return XEiJ.regRn[11]; 17121: } 17122: //fallthrough 17123: case 0b010_100: //(A4) 17124: if (XEiJ.EFA_SEPARATE_AR) { 17125: XEiJ.mpuCycleCount += 24; 17126: return XEiJ.regRn[12]; 17127: } 17128: //fallthrough 17129: case 0b010_101: //(A5) 17130: if (XEiJ.EFA_SEPARATE_AR) { 17131: XEiJ.mpuCycleCount += 24; 17132: return XEiJ.regRn[13]; 17133: } 17134: //fallthrough 17135: case 0b010_110: //(A6) 17136: if (XEiJ.EFA_SEPARATE_AR) { 17137: XEiJ.mpuCycleCount += 24; 17138: return XEiJ.regRn[14]; 17139: } 17140: //fallthrough 17141: case 0b010_111: //(A7) 17142: if (XEiJ.EFA_SEPARATE_AR) { 17143: XEiJ.mpuCycleCount += 24; 17144: return XEiJ.regRn[15]; 17145: } else { 17146: XEiJ.mpuCycleCount += 24; 17147: return XEiJ.regRn[ea - (0b010_000 - 8)]; 17148: } 17149: case 0b011_000: //(A0)+ 17150: if (XEiJ.EFA_SEPARATE_AR) { 17151: XEiJ.mpuCycleCount += 24; 17152: return (XEiJ.regRn[ 8] += 12) - 12; 17153: } 17154: //fallthrough 17155: case 0b011_001: //(A1)+ 17156: if (XEiJ.EFA_SEPARATE_AR) { 17157: XEiJ.mpuCycleCount += 24; 17158: return (XEiJ.regRn[ 9] += 12) - 12; 17159: } 17160: //fallthrough 17161: case 0b011_010: //(A2)+ 17162: if (XEiJ.EFA_SEPARATE_AR) { 17163: XEiJ.mpuCycleCount += 24; 17164: return (XEiJ.regRn[10] += 12) - 12; 17165: } 17166: //fallthrough 17167: case 0b011_011: //(A3)+ 17168: if (XEiJ.EFA_SEPARATE_AR) { 17169: XEiJ.mpuCycleCount += 24; 17170: return (XEiJ.regRn[11] += 12) - 12; 17171: } 17172: //fallthrough 17173: case 0b011_100: //(A4)+ 17174: if (XEiJ.EFA_SEPARATE_AR) { 17175: XEiJ.mpuCycleCount += 24; 17176: return (XEiJ.regRn[12] += 12) - 12; 17177: } 17178: //fallthrough 17179: case 0b011_101: //(A5)+ 17180: if (XEiJ.EFA_SEPARATE_AR) { 17181: XEiJ.mpuCycleCount += 24; 17182: return (XEiJ.regRn[13] += 12) - 12; 17183: } 17184: //fallthrough 17185: case 0b011_110: //(A6)+ 17186: if (XEiJ.EFA_SEPARATE_AR) { 17187: XEiJ.mpuCycleCount += 24; 17188: return (XEiJ.regRn[14] += 12) - 12; 17189: } 17190: //fallthrough 17191: case 0b011_111: //(A7)+ 17192: if (XEiJ.EFA_SEPARATE_AR) { 17193: XEiJ.mpuCycleCount += 24; 17194: return (XEiJ.regRn[15] += 12) - 12; 17195: } else { 17196: XEiJ.mpuCycleCount += 24; 17197: return (XEiJ.regRn[ea - (0b011_000 - 8)] += 12) - 12; 17198: } 17199: case 0b100_000: //-(A0) 17200: case 0b100_001: //-(A1) 17201: case 0b100_010: //-(A2) 17202: case 0b100_011: //-(A3) 17203: case 0b100_100: //-(A4) 17204: case 0b100_101: //-(A5) 17205: case 0b100_110: //-(A6) 17206: case 0b100_111: //-(A7) 17207: XEiJ.mpuCycleCount += 26; 17208: return XEiJ.regRn[ea - (0b100_000 - 8)] -= 12; 17209: case 0b101_000: //(d16,A0) 17210: case 0b101_001: //(d16,A1) 17211: case 0b101_010: //(d16,A2) 17212: case 0b101_011: //(d16,A3) 17213: case 0b101_100: //(d16,A4) 17214: case 0b101_101: //(d16,A5) 17215: case 0b101_110: //(d16,A6) 17216: case 0b101_111: //(d16,A7) 17217: XEiJ.mpuCycleCount += 28; 17218: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17219: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17220: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 17221: } else { 17222: t = XEiJ.regPC; 17223: XEiJ.regPC = t + 2; 17224: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17225: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 17226: } 17227: case 0b110_000: //(d8,A0,Rn.wl) 17228: case 0b110_001: //(d8,A1,Rn.wl) 17229: case 0b110_010: //(d8,A2,Rn.wl) 17230: case 0b110_011: //(d8,A3,Rn.wl) 17231: case 0b110_100: //(d8,A4,Rn.wl) 17232: case 0b110_101: //(d8,A5,Rn.wl) 17233: case 0b110_110: //(d8,A6,Rn.wl) 17234: case 0b110_111: //(d8,A7,Rn.wl) 17235: XEiJ.mpuCycleCount += 30; 17236: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17237: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 17238: } else { 17239: w = XEiJ.regPC; 17240: XEiJ.regPC = w + 2; 17241: w = XEiJ.busRwze (w); //pcwz。拡張ワード 17242: } 17243: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 17244: + (byte) w //バイトディスプレースメント 17245: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 17246: XEiJ.regRn[w >> 12])); //ロングインデックス 17247: case 0b111_000: //(xxx).W 17248: XEiJ.mpuCycleCount += 28; 17249: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 17250: case 0b111_001: //(xxx).L 17251: XEiJ.mpuCycleCount += 32; 17252: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 17253: } //switch 17254: XEiJ.mpuCycleCount += 34; 17255: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 17256: throw M68kException.m6eSignal; 17257: } //efaMltExtd 17258: 17259: //a = efaLeaPea (ea) //| M WXZP | 17260: // LEA命令とPEA命令のオペランドの実効アドレスを求める 17261: // efaCntWordとの違いはサイクル数のみ 17262: // LEA命令のベースサイクル数4を含んでいるのでLEA命令ではベースサイクル数を加えなくてよい 17263: // PEA命令のベースサイクル数は12-4=8 17264: @SuppressWarnings ("fallthrough") public static int efaLeaPea (int ea) throws M68kException { 17265: int t, w; 17266: switch (ea) { 17267: case 0b010_000: //(A0) 17268: if (XEiJ.EFA_SEPARATE_AR) { 17269: XEiJ.mpuCycleCount += 4; 17270: return XEiJ.regRn[ 8]; 17271: } 17272: //fallthrough 17273: case 0b010_001: //(A1) 17274: if (XEiJ.EFA_SEPARATE_AR) { 17275: XEiJ.mpuCycleCount += 4; 17276: return XEiJ.regRn[ 9]; 17277: } 17278: //fallthrough 17279: case 0b010_010: //(A2) 17280: if (XEiJ.EFA_SEPARATE_AR) { 17281: XEiJ.mpuCycleCount += 4; 17282: return XEiJ.regRn[10]; 17283: } 17284: //fallthrough 17285: case 0b010_011: //(A3) 17286: if (XEiJ.EFA_SEPARATE_AR) { 17287: XEiJ.mpuCycleCount += 4; 17288: return XEiJ.regRn[11]; 17289: } 17290: //fallthrough 17291: case 0b010_100: //(A4) 17292: if (XEiJ.EFA_SEPARATE_AR) { 17293: XEiJ.mpuCycleCount += 4; 17294: return XEiJ.regRn[12]; 17295: } 17296: //fallthrough 17297: case 0b010_101: //(A5) 17298: if (XEiJ.EFA_SEPARATE_AR) { 17299: XEiJ.mpuCycleCount += 4; 17300: return XEiJ.regRn[13]; 17301: } 17302: //fallthrough 17303: case 0b010_110: //(A6) 17304: if (XEiJ.EFA_SEPARATE_AR) { 17305: XEiJ.mpuCycleCount += 4; 17306: return XEiJ.regRn[14]; 17307: } 17308: //fallthrough 17309: case 0b010_111: //(A7) 17310: if (XEiJ.EFA_SEPARATE_AR) { 17311: XEiJ.mpuCycleCount += 4; 17312: return XEiJ.regRn[15]; 17313: } else { 17314: XEiJ.mpuCycleCount += 4; 17315: return XEiJ.regRn[ea - (0b010_000 - 8)]; 17316: } 17317: case 0b101_000: //(d16,A0) 17318: case 0b101_001: //(d16,A1) 17319: case 0b101_010: //(d16,A2) 17320: case 0b101_011: //(d16,A3) 17321: case 0b101_100: //(d16,A4) 17322: case 0b101_101: //(d16,A5) 17323: case 0b101_110: //(d16,A6) 17324: case 0b101_111: //(d16,A7) 17325: XEiJ.mpuCycleCount += 8; 17326: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17327: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17328: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 17329: } else { 17330: t = XEiJ.regPC; 17331: XEiJ.regPC = t + 2; 17332: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17333: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 17334: } 17335: case 0b110_000: //(d8,A0,Rn.wl) 17336: case 0b110_001: //(d8,A1,Rn.wl) 17337: case 0b110_010: //(d8,A2,Rn.wl) 17338: case 0b110_011: //(d8,A3,Rn.wl) 17339: case 0b110_100: //(d8,A4,Rn.wl) 17340: case 0b110_101: //(d8,A5,Rn.wl) 17341: case 0b110_110: //(d8,A6,Rn.wl) 17342: case 0b110_111: //(d8,A7,Rn.wl) 17343: XEiJ.mpuCycleCount += 12; 17344: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17345: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 17346: } else { 17347: w = XEiJ.regPC; 17348: XEiJ.regPC = w + 2; 17349: w = XEiJ.busRwze (w); //pcwz。拡張ワード 17350: } 17351: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 17352: + (byte) w //バイトディスプレースメント 17353: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 17354: XEiJ.regRn[w >> 12])); //ロングインデックス 17355: case 0b111_000: //(xxx).W 17356: XEiJ.mpuCycleCount += 8; 17357: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 17358: case 0b111_001: //(xxx).L 17359: XEiJ.mpuCycleCount += 12; 17360: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 17361: case 0b111_010: //(d16,PC) 17362: XEiJ.mpuCycleCount += 8; 17363: t = XEiJ.regPC; 17364: XEiJ.regPC = t + 2; 17365: return (t //ベースレジスタ 17366: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 17367: case 0b111_011: //(d8,PC,Rn.wl) 17368: XEiJ.mpuCycleCount += 12; 17369: t = XEiJ.regPC; 17370: XEiJ.regPC = t + 2; 17371: w = XEiJ.busRwze (t); //pcwz。拡張ワード 17372: return (t //ベースレジスタ 17373: + (byte) w //バイトディスプレースメント 17374: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 17375: XEiJ.regRn[w >> 12])); //ロングインデックス 17376: } //switch 17377: XEiJ.mpuCycleCount += 34; 17378: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 17379: throw M68kException.m6eSignal; 17380: } //efaLeaPea 17381: 17382: //a = efaJmpJsr (ea) //| M WXZP | 17383: // JMP命令とJSR命令のオペランドの実効アドレスを求める 17384: // efaCntWordとの違いはサイクル数のみ 17385: // JMP命令のベースサイクル数8を含んでいるのでJMP命令ではベースサイクル数を加えなくてよい 17386: // JSR命令のベースサイクル数は16-8=8 17387: @SuppressWarnings ("fallthrough") public static int efaJmpJsr (int ea) throws M68kException { 17388: int t, w; 17389: switch (ea) { 17390: case 0b010_000: //(A0) 17391: if (XEiJ.EFA_SEPARATE_AR) { 17392: XEiJ.mpuCycleCount += 8; 17393: return XEiJ.regRn[ 8]; 17394: } 17395: //fallthrough 17396: case 0b010_001: //(A1) 17397: if (XEiJ.EFA_SEPARATE_AR) { 17398: XEiJ.mpuCycleCount += 8; 17399: return XEiJ.regRn[ 9]; 17400: } 17401: //fallthrough 17402: case 0b010_010: //(A2) 17403: if (XEiJ.EFA_SEPARATE_AR) { 17404: XEiJ.mpuCycleCount += 8; 17405: return XEiJ.regRn[10]; 17406: } 17407: //fallthrough 17408: case 0b010_011: //(A3) 17409: if (XEiJ.EFA_SEPARATE_AR) { 17410: XEiJ.mpuCycleCount += 8; 17411: return XEiJ.regRn[11]; 17412: } 17413: //fallthrough 17414: case 0b010_100: //(A4) 17415: if (XEiJ.EFA_SEPARATE_AR) { 17416: XEiJ.mpuCycleCount += 8; 17417: return XEiJ.regRn[12]; 17418: } 17419: //fallthrough 17420: case 0b010_101: //(A5) 17421: if (XEiJ.EFA_SEPARATE_AR) { 17422: XEiJ.mpuCycleCount += 8; 17423: return XEiJ.regRn[13]; 17424: } 17425: //fallthrough 17426: case 0b010_110: //(A6) 17427: if (XEiJ.EFA_SEPARATE_AR) { 17428: XEiJ.mpuCycleCount += 8; 17429: return XEiJ.regRn[14]; 17430: } 17431: //fallthrough 17432: case 0b010_111: //(A7) 17433: if (XEiJ.EFA_SEPARATE_AR) { 17434: XEiJ.mpuCycleCount += 8; 17435: return XEiJ.regRn[15]; 17436: } else { 17437: XEiJ.mpuCycleCount += 8; 17438: return XEiJ.regRn[ea - (0b010_000 - 8)]; 17439: } 17440: case 0b101_000: //(d16,A0) 17441: case 0b101_001: //(d16,A1) 17442: case 0b101_010: //(d16,A2) 17443: case 0b101_011: //(d16,A3) 17444: case 0b101_100: //(d16,A4) 17445: case 0b101_101: //(d16,A5) 17446: case 0b101_110: //(d16,A6) 17447: case 0b101_111: //(d16,A7) 17448: XEiJ.mpuCycleCount += 10; 17449: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17450: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17451: + XEiJ.busRwse ((XEiJ.regPC += 2) - 2)); //pcws。ワードディスプレースメント 17452: } else { 17453: t = XEiJ.regPC; 17454: XEiJ.regPC = t + 2; 17455: return (XEiJ.regRn[ea - (0b101_000 - 8)] //ベースレジスタ 17456: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 17457: } 17458: case 0b110_000: //(d8,A0,Rn.wl) 17459: case 0b110_001: //(d8,A1,Rn.wl) 17460: case 0b110_010: //(d8,A2,Rn.wl) 17461: case 0b110_011: //(d8,A3,Rn.wl) 17462: case 0b110_100: //(d8,A4,Rn.wl) 17463: case 0b110_101: //(d8,A5,Rn.wl) 17464: case 0b110_110: //(d8,A6,Rn.wl) 17465: case 0b110_111: //(d8,A7,Rn.wl) 17466: XEiJ.mpuCycleCount += 14; 17467: if (XEiJ.MPU_COMPOUND_POSTINCREMENT) { 17468: w = XEiJ.busRwze ((XEiJ.regPC += 2) - 2); //pcwz。拡張ワード 17469: } else { 17470: w = XEiJ.regPC; 17471: XEiJ.regPC = w + 2; 17472: w = XEiJ.busRwze (w); //pcwz。拡張ワード 17473: } 17474: return (XEiJ.regRn[ea - (0b110_000 - 8)] //ベースレジスタ 17475: + (byte) w //バイトディスプレースメント 17476: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 17477: XEiJ.regRn[w >> 12])); //ロングインデックス 17478: case 0b111_000: //(xxx).W 17479: XEiJ.mpuCycleCount += 10; 17480: return XEiJ.busRwse ((XEiJ.regPC += 2) - 2); //pcws 17481: case 0b111_001: //(xxx).L 17482: XEiJ.mpuCycleCount += 12; 17483: return XEiJ.busRlse ((XEiJ.regPC += 4) - 4); //pcls 17484: case 0b111_010: //(d16,PC) 17485: XEiJ.mpuCycleCount += 10; 17486: t = XEiJ.regPC; 17487: XEiJ.regPC = t + 2; 17488: return (t //ベースレジスタ 17489: + XEiJ.busRwse (t)); //pcws。ワードディスプレースメント 17490: case 0b111_011: //(d8,PC,Rn.wl) 17491: XEiJ.mpuCycleCount += 14; 17492: t = XEiJ.regPC; 17493: XEiJ.regPC = t + 2; 17494: w = XEiJ.busRwze (t); //pcwz。拡張ワード 17495: return (t //ベースレジスタ 17496: + (byte) w //バイトディスプレースメント 17497: + (w << 31 - 11 >= 0 ? (short) XEiJ.regRn[w >> 12] : //ワードインデックス 17498: XEiJ.regRn[w >> 12])); //ロングインデックス 17499: } //switch 17500: XEiJ.mpuCycleCount += 34; 17501: M68kException.m6eNumber = M68kException.M6E_ILLEGAL_INSTRUCTION; 17502: throw M68kException.m6eSignal; 17503: } //efaJmpJsr 17504: 17505: 17506: 17507: } //class MC68010 17508: 17509: 17510: