- 94
- Posts
- 14
- Years
- Seen Nov 2, 2016
There are a couple of ways in fr. There is software interrupt 0x6, which is a bios function call that does division and modulo. There is routine 081E4018 developed by gamefreak, that does division and modulo as well.With ASM, how would you do modulo?
R0 = dividend
R1 = divisor
returning
R0 = quotient
R1 = modulo answer
081E4684 is another routine made by gamefreak that does modulo only.
A few other math routines:
081E460C: another division routine
081E3B9C: square root, calls swi 0x8
I've stumbled across a few others that I dont remember..