Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.18 KB | None | 0 0
  1. TRANSLATING AN ASSEMBLY CODE TO BINARY FOR R FORMAT
  2. |OP|RS|RT|RD|SHAMT|FUNCT|
  3. Op code 6 bits
  4. First source code 5 bits
  5. Second source code 5 bits
  6. Destination code 5 bits
  7. Shift amount  6 bits
  8. Function code extends OP code 6 bits
  9.  
  10. OP    RS blank RT=$t0 RD
  11.  OP     DEST              RS                    RT                                                                   SHAMT       Funct    
  12. ADD $T0(RDest),$$(RSource 1),$$(RT source 2) adds $$ and $$ to $T0 |shiftamt 0| Funct = 32|
  13. 0             0-31 (17)    0-31 (18)          0-31(8)                  |     0        |                                                 32
  14. OPcode000000   17unsigned 10001| 18unsigned 10010| 8uns 01000| 00000SHIFTAMT|  100000FUNCT
  15.                   OP                       RS                    RT                                        RD             SHAMT                   FUNCT
  16.  
  17. 0x0 | 2| 3| 4| 0| 2| 0|
  18. I FORMAT
  19.  
  20. |OP|RS|RT|CONSTANT/ADDRESS|
  21. Immediate arithmetic and load/store
  22. RT dest
  23. Constant -2^15-2^15-1
  24. OP  RT   RS|ADDRESS
  25. LW $t1 8($S0)
  26. Removes from third spot in the array. And places in to $T1 register
  27. OP| RS| RT| Address/integer/constant|
  28. 6BIT5BIT5BIT                16BIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement