当前位置:网站首页>汇编语言之栈
汇编语言之栈
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指向当前栈顶下面的单元,以当前栈顶下的单元为新的栈顶。

边栏推荐
- 三分建设,七分管理!产品、系统、组织三管齐下节能降耗
- Brush esp8266-01 s firmware steps
- 一个属于程序员的七夕节!
- Dong mingzhu live cold face away, when employees frequency low-level mistakes, no one can understand their products
- QNX Hypervisor] 10.2 vdev 8259 2.2 user manual
- Power button (LeetCode) 215. The first K largest elements in the array (2022.08.03)
- 【原创】启动Win10自带的XPS/OXPS阅读器
- How to read the resources files in the directory path?
- STM8S105k4t6c--------------点亮LED
- QNX Hypervisor 2.2 user manual] 10.1 gm vdev options
猜你喜欢

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

Architecture of the actual combat camp module three operations

Taurus.MVC WebAPI 入门开发教程1:框架下载环境配置与运行(含系列目录)。

Utilities of Ruineng Micrometer Chip RN2026

数据安全峰会2022 | 美创DSM获颁“数据安全产品能力验证计划”评测证书

三分建设,七分管理!产品、系统、组织三管齐下节能降耗

pytorch应用于MNIST手写字体识别

案例 | 重庆银行流动数据安全挑战及应对实践

网络工程师入门必懂华为认证体系,附系统学习路线分享

pytorch applied to MNIST handwritten font recognition
随机推荐
架构实战营模块三作业
QNX Hypervisor 2.2用户手册]10.1 通用vdev选项
How to drop all tables under database in MySQL
Detailed analysis of scaffolding content
单片机C语言->的用法,和意思
TOML configuration file format, YAML's top contender
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
函数,递归以及dom简单操作
How to read the resources files in the directory path?
数据安全峰会2022 | 美创DSM获颁“数据安全产品能力验证计划”评测证书
In a more general sense, calculating the displacement distance and assumptions
activiti流程执行过程中,数据库表的使用关系
用户与用户互发红包/支付宝C2C/B2C现金红包php源码示例/H5方式/兼容苹果/安卓
Zabbix set up email alert + enterprise WeChat alert
kingbaseES V8R2/R3 表在指定表空间,为何显示为默认表空间?
创新互融|华秋赋能助力OpenHarmony生态硬件开发落地
【观察】超聚变:首提“算网九阶”评估模型,共建开放繁荣的算力网络
sql注入一般流程(附例题)
View mysql deadlock syntax
2 Gigabit Optical + 6 Gigabit Electric Rail Type Managed Industrial Ethernet Switch Supports X-Ring Redundant Ring One-key Ring Switch