IBM-PC Assembly Language Instruction Set

Source: Internet
Author: User
Tags processing instruction
Data transmission Instruction Set
MoV
Function: sends the source operand to the destination operand.
Syntax: mov destination operand, source operand
Format: mov R1, R2
MoV R, m
MoV M, R
MoV R, Data

Xchg
Function: Exchange data of two operands.
Syntax: xchg
Format: xchg R1, R2 xchg M, r xchg R, m

Push, pop
Function: pushes the operand to or from the stack.
Syntax: Push operand pop operand
Format: Push R push m push data pop R pop m

Pushf, popf, pusha, Popa
Function: Stack Command Group
Format: pushf popf pusha Popa

Lea, LDs, les
Function: Get the address to the Register.
Syntax: Lea R, M lDs R, M les r, m

Xlat (xlatb)
Function: Query table command
Syntax: xlat m
Arithmetic Operation Command
Add, ADC
Function: Addition command
Syntax: Add OP1, OP2 ADC OP1, OP2
Format: Add R1, R2 add r, M add M, r add r, Data
Impact indicator: C, P, A, Z, S, O

Sub, SBB
Function: subtraction command
Syntax: Sub OP1, OP2 SBB OP1, OP2
Format: Sub R1, R2 sub R, M sub M, r sub R, data sub M, Data
Impact indicator: C, P, A, Z, S, O

INC, Dec
Function: add or subtract one of OP values.
Syntax: Inc op dec op
Format: Inc R/M dec R/m
Impact indicator: P, A, Z, S, O

Neg
Function: reverse the op symbol (bitwise complement)
Syntax: neg op
Format: neg R/m
Impact indicator: C, P, A, Z, S, O
Mul, imul
Function: Multiplication command
Syntax: Mul op imul op
Format: Mul R/M imul R/m
Impact indicator: C, P, A, Z, S, O (only imul will affect the s mark)

Div, idiv
Function: division command
Syntax: div op idiv op
Format: div R/M idiv R/m
CBW, CWD
Function: provides an extended number of signed commands.
Syntax: CBW CWD
Aaa, AAS, AAM, aad
Function: Non-pressure BCD code Operation Adjustment Command
Syntax: aaa aas aam aad
Impact indicator: A, C (AAA, AAS) s, Z, P (AAM, AAD)

DAA, Das
Function: compress BCD code adjustment commands.
Syntax: DAA Das
Impact indicator: C, P, A, Z, S
Bit operation instruction set
And, Or, XOR, not, test
Function: Performs logical operations between bit and bit.
Syntax: and R/m, R/M/data or R/m, R/M/Data xor r/m, R/M/data test R/m, r/M/data not r/m
Impact flag: C, O, P, Z, S (where the C and O flags are set to 0) not command does not affect any flag
SHR, SHL, SAR, Sal
Function: Shift command
Syntax: shr r/m, data/Cl shl r/m, data/Cl sar r/m, data/Cl Sal R/m, data/Cl
Impact indicator: C, p, Z, S, O
Ror, Rol, RCR, RCL
Function: cyclic shift command
Syntax: ror R/m, data/Cl rol r/m, data/Cl rcr r/m, data/Cl rcl r/m, data/Cl
Impact indicator: C, p, Z, S, O
Program Process Control Instruction Set
CLC, STC, CMC
Function: sets the carry flag.
Syntax: CLC STC CMC
Flag: c
CLD, STD
Function: sets the direction flag.
Syntax: CLD std
Flag: d
CLI, STI
Function: sets the interrupt flag.
Syntax: CLI STI
Flag: I
CMP
Function: Compare the values of OP1 and OP2.
Syntax: cmp r/m, R/M/Data
Flag: C, P, A, Z, O
JMP
Function: jumps to a specified address for execution.
Syntax: JMP address
Jxx
Function: if a specific condition is true, it is executed at the specified address.
Syntax: jxx address
Note:
A: above, which is valid when C = 0 and Z = 0
B: below, which is valid when C = 1
C: Carry. this parameter is valid when the value of the cxz: Cx register is set to 0 (zero) When memory is set.
E: equal, valid when z = 1
G: greater (greater than), valid when z = 0 and S = 0
L: less than (less than), valid when S is not zero
N: Not (inverse condition), must be used with other symbols
O: overflow, O = 1
P: parity, P = 1
PE: parity even, P = 1
Po: parity odd, P = 0
S: sign, S = 1
Z: Zero, Z = 1
Loop
Function: cyclic Instruction Set
Syntax: loop address
Loope (z)
Address loopne (z) Address
Flag space: None
Call, RET
Function: Call a subroutine and return an instruction.
Syntax: Call address RET n
Flag space: None
Int, iret
Function: interrupt call and return command
Syntax: int n iret
Flag: When int is executed, the CPU will automatically import the value of the Flag Register into the stack. When iret is executed, the flag value in the stack will be returned to the Register.
String operation instruction set
Movsb, movsw, movsd
Function: string transmission command
Syntax: movsb movsw movsd
Flag space: None
Cmpsb, cmpsw, cmpsd
Function: String comparison command
Syntax: cmpsb cmpsw cmpsd
Flag: C, p, Z, S, O
Scasb, scasw
Function: string SEARCH Command
Syntax: scasb scasw
Flag: C, p, Z, S, O
Lodsb, lodsw, stosb, stosw
Function: String loading or storage commands
Syntax: lodsb lodsw stosb stosw
Flag space: None
Rep, repe, repne
Function: Repeated prefix Instruction Set
Syntax: rep command s repe command s repne command s
Flag: Depends on instruction S.
 
For an ibm pc, it has its command system, including: Data Transmission commands, string processing commands, arithmetic commands, control mobile commands, logical commands, and processor control commands.
Here we will briefly introduce the command type and instructions. If you have any requirements for specific command formats and applications, please contact amay and update amay.
1) Data Transmission command: responsible for sending data, addresses, or immediate data transmission to registers or storage units.
Description of the data transfer instruction type
Common Data Transmission commands mov, push, pop, and xchg)
Dedicated Transfer Instruction in (input instruction) and out (input instruction) of the Accumulators)
Address Transfer command LEA (valid address send register), LDS (pointer send register and DS), Les (pointer send register and ES)
Mark register transfer command lahf (Mark send Ah), sahf (Ah send sign register), pushf (Mark into Stack), popf (mark out stack)

2) arithmetic commands: used to execute arithmetic operations.
Arithmetic instruction type refers to description
Addition command Add (addition), ADC (incoming addition), Inc (addition 1)
Subtraction commands: Sub (subtraction), SBB (subtraction with digits), Dec (subtraction 1), neg (complement), CMP (comparison)
Multiplication command MUL (unsigned number multiplication) and imul (signed number multiplication)
Division command Div (unsigned number division), idiv (number division with symbols), CBW (byte conversion to word), CWD (word conversion to double word)

3) logical commands: Perform logical operations on words or bytes.
Description of logical instruction type
Logical operation commands and (logical and), or (logical or), not (logical not), XOR (exclusive or), test (test)
Move command SHL (logical left shift), Sal (arithmetic left shift), SHR (logical right shift), SAR (arithmetic right shift), Rol (cyclic left shift), Ror (cyclic right shift), RCL (left shift of the inner bit loop), RCR (right shift of inner bit)

4) string processing command: process the data strings stored in the memory.
Description of the string processing instruction type
Movs, CMPs, SCAs, lods, and STOs)

5) transfer control command: used to control the execution process of the program.
Transfer control instruction type description
Unconditional transfer instruction JMP (inter-and intra-segment transfer)
Conditional transfer command JZ (transfer when the result is 0 (or equal), JS (transfer when the result is negative), JNS (result is regular transfer), JO (transfer when overflow), jno (transfer without Overflow), JP (transfer when parity is 1), jnp (transfer when parity is 0)
Loop command loop (Cyclic command), looppz/loope (Cyclic command when it is 0 or equal), loopnz/loopne (Cyclic command when it is not 0 or not equal)
Subroutine command call and RET)
Interrupt command int (Interrupt), into (interrupt if overflow occurs), Riet (return from interrupt)

 
6) processor control commands:
Processor Control Instruction type description
Mark Processing Command CLC (carry position 0 command), CMC (carry position reverse command), STC (carry position 1 command), CLD (Direction Flag 1 command) STD (direction mark position 1 command), CLI (Interrupt Mark sets 0 command), and STI (Interrupt Mark sets 1 command)
Other processor control commands Nop (no operation), hlt (stopped), wait (waiting), ESC (Code changing), lock (blocking)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.