First 8086 program
This presentation is the property of its rightful owner.
Sponsored Links
1 / 16

First 8086 Program PowerPoint PPT Presentation


  • 34 Views
  • Uploaded on
  • Presentation posted in: General

First 8086 Program. Module M14.4 Section 9.4 Appendix A (pp. 529-531). A First 8086 Program. 0. 1. 2. 3. 4. 5. 6. 7. ADD b. PUSH. POP. ADD w. ADD b. ADD w. ADD b. ADD w. 0. ES. r/m,reg. ES. r/m,reg. AL,imm. AX,imm. reg,r/m. reg,r/m. ADC b. ADC b. ADC w. ADC w.

Download Presentation

First 8086 Program

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


First 8086 program

First 8086 Program

Module M14.4

Section 9.4

Appendix A (pp. 529-531)


A first 8086 program

A First 8086 Program


First 8086 program

0

1

2

3

4

5

6

7

ADD b

PUSH

POP

ADD w

ADD b

ADD w

ADD b

ADD w

0

ES

r/m,reg

ES

r/m,reg

AL,imm

AX,imm

reg,r/m

reg,r/m

ADC b

ADC b

ADC w

ADC w

ADC b

ADC w

PUSH

POP

1

reg,r/m

r/m,reg

reg,r/m

AL,imm

AX,imm

r/m,reg

SS

SS

AND b

AND w

AND b

AND w

AND b

AND w

SEGMENT

DAA

2

reg,r/m

reg,r/m

AL,imm

AX,imm

r/m,reg

r/m,reg

ES

XOR b

XOR w

XOR b

XOR w

XOR b

XOR w

SEGMENT

AAA

3

reg,r/m

r/m,reg

r/m,reg

reg,r/m

AL,imm

AX,imm

SS

INC

INC

INC

INC

INC

INC

INC

INC

4

DX

BX

SP

SI

DI

AX

CX

BP

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

5

AX

SI

DI

CX

DX

BX

SP

BP

6

JO

JNO

JB/JNAE

JNB/JAE

JE/JZ

JNE/JNZ

JNBE/JA

JBE/JNA

7

JC

JNC

XCHG w

TEST b

TEST w

XCHG b

8

*

*

*

*

r/m,reg

r/m,reg

r/m,reg

r/m,reg

XCHG

XCHG

XCHG

XCHG

XCHG

XCHG

XCHG

NOP

9

CX,AX

DX,AX

BX,AX

SP,AX

BP,AX

SI,AX

DI,AX

MOV b

MOV w

MOV b

MOV w

MOVS b

MOVS w

CMPS b

CMPS w

A

AL,mem

AX,mem

mem,AL

mem,AX

MOV

MOV

MOV

MOV

MOV

MOV

MOV

MOV

B

AL,imm

CL,imm

DL,imm

BL,imm

AH,imm

CH,imm

DH,imm

BH,imm

RET

LES

LDS

RET

MOV b

MOV w

C

reg.r/m

intra+

reg.r/m

intra

r/m,imm

r/m,imm

XLAT

*

AAD

*

*

*

AAM

D

LOOPZ/

LOOP

OUT b

OUT w

LOOPNZ/

JCXZ

IN b

IN w

E

LOOPE

port,AL

port,AX

LOOPNE

AL,port

AX,port

REP/REPNE

REPE/

*

LOCK

HLT

CMC

*

F

REPNZ

REPZ

Table A2.a

Opcode Map


First 8086 program

8

9

A

B

C

D

E

F

OR b

OR w

OR b

OR w

OR b

OR w

PUSH

0

AL,imm

AX,imm

r/m,reg

r/m,reg

reg,r/m

CS

reg,r/m

POP

PUSH

SBB b

SBB w

SBB b

SBB w

SBB b

SBB w

1

DS

DS

AL,imm

AX,imm

reg,r/m

r/m,reg

reg,r/m

r/m,reg

SUB w

SUB b

SUB w

SUB b

SUB b

SUB w

SEGMENT

DAS

2

AL,imm

AX,imm

reg,r/m

reg,r/m

CS

r/m,reg

r/m,reg

CMP b

CMP w

CMP b

CMP w

CMP b

CMP w

SEGMENT

AAS

3

AL,imm

AX,imm

reg,r/m

r/m,reg

DS

r/m,reg

reg,r/m

DEC

DEC

DEC

DEC

DEC

DEC

DEC

DEC

4

DX

BX

SP

BP

SI

DI

AX

CX

POP

POP

POP

POP

POP

POP

POP

POP

5

AX

CX

DX

BX

SP

BP

SI

DI

6

7

JS

JNS

JNLE/JG

JP/JPE

JNP/JPO

JL/JNGE

JNL/JGE

JLE/JNG

POP

MOV b

MOV

LEA

MOV

MOV W

MOV b

MOV W

8

r/m

r/m,reg

r/m,seg

reg,r/m

seg,r/m

r/m,reg

reg,r/m

reg,r/m

CALL

CBW

SAHF

LAHF

CWD

PUSHF

POPF

WAIT

9

inter

TEST b

TEST w

SCAS w

STOS b

STOS w

LODS b

LODS w

SCAS b

A

AL,imm

AL,imm

MOV

MOV

MOV

MOV

MOV

MOV

MOV

MOV

B

AX,imm

CX,imm

DX,imm

BX,imm

SP,imm

BP,imm

SI,imm

DI,imm

RET

INT

RET

INT

INTO

IRET

C

inter+

type

inter

ESC

ESC

ESC

ESC

ESC

ESC

ESC

ESC

D

0

1

2

3

4

5

6

7

CALL

JMP

JMP

JMP

IN b

IN w

OUT b

OUT w

E

intra

intra

inter

short

AL,DX

AX,DX

DX,AL

DX,AX

CLC

CLD

STC

CLI

STI

STD

*

*

F

Table A2.a

Opcode Map


First 8086 program

8

9

A

B

C

D

E

F

OR b

OR w

OR b

OR w

OR b

OR w

PUSH

0

AL,imm

AX,imm

r/m,reg

r/m,reg

reg,r/m

CS

reg,r/m

POP

PUSH

SBB b

SBB w

SBB b

SBB w

SBB b

SBB w

1

DS

DS

AL,imm

AX,imm

reg,r/m

r/m,reg

reg,r/m

r/m,reg

SUB w

SUB b

SUB w

SUB b

SUB b

SUB w

SEGMENT

DAS

2

AL,imm

AX,imm

reg,r/m

reg,r/m

CS

r/m,reg

r/m,reg

CMP b

CMP w

CMP b

CMP w

CMP b

CMP w

SEGMENT

AAS

3

AL,imm

AX,imm

reg,r/m

r/m,reg

DS

r/m,reg

reg,r/m

DEC

DEC

DEC

DEC

DEC

DEC

DEC

DEC

4

DX

BX

SP

BP

SI

DI

AX

CX

POP

POP

POP

POP

POP

POP

POP

POP

5

AX

CX

DX

BX

SP

BP

SI

DI

6

7

JS

JNS

JNLE/JG

JP/JPE

JNP/JPO

JL/JNGE

JNL/JGE

JLE/JNG

POP

MOV b

MOV

LEA

MOV

MOV W

MOV b

MOV W

8

r/m

r/m,reg

r/m,seg

reg,r/m

seg,r/m

r/m,reg

reg,r/m

reg,r/m

CALL

CBW

SAHF

LAHF

CWD

PUSHF

POPF

WAIT

9

inter

TEST b

TEST w

SCAS w

STOS b

STOS w

LODS b

LODS w

SCAS b

A

AL,imm

AL,imm

MOV

MOV

MOV

MOV

MOV

MOV

MOV

MOV

B

AX,imm

CX,imm

DX,imm

BX,imm

SP,imm

BP,imm

SI,imm

DI,imm

RET

INT

RET

INT

INTO

IRET

C

inter+

type

inter

ESC

ESC

ESC

ESC

ESC

ESC

ESC

ESC

D

0

1

2

3

4

5

6

7

CALL

JMP

JMP

JMP

IN b

IN w

OUT b

OUT w

E

intra

intra

inter

short

AL,DX

AX,DX

DX,AL

DX,AX

CLC

CLD

STC

CLI

STI

STD

*

*

F

Table A2.a

Opcode Map

mov ax,1234h

B8 34 12


First 8086 program

8

9

A

B

C

D

E

F

OR b

OR w

OR b

OR w

OR b

OR w

PUSH

0

AL,imm

AX,imm

r/m,reg

r/m,reg

reg,r/m

CS

reg,r/m

POP

PUSH

SBB b

SBB w

SBB b

SBB w

SBB b

SBB w

1

DS

DS

AL,imm

AX,imm

reg,r/m

r/m,reg

reg,r/m

r/m,reg

SUB w

SUB b

SUB w

SUB b

SUB b

SUB w

SEGMENT

DAS

2

AL,imm

AX,imm

reg,r/m

reg,r/m

CS

r/m,reg

r/m,reg

CMP b

CMP w

CMP b

CMP w

CMP b

CMP w

SEGMENT

AAS

3

AL,imm

AX,imm

reg,r/m

r/m,reg

DS

r/m,reg

reg,r/m

DEC

DEC

DEC

DEC

DEC

DEC

DEC

DEC

4

DX

BX

SP

BP

SI

DI

AX

CX

POP

POP

POP

POP

POP

POP

POP

POP

5

AX

CX

DX

BX

SP

BP

SI

DI

6

7

JS

JNS

JNLE/JG

JP/JPE

JNP/JPO

JL/JNGE

JNL/JGE

JLE/JNG

POP

MOV b

MOV

LEA

MOV

MOV W

MOV b

MOV W

8

r/m

r/m,reg

r/m,seg

reg,r/m

seg,r/m

r/m,reg

reg,r/m

reg,r/m

CALL

CBW

SAHF

LAHF

CWD

PUSHF

POPF

WAIT

9

inter

TEST b

TEST w

SCAS w

STOS b

STOS w

LODS b

LODS w

SCAS b

A

AL,imm

AL,imm

MOV

MOV

MOV

MOV

MOV

MOV

MOV

MOV

B

AX,imm

CX,imm

DX,imm

BX,imm

SP,imm

BP,imm

SI,imm

DI,imm

RET

INT

RET

INT

INTO

IRET

C

inter+

type

inter

ESC

ESC

ESC

ESC

ESC

ESC

ESC

ESC

D

0

1

2

3

4

5

6

7

CALL

JMP

JMP

JMP

IN b

IN w

OUT b

OUT w

E

intra

intra

inter

short

AL,DX

AX,DX

DX,AL

DX,AX

CLC

CLD

STC

CLI

STI

STD

*

*

F

Table A2.a

Opcode Map

mov bx,ax

8B D8


First 8086 program

Table A.3

Fields

mod,r/m

Postbyte

mod

= 11

r/m

byte

word

mod

= 00

mod

= 01

mod

= 10

000

AL

AX

BX + SI

BX + SI + disp8

BX + SI + disp16

001

CL

CX

BX + DI

BX + DI + disp8

BX + DI + disp16

010

DL

DX

BP + SI

BP + SI + disp8

BP + SI + disp16

011

BL

BX

BP + DI

BP + DI + disp8

BP + DI + disp16

Postbyte

Table A.4

Postbyte

Field

reg

reg

byte (b)

word (w)

000

AL

AX

001

CL

CX

010

DL

DX

011

BL

BX

100

AH

SP

100

AH

SP

SI

SI + disp8

SI + disp16

101

CH

BP

101

CH

BP

DI

DI + disp8

DI + disp16

110

DH

SI

110

DH

SI

Direct

BP + disp8

BP + disp16

111

BH

DI

111

BH

DI

BX

BX + disp8

BX + disp16

1 1

0 1 1

0 0 0

= D8

mod

reg

r/m

mov bx,ax

8B D8

mov bx,ax

mov w reg,r/m

reg = bx = 011

mod = 11

r/m = ax = 0 0 0


A first 8086 program1

A First 8086 Program


First 8086 program

0

1

2

3

4

5

6

7

ADD b

PUSH

POP

ADD w

ADD b

ADD w

ADD b

ADD w

0

ES

r/m,reg

ES

r/m,reg

AL,imm

AX,imm

reg,r/m

reg,r/m

ADC b

ADC b

ADC w

ADC w

ADC b

ADC w

PUSH

POP

1

reg,r/m

r/m,reg

reg,r/m

AL,imm

AX,imm

r/m,reg

SS

SS

AND b

AND w

AND b

AND w

AND b

AND w

SEGMENT

DAA

2

reg,r/m

reg,r/m

AL,imm

AX,imm

r/m,reg

r/m,reg

ES

XOR b

XOR w

XOR b

XOR w

XOR b

XOR w

SEGMENT

AAA

3

reg,r/m

r/m,reg

r/m,reg

reg,r/m

AL,imm

AX,imm

SS

INC

INC

INC

INC

INC

INC

INC

INC

4

DX

BX

SP

SI

DI

AX

CX

BP

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

5

AX

SI

DI

CX

DX

BX

SP

BP

6

JO

JNO

JB/JNAE

JNB/JAE

JE/JZ

JNE/JNZ

JNBE/JA

JBE/JNA

7

JC

JNC

XCHG w

TEST b

TEST w

XCHG b

8

*

*

*

*

r/m,reg

r/m,reg

r/m,reg

r/m,reg

XCHG

XCHG

XCHG

XCHG

XCHG

XCHG

XCHG

NOP

9

CX,AX

DX,AX

BX,AX

SP,AX

BP,AX

SI,AX

DI,AX

MOV b

MOV w

MOV b

MOV w

MOVS b

MOVS w

CMPS b

CMPS w

A

AL,mem

AX,mem

mem,AL

mem,AX

MOV

MOV

MOV

MOV

MOV

MOV

MOV

MOV

B

AL,imm

CL,imm

DL,imm

BL,imm

AH,imm

CH,imm

DH,imm

BH,imm

RET

LES

LDS

RET

MOV b

MOV w

C

reg.r/m

intra+

reg.r/m

intra

r/m,imm

r/m,imm

XLAT

*

AAD

*

*

*

AAM

D

LOOPZ/

LOOP

OUT b

OUT w

LOOPNZ/

JCXZ

IN b

IN w

E

LOOPE

port,AL

port,AX

LOOPNE

AL,port

AX,port

REP/REPNE

REPE/

*

LOCK

HLT

CMC

*

F

REPNZ

REPZ

Table A2.a

Opcode Map


First 8086 program

= D8

11

011

000

neg ax

F7

D8


First 8086 program

0

1

2

3

4

5

6

7

ADD b

PUSH

POP

ADD w

ADD b

ADD w

ADD b

ADD w

0

ES

r/m,reg

ES

r/m,reg

AL,imm

AX,imm

reg,r/m

reg,r/m

ADC b

ADC b

ADC w

ADC w

ADC b

ADC w

PUSH

POP

1

reg,r/m

r/m,reg

reg,r/m

AL,imm

AX,imm

r/m,reg

SS

SS

AND b

AND w

AND b

AND w

AND b

AND w

SEGMENT

DAA

2

reg,r/m

reg,r/m

AL,imm

AX,imm

r/m,reg

r/m,reg

ES

XOR b

XOR w

XOR b

XOR w

XOR b

XOR w

SEGMENT

AAA

3

reg,r/m

r/m,reg

r/m,reg

reg,r/m

AL,imm

AX,imm

SS

INC

INC

INC

INC

INC

INC

INC

INC

4

DX

BX

SP

SI

DI

AX

CX

BP

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

PUSH

5

AX

SI

DI

CX

DX

BX

SP

BP

6

JO

JNO

JB/JNAE

JNB/JAE

JE/JZ

JNE/JNZ

JNBE/JA

JBE/JNA

7

JC

JNC

XCHG w

TEST b

TEST w

XCHG b

8

*

*

*

*

r/m,reg

r/m,reg

r/m,reg

r/m,reg

XCHG

XCHG

XCHG

XCHG

XCHG

XCHG

XCHG

NOP

9

CX,AX

DX,AX

BX,AX

SP,AX

BP,AX

SI,AX

DI,AX

MOV b

MOV w

MOV b

MOV w

MOVS b

MOVS w

CMPS b

CMPS w

A

AL,mem

AX,mem

mem,AL

mem,AX

MOV

MOV

MOV

MOV

MOV

MOV

MOV

MOV

B

AL,imm

CL,imm

DL,imm

BL,imm

AH,imm

CH,imm

DH,imm

BH,imm

RET

LES

LDS

RET

MOV b

MOV w

C

reg.r/m

intra+

reg.r/m

intra

r/m,imm

r/m,imm

XLAT

*

AAD

*

*

*

AAM

D

LOOPZ/

LOOP

OUT b

OUT w

LOOPNZ/

JCXZ

IN b

IN w

E

LOOPE

port,AL

port,AX

LOOPNE

AL,port

AX,port

REP/REPNE

REPE/

*

LOCK

HLT

CMC

*

F

REPNZ

REPZ

add ax,bx

03

Table A2.a

Opcode Map


First 8086 program

Table A.3

Fields

mod,r/m

Postbyte

mod

= 11

r/m

byte

word

mod

= 00

mod

= 01

mod

= 10

000

AL

AX

BX + SI

BX + SI + disp8

BX + SI + disp16

001

CL

CX

BX + DI

BX + DI + disp8

BX + DI + disp16

010

DL

DX

BP + SI

BP + SI + disp8

BP + SI + disp16

011

BL

BX

BP + DI

BP + DI + disp8

BP + DI + disp16

Postbyte

Table A.4

Postbyte

Field

reg

reg

byte (b)

word (w)

000

AL

AX

001

CL

CX

010

DL

DX

011

BL

BX

100

AH

SP

100

AH

SP

SI

SI + disp8

SI + disp16

101

CH

BP

101

CH

BP

DI

DI + disp8

DI + disp16

110

DH

SI

110

DH

SI

Direct

BP + disp8

BP + disp16

111

BH

DI

111

BH

DI

BX

BX + disp8

BX + disp16

1 1

0 0 0

0 1 1

= C3

mod

reg

r/m

add ax,bx

03 C3

add ax,bx

add w reg,r/m

reg = ax = 000

mod = 11

r/m = bx = 0 11


First 8086 program

= D3

11

010

011

not bx

F7

D3


A first 8086 program2

A First 8086 Program


  • Login