Skip to content

Commit 69e660f

Browse files
Update p4-lab1.md
1 parent d4e1098 commit 69e660f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lec2/p4-lab1.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md
621621
.section .text.entry
622622
.globl _start
623623
_start:
624-
la sp, boot_stack_top
624+
la sp, boot_stack_top
625625
call rust_main
626626
627627
.section .bss.stack
@@ -631,6 +631,16 @@ boot_stack:
631631
.globl boot_stack_top
632632
boot_stack_top:
633633
```
634+
<!--la sp, boot_stack_top 将栈顶地址 boot_stack_top 加载到栈指针寄存器 sp 中,这个操作初始化了栈。
635+
636+
.globl boot_stack 栈的起始地址。
637+
638+
.space 4096 * 16分配 4096 * 16 字节(即 64 KB)的栈空间。这种分配方式常用于规定栈的最大尺寸。
639+
640+
globl boot_stack_top 和 boot_stack_top::
641+
642+
声明并定义一个全局标签 boot_stack_top,表示栈的顶部。
643+
-->
634644

635645
---
636646
#### 分配并使用启动栈

0 commit comments

Comments
 (0)