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

fib_n:
	push bpr
	mov spr, bpr

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

start:
    add rg1, rg2, rg3

    pusha 4
    push rg1
    call print::print_hex_byte
    call print::print_newline
    pop zero
    popa 4

    mov rg2, rg1
    mov rg3, rg2

    dec rg0
    cmp rg0, zero
    jgt start

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