当前位置:网站首页>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
边栏推荐
猜你喜欢

~68 Icon Font introduction

Alibaba cloud server builds SVN version Library

Error occurred during initialization of VM Could not reserve enough space for object heap

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

Install docker under windows10 (through Oracle VM VirtualBox)

~69 other ways to use icon fonts

Redis standalone startup

ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues

The "advertising maniacs" in this group of programmers turned Tiktok advertisements into ar games

was unable to send heartbeat
随机推荐
How to generate six digit verification code
~68 Icon Font introduction
Activiti directory (V) reject, restart and cancel process
谢邀,人在工区,刚交代码,在下字节跳动实习生
Idea resolving jar package conflicts
was unable to send heartbeat
Description of project structure configuration of idea
Eureka single machine construction
字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
(multiple methods, need to continue to see) 7-11 go deep into the tiger's Den
唯有学C不负众望 TOP5 S1E8|S1E9:字符和字符串&&算术运算符
算数运算指令
7-10 punch in strategy
The most lost road I have ever walked through is the brain circuit of ByteDance programmers
Activiti directory (III) deployment process and initiation process
Go language uses the thrift protocol to realize the client and service end reports not enough arguments in call to oprot Writemessagebegin error resolution
LeetCode 1558. Get the minimum number of function calls of the target array
Eureka high availability
Shell_ 06_ Judgment and circulation
Shell_ 05_ operator







