Translate this code into MIPS64 assembly language Addresses

Translate this code into MIPS64 assembly language.

Addresses: a@800, b@808, c@816

double a, b, c;

if( a!=b && a>50 ) c = 1;

else c = 0;

Solution

main:
        daddiu $sp,$sp,-48
        sd      $fp,40($sp)
        move    $fp,$sp
        lui     $3,%hi(%neg(%gp_rel(main)))
        daddu   $3,$3,$25
        daddiu $3,$3,%lo(%neg(%gp_rel(main)))
        ldc1    $f1,8($fp)
        ldc1    $f0,16($fp)
        c.eq.d $fcc0,$f1,$f0
        bc1t    $fcc0,.L2
        nop

        ldc1    $f1,8($fp)
        ld      $2,%got_page(.LC0)($3)
        ldc1    $f0,%got_ofst(.LC0)($2)
        c.lt.d $fcc1,$f0,$f1
        bc1f    $fcc1,.L2
        nop

        ld      $2,%got_page(.LC1)($3)
        ldc1    $f0,%got_ofst(.LC1)($2)
        sdc1    $f0,24($fp)
        b       .L4
        nop

.L2:
        sd      $0,24($fp)
.L4:
        move    $2,$0
        move    $sp,$fp
        ld      $fp,40($sp)
        daddiu $sp,$sp,48
        j       $31
        nop

Translate this code into MIPS64 assembly language. Addresses: a@800, b@808, c@816 double a, b, c; … if( a!=b && a>50 ) c = 1; else c = 0;Solutionmain

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site