This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Optimizing code size

Hi,
I am developing an application for ARM lpc2102.The code size is very critical so I decided to look for list file generated by Keil:
var | = EXPAND

LDR R0=var
LDRB R1,[R0,#0x0]
MOV R0,#0x1
ORR R1,R0
LDR R0=var
STRB R1,[R0,#0x0]
This is the code I expected:
LDR R0=var
LDRB R1,[R0,#0x0]
MOV R2,#0x1
ORR R1,R2
STRB R1,[R0,#0x0]

Why not use another register like R2 to avoid
load R0 (LDR R0=var )twice ?

I am using thumb mode and code optmization option is Emphasis: favor code size

Thanks

Parents Reply Children
No data