How to convert double value to integer value in MIPS? -


if have in mips : li.d $f0,4.5

my question : how convert double value integer value in mips... how can cast value in register $f0 4 ???

here's sequence works. can use $f0 instead of $f2 if want:

    .text     .globl  main main:     li.d        $f0,4.5     cvt.w.d     $f2,$f0             # f2 have 4      # print integer     mfc1        $a0,$f2     li          $v0,1     syscall      # exit program     li          $v0,10     syscall 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -