PDA

View Full Version : ARM Developer Studio Assembler



hanzelko
13-05-2003, 09:18 AM
Hi,

Can some one help me with this.
I have this part of Nokia Flash:

CODE16

adr r1,DAT_2055D0
lsl r0,r0,#2
ldr r0,[r1,r0]
mov pc,r0

DAT_2055D0

DCD B_2058a6
DCD B_205896
DCD B_205664
END

It is normal jump table. But this whole stuff is in Thumb mode and ADS Assembler will for DCD B_xxxx generate address + 1 (For thumb like BX) and in flash this is without that +1.
How to avoid this +1 address adding?
When I use DCD B_2058a6 it will generete 0x002058A7

When I use DCD B_2058a6-1 it will generate 0x002058A5.

Any suggestions?

Thanks

OrbiTel gSm
05-06-2003, 12:04 PM
CODE16

adr r1,DAT_2055D0 [R1,thisadress]


lsl r0,r0,#2 [log. shift left from r0. I dont know value from
r0 then i can not identifi]


ldr r0,[r1,r0] [r0=adr[r1 + r0] this can be 2055D0 + lsl
from R0


mov pc,r0 [back like bx]


DAT_2055D0


DCD B_2058a6
DCD B_205896
DCD B_205664
END

g3gg0
08-06-2003, 11:05 PM
hmm 1st:
when bit 0 is set to zero, the CPU will enter ARM mode
if bit 0 is set, it will run in THUMB mode
since you are in THUMB mode, bit 0 will always be set
and this is needed for the MCU
just in case you didnt know ;)

(perhaps) reason:
the project supports selecting the cpu mode..
ARM, THUMB or ARM-THUMB inter-blah-mode
maybe u selected just THUMB mode?

hack:
did u try lsr r1,r1,1 and lsl r1,r1,1 to clear bit 0?
did u try sub r1, r1, #1 to clear bit 0?

may i know what u are trying - just interested :)

OrbiTel gSm
09-06-2003, 07:01 AM
more problematics about arm you can find also on:
www.odblokovani.net/forum
section firmware reversing (this section is in eng language)