• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ASM & Hex✓] Fire Red: What is wrong with this ASM code

Hi folks!
Can someone tell me what is wrong with the following ASM code? The thumb batch compiler is not compiling it for some reason.
The code:
Spoiler:


This is just one part of another huge ASM and so far the other parts of the code doesn't seem to have any problems.

Additional question:
Where is the play time stored in Fire Red RAM?
And is there any in game function that calculates how many days it has been since the start of the game?
 
Last edited:
It's not compiling because line 4 in the function should be mov r1, #0xFF (your forgot the #). Additionally, even if you call this function from another function, the return value will be incorrect, as you discard the computed value at the end by popping r0. I recommend removing the line push {r0-r2, lr}, and replacing the last line in the function with bx lr.
 
It's not compiling because line 4 in the function should be mov r1, #0xFF (your forgot the #). Additionally, even if you call this function from another function, the return value will be incorrect, as you discard the computed value at the end by popping r0. I recommend removing the line push {r0-r2, lr}, and replacing the last line in the function with bx lr.

My bad.. did not notice the missing #.. thanks a lot!

And this routine isn't complete yet. I'll put the final answers of my result in some variables before popping the registers! But I will keep bx lr in mind for future functions! Thank you! :D
 
Back
Top