1 / 28

Computer Organization and Architecture

Computer Organization and Architecture. 8086 Assembly Language. Intel Instruction Format (manual decoding !). +rw add reg # to opcode Dw immediate / displacement follows /r mod r/m byte follows /n reg field in R/M = n. Opcode (8). Mode (2). Reg (3). R/M (3).

Download Presentation

Computer Organization and Architecture

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Organization and Architecture 8086 Assembly Language

  2. Intel Instruction Format(manual decoding !) • +rw add reg # to opcode • Dw immediate / displacement follows • /r mod r/m byte follows • /n reg field in R/M = n Opcode (8) Mode (2) Reg (3) R/M (3) Displacement / Immediate (8) Displacement / Immediate (16)

  3. Examples Mov al, bl ; 88 /r • Opcode: 88 • Rest: 11 011 000 = D8 Mov ax, bx ; 89 /r • Opcode: 89 • Rest: 11 011 000 = D8

  4. Examples Push cx ; 50 +rw • Opcode: 50 • Add 001  51 Mov ax, dx ; 89 /r mov ew, rw • Opcode: 89 • Rest: 11 010 000 = D0

  5. Examples Mov [SI], ax ; 89 /r mov ew, rw • Opcode: 89 • Rest: 04 (look at table) Mov [SI], al ; 88 /r mov eb, rb • Opcode: 88 • Rest: 04 (look at table)

  6. Examples Inc dx ; just opcde • Opcode: 42 Mov ax, 1 ; B8 +rw dw mov rw, dw • Opcode: B8 + 0 = B8 • Rest: 0100 (immediate) = 4

  7. Examples Mov bx, 1234h ; B8 +rw dw mov rw, dw • Opcode: B8 + 011 = BB • Rest: 3412 (immediate)

  8. Examples Mov ax, bx ; 8B /r • Opcode: 8B • Rest: 11 000 011 = C3 ; vs. 89 D8 Mov [di],bx ; 89 /r mov ew, rw • Opcode: 89 • Rest: 1D (look at table)

  9. Examples Mov [bx+2], ax ; 89 /r ew, rw • Opcode: 89 • Rest: [bx] + D8 in table  47 02 Mov ax, [0120] ; A1 dw mov ax, xw • Opcode: A1 • Rest: 20 01

  10. 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)

More Related