当前位置:网站首页>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
边栏推荐
猜你喜欢
Fdog series (I): think about it. It's better to write a chat software. Then start with the imitation QQ registration page.
~68 Icon Font introduction
Mongodb learning notes
LeetCode 1584. Minimum cost of connecting all points
Redis standalone startup
I'm "fixing movies" in ByteDance
LeetCode 1637. The widest vertical area between two points without any point
The 116 students spent three days reproducing the ByteDance internal real technology project
Shell_ 04_ Shell script
ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
随机推荐
Usage of insert() in vector
MySQL数字函数
冯诺依曼体系结构
姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
~79 Movie card exercise
Record the error reason
谢邀,人在工区,刚交代码,在下字节跳动实习生
Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
Solr word segmentation analysis
Resume of a microservice architecture teacher with 10 years of work experience
逻辑运算指令
Activiti directory (IV) inquiry agency / done, approved
The daemon thread starts redis and modifies the configuration file
Activit零零碎碎要人命的坑
The difference between URI and URL
README. txt
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
Mongodb在node中的使用
Eureka high availability
How to generate six digit verification code