summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-10-16 12:37:31 +0000
committerCamil Staps2016-10-16 12:37:31 +0000
commitd0f45e3b927bed08e732947a0176697e1d2b5406 (patch)
treebb2a49bdddfe5ce96339ea379017990daf0979cb
parent.thumb_func only for node entry labels (diff)
Maybe Fix for having the LSB on 1, by flipping its meaning in the garbage collector
-rw-r--r--cgthumb2was.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cgthumb2was.c b/cgthumb2was.c
index 555bf1d..af06567 100644
--- a/cgthumb2was.c
+++ b/cgthumb2was.c
@@ -401,6 +401,10 @@ static void w_as_define_code_label (LABEL *label)
w_as_label (label->label_name);
w_as_colon();
w_as_newline();
+
+ if (label->label_flags & NODE_ENTRY_LABEL) {
+ w_as_instruction_without_parameters ("nop");
+ }
}
static void w_as_internal_label (int label_number)
@@ -1494,7 +1498,7 @@ static void w_as_jsr_instruction (struct instruction *instruction)
case P_INDIRECT_WITH_UPDATE:
w_as_instruction_without_parameters (".align");
w_as_opcode ("add");
- fprintf (assembly_file,"lr,pc,#8");
+ fprintf (assembly_file,"lr,pc,#9");
w_as_newline_after_instruction();
w_as_opcode ("str");
fprintf (assembly_file,"lr,[sp,#%d]!",instruction->instruction_parameters[1].parameter_offset);
@@ -2351,9 +2355,6 @@ static void w_as_rts_instruction (void)
w_as_opcode ("ldr");
fprintf (assembly_file,"lr,[sp],#4");
w_as_newline_after_instruction();
- w_as_opcode ("orr");
- fprintf (assembly_file,"lr,lr,#1");
- w_as_newline_after_instruction();
w_as_opcode ("mov");
fprintf (assembly_file,"pc,lr");
w_as_newline_after_instruction();