I'm writing a program for class, to calculate the Fibonacci number given the n value. For some reason, my output goes negative at N=24. Does anyone understand MARIE Simulator enough to figure out what the issue is?
ORG 100
Input Input number
Store N
Store Ctr
Loop1, Clear
Load Ctr
Subt C1
Store Ctr
Load F2
Add F1
Store F3
Load F1
Store F2
Load F3
Store F1
Load Ctr
Skipcond 400
Jump Loop1
Load Ctr
Output
Load N
Output
Load F1
Output
Halt
N, DEC 0
Ctr, DEC 0
C1, DEC 1
F1, DEC 0
F2, DEC 1
F3, DEC 0
Thanks