#1930 - regularkid - Sun Jan 26, 2003 3:12 am
Hi. I'm using C and ASM together and am trying to do this: I have a global variable in one of my C files that I want to access in my ASM files. So, in my C file it looks like this:
and so this is what my ASM file looks like:
(the ... means that there is more code here but it's not important so I left it out). So this should put two white pixels at the top left corner of the screen (MODE 3). But this doesn't work. However, this DOES work:
Can someone please explain to me how to use a global variable from a C file in my ASM files? Is there something I'm missing? Thanks!
_________________
- RegularKid
Code: |
... u16* videoBuffer =(u16*)0x06000000; ... |
and so this is what my ASM file looks like:
Code: |
... .EXTERN videoBuffer ... ldr r0, =videoBuffer ldr r1, =0xFFFFFFFF str r1, [r0] ... |
(the ... means that there is more code here but it's not important so I left it out). So this should put two white pixels at the top left corner of the screen (MODE 3). But this doesn't work. However, this DOES work:
Code: |
... .EXTERN videoBuffer ... ldr r0, =0x06000000 ldr r1, =0xFFFFFFFF str r1, [r0] ... |
Can someone please explain to me how to use a global variable from a C file in my ASM files? Is there something I'm missing? Thanks!
_________________
- RegularKid