Assembly review (3)-pseudo-instructions and operators

One, pseudo-instruction

1. Segment definition

data segment
	buff db 'ABC'
data ends
code segment
assume cs:code,ds:code
start: mov ax,data
		mov ds,ax
		mov ah,9
		int 21h
code ends
end start

2. The beginning and end of the program

END [lable]

3. Data definition and storage unit allocation
Format:

[变量]	操作码	n个操作数

Operation code:

DB byte
DW word
DD double word
DF 6 byte word
DQ 4 word
DT 10 byte word

4. Type attribute operator

WORD PTR

Word type

BYTE PTR

Byte type

5. THIS operator and LABLE pseudo operation

6. Expression assignment directives EQUand=

7. Address counter $and definition directive

(1) $
Represents the value of the current address counter
(2) ORG
Used to set the value of the current address counter
(3) The
next variable/instruction of EVEN starts at an even address
(4) The
next variable/instruction of ALIGN starts at a multiple of 4
8. Process Definition directive

procedure_name PROC Attribute
...
procedure_name ENDP

Second, the operator

1. The arithmetic operators
+, -, *, / and MOD MODrefer to the division operation余数

2. Logic and logical shift operators
Logical operators: AND, OR, XOR, NOT
Logical shift operators: SHL, SHR

3. The relational operator
EQ, NE is equal to/not equal to
LT, GT is less than/greater than
LE, GE is less than or equal to/greater than or equal to the
calculation result is a logical value, true FFFFH, false0

4. The numeric return operator
(1) TYPE
returns the type of the variable expressed in bytes,

DB:1
DW:2
DD:4,
DF:6
DQ:8
DT:10
NEAR:-1
FAR:-2

(2) LENGTH
Return the total number of variables copied by DUP, others are1

Eg:
MESSAGE 4 DUP(0)

Then LENGTH MESSAGE = 4
(3) OFFSET
Return offset address
(4) SEG
Return segment address

Guess you like

Origin blog.csdn.net/syy0201/article/details/103110567