OpRegToFlags(high);\r
}\r
\r
-// Pop PC - assumes r11=Memory Base - trashes r0-r3\r
+// Pop PC - trashes r0-r3\r
static void PopPc()\r
{\r
ot(";@ Pop PC:\n");\r
ot(" add r1,r0,#4 ;@ Postincrement A7\n");\r
ot(" str r1,[r7,#0x3c] ;@ Save A7\n");\r
MemHandler(0,2);\r
- ot(" add r0,r0,r11 ;@ Memory Base+PC\n");\r
+ ot(" ldr r1,[r7,#0x60] ;@ Get Memory base\n");\r
+ ot(" add r0,r0,r1 ;@ Memory Base+PC\n");\r
ot("\n");\r
CheckPc();\r
#if EMULATE_ADDRESS_ERRORS_JUMP\r
case 3: // rte\r
OpStart(op,0x10,0,0,1); Cycles=20;\r
PopSr(1);\r
- ot(" ldr r11,[r7,#0x60] ;@ Get Memory base\n");\r
PopPc();\r
ot(" ldr r1,[r7,#0x44] ;@ reload SR high\n");\r
SuperChange(op,1);\r
\r
case 5: // rts\r
OpStart(op,0x10); Cycles=16;\r
- ot(" ldr r11,[r7,#0x60] ;@ Get Memory base\n");\r
PopPc();\r
#if EMULATE_ADDRESS_ERRORS_JUMP\r
ot(" tst r4,#1 ;@ address error?\n");\r
case 7: // rtr\r
OpStart(op,0x10); Cycles=20;\r
PopSr(0);\r
- ot(" ldr r11,[r7,#0x60] ;@ Get Memory base\n");\r
PopPc();\r
#if EMULATE_ADDRESS_ERRORS_JUMP\r
ot(" tst r4,#1 ;@ address error?\n");\r
\r
EaCalcReadNoSE((type>0)?8:-1,0,tea,size,0x003f);\r
\r
- if (tea>=0x11)\r
+ if (tea>=0x10)\r
ot(" and r11,r11,#7 ;@ mem - do mod 8\n"); // size always 0\r
else ot(" and r11,r11,#31 ;@ reg - do mod 32\n"); // size always 2\r
ot("\n");\r
EaCalcReadNoSE(-1,0,sea,0,0);\r
ot(" mov r11,#1\n");\r
ot(" bic r10,r10,#0x40000000 ;@ Blank Z flag\n");\r
- if (tea>=0x11)\r
+ if (tea>=0x10)\r
ot(" and r0,r0,#7 ;@ mem - do mod 8\n"); // size always 0\r
else ot(" and r0,r0,#0x1F ;@ reg - do mod 32\n"); // size always 2\r
ot(" mov r11,r11,lsl r0 ;@ Make bit mask\n");\r
\r
OpStart(op,ea,0,1);\r
\r
+ ot(" ldrh r11,[r4],#2 ;@ r11=register mask\n");\r
+ ot("\n");\r
+ ot(";@ Get the address into r6:\n");\r
+ EaCalc(6,0x003f,cea,size);\r
+\r
#if !MEMHANDLERS_NEED_PREV_PC\r
// must save PC, need a spare register\r
ot(" str r4,[r7,#0x40] ;@ Save PC\n");\r
#endif\r
-#if !MEMHANDLERS_NEED_CYCLES\r
- ot(" str r5,[r7,#0x5c] ;@ Save Cycles\n");\r
-#endif\r
- ot(" ldrh r11,[r4],#2 ;@ r11=register mask\n");\r
\r
ot(";@ r4=Register Index*4:\n");\r
if (decr) ot(" mov r4,#0x40 ;@ order reversed for -(An)\n");\r
else ot(" mov r4,#-4\n");\r
\r
- ot("\n");\r
- ot(";@ Get the address into r6:\n");\r
- EaCalc(6,0x003f,cea,size);\r
-\r
ot("\n");\r
ot(" tst r11,r11\n"); // sanity check\r
ot(" beq NoRegs%.4x\n",op);\r