Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer if you are 100% it works please Write a complete MIPS-32 assembly

ID: 3811462 • Letter: P

Question

Please answer if you are 100% it works please

Write a complete MIPS-32 assembly language program including data declaration that uses a function“Eval_Z” which evaluates the following expression Z = X - 3 (Y / 8 + 125). Assume that callerprogram passes the values of X and Y to the function using registers $a0 and $a1 respectively whilethe result of executing the function is returned to the caller in register $v0. The caller program shoulddisplay the result on the console preceded by an appropriate message. Test your program using thefollowing values (X1, Y1) = (100, 24) and (X1, Y1) = (100, 21)

Explanation / Answer

$Ltext0:
$LFB0 = .
Eval_Z(int, int):
addiu $sp,$sp,-16
sw $fp,12($sp)
move $fp,$sp
sw $4,16($fp)
sw $5,20($fp)
sw $0,4($fp)
lw $2,20($fp)
bgez $2,$L2
nop

addiu $2,$2,7
$L2:
sra $2,$2,3
addiu $3,$2,125
move $2,$3
sll $2,$2,1
addu $2,$2,$3
subu $2,$0,$2
lw $3,16($fp)
addu $2,$2,$3
sw $2,4($fp)
lw $2,4($fp)
move $sp,$fp
lw $fp,12($sp)
addiu $sp,$sp,16
j $31
nop

$LFE0:
$LC0:
$LFB1 = .
main:
addiu $sp,$sp,-40
sw $31,36($sp)
sw $fp,32($sp)
move $fp,$sp
lui $28,%hi(__gnu_local_gp)
addiu $28,$28,%lo(__gnu_local_gp)
sw $0,28($fp)
li $5,24 # 0x18
li $4,100 # 0x64
jal Eval_Z(int, int)
nop

lw $28,16($fp)
sw $2,28($fp)
lw $5,28($fp)
lui $2,%hi($LC0)
addiu $4,$2,%lo($LC0)
lw $2,%call16(printf)($28)
move $25,$2
1: jalr $25
nop

lw $28,16($fp)
move $2,$0
move $sp,$fp
lw $31,36($sp)
lw $fp,32($sp)
addiu $sp,$sp,40
j $31
nop

$LFE1:
$Letext0:
$Ldebug_info0:
$Ldebug_abbrev0:
$Ldebug_line0:
$LASF6:
$LASF0:
$LASF1:
$LASF12:
$LASF3:
$LASF7:
$LASF11:
$LASF14:
$LASF10:
$LASF15:
$LASF8:
$LASF13:
$LASF2:
$LASF4:
$LASF5:
$LASF9:

For reference please visit :

http://www.oocities.org/codeteacher/x86asm/asml1002.html

https://www.tuto

rialspoint.com/assembly_programming/index.htm

https://www.jdoodle.com/compile-assembler-nasm-online

and some converters by which you can convert any language to any language

https://godbolt.org/

https://www.tuto

rialspoint.com/compile_assembly_online.php

If you have any problem then please don't hesitate to mail me at pratap_mishra@hotmail.com.