Assembly for GBA

Post Reply
WorldInThe
Posts: 2
Joined: Sun Jun 18, 2017 4:48 am

Assembly for GBA

Post by WorldInThe » Sun Jun 18, 2017 5:03 am

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


WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Assembly for GBA

Post by WinterMute » Sun Jun 25, 2017 3:21 pm

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

WorldInThe
Posts: 2
Joined: Sun Jun 18, 2017 4:48 am

Re: Assembly for GBA

Post by WorldInThe » Sat Jul 01, 2017 9:40 am

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.

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Assembly for GBA

Post by WinterMute » Thu Jul 06, 2017 10:14 pm

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests