I. Data transfer instructions - ─────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ Data between registers, registers, and input and output ports. 1. Universal data transfer instructions. MOV transmission or bytes. Movsx first symbol extension, then transfer. Movzx first zero extension, then transfer. Push pinch into the stack. Pop Push the word pile. Pusha pressed the AX, CX, DX, BX, SP, BP, SI, DI in the stack. Popa pops up DI, Si, BP, SP, BX, DX, CX, AX, pops up the stack. Pushhad EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI sequentially press the stack. Popad pops EDI, ESI, EBP, ESP, EBX, EDX, ECX, EAX pops up the stack. BSWAP swaps the byte of the 32-bit register Sequentially XCHG exchange word or bytes. (At least one operand is the register, the segment register is not operated as an operand) CmpxCHG compares and exchanges the operand. (The second operator must be accumulator Al / Ax / eax) XADD first exchange Recumet. (Results in the first operation) XLAT byte check table conversion. ─ BX point to the starting point of a 256-byte table, Al is the index value of the table (0-255, 0-FFH) Returns Al is the results of the surfaction table. ([BX Al] -> Al) 2. Enter the output port transfer command. In I / O port input. (Syntax: in accumulator, {port number │DX}) OUT I / O port output. (Syntax: OUT {port number │DX}, accumulator) The input output port is specified by the immediate way, and its range is 0-255; when the register DX is specified, its range is 0-65535. 3. Purpose Address Transfer Directions. Example: Lea DX, String; Departing the offset address to DX. LDS transmission target pointer, put the pointer content into DS. Example: LDS Si, String; Put the segment address: Offset The address exists to the DS: Si. LES Transmit the target pointer, put the pointer content into the ES. Example: les di, string; put the segment address: Offset Address to ES: Di. LFS Transfer Target Pointer, put the pointer content into FS Example: LFS Di, String; Deploying Segment Address: The Offset Address to FS: DI. LGS Transfer Target Pointer, put the pointer content into GS. Example: LGS Di, String; put the segment address: Offset address to GS : Di. LSS transmits the target pointer, put the pointer content Loading SS. Example: LSS Di, String; Deposit Segment Address: Offset Address to SS: DI. 4. Sign Transfer Instruction. Lahf Sign Register Transfer, put the flag into ah. Sahf flag register, put ah content Into the logo register. Pushf flag is in the stack. PUSHD 32-bit flag enables the stack. Second, arithmetic operation instructions --- - ─────────────────────────────────── ──────────────── ADD addex method. Inc plus 1. AAA addition ASCII code adjustment. DAA additive decision. SUB subtraction SBB with borrowing subtraction. Decimal 1. NEC to reverse (decreased by 0). CMP comparison. (Two Operations subtracted, only modify the flag, no return result). AAS subtssion ASCIII code adjustment. DAS subtssion The decimal adjustment. MUL unsigned multiplication. IMUL integer multiplication. The above two, the results are returned to AH and Al (byte operation), or the AAM multiplication ASCII code adjustment. DIV unsigned division. Idiv Integer division. The above two, the result is sent: the merchant return Al, the remainder will return AH, (byte operation);
Or queer back AX, the remainder is sent to DX, (word operation). AAD division ASCII code adjustment. CBW byte converted to word. (Extend the symbol of the AL to AH) CWD word to double words. Extend the symbols in the AX to DX) CWDE word to double words. (Extended the word symbol in the AX to Eax) CDQ double word extension. (Extend the symbols in Eax to EDX Go) three, logical operations - ───────────────────────────────── - And and operations. OR or calculation. Xor is too or calculation. NOT reflects. Test test. (Two Operations, only modify flag bits, no return results). SHL logic left. SAL arithmetic left shift. (= Shl) SHR logic Right shift. SAR calculation right shift. (= SHR) ROL loop left shift. RC loop right shift. RCL is shifted by the RCR. RCR is shifted by the RCR. The above eight shift instructions, the number of shifts More than 255 times. When shifting once, you can use the operation code directly. Such as SHL AX, 1. Shift> 1 time, the number of shifts is given by the register CL. Such as MOV CL, 04 SHL AX, CL 4, string Directive - ──────────────────────────── DS: Si Source Series Register: Source Strings Alley. ES: DI Target Series Segment Register: Target String Add Site. AL / AX Scan Value. D Sign 0 Represents Si and Di Turn Auto Increment in Repeated Operation; 1 indicates automatic reduction. Z The logo is used to control the end of the scan or compare operation. MOVS string transfer. (Movsb transfer characters. MovsW transmitted word.) CMPS string comparison. (CMPSB comparison character. CMPSW comparison word.) ScaS String scan. Put Al Or the content of AX is compared to the target string, the comparison result is reflected in the flag. LODS is loaded into the string. Put the elements in the source string (word or bytes) in Al or AX one by one. (LODSB Transfer Character. Lodsw Transport word. LodSD transmits double word.) STOS Save Skewers. It is the reverse process of LODS. REP is repeated when CX / ECX <> 0. REPE / REPZ is equal to ZF = 1 or the comparison result, and CX / ECX <> 0 is repeated. Repne / RepNZ is repeated when ZF = 0 or the comparison result is equal, and CX / ECX <> 0 is repeated. REPC is repeated when CF = 1 and CX / ECX <> 0. REPNC is CF = 0 and CX / ECX <> 0 Repeat. V. Program transfer instructions - ───────────────────────────── ─ 1> Unconditional transfer command (long transfer) JMP unconditional transfer command CALL process call RET / RETF process return. 2> Condition transfer instruction (short transfer, -128 to 127) (During and only (sf xor) When OF) = 1, the OP1