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

Using only MIPS integer instructions, write a function that will make x = (y < z

ID: 3686211 • Letter: U

Question

Using only MIPS integer instructions, write a function that will make x = (y < z) where x is an integer and y and z are positive floating-point numbers. The resulting value of x should be the integer 0 or 1. Your function only needs to handle positive normal float values correctly, not negative values, NaN, etc. (Hint: the weightings of bit positions are different for floats and integers, but bits have less significance as you move to lower positions in both integers and floats.)

Using only MIPS integer instructions, write a function that will make x = (y

Explanation / Answer

.Ltext0: .section .rodata.str1.1,"aMS",@progbits,1 .LC0: 0000 456E7465 .string "Enter y and z: " 72207920 616E6420 7A3A200A 00 .LC1: 0011 25662566 .string "%f%f" 00 .LC3: 0016 496E7661 .string "Invalid" 6C696400 .section .text.unlikely,"ax",@progbits .LCOLDB4: .section .text.startup,"ax",@progbits .LHOTB4: .p2align 4,,15 .section .text.unlikely .Ltext_cold0: .section .text.startup .globl main main: .LFB13: .cfi_startproc 0000 4883EC18 subq $24, %rsp .cfi_def_cfa_offset 32 .LBB8: .LBB9: 0004 BE000000 movl $.LC0, %esi 00 0009 BF010000 movl $1, %edi 00 .LBE9: .LBE8: 000e 64488B04 movq %fs:40, %rax 25280000 00 0017 48894424 movq %rax, 8(%rsp) 08 001c 31C0 xorl %eax, %eax .LVL0: .LBB11: .LBB10: 001e E8000000 call __printf_chk 00 .LVL1: .LBE10: .LBE11: 0023 488D5424 leaq 4(%rsp), %rdx 04 0028 31C0 xorl %eax, %eax 002a 4889E6 movq %rsp, %rsi 002d BF000000 movl $.LC1, %edi 00 0032 E8000000 call __isoc99_scanf 00 .LVL2: 0037 660FEFC0 pxor %xmm0, %xmm0 003b F20F2A04 cvtsi2sd (%rsp), %xmm0 24 0040 660F2E05 ucomisd .LC2(%rip), %xmm0 00000000 0048 7617 jbe .L6 .L2: 004a 31C0 xorl %eax, %eax 004c 488B4C24 movq 8(%rsp), %rcx 08 0051 6448330C xorq %fs:40, %rcx 25280000 00 005a 7518 jne .L7 005c 4883C418 addq $24, %rsp .cfi_remember_state .cfi_def_cfa_offset 8 0060 C3 ret .L6: .cfi_restore_state .LVL3: .LBB12: .LBB13: 0061 BE000000 movl $.LC3, %esi 00 0066 BF010000 movl $1, %edi 00 006b 31C0 xorl %eax, %eax 006d E8000000 call __printf_chk 00 .LVL4: 0072 EBD6 jmp .L2 .LVL5: .L7: .LBE13: .LBE12: 0074 E8000000 call __stack_chk_fail 00 .LVL6: .cfi_endproc .LFE13: .section .text.unlikely .LCOLDE4: .section .text.startup .LHOTE4: .section .rodata.cst8,"aM",@progbits,8 .align 8 .LC2: 0000 00000000 .long 0 0004 00000000 .long 0 .text .Letext0: .section .text.unlikely .Letext_cold0:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote