From: notaz Date: Sat, 18 Oct 2014 17:22:32 +0000 (+0300) Subject: fix another case of movem PC saving X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=355815ebb5b1c60916f66d043a43f3af7839589f;p=cyclone68000.git fix another case of movem PC saving --- diff --git a/Main.cpp b/Main.cpp index 13efac2..b6f49c3 100644 --- a/Main.cpp +++ b/Main.cpp @@ -169,13 +169,14 @@ static void AddressErrorWrapper(char rw, const char *dataprg, int iw) } #endif -void FlushPC(void) +void FlushPC(int force) { #if MEMHANDLERS_NEED_PC - if (pc_dirty) - ot(" str r4,[r7,#0x40] ;@ Save PC\n"); -#endif + force |= pc_dirty; pc_dirty = 0; +#endif + if (force) + ot(" str r4,[r7,#0x40] ;@ Save PC\n"); } static void PrintFramework() diff --git a/OpMove.cpp b/OpMove.cpp index 338dab1..0d5f670 100644 --- a/OpMove.cpp +++ b/OpMove.cpp @@ -406,7 +406,7 @@ int OpMovem(int op) EaCalc(6,0x003f,cea,size); // must save PC, need a spare register - FlushPC(); + FlushPC(1); ot(";@ r4=Register Index*4:\n"); if (decr) ot(" mov r4,#0x40 ;@ order reversed for -(An)\n"); diff --git a/app.h b/app.h index 9d01957..5a064ab 100644 --- a/app.h +++ b/app.h @@ -58,7 +58,7 @@ extern int arm_op_count; // for stats void ot(const char *format, ...); void ltorg(); int MemHandler(int type,int size,int addrreg=0,int need_addrerr_check=1); -void FlushPC(void); +void FlushPC(int force=0); // OpAny.cpp extern int g_op;