1,
Assembly instructions: With the corresponding machine code instructions, are compiled into machine instructions, and ultimately by the CPU execution.
Pseudo-directive: The compiler executes instructions that the compiler performs related to the compilation work.
2,
Segment and ends define the beginning of a segment, instructions, data, and stacks are divided into different stacks.
End indicates a assembler ending, assume assumes that a section register is associated with a segment defined by Segment...ends.
After end, label the compiler program portal and set the CS:IP.
3,
MOV cx,3
S
???? Add???? Ax,ax
???? Loop s
When performing loop, CX minus 1, if CX does not bit 0 jump to s place.
4,
and al,01110011b
or al,00111010b
5,
Segment Register: DS, SS, CS, ES;
Registers: AX, BX, CX, DX,
???? Ah, AL, BH, BL, CH, cl, DH, DL,
???? SP, BP, Si, di.
6,
[BX], [Bx+si], [Bx+di], [bx+si+3], [bx+di+3] segment are DS;
[BP], [Bp+si], [Bp+di], [bp+si+5], [bx+di+5] segments are SS.
7,
division, which can be followed by a register or an inner deposit element.
Div Register
div Memory Unit
Al = 16-bit/8-bit; ah = 16-bit% 8-bit.
Ax= 32-bit/16-bit, DX = 32-bit% 8-bit.
Status quotient, high surplus.
div word ptr [dx+si+8];ax is the quotient of the memory unit value for AX, and DX is the remainder of the memory unit that is modified for AX.
8,
DUP data replication
DB 3 dup (0); 0 0 0
DB 3 dup (0, 0,1,2), 0,1,2, 0,1,2
DB a data one byte; DW a data one word word, double byte; dd a data double word, four bytes.
9,
Operator offset gets the offset address of the label, which is the symbol processed by the compiler.
mov ax, offset start; To assign a value to the shift address of start to ax
10,
JMP unconditionally jumps by modifying IP or CS:IP.
JMP short designator; ip = IP + (8-bit displacement)
JMP near PTR marking; IP = IP + (16-bit displacement)
Short is an intra-paragraph transfer, the IP modification range is ( -128--127) before and after 2 of the 7-time Square
Near the PTR segment, the range is ( -32768--32767) before and after 2 of the 15-time Square
This displacement is not the destination address of the label, it is the difference between the current IP value and the position of the label that is computed from the label position, and JMP assigns a value to the IP to make it jump based on the relative displacement position plus the current IP's worth to the label position.
Transfer between segments:
JMP far ptr designator, cs= designator segment cs,ip= label segment IP
JMP Ax; IP = ax
JMP word ptr ds:[0]; ip = ds:[0]
JMP DWORD ptr ds:[0]; ip = ds:[0], cs = ds:[2]
11,
JCXZ marking; if (CX ==0) {JMP short designator}
loop marking; cx--; if (cx!=0) {JMP short designator}
Ret Pop IP
RETF;p op IP and POP CS
Call label; push IP and jmp near PTR label
Call Ax; Push IP and jmp near PTR ax
Call word ptr ds:[0]; ibid.
12,
Multiplication, followed by a register or an inner deposit element.
Mul Register
Mul Memory Unit
If 8-bit multiplier results are placed in Microsoft Dynamics AX, 18-bit multiply-place DX low-position ax
Mul byte [0]; Ax = Al * Ds:[0]
Mul BX; AX = low value of ax*bx, DX = ax*bx High value
13,
Add ax, 9; AX = ax + 9
Sub Ax, 5; Ax = ax–9
Inc AX; AX = ax + 1
Dec ax; Ax = ax-1
Compilation: Some Syntax 1