|
Hello all,
I have a question about memory structure in the GBA.
I have the following code (taken from a GBA assembler tutorial).
The code should display a picture on the screen
------------------------------------------
main:
mov r0, #0x4000000
mov r1, #0x400
add r1, r1, #3
strh r1, [r0]
mov r0, #0x6000000
ldr r1, =pic @ my question refers to this line here!
mov r2, #0x960
loop1:
ldmia r1!, { r3,r4,r5,r6,r7,r8,r9,r10 }
stmia r0!, { r3,r4,r5,r6,r7,r8,r9,r10 }
subs r2, r2, #1
bne loop1
infin:
b infin
.ltorg
pic:
DCW 0x4A31,0x4E52,0x4A31,0x4E52,0x4E52,0x4E52,0x4E53,0x4A32
DCW 0x4A31,0x4631,0x4631,0x4A31,0x4631,0x4631,0x4610,0x4611
DCW 0x4631,0x4A52,0x4A52,0x4A52,0x4E72,0x4A52,0x4A31,0x4A31
and lots more of DCW...
------------------------------------
When I use the code with no$GBA it assembles and runs fine. The
result should be a picture shown on the GBA screen.
However the program runs, but the screen remains black.
Debugging the program I find, that the line
ldr r1, =pic
does not point to the picture data.
My code is in the 8000000 adress region, so the pic: data is at about
80000FC. However when I stop the debugger right after the mentioned
instruction, I see, thet r1 contains 20000FC. That adress (20000FC)
is according to the debugger filled with lots of zeroes, therefore no
surprise that my screen remains black.
What am I doing wrong here? Why does the above mentioned instruction
not contain the proper adress for my data?
I am sorry for the newbie question - but I am stuck here. Any help
would be really welcome!
Thank you all,
Miklos
|
"miklos_tomka" <miklos_tomka@...>
miklos_tomka
Offline Send Email
|