Skip to content
Snippets Groups Projects
Commit aaa90311 authored by Rachkovska, Ievgeniia's avatar Rachkovska, Ievgeniia
Browse files

Fibonacci's series by Rachkiev

parent d4430035
No related branches found
No related tags found
No related merge requests found
.globl _start
.option norelax
_start:
addi t0, x0, 5 // Set value of N
addi s0, x0, 0 // F(0)
addi s1, x0, 1 // F(1)
addi t1, x0, 2 // initialization instruction of for cycle: i=2, kde i=t1
loop_body:
add t2, s0, s1 // t2 = s0 + s1
add s0, s1, x0 //s0 = s1
nop
add s1, t2, x0 //s1 = t2
addi t1, t1, 1 # i++
ble t1, t0, loop_body
done:
addi t0, x0, 0x400 // la t0, fibonacci bez hazardu
ebreak
.data
.org 0x400
fibonacci:
.word 0x1234
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment