From d0f45e3b927bed08e732947a0176697e1d2b5406 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 16 Oct 2016 12:37:31 +0000 Subject: Maybe Fix for having the LSB on 1, by flipping its meaning in the garbage collector --- cgthumb2was.c | 9 +++++---- 1 file 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(); -- cgit v1.2.3