Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
ads problem
Jump...
Cancel
Locked
Locked
Replies
4 replies
Subscribers
119 subscribers
Views
3030 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
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
ads problem
LI JUN
over 12 years ago
Note: This was originally posted on 26th April 2010 at
http://forums.arm.com
code:
void __irq IRQ_Timer(void)
{
[0xe92d503f] stmfd r13!,{r0-r5,r12,r14}
if((IO0PIN&U0)&&(T1IR&0x40))
[0xe59f39ac] [color="#FF0000"]ldr r3,0x0000132c ; = #0xe0028000[/color]
[0xe5930000] [color="#FF0000"]ldr r0,[r3,#0][/color]
[0xe3100b80] tst r0,#0x20000
[0xe59f099c] ldr r0,0x00001328 ; = #0x40000004
[0xe3a0c055] mov r12,#0x55
[0xe2431b80] [color="#FF0000"] sub r1,r3,#0x20000[/color]
[0x0a000014] beq 0x9e8 ; (IRQ_Timer + 0x74)
[0xe5912000] ldr r2,[r1,#0]
[0xe3120040] tst r2,#0x40
[0x0a000011] beq 0x9e8 ; (IRQ_Timer + 0x74)
ram data:
0x00001320 E000C000 E0034000 40000004 [color="#FF0000"]E0028000[/color]
0x00001330 00003092 00002710 40000044 000008D4
0x00001340 4000001C 40000000 00000974 000030A2
i have defined the[color="#FF0000"] T1IR [/color]and [color="#FF0000"]IO0PIN[/color] by macro,but i find the mcu gets the register address from ram , please look at the ram data.and i use the lpc2138.
please help me!
LI JUN
over 12 years ago
Note: This was originally posted on 26th April 2010 at
http://forums.arm.com
register address
IO0PIN 0xe0028000
T1IR 0xe0008000
Cancel
Vote up
0
Vote down
Cancel
LI JUN
over 12 years ago
Note: This was originally posted on 6th May 2010 at
http://forums.arm.com
first, thank you very much.
i see.
Cancel
Vote up
0
Vote down
Cancel
Simon Craske
over 12 years ago
Note: This was originally posted on 26th April 2010 at
http://forums.arm.com
There doesn't appear to be anything fundamentally wrong with what the compiler has done;
optimising for space, this is likely to be the best option.
It is possible that speed may be improved by generating the address via MOV and ADD,
are you compiling with -Otime or -Ospace?
hth
s.
Cancel
Vote up
0
Vote down
Cancel
Peter Harris
over 12 years ago
Note: This was originally posted on 26th April 2010 at
http://forums.arm.com
The ARM instructions can only encode an 8-bit literal rotated an even number of places - if the value cannot be encoded in that then most compilers fall back on loading the constant from memory. In your case the constants 0xe0028000 cannot be encoded in 8-bits rotated, so the compiler has fallen back on loading from memory.
FYI: The ARMv7 architecture (ARM and Thumb2) includes a pair of wide-move instructions for putting a 16-bit value into either the high or the low halves of a register, which would help in this case, , although code-size can be larger. Newer micro-controllers based on the Cortex-M family include these instructions.
Cancel
Vote up
0
Vote down
Cancel