Please help In assembly language Thank you NOT IN MATLAB For

Please, help. In assembly language. Thank you. NOT IN MATLAB.

For this assignment, you will write a main routine in which at the end of execution: v0 = the sum of even positive integers between 1 and 1000. # calculate this sum t0 = v0* v0 # square the sum if(t0 has a greater value than can be represented in a 32 bit word) v1 = -1 else v1 = t0

Solution

Solution :- .file 1 \"\" .section .mdebug.abi32 .previous .gnu_attribute 4, 1 .abicalls .text .align 2 .globl main $LFB0 = . .set nomips16 .ent main .type main, @function main: .frame $fp,32,$31 # vars= 16, regs= 1/0, args= 0, gp= 8 .mask 0x40000000,-4 .fmask 0x00000000,0 .set noreorder .set nomacro addiu $sp,$sp,-32 $LCFI0: sw $fp,28($sp) $LCFI1: move $fp,$sp movz $31,$31,$0 $LCFI2: sw $0,20($fp) sw $0,16($fp) li $2,1 # 0x1 sw $2,20($fp) b $L2 nop $L3: lw $3,16($fp) lw $2,20($fp) nop addu $2,$3,$2 sw $2,16($fp) lw $2,20($fp) nop addiu $2,$2,1 sw $2,20($fp) $L2: lw $2,20($fp) nop slt $2,$2,101 andi $2,$2,0x00ff bne $2,$0,$L3 nop lw $3,16($fp) lw $2,16($fp) nop mult $3,$2 mflo $2 sw $2,12($fp) lw $3,12($fp) li $2,32768 # 0x8000 slt $2,$3,$2 bne $2,$0,$L4 nop li $2,-1 # 0xffffffffffffffff sw $2,8($fp) b $L5 nop $L4: lw $2,12($fp) nop sw $2,8($fp) $L5: move $2,$0 move $sp,$fp lw $fp,28($sp) addiu $sp,$sp,32 j $31 nop .set macro .set reorder .end main $LFE0: .size main, .-main .ident \"GCC: (Debian 4.4.5-8) 4.4.5\"
Please, help. In assembly language. Thank you. NOT IN MATLAB. For this assignment, you will write a main routine in which at the end of execution: v0 = the sum

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site