#23234 - Darmstadium - Thu Jul 08, 2004 6:04 am
Yo, I'm a real noob to ASM, I just started today. I got a problem with this code that is supposed to display two red dots of 0xF > 0xE:
The first dot appears but the second doesn't.
And I got a question about branching to a different label: if I want to go back to where I branched from in the drawreddots label after the code there is done being executed, do I have to make a label back where I branched from and then branch back to there like this?:
thanks
Code: |
@include screen.h @textarea ;set mode, enable bg2 ldr r0,=REG_DISPCNT ldr r1,=(MODE_3 | BG2_ENABLE) str r1,[r0] ldr r0,=0xF ldr r1,=0xE cmp r0,r1 bgt drawreddots ;main loop mainloop B mainloop drawreddots ldr r0,=0xFF ldr r1,=(vram+(40+100*240)) str r0,[r1] ldr r1,=(vram+(43+100*240)) str r0,[r1] @pool @endarea |
The first dot appears but the second doesn't.
And I got a question about branching to a different label: if I want to go back to where I branched from in the drawreddots label after the code there is done being executed, do I have to make a label back where I branched from and then branch back to there like this?:
Code: |
@include screen.h @textarea ;set mode, enable bg2 ldr r0,=REG_DISPCNT ldr r1,=(MODE_3 | BG2_ENABLE) str r1,[r0] ldr r0,=0xF ldr r1,=0xE cmp r0,r1 bgt drawreddots returnfromdrawing ;main loop mainloop b mainloop drawreddots ldr r0,=0xFF ldr r1,=(vram+(40+100*240)) str r0,[r1] ldr r1,=(vram+(43+100*240)) str r0,[r1] b returnfromdrawing @pool @endarea |
thanks