当前位置:网站首页>汇编语言之栈
汇编语言之栈
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指向当前栈顶下面的单元,以当前栈顶下的单元为新的栈顶。
边栏推荐
- 多线程间的通信方式你知道几种?
- C language -- ring buffer
- There are n steps in total, and you can go up to 1 or 2 steps each time. How many ways are there?
- 2千兆光+6千兆电导轨式网管型工业级以太网交换机支持X-Ring冗余环网一键环网交换机
- 数据湖(二十):Flink兼容Iceberg目前不足和Iceberg与Hudi对比
- 返回字符串中的最大回文数
- 瑞能微计量芯片RN2026的实用程序
- 出海季,互联网出海锦囊之本地化
- 2022.8.3-----leetcode.899
- Dong mingzhu live cold face away, when employees frequency low-level mistakes, no one can understand their products
猜你喜欢
复制带随机指针的链表
2千兆光+6千兆电导轨式网管型工业级以太网交换机支持X-Ring冗余环网一键环网交换机
There are too many systems, how to realize multi-account interworking?
sqoop ETL工具
[Medical Insurance Science] To maintain the safety of medical insurance funds, we can do this
说说数据治理中常见的20个问题
sqoop ETL tool
Zabbix set up email alert + enterprise WeChat alert
一文详解DHCP原理及配置
Countdown to 2 days, the "New Infrastructure of Cultural Digital Strategy and Ecological Construction of Cultural Art Chain" will kick off soon
随机推荐
new Date converts strings into date formats Compatible with IE, how ie8 converts strings into date formats through new Date, how to replace strings in js, and explain the replace() method in detail
Zabbix set up email alert + enterprise WeChat alert
Gigabit 2 X light 8 electricity management industrial Ethernet switches WEB management - a key Ring Ring net switch
Mockito unit testing
QNX Hypervisor 2.2用户手册]10.1 通用vdev选项
docker+网桥+redis主从+哨兵模式
ingress 待完善
How many ways do you know about communication between multiple threads?
2022.8.3-----leetcode.899
base address: environment variable
SQL injection in #, - +, - % 20, % 23 is what mean?
一文详解DHCP原理及配置
C language -- ring buffer
[QNX Hypervisor 2.2用户手册]10.3 vdev gic
Flink原理流程图简单记录
数据湖(二十):Flink兼容Iceberg目前不足和Iceberg与Hudi对比
Polygon zkEVM网络节点
深度学习(三)分类 理论部分
基地址:环境变量
如果禁用了安全启动,GNOME 就会发出警告