Write and test code in
MIPS assembly language program to implement algorithms "The
Non-Restoring Algorithm "of an 8-bit integer
the user shoud insert the number then by the algo well find the
square root
LC0:
.ascii "please enter the number to have Square-Root for it
\000"
.LC1:
.ascii "%u\000"
main:
daddiu $sp,$sp,-48
sd $31,40($sp)
sd $fp,32($sp)
sd $28,24($sp)
move $fp,$sp
lui $28,%hi(%neg(%gp_rel(main)))
daddu $28,$28,$25
daddiu $28,$28,%lo(%neg(%gp_rel(main)))
ld $2,%got_page(.LC0)($28)
daddiu $4,$2,%got_ofst(.LC0)
ld $2,%call16(printf)($28)
move $25,$2
nop
move $5,$fp
ld $2,%got_page(.LC1)($28)
daddiu $4,$2,%got_ofst(.LC1)
ld $2,%call16(scanf)($28)
move $25,$2
nop
move $2,$0
move $sp,$fp
ld $31,40($sp)
ld $fp,32($sp)
ld $28,24($sp)
daddiu $sp,$sp,48
j $31
nop
Get Answers For Free
Most questions answered within 1 hours.