SHARE
TWEET

Untitled

a guest Nov 21st, 2019 135 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .text
  2. .globl main
  3. main:
  4.  
  5.     li $a0, 4194352
  6.     addi $sp, $sp, -4
  7.     sw $ra, 0($sp)
  8.     jal getOp
  9.     lw $ra, 0($sp)
  10.     addi $sp, $sp, 4
  11.    
  12.     ## preparo tutto per la syscall
  13.    
  14.     add $a0, $0, $v0    #sposto in a0, argomento per la stampa a schermo!
  15.     addi $v0, $0, 1     #codice syscall: print int
  16.     syscall
  17.     jr $ra
  18.    
  19.    
  20. getOp:
  21.     # l'opcode sono i primi sei bit dell'istruzione!
  22.     add $s0, $0, $a0    #sposto in s0
  23.     lw $v0, 0($s0)      #quello che sta in s0
  24.     srl $v0, $v0, 26    #shifto di 26b
  25.     jr $ra
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top