#8911 - wasiliy - Wed Jul 23, 2003 6:43 pm
hi
i'm using armsdt and i'm trying to predefine a variable
color DCB 1
when i try to load the value via
ldr r2,=color
ldrb r1,[r2]
it doesnt work. r1 seems still to be zero. here is the whole code:
when i just load 1 into the r1 register by using
mov r1,#1
it works but when i try to load a 1 from memory it doesnt.
i'm using armsdt and i'm trying to predefine a variable
color DCB 1
when i try to load the value via
ldr r2,=color
ldrb r1,[r2]
it doesnt work. r1 seems still to be zero. here is the whole code:
Code: |
AREA new, CODE, READONLY ENTRY main mov r0,#0x4000000 ldr r1,=0x404 str r1,[r0] ; set gfx mode 4 ldr r0,=0x05000002 ; set color 1 to white ldr r1,=0x0FFFF strh r1,[r0] ldr r0,=0x6000000 ; set a white pixel on screen ldr r2,=color ldrb r1,[r2] strb r1,[r0,#10] infinit b infinit AREA Block, DATA, READWRITE color DCB 1 END |
when i just load 1 into the r1 register by using
mov r1,#1
it works but when i try to load a 1 from memory it doesnt.