Fibonacci in PowerPC ASM
I was asked by a random person on Discord if I could make a Fibonacci sequence on PPC ASM. 

x + y = z
0 + 1 = 1
1 + 1 = 2
1 + 2 = 3
2 + 3 = 5
etc etc

He wanted the equation to loop and repeat until X equals 255 then the loop will start from the very beginning again. Anyway here's a quick fibonacci ASM sequence if anybody cares... Ofc, modify this according to store/load to/from memory addresses for use in Cheat Codes...

li r16, 0x0
li r17, 0x1

add r18, r17, r16
mr r16, r17
mr r17, r18

cmpwi r16, 0xFF
blt+ first_label
b second_label

Raw ASM:
3A000000 3A200001
7E518214 7E308B78
7E519378 2C1000FF

Forum Jump:

Users browsing this thread: 1 Guest(s)