当前位置:网站首页>汇编语言之栈
汇编语言之栈
2022-08-04 03:06:00 【每天一道题】
基本概念
基本操作
1.入栈:将一个新的元素放到栈顶。
2.出栈:从栈顶取出一个元素。
操作规则:LIFO(后进先出)。
CPU提供的栈机制
PUSH入栈与POP出栈。
push ax:将寄存器ax中的数据送入栈中。
pop ax:从栈顶取出数据送入ax。
注:8086CPU的入栈和出栈操作都是以字为单位进行的。
在8086CPU中,有两个寄存器:
段寄存器SS:存放栈顶的段地址。
寄存器SP:存放栈顶的偏移地址。
且任意时刻SS:SP都指向栈顶元素。
PUSH和POP
push ax
1.SP = SP - 2;
2.将ax中的内容送入SS:SP指向的内存单元处,此时SS:SP指向新栈顶。
pop ax
1.将SS:SP指向的内存单元处的数据送入ax中;
2.SP = SP + 2,SS:SP指向当前栈顶下面的单元,以当前栈顶下的单元为新的栈顶。

边栏推荐
- 【项目实现】Boost搜索引擎
- LeetCode每日一题(2285. Maximum Total Importance of Roads)
- Y86. Chapter iv Prometheus giant monitoring system and the actual combat, Prometheus storage (17)
- 为什么用Selenium做自动化测试
- [QNX Hypervisor 2.2 User Manual] 10.3 vdev gic
- Detailed analysis of scaffolding content
- STM8S105k4t6c---------------Light up LED
- Gigabit 2 X light 8 electricity management industrial Ethernet switches WEB management - a key Ring Ring net switch
- 架构实战营模块三作业
- Big guys, it takes a long time to read mysql3 million single tables, what parameters can be discounted, or is there any way to hurry up
猜你喜欢

Polygon zkEVM网络节点
![[Study Notes Dish Dog Learning C] Dynamic Memory Management](/img/57/a1837e5eec2af0e684e5895a8afed0.png)
[Study Notes Dish Dog Learning C] Dynamic Memory Management

自定义通用分页标签01

《nlp入门+实战:第八章:使用Pytorch实现手写数字识别》

系统太多,多账号互通如何实现?

MySQL查询优化与调优

Pine Script | How to display and typeset a plot switch?

Flink原理流程图简单记录

Architecture of the actual combat camp module three operations

一文看懂推荐系统:召回05:矩阵补充、最近邻查找,工业界基本不用了,但是有助于理解双塔模型
随机推荐
MySQL查询优化与调优
4路双向HDMI综合业务高清视频光端机8路HDMI高清视频光端机
[QNX Hypervisor 2.2 User Manual] 10.3 vdev gic
一文看懂推荐系统:召回04:离散特征处理,one-hot编码和embedding特征嵌入
pytorch applied to MNIST handwritten font recognition
Utilities of Ruineng Micrometer Chip RN2026
C language -- ring buffer
董明珠直播时冷脸离场,员工频犯低级错误,自家产品没人能弄明白
【学习笔记之菜Dog学C】动态内存管理
How to read the resources files in the directory path?
QNX Hypervisor] 10.2 vdev 8259 2.2 user manual
Mockito unit testing
STM8S-----选项字节
Development of Taurus. MVC WebAPI introductory tutorial 1: download environment configuration and operation framework (including series directory).
STM8S105K4T6------串口发送和接收
逻辑漏洞----其他类型
JVM内存和垃圾回收-07.堆
QNX Hypervisor 2.2用户手册]10.1 通用vdev选项
SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropri
数据安全峰会2022 | 美创DSM获颁“数据安全产品能力验证计划”评测证书