Files
2026-10-05 01:25:54 +03:00

36 lines
699 B
ArmAsm
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Напишите программу на ассемблере RISC-V,
# которая принимает на вход целое число x и
# выводит все значения в диапазоне min(x, y)...max(x, y) с шагом h.
# Где y – номер группы, h – номер студента в группе.
.eqv y, 118
.eqv h, 3
.text
.globl main
main:
li a7, 5
ecall
mv t0, a0
li t1, y
li t3, h
ble t0, t1, loop
mv t2, t0
mv t0, t1
mv t1, t2
loop:
mv a0, t0
li a7, 1
ecall
li a0, 32
li a7, 11
ecall
sub t2, t1, t0
bltu t2, t3, exit
add t0, t0, t3
j loop
exit:
li a7, 10
ecall