#168234 - FluBBa - Thu Apr 16, 2009 9:43 am
After a couple of hours I finally found out that using a BSS section and the adr (semi) opcode doesn't work in the latest DevKitARM (gcc bug?).
Doing something like:
r0 is loaded with the current PC and not with the address of SN76496_0.
Using ldr r0,=SN76496_o works as expected and is the right way to do it, but using adr should at least give a warning and probably an error.
_________________
I probably suck, my not is a programmer.
Doing something like:
Code: |
.arm .align 4 .section .text ;@---------------------------------------------------------------------------- Sound_reset: ;@---------------------------------------------------------------------------- stmfd sp!,{lr} adr r0,SN76496_0 bl SN76496_reset ;@ sound ldmfd sp!,{lr} bx lr ;@---------------------------------------------------------------------------- .section .bss SN76496_0: .space 72 |
r0 is loaded with the current PC and not with the address of SN76496_0.
Using ldr r0,=SN76496_o works as expected and is the right way to do it, but using adr should at least give a warning and probably an error.
_________________
I probably suck, my not is a programmer.