Architecture - Chapter 6

  1. Simple (non-nested) procedure call (in MIPS)
    • jal proc
    • # Rest of calling procedure ...

    • proc:
    •   # Do stuff
    •   jr $ra
  2. jal stands for
    Jump and link
  3. What registers should arguments be placed in for procedure calls?
    $a0 - $a3
  4. What registers should data be placed in to be output from a procedure call?
    $v0 - $v1
  5. Non-nested procedure call sequence of actions
    • 1. Put arguments in registers $a0 - $a3
    • 2. Transfer control to the procedure using jal
    • 3. Acquire storage space (if needed)
    • 4. Perform the task
    • 5. Place results in registers $v0 - $v1
    • 6. Return to the calling procedure using jr $ra
  6. How is overwriting data in registers prevented?
    The newly called procedure will save the results of registers it will use before it performs it's actions. Then, it restores them before it returns to the calling procedure.
  7. $sp stands for
    Stack pointer
  8. $fp stands for
    Frame pointer
  9. Which pointer is "on top" of the stack?
    The stack pointer
  10. What is the purpose of $fp
    To "frame" the current function, or region of the stack
  11. MiniMIPS memory regions (lowest address (0) to highest)
    • Reserved area for OS
    • Program text segment
    • Static data segment
    • Dynamic data segment
    • The stack
  12. Which regions of MiniMIPS memory are in the data segment?
    • Static data segment
    • Dynamic data segment
  13. $gp points to
    The start of the dynamic data segment
  14. Order of variables on the stack
    • 1. Saved registers
    • 2. Local variables
  15. MiniMIPS loading and storing byte instructions
    • lb
    • lbu
    • sb
  16. MiniMIPS lb instruction
    • Stands for "load byte"
    • Loads a single byte from main memory
    • The register is sign-extended
  17. MiniMIPS lbu instruction
    • Stands for "load byte unsigned"
    • Loads a single byte from memory, treats it as unsigned value
    • The register is zero-extended
  18. MiniMIPS sb instruction
    • Stands for "store byte"
    • Stores a byte into memory
  19. Methods of accessing an array
    • Pointer - Store the address of the current element and increment it directly
    • Index - Store an index and add it to some base address to access an element
  20. MiniMIPS multiplication/division instructions
    • mult
    • div
    • mfhi
    • mflo
  21. MiniMIPS mult instruction
    • $hi becomes rsrt
    • $lo becomes rsrt
  22. MiniMIPS div instruction
    • $hi becomes rs mod rt
    • $lo becomes rsrt
  23. MiniMIPS mfhi instruction
    Moves the content of $hi to rd
  24. MiniMIPS mflo instruction
    Moves the content of $lo to rd
  25. MiniMIPS logical shift instructions
    • sll
    • srl
    • sllv
    • srlv
  26. MiniMIPS sll instruction
    • Shifts the value addressed by rt left by sh places
    • Places value in rd
  27. MiniMIPS srl instruction
    • Shifts the value addressed by rt right by sh places
    • Places value in rd
  28. MiniMIPS sllv instruction
    • Shifts the value addressed by rt left by the number of places in specified by a register given by rs
    • Places value in rd
  29. MiniMIPS sllv instruction
    • Shifts the value addressed by rt right by the number of places in specified by a register given by rs
    • Places value in rd
  30. Which MiniMIPS instructions have unsigned versions
    InstructionUnsigned version
    addaddu
    subsubu
    multmultu
    divdivu
    addiaddiu
Author
Ant
ID
357877
Card Set
Architecture - Chapter 6
Description
Updated