- 48
- Posts
- 8
- Years
- Katones City
- Seen May 13, 2025
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:
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?
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:
.text
.align 2
.thumb
.thumb_func
main:
push {r0-r2, lr}
ldr r2, =(0x0300553C) @ r2 = address of year
ldrh r0, [r2] @ r0 = current year
mov r1, 0xFF @ r1 = 255
add r1, r1, #0x6E @ r1 = 365
mul r0, r0, r1 @ r0 = year * 365
pop {r0-r2, pc}
.align 2
.align 2
.thumb
.thumb_func
main:
push {r0-r2, lr}
ldr r2, =(0x0300553C) @ r2 = address of year
ldrh r0, [r2] @ r0 = current year
mov r1, 0xFF @ r1 = 255
add r1, r1, #0x6E @ r1 = 365
mul r0, r0, r1 @ r0 = year * 365
pop {r0-r2, pc}
.align 2
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: