0% found this document useful (0 votes)
49 views8 pages

Code Machine Instructions I8086 Juillet2015

The document summarizes the instruction set and machine code format of the Intel 8086/8088 microprocessors. It defines the registers, addressing modes, data types, and purpose of common instructions used for data transfer, arithmetic operations, and other functions. The machine code format is shown for different instruction classes, indicating the fields for opcode, operands, immediate data values, and other parameters.

Uploaded by

Cherubin Bila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views8 pages

Code Machine Instructions I8086 Juillet2015

The document summarizes the instruction set and machine code format of the Intel 8086/8088 microprocessors. It defines the registers, addressing modes, data types, and purpose of common instructions used for data transfer, arithmetic operations, and other functions. The machine code format is shown for different instruction classes, indicating the fields for opcode, operands, immediate data values, and other parameters.

Uploaded by

Cherubin Bila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Code machine des instructions du 8086/8088

(Extrait de : Microprocesseur Systems : the 8086/8088 family - Architecture, programming and design. - 2e edition.
YU-CHENG LIU et GLENN A. GIBSON. – Prentice Hall International, 1986)

AL = 8-bit accumulator If s:w = 00 then the 8 bits of immediate data form the operand
AX = 16-bit accumulator If s:w = 01 then the 16 bits of immediate data form the operand
CX = count register If s:w = 11 then an immediate data byte is sign-extended to form the 16 bits operand
DS = Data segment If v = 0 then “count” = 1; if v = 1 then “count” is (CL)
ES = Extra data segment X = don’t care
Z is used for string primitives for comparison with ZF FLAG

Above/below refers to unsigned value


Greater = more positive
Less = less positive (more negative) signed values SEGMENT OVERRIDE PREFIX
If d = 1 then “to” REG; if d = 0 then “from” REG 001 SR 110
If w = 1 then word instruction; if w = 0 then byte instruction

If mod = 11 then r/m is treated as a REG field REG and SR are assigned according to the following table
If mod = 00 then DISP = 0*; disp-low and disp-high are absent
16-bit (w = 1) 8-bit (w = 0) Segment register (SR)
If mod = 01 then DISP = disp-low sign –extended to 16-bits; disp-high is absent
If mod = 10 then DISP = disp-high:disp-low 000 AX 000 AL 00 ES
If r/m = 000 then EA = (BX) + (SI) + DISP 001 CX 001 CL 01 CS
If r/m = 001 then EA = (BX) + (DI) + DISP 010 DX 010 DL 10 SS
If r/m = 010 then EA = (BP) + (SI) + DISP 011 BX 011 BL 11 DS
If r/m = 011 then EA = (BP) + (DI) + DISP 100 SP 100 AH
If r/m = 100 then EA = (SI) + DISP 101 BP 101 CH
If r/m = 101 then EA = (DI) + DISP 110 SI 110 DH
If r/m = 110 then EA = (BP) + DISP 111 DI 111 BH
If r/m = 111 then EA = (BX) + DISP
DISP follows 2nd byte instruction (before data if required) Instructions which reference the flag register file as a 16-bit object use the
symbol FLAGS to represent the file
* Except if mod = 00 and r/m = 110 then EA = disp-high:disp-low FLAGS = X:X:X:X: (OF):(DF):(IF):(TF): (SF):(ZF):X:(AF):X:(PF):X:(CF)

1/8
DATA TRANSFER
MOV = Move 7 6 5 4 3 2 1 0 76543210 76543210 76543210 76543210 76543210
Register/memory to/from register 1 0 0 0 1 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate to register/memory 1 1 0 0 0 1 1 w mod 000 r/m (DISP-LOW) (DISP-HIGH) Data Data if w = 1
Immediate to register 1 0 1 1 w REG Data Data if w = 1
Memory to accumulator 1 0 1 0 0 0 0 w ADDR-LOW ADDR-HIGH
Accumulator to memory 1 0 1 0 0 0 1 w ADDR-LOW ADDR-HIGH
Register/memory to segment register 1 0 0 0 1 1 1 0 mod 0 SR r/m (DISP-LOW) (DISP-HIGH)
Segment register to register/memory 1 0 0 0 1 1 0 0 mod 0 SR r/m (DISP-LOW) (DISP-HIGH)

PUSH = push
Register/memory 1 1 1 1 1 1 1 1 mod 110 r/m (DISP-LOW) (DISP-HIGH)
register 0 1 0 1 0 REG
Segment register 0 0 0 SR 1 1 0

POP = pop
Register/memory 1 0 0 0 1 1 1 1 mod 000 r/m (DISP-LOW) (DISP-HIGH)
register 0 1 0 1 1 REG
Segment register 0 0 0 SR 1 1 1

XCHG = Exchange
Register/memory with register 1 0 0 0 0 1 1 w mod REG r/m (DISP-LOW) (DISP-HIGH)
Register with accumulator 1 0 0 1 0 REG

IN = input from
Fixed port 1 1 1 0 0 1 0 w DATA-8
Variable port 1 1 1 0 1 1 0 w

OUT = ouput to
Fixed port 1 1 1 0 0 1 1 w DATA-8
Variable port 1 1 1 0 1 1 1 w

2/8
XLAT = translate byte to AL 1 1 0 1 0 1 1 1
LEA = lead EA to register 1 0 0 0 1 1 0 1 mod REG r/m (DISP-LOW) (DISP-HIGH)
LDS = load pointer to DS 1 1 0 0 0 1 0 1 mod REG r/m (DISP-LOW) (DISP-HIGH)
LES = load pointer to ES 1 1 0 0 0 1 0 0 mod REG r/m (DISP-LOW) (DISP-HIGH)
LAHF = load AH with flags 1 0 0 1 1 1 1 1
SAHF = store AH into flags 1 0 0 1 1 1 1 0
PUSHF = push flags 1 0 0 1 1 1 0 0
POPF = pop flags 1 0 0 1 1 1 0 1

Arithmetic
ADD = add
Register/memory with register to either 0 0 0 0 0 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate to register/memory 1 0 0 0 0 0 s w mod 000 r/m (DISP-LOW) (DISP-HIGH) Data Data if s:w = 01
Immediate to accumulator 0 0 0 0 0 1 0 w Data Data if w = 1

ADC = add with carry :


Register/memory with register either 0 0 0 1 0 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate to register/memory 1 0 0 0 0 0 s w mod 010 r/m (DISP-LOW) (DISP-HIGH) Data Data if s:w = 01
Immediate to accumulator 0 0 0 1 0 1 0 w Data Data if w = 1

INC = increment
Register/memory 1 1 1 1 1 1 1 w mod 000 r/m (DISP-LOW) (DISP-HIGH)
register 0 1 0 0 0 REG

AAA = ASCII adjust for add 0 0 1 1 0 1 1 1


DAA = decimal adjust for add 0 0 1 0 0 1 1 1

3/8
SUB = subtract
Register/memory and register to either 0 0 1 0 1 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate from register/memory 1 0 0 0 0 0 s w mod 101 r/m (DISP-LOW) (DISP-HIGH) Data Data if s:w = 01
Immediate from accumulator 0 0 1 0 1 1 0 w Data Data if w = 1

SBB = subtract with borrow


Register/memory and register either 0 0 0 1 1 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate from register/memory 1 0 0 0 0 0 s w mod 011 r/m (DISP-LOW) (DISP-HIGH) Data Data if s:w = 01
Immediate from accumulator 0 0 0 1 1 1 0 w Data Data if w = 1

DEC = decrement
Register/memory 1 1 1 1 1 1 1 w mod 001 r/m (DISP-LOW) (DISP-HIGH)
register 0 1 0 0 1 REG

NEG = change sign 1 1 1 1 0 1 1 w mod 011 r/m (DISP-LOW) (DISP-HIGH)

CMP = compare
Register/memory and register 0 0 1 1 1 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate with register/memory 1 0 0 0 0 0 s w mod 111 r/m (DISP-LOW) (DISP-HIGH) Data Data if s:w = 01
Immediate with accumulator 0 0 1 1 1 1 0 w Data Data if w = 1

AAS = ASCII adjust for subtract 0 0 1 1 1 1 1 1


DAS = decimal adjust for subtract 0 0 1 0 1 1 1 1
MUL = multiply (unsigned) 1 1 1 1 0 1 1 w mod 100 r/m (DISP-LOW) (DISP-HIGH)
IMUL = integer multiply (signed) 1 1 1 1 0 1 1 w mod 101 r/m (DISP-LOW) (DISP-HIGH)
AAM = ASCII adjust for multiply 1 1 0 1 0 1 0 0 000 010 10
DIV = divide (unsigned) 1 1 1 1 0 1 1 w mod 110 r/m (DISP-LOW) (DISP-HIGH)
IDIV = integer divide (signed) 1 1 1 1 0 1 1 w mod 111 r/m (DISP-LOW) (DISP-HIGH)
AAD = ASCII adjust for divide 1 1 0 1 0 1 0 1 000 010 10
CBW = convert byte to word 1 0 0 1 1 0 0 0
CWD = convert word to double word 1 0 0 1 1 0 0 1

4/8
Logic
NOT = invert 1 1 1 1 0 1 1 w mod 010 r/m (DISP-LOW) (DISP-HIGH)
SHL/SAL = shift logical/arithmetic left 1 1 0 1 0 0 v w mod 100 r/m (DISP-LOW) (DISP-HIGH)
SHR = shift logical right 1 1 0 1 0 0 v w mod 101 r/m (DISP-LOW) (DISP-HIGH)
SAR = shift arithmetic right 1 1 0 1 0 0 v w mod 111 r/m (DISP-LOW) (DISP-HIGH)
ROL = rotate left 1 1 0 1 0 0 v w mod 000 r/m (DISP-LOW) (DISP-HIGH)
ROR = rotate right 1 1 0 1 0 0 v w mod 001 r/m (DISP-LOW) (DISP-HIGH)
RCR = rotate through carry flag right 1 1 0 1 0 0 v w mod 010 r/m (DISP-LOW) (DISP-HIGH)
RCL = rotate through carry flag left 1 1 0 1 0 0 v w mod 011 r/m (DISP-LOW) (DISP-HIGH)

AND = And
Register/memory and register 0 0 1 0 0 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate to register/memory 1 0 0 0 0 0 s w mod 100 r/m (DISP-LOW) (DISP-HIGH) Data Data if w = 1
Immediate to accumulator 0 0 1 0 0 1 0 w Data Data if w = 1

TEST = And function to flags no result


Register/memory and register 1 0 0 0 0 1 0 w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate data and register/memory 1 1 1 1 0 1 1 w mod 100 r/m (DISP-LOW) (DISP-HIGH) Data Data if w = 1
Immediate data and accumulator 1 0 1 0 1 0 0 w Data Data if w = 1

OR = or
Register/memory and register either 0 0 0 0 1 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate to register/memory 1 0 0 0 0 0 s w mod 001 r/m (DISP-LOW) (DISP-HIGH) Data Data if w = 1
Immediate to accumulator 0 0 0 0 1 1 0 w Data Data if w = 1

XOR = Exclusive or
Register/memory with register to either 0 0 1 1 0 0 d w mod REG r/m (DISP-LOW) (DISP-HIGH)
Immediate to register/memory 1 0 0 0 0 0 s w mod 110 r/m (DISP-LOW) (DISP-HIGH) Data Data if w = 1
Immediate to accumulator 0 0 1 1 0 1 0 w Data Data if w = 1

5/8
String manipulation

REP = repeat 1 1 1 1 0 0 1 z
MOVS = move byte/word 1 0 1 0 0 1 0 w
CMPS = compare byte/word 1 0 1 0 0 1 1 w
SCAS = scan byte/word 1 0 1 0 1 1 1 w
LODS = load byte/word to AL/AX 1 0 1 0 1 1 0 w
STDS = store byte/word from AL/AX 1 0 1 0 1 0 1 w

Control transfer
CALL = call
Direct within segment 1 1 1 0 1 0 0 0 IP-INC-LOW IP-INC-HIGH
Indirect within segment 1 1 1 1 1 1 1 1 mod 010 r/m (DISP-LOW) (DISP-HIGH)
Direct intersegment 1 0 0 1 1 0 1 0 IP-LOW IP-HIGH CS-LOW CS-HIGH
Indirect intersegment 1 1 1 1 1 1 1 1 mod 011 r/m (DISP-LOW) (DISP-HIGH)

JMP = unconditional jump


Direct within segment 1 1 1 0 1 0 0 1 IP-INC-LOW IP-INC-HIGH
Direct within segment-short 1 1 1 0 1 0 1 1 IP-INC8
Indirect within segment 1 1 1 1 1 1 1 1 mod 100 r/m (DISP-LOW) (DISP-HIGH)
Direct intersegment 1 1 1 0 1 0 1 0 IP-LOW IP-HIGH CS-LOW CS-HIGH
Indirect intersegment 1 1 1 1 1 1 1 1 mod 101 r/m (DISP-LOW) (DISP-HIGH)

RET = return from CALL


within segment 1 1 0 0 0 0 1 1
within segment adding immediate to SP 1 1 0 0 0 0 1 0 DATA-LOW DATA-HIGH
intersegment 1 1 0 0 1 0 1 1
Intersegment adding immediate to SP 1 1 0 0 1 0 1 0 DATA-LOW DATA-HIGH

6/8
Conditional jump
JE/JZ = jump on equal/zero 0 1 1 1 0 1 0 0 IP-INC8
JL/JNZE = jump on less/not greater or equal 0 1 1 1 1 1 0 0 IP-INC8
JLE/JNG = jump on less or equal/not greater 0 1 1 1 1 1 1 0 IP-INC8
JB/JNAE = jump on below/not above or equal 0 1 1 1 0 0 1 0 IP-INC8
JBE/JNA = jump on below/not above 0 1 1 1 0 1 1 0 IP-INC8
JP/JPE = jump on parity/parity even 0 1 1 1 1 0 1 0 IP-INC8
JO = jump on overflow 0 1 1 1 0 0 0 0 IP-INC8
JS = jump on sign 0 1 1 1 1 0 0 0 IP-INC8
JNE/JNZ = jump on not equal/not zero 0 1 1 1 0 1 0 1 IP-INC8
JNL/JGE = jump on not less/greater or equal 0 1 1 1 1 1 0 1 IP-INC8
JNLE/JG = jump on not less or equal/greater 0 1 1 1 1 1 1 1 IP-INC8
JNB/JAE = jump on not below/above or equal 0 1 1 1 0 0 1 1 IP-INC8
JNBE/JA = jump on not below or equal/above 0 1 1 1 0 1 1 1 IP-INC8
JNP/JPO = jump on not parity/parity odd 0 1 1 1 1 0 1 1 IP-INC8
JNO = jump on not overflow 0 1 1 1 0 0 0 1 IP-INC8
JNS = jump on not sign 0 1 1 1 1 0 0 1 IP-INC8
LOOP = loop CX times 1 1 1 0 0 0 1 0 IP-INC8
LOOPZ/LOOPE = loop while zero/equal 1 1 1 0 0 0 0 1 IP-INC8
LOOPNZ/LOOPNE = loop while not zero/equal 1 1 1 0 0 0 0 0 IP-INC8
JCXZ = jump on CX zero 1 1 1 0 0 0 1 1 IP-INC8

7/8
INT = interrupt
Type specified 1 1 0 0 1 1 0 1 DATA-8
Type 3 1 1 0 0 1 1 0 0

INTO = interrupt on overflow 1 1 0 0 1 1 1 0


IRET = interrupt return 1 1 0 0 1 1 1 1

Processor control

CLS = clear carry 1 1 1 1 1 0 0 0


CMC = complement carry 1 1 1 1 0 1 0 1
STC = set carry 1 1 1 1 1 0 0 1
CLD = clear direction 1 1 1 1 1 1 0 0
STD = set direction 1 1 1 1 1 1 0 1
CLI = clear interrupt 1 1 1 1 1 0 1 0
STI = set interrupt 1 1 1 1 1 0 1 1
HLT = Halt 1 1 1 1 0 1 0 0
NOP = No operation 1 0 0 1 0 0 0 0
WAIT = wait 1 0 0 1 1 0 1 1
ESC = Escape (to external device) 1 1 0 1 1 x x x mod yyy r/m (DISP-LOW) (DISP-HIGH)
LOCK = bus lock prefix 1 1 1 1 0 0 0 0
SEGMENT = override prefix 0 0 1 REG 1 0

8/8

You might also like