当前位置:网站首页>Assembly language segment definition
Assembly language segment definition
2022-07-06 17:02:00 【My71】
Three steps for segment definition
Segment definition
keyword :segment( Start ) ends( end )
Paragraph name : No more than eight characters . In general ,
- code Represents a code snippet .
- data Represents a data segment
grammar
Paragraph name segment Paragraph name ends
Segment Association
keyword :assume
type :CS( Code segment )、DS( Data segment )、SS( stack segment )、ES( Additional segment )
grammar :
assume type : Paragraph name
example : Define a code snippet code, Define a data segment data
code segment assume cs:code,ds:data code ends data segment data ends
Segment transmission
Transfer is to transfer the data in the segment to the specified segment register . for example , speak data The data in is transmitted to DS In data segment , There is no real transfer of data during Association .
Code segments do not need segment transfer when defining , Other segments need to be transferred manually .
adopt mov Segments cannot be passed directly to segment registers , It can be transmitted indirectly .
…… mov ax,data mov ds,ax ……
This code means , Will now data Save the data segment to ax in , then ax Save the data in to ds in .
Data segment
Pseudo instructions for opening up space
- db: Open up a byte space .
- dw: Open up a word space .( Two bytes )
- dup: Cycle to store characters
Store the data
- Storage 10 Hexadecimal data , Direct write .
- When storing character data, use single quotation marks , In the end in debug In this mode, the real thing is this character ASCII code 16 Base representation .
Grammar format
No address symbol
With address symbols
Code demonstration
Use db Definition 5 An odd number , Save the first number to AH in , The last number is saved to AL in .
Final ,AX=0109, Exactly AH And AL The joining together of .
Use dw Definition 5 An odd number , Deposit in AX in .
utilize dup Open up three single byte spaces
data segment str db 3 dup(5) data ends code segment assume cs:code,ds:data main: mov ax,data mov ds,ax edit: mov ah,4ch int 21h code ends end main
边栏推荐
- 字节跳动技术新人培训全记录:校招萌新成长指南
- Restful style interface design
- Typescript basic operations
- ~83 form introduction
- DS18B20数字温度计系统设计
- 冯诺依曼体系结构
- LeetCode 1566. Repeat the pattern with length m at least k times
- Design of DS18B20 digital thermometer system
- Only learning C can live up to expectations top5 S1E8 | S1E9: characters and strings & arithmetic operators
- LeetCode 1637. The widest vertical area between two points without any point
猜你喜欢
100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
Eight part essay that everyone likes
Data config problem: the reference to entity 'useunicode' must end with ';' delimiter.
汇编语言段定义
Eureka single machine construction
Activiti directory (V) reject, restart and cancel process
算数运算指令
Ruoyi-Cloud 踩坑的BUG
Log4j2 major vulnerabilities and Solutions
随机推荐
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
原型链继承
字节跳动春招攻略:学长学姐笔经面经,还有出题人「锦囊」
字节跳动技术面试官现身说法:我最想pick什么样的候选人
Solr word segmentation analysis
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
7-7 ring the stupid bell
ByteDance open source Gan model compression framework, saving up to 97.8% of computing power - iccv 2021
Activiti目录(一)重点介绍
[unsolved]7-14 calculation diagram
redux使用说明
~82 style of table
After idea installs the plug-in, restart the plug-in and disappear
汇编语言寻址方式
LeetCode 1584. Minimum cost of connecting all points
唯有学C不负众望 TOP1环境配置
@RequestMapping、@GetMapping
8086 分段技术
Jedis
~68 Icon Font introduction