Skip to content

Commit

Permalink
add 操作数
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiewyjson committed May 9, 2023
1 parent d7dc145 commit ae7550a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/3.程序的机器级表示.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## 操作数指示符



- 立即数(`immediate`),表示常数值

- 寄存器(`register`),**表示某个寄存器的内容**

- 内存引用,根据计算出来的地址访问某个内存位置

寻址模式组成:

- 立即数偏移`Imm`
- 基址寄存器`rb`
- 变址寄存器`ri`
- 比例因子`s`(s 是`1,2,4,8`).
- 有效地址的计算:`Imm+R[rb]+s*[ri]`

![image-20230507234057757](https://raw.githubusercontent.com/Jiewyjson/P/main/md/v1/202305072341281.png)

### 数据传送指令

> `MOV`类,使用字符(`b`,`w`,`l`,`q`)来指定数据的大小(字节,字,双字,四字).
>
> `movl` 以寄存器为目的时,会把寄存器的高位四字节设为`0`.
>
> `movabsq` 能以任意64位立即数作为源操作数,并且目的只能是寄存器
>
> `movz` 把目的中剩余的字节填充为`0`,`movs` 通过符号扩展填充
>
> `cltq` 只作用与寄存器`%eax` ` %rax`.
2 changes: 2 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
- [cs](./cs.md)
- [csapp](./csapp.md)
- [2.信息的表示和处理](./2.信息的表示和处理.md)
- [3.程序的机器级表示](./3.程序的机器级表示.md)
- [网络](./网络.md)
- [http](http.md)
- [概述](./概述.md)
- [数据库](./数据库系统.md)


- [rust_learning](./rust_index.md)
Expand Down
Binary file added src/assets/image-20230507234057757.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/csapp.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# cs:app

[2.信息的表示和处理](./2.信息的表示和处理.md)
[2.信息的表示和处理](./2.信息的表示和处理.md)

[3.程序的机器级表示](./3.程序的机器级表示.md)
Empty file added src/数据库系统.md
Empty file.

0 comments on commit ae7550a

Please sign in to comment.