Skip to content

Commit

Permalink
Update example.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ksitta authored Oct 21, 2024
1 parent fa66a7f commit c901dc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/step9/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ T0 = CALL foo(T1, T2)

`T1``T2`作为被调用函数`foo`的实参,而调用后的返回值保存在`T0`中。

实际上这与高级语言的函数语义非常相似。你可能会觉得一个与源语言语义几乎没差别的中间代码函数调用指令有点多余,所以我们也提供了另一种方案。
实际上这与高级语言的函数语义非常相似。你可能会觉得一个与源语言语义几乎没差别的中间代码函数调用指令有点多余,所以我们也提供了另一种方案**不推荐按照这样实现,可能会造成数据流分析困难**

> 在早先的文档中,函数调用涉及`CALL``PARAM`两种指令。`CALL`指令只对应实际汇编代码的函数调用,而`PARAM T0`指令用于传递一个参数。
> 假设我们有若干个参数,可以依次使用 PARAM 命令将它们加入参数列表。在调用函数时,这些参数的值会自动依次按顺序装载到临时变量 _T0, _T1 ... 中。比如我们有这样一段 TAC 程序**不推荐按照这样实现,可能会造成数据流分析困难**
> 假设我们有若干个参数,可以依次使用 PARAM 命令将它们加入参数列表。在调用函数时,这些参数的值会自动依次按顺序装载到临时变量 _T0, _T1 ... 中。比如我们有这样一段 TAC 程序:
```assembly
PARAM A
Expand Down

0 comments on commit c901dc0

Please sign in to comment.