include print "../io/print.dsa"

fib_n:
	push bpr
	mov spr, bpr

	ldw bpr, rg0, 8  // load arg
    lwi 0, rg1
    lwi 1, rg2

_start:
    add rg1, rg2, rg3

    mov rg2, rg1
    mov rg3, rg2

    dec rg0
    cmp rg0, zero
    jgt _start

    stw rg3, bpr, 8
    mov bpr, spr
    pop bpr
    return
