Skip to content

Commit

Permalink
fix another case of movem PC saving
Browse files Browse the repository at this point in the history
  • Loading branch information
notaz committed Oct 18, 2014
1 parent fd7e3e4 commit 355815e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion OpMove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion app.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 355815e

Please sign in to comment.