done bugfixing

This commit is contained in:
karthikmurakonda 2022-10-20 21:36:55 +05:30
parent 55a7c11290
commit 0ca303387d
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
.data
a:
177771
1777721
.text
main:
load %x0, $a, %x3
@ -8,7 +8,7 @@ init:
addi %x3, 0, %x11
addi %x3, 0, %x17
addi %x0, 1, %x15
addi %x0, 0, %x17
addi %x0, 0, %x16
forloop:
divi %x3, 10, %x3
muli %x15, 10, %x15
@ -19,12 +19,12 @@ end1:
forloop1:
divi %x11, 10, %x11
mul %x31, %x15, %x3
add %x17, %x3, %x17
add %x16, %x3, %x16
divi %x15, 10, %x15
beq %x11, 0, end2
jmp forloop1
end2:
beq %x17, %x17, write1
beq %x16, %x17, write1
subi %x10, 1, %x10
end
write1:

View File

@ -14,7 +14,7 @@ round:
check:
beq %x31, 0, notAnswer
addi %x3, 1, %x3
blt %x3, %x4, round
blt %x3, %x11, round
Answer:
addi %x0, 1, %x10
end

BIN
assignment-4/Report.pdf Normal file

Binary file not shown.