printList((p)next)课件.pptVIP

  • 2
  • 0
  • 约5.55千字
  • 约 9页
  • 2017-08-16 发布于河南
  • 举报
printList((p)next)课件

The MIPS stack: recap The stack grows downward in terms of memory addresses. The address of the top element of the stack is stored (by convention) in the “stack pointer” register, $sp. 0($sp), 1($sp), … are “used” locations -1($sp), -2($sp), … are “free” MIPS does not provide “push” and “pop” instructions. Instead, they must be done explicitly by the programmer. “push” $t0 simulated with: sub $sp, $sp, 4 # $t0 needs 4 bytes sw $t0, 0($sp) # write to stack “pop” $t0 simulated with: lw $t0, 0($sp) # read stack top addi $sp, $sp, 4 # free 4 bytes 0x7FFFFFFF 0$sp stack 堤惟猪盾妮矮蝗良花邪

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档