当前位置:网站首页>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 nameexample : 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
边栏推荐
- Resume of a microservice architecture teacher with 10 years of work experience
- 唯有学C不负众望 TOP2 p1变量
- Yum install XXX reports an error
- ~79 Movie card exercise
- 控制转移指令
- Notes on how the network is connected
- 我走过最迷的路,是字节跳动程序员的脑回路
- @RestController、@Controller
- 7-8 likes (need to continue to improve)
- Cartesian tree (modified)
猜你喜欢

When it comes to Google i/o, this is how ByteDance is applied to flutter

100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021

汇编语言寻址方式
![[unsolved]7-14 calculation diagram](/img/33/39802c0106f2bef4b9979e5ae12b83.jpg)
[unsolved]7-14 calculation diagram

Shell_ 05_ operator

Full record of ByteDance technology newcomer training: a guide to the new growth of school recruitment

姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?

7-10 punch in strategy

~84 form supplement

~83 form introduction
随机推荐
Solr new core
Usage of insert() in vector
~72 horizontal and vertical alignment of text
The QT program compiled on CentOS lacks a MySQL driven solution
汇编语言基础知识
Record the error reason: terminate called after throwing an instance
7-5 blessing arrived
TCP的三次握手和四次挥手
Activiti directory (I) highlights
Fdog series (4): use the QT framework to imitate QQ to realize the login interface, interface chapter.
~86m rabbit practice
Eureka high availability
Activiti目录(四)查询代办/已办、审核
DS18B20数字温度计系统设计
100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
Solr standalone installation
Eight part essay that everyone likes
Shell_ 07_ Functions and regular expressions
The 116 students spent three days reproducing the ByteDance internal real technology project
唯有学C不负众望 TOP1环境配置







