- ot(";@ Jsr - Push old PC first\n");\r
- ot(" ldr r0,[r7,#0x3c]\n");\r
- ot(" sub r1,r4,r10 ;@ r1 = Old PC\n");\r
- ot(";@ Push r1 onto stack\n");\r
- ot(" sub r0,r0,#4 ;@ Predecrement A7\n");\r
+ ot(" ldr r2,[r7,#0x3c]\n");\r
+ ot(" sub r1,r4,r11 ;@ r1 = Old PC\n");\r
+ }\r
+#if EMULATE_ADDRESS_ERRORS_JUMP\r
+ // jsr prefetches next instruction before pushing old PC,\r
+ // according to http://pasti.fxatari.com/68kdocs/68kPrefetch.html\r
+ ot(" mov r4,r0\n");\r
+ ot(" tst r4,#1 ;@ address error?\n");\r
+ ot(" bne ExceptionAddressError_r_prg_r4\n");\r
+#else\r
+ ot(" bic r4,r0,#1\n");\r
+#endif\r
+\r
+ if (!(op&0x40))\r
+ {\r
+ ot(";@ Push old PC onto stack\n");\r
+ ot(" sub r0,r2,#4 ;@ Predecrement A7\n");\r