Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit 227b8af

Browse files
ZecyelCopilot
andauthored
Update docs/lab/lab3.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4295185 commit 227b8af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/lab/lab3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void main(){
317317
318318
> [!NOTE]Problem 4.2 (2 pts)
319319
>
320-
> 二分查找函数中我们使用了 `register int` 保留字,这告诉编译器要把变量存到寄存器而不是内存中,这样做有什么好处<sup>1</sup>?正因如此,在执行完二分查找函数中的**算法部分**,希望返回主函数时,能否直接修改 %rip 的值到 1221 而不做其他事情?还缺少什么步骤?
320+
> 二分查找函数中我们使用了 `register int` 保留字,这告诉编译器要把变量存到寄存器而不是内存中,这样做有什么好处 <sup>1</sup>?正因如此,在执行完二分查找函数中的**算法部分**,希望返回主函数时,能否直接修改 %rip 的值到 1221 而不做其他事情?还缺少什么步骤?
321321
322322
> [1]实际上在现代编译器中,你不需要自己手写 register 关键字。开启优化后,编译器会自动安排变量的位置,找到最优化的一种策略,这基本是现代编译器必备的操作。
323323

0 commit comments

Comments
 (0)