Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Question re. memory locations   Message List  
Reply | Forward Message #14854 of 15019 |


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









Thu Jan 27, 2005 9:58 pm

miklos_tomka
Offline Offline
Send Email Send Email

Forward
Message #14854 of 15019 |
Expand Messages Author Sort by Date

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...
miklos_tomka
Offline Send Email
Jan 28, 2005
12:41 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help