当前位置:网站首页>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
边栏推荐
- 服务器端渲染(SSR)和客户端渲染(CSR)的区别
- 汇编语言段定义
- Train 100 pictures for 1 hour, and the style of the photos changes at will. There is a demo at the end of the article | siggraph 2021
- MySQL数字函数
- 这116名学生,用3天时间复刻了字节跳动内部真实技术项目
- ~77 linear gradient
- yum install xxx报错
- Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
- 原型链继承
- ~81 long table
猜你喜欢

Shell_ 05_ operator

Record the error reason: terminate called after throwing an instance

Shell_ 00_ First meeting shell

Activit零零碎碎要人命的坑

The most lost road I have ever walked through is the brain circuit of ByteDance programmers

服务器端渲染(SSR)和客户端渲染(CSR)的区别

字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题

我走過最迷的路,是字節跳動程序員的腦回路

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

字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
随机推荐
LeetCode 1636. Sort the array in ascending order by frequency
README. txt
算数运算指令
~69 other ways to use icon fonts
Erlang installation
Alibaba cloud server docker installation mysql5.5
Log4j2 major vulnerabilities and Solutions
唯有学C不负众望 TOP5 S1E8|S1E9:字符和字符串&&算术运算符
7-10 punch in strategy
Typescript basic operations
LeetCode 1584. Minimum cost of connecting all points
Install docker under windows10 (through Oracle VM VirtualBox)
Notes on how the network is connected
~75 background
Introduction to microservices
Thank you for your invitation. I'm in the work area. I just handed in the code. I'm an intern in the next ByteDance
Activiti目录(三)部署流程、发起流程
冯诺依曼体系结构
(multiple methods, need to continue to see) 7-11 go deep into the tiger's Den
The difference between URI and URL







