Page 1 of 1

Assembly for GBA

Posted: Sun Jun 18, 2017 5:03 am
by WorldInThe
I'm having issue with a program from the GBA ASM tutorial on patater.com I don't know if it's the code not working on the newer version of the assembler, if I'm using the wrong assembler or what's going on any help would be appreciated.

Code: Select all

.arm
.text
.global main
main:
  mov r0, #0x4000000
  mov r1, #0x400
  add r1, r1, #3
  str r1, [r0]

  mov r0, #0x6000000
  mov r1, #0xFF
  mov r2, #0x9600
loop1:
  strh r1, [r0], #2
  subs r2, r2, #1
  bne loop1

infin:
  b infin


Re: Assembly for GBA

Posted: Sun Jun 25, 2017 3:21 pm
by WinterMute
What's the issue?

It's hard to help without knowing what you're actually doing. Please tell us what you're trying to do, what steps you've taken to achieve that goal and what errors/problems you encountered along the way.

Re: Assembly for GBA

Posted: Sat Jul 01, 2017 9:40 am
by WorldInThe
There's not much to say honestly when I run the bin made from the assembly code through arm-none-eabi-gcc and arm-none-eabi-objcopy. It does nothing VBA gives me moving values in the disassembler but no$ won't even load the file. I can't see many things that could be an issue. I've double checked the memory locations multiple times but they're fine.

Re: Assembly for GBA

Posted: Thu Jul 06, 2017 10:14 pm
by WinterMute
I've just tried this and it produces a red screen on hardware, no$gba and mGBA. I haven't used VBA in a very long time.

Code: Select all

arm-none-eabi-gcc -o test.elf -specs=gba.specs test.S
arm-none-eabi-objcopy -O binary test.elf test.gba
gbafix test.gba
The last step, using gbafix may help with no$gba although it worked fine in my current setup without that. I think no$gba may default to complaining about checksums though.