Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Tue Sep 02, 2025 2:01 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Thumb Assembly
PostPosted: Tue Apr 03, 2007 11:23 am 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
I do thumb just fine (I can assemble any opcodes by hand that I don't know how to enter into an assembler properly), but I'd rather just learn the syntax.

Anyhow, I have an
ldr r1, [TableBase]

and later on down is a

TableBase:

That works fine, but it says I'm missing an argument.

I slap a ", =$08000000" onto the end of the opcode to see if it will shut up, and it does. No more warnings. But of course, it didn't assemble either.

How do I tell it what the hell to do?

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 03, 2007 7:53 pm 
Offline
Komrade
Komrade
User avatar

Joined: Tue Mar 27, 2007 6:23 pm
Posts: 1354
Location: Mario Raceway, 1509.831, 217.198, -564.429
Title: Mario Kart 64 Hacker
ldr r1, [=TableBase]?

_________________
Image 143
HyperNova Software is now live (but may take a few tries to load) currently down; check out my PSP/DS/Game Boy/Windows/Linux homebrew, ROM hacks, and Gameshark codes!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 04, 2007 1:15 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
That didn't work :\

How do I assemble a value (non opcode)?

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 04, 2007 1:52 pm 
Offline
Kommunist
Kommunist

Joined: Tue Oct 10, 2006 9:32 am
Posts: 445
ldr r1,TableBase ?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 04, 2007 1:58 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
That's not working either.

Here's the full thing:

.org 801745e
nop
nop
nop

.org 802a02c
bl $80cb51a

.org 80cb51a
ldr r1, TableBase, =$080CB4DE
add r0, r0, r1
ldrb r0, [r0, #0x0]
bx lr
nop
TableBase:

.org 802a032
nop

I want it to allocate 0x080cb4de at the label TableBase and load from that address.

I've already assembled it by hand and posted a ROM patch for this at the Fire Emblem Sanctuary of Strategy (it's a patch for Fire Emblem 7).

I can't help but think the syntax is incredibly obvious, but I can't think of anything else to try.

I had to assemble it by hand anyhow because Renegade garbled the BL.

Edit: In case anyone who's seen how lazily I program is wondering why I put the ".org" in there even though it's apparently unnecessary, it's because I was originally planning to use devkitPro. I accidentally erased it earlier and decided not to download it again immediately once I remembered that Renegade has that lovely new Thumb assembler. Well, mostly lovely. The BL business is kind of ugly...

Edit: Using the immediate loading pseudo op was failing, so I decided to use the syntax "ldr r1, [PC, #0x8]" instead. Now it assembles fine.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: AhrefsBot [Bot] and 91 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group