28
Computer Organization and Architecture 8086 Assembly Language

Computer Organization and Architecture

Embed Size (px)

DESCRIPTION

Computer Organization and Architecture. 8086 Assembly Language. Intel Instruction Format (manual decoding !). +rwadd reg # to opcode Dwimmediate / displacement follows /rmod r/m byte follows /nreg field in R/M = n. Opcode (8). Mode (2). Reg (3). R/M (3). - PowerPoint PPT Presentation

Citation preview

Page 1: Computer Organization  and Architecture

Computer Organization and Architecture

8086 Assembly Language

Page 2: Computer Organization  and Architecture

Intel Instruction Format(manual decoding !)

Opcode (8) Reg (3)Mode (2) R/M (3)

Displacement / Immediate (8)

Displacement / Immediate (16)

+rw add reg # to opcode Dw immediate / displacement follows /r mod r/m byte follows /n reg field in R/M = n

Page 3: Computer Organization  and Architecture
Page 4: Computer Organization  and Architecture
Page 5: Computer Organization  and Architecture
Page 6: Computer Organization  and Architecture
Page 7: Computer Organization  and Architecture
Page 8: Computer Organization  and Architecture
Page 9: Computer Organization  and Architecture
Page 10: Computer Organization  and Architecture
Page 11: Computer Organization  and Architecture
Page 12: Computer Organization  and Architecture
Page 13: Computer Organization  and Architecture

Examples

Mov al, bl ; 88 /r

Opcode: 88Rest: 11 011 000 = D8

Mov ax, bx ; 89 /r

Opcode: 89Rest: 11 011 000 = D8

Page 14: Computer Organization  and Architecture

Examples

Push cx ; 50 +rw

Opcode: 50Add 001 51

Mov ax, dx ; 89 /r mov ew, rw

Opcode: 89Rest: 11 010 000 = D0

Page 15: Computer Organization  and Architecture

Examples

Mov [SI], ax ; 89 /r mov ew, rw

Opcode: 89Rest: 04 (look at table)

Mov [SI], al ; 88 /r mov eb, rb

Opcode: 88Rest: 04 (look at table)

Page 16: Computer Organization  and Architecture

Examples

Inc dx ; just opcde

Opcode: 42

Mov ax, 1 ; B8 +rw dw mov rw, dw

Opcode: B8 + 0 = B8Rest: 0100 (immediate) = 4

Page 17: Computer Organization  and Architecture

Examples

Mov bx, 1234h ; B8 +rw dw mov rw, dw

Opcode: B8 + 011 = BBRest: 3412 (immediate)

Page 18: Computer Organization  and Architecture

Examples

Mov ax, bx ; 8B /r

Opcode: 8BRest: 11 000 011 = C3 ; vs. 89 D8

Mov [di],bx ; 89 /r mov ew, rw

Opcode: 89Rest: 1D (look at table)

Page 19: Computer Organization  and Architecture

Examples

Mov [bx+2], ax ; 89 /r ew, rw

Opcode: 89Rest: [bx] + D8 in table 47 02

Mov ax, [0120] ; A1 dw mov ax, xw

Opcode: A1Rest: 20 01

Page 20: Computer Organization  and Architecture

Examples

Mov [bx + di + 2], 1234 ; mov ew, dw

Opcode: C7 /0 dw Rest: 01 000 001 02 32 12 C7 41 02 34 12

Mov [bx+si], ax ; mov ew, bw

Opcode: 89 Rest: 00 (see table)

Page 21: Computer Organization  and Architecture
Page 22: Computer Organization  and Architecture
Page 23: Computer Organization  and Architecture
Page 24: Computer Organization  and Architecture
Page 25: Computer Organization  and Architecture
Page 26: Computer Organization  and Architecture
Page 27: Computer Organization  and Architecture
Page 28: Computer Organization  and Architecture