Instruction TemplateNeed - PowerPoint PPT Presentation

1 / 71
About This Presentation
Title:

Instruction TemplateNeed

Description:

The opcodes can be printed on a sheet. 8086 has about 13000 opcodes ... SubInspector DIxit knows to control BP ([SI BP] and [DI BP] ... – PowerPoint PPT presentation

Number of Views:143
Avg rating:3.0/5.0
Slides: 72
Provided by: forum5
Category:

less

Transcript and Presenter's Notes

Title: Instruction TemplateNeed


1
Instruction Template-Need
  • 8085 has 246 opcodes
  • The opcodes can be printed on a sheet
  • 8086 has about 13000 opcodes
  • Book of 60 pages needed for the opcodes!

Dr. K. Udaya Kumar BNM Institute of
Technology
2
Concept of Template
  • In 8085, MOV r1, r2 (ex. MOV A, B) has the
    following template

3
Concept of Template contd.
4
Concept of Template contd.
5
8086 Template
  • For data transfer between REG and R/M
  • REG 8/16-bits register of 8086
  • (except SR, IP, Flags)
  • REG AL/ BL/ CL/ DL/ AH/ BH/ CH/ DH
  • AX/ BX/ CX/ DX/ SI/ DI/ BP/ SP
  • R/ M REG or Memory contents (8 or 16-bits)

6
8086 Template contd.
  • W 1 Word operation
  • W 0 Byte operation
  • D 1 REG is Destination register
  • D 0 REG is Source register
  • MOD 00 R/M for Memory with no displacement
  • MOD 01 R/M for Memory with 8-bit displacement
  • MOD 10 R/M for Memory with 16-bit disp.
  • MOD 11 R/M for a Register

7
8086 Template contd.
8
8086 Template contd.
  • Aid to remember
  • ALl Children Drink Bournvita
  • (AL, CL, DL, BL)
  • SPecial Beverages SIamese DrInk
  • (SP, BP, SI, DI)
  • This template used for generating 210 1024
    opcodes

9
Case of MOD 11
Ex. Code for MOV AX, BX treated as Move from BX
to destination register AX
10
Case of MOD 11 contd.
  • Ex Another code for MOV AX, BX treating it as
    Move from source reg. BX to reg. AX
  • 2 possible opcodes for MOV AX, BX as either AX or
    BX can be REG

11
Case of MOD 11 contd.
  • Ex Code for MOV AL, BH treated as Move from BL
    to destination register AL

12
Case of MOD 11 contd.
Ex. Another Code for MOV AL, BH treating it as
Move from source Reg. BH to Reg. AL 2
possible opcodes for MOV AL, BH as either AL or
BH can be REG
Dr. K. Udaya Kumar BNM Institute of
Technology
13
24 Memory Addressing modes
Dr. K. Udaya Kumar BNM Institute of
Technology
14
Aid to remember SubInspector DIxit is a
BoXer (SIBX and DIBX) SubInspector DIxit
knows to control BP (SIBP and DIBP) He
says SImple DIet DIRECTs a BoXer (SI, DI,
BP Direct addressing, BX)
Dr. K. Udaya Kumar BNM Institute of
Technology
15
Case of MOD 00
Ex Code for MOV CL, SI Unique code for
MOV CL, SI as CL only can be REG
Dr. K. Udaya Kumar BNM Institute of
Technology
16
Case of MOD 01
Ex Code for MOV 46HBP, DX Unique code
for MOV 46HBP, DX as DX only can be REG
Dr. K. Udaya Kumar BNM Institute of
Technology
17
Case of MOD 10
Ex Code for MOV 0F246HBP, DX Unique
code for MOV 0F246HBP, DX as DX is only REG
Dr. K. Udaya Kumar BNM Institute of
Technology
18
Case of MOD 00 or 01?
Ex Code for MOV BP, DX Note MOV BP,
DX is treated as MOV 00HBP, DX
Dr. K. Udaya Kumar BNM Institute of
Technology
19
Direct Addressing
Ex Code for MOV BX, DS1234H Note When
MOD 00 and R/M 110 it is Direct Addressing
20
8086 Instruction set
21
8086 Instruction set contd.
22
8086 Instruction set types
Instructions are normally discussed under Data
Transfer instructions Ex. MOV BX, CX Arithmetic
instructions Ex. ADD BX, CX Logical group of
instructions Ex. AND BX, CX Stack group Ex. PUSH
DX I/O group Ex. IN AL, 30H Branch group Ex.
JNC LOCN String instructions Ex. MOVS Interrupt
instructions Ex. INT 21H
23
8086 Instruction set types contd.
Data Transfer group, Arithmetic group, Logical
group, Stack group,and I/O group of instructions
explained first. They occupy several chapters in
books. Here, I explain them under 2-operand
instructions Ex. ADD BX, CX 1-operand
instructions Ex. PUSH SI 0-operand instructions
Ex. DAA Branch group, String instructions, and
Interrupt instructions are explained later.
24
2-Operand instructions
25
2-Operand instructions contd. Sl. no.1
26
2-Operand instructions contd. Sl. no.1
27
2-Operand instructions contd. Sl. no.1
28
2-Operand instructions contd. Sl. no.1
29
2-Operand instructions contd. Sl. no.1
30
V- Overflow flag
31
V- Overflow flag contd.
32
V- Overflow flag contd.
33
V- Overflow flag contd.
34
2-Operand instructions contd. Sl. no.1
35
2-Operand instructions contd. Sl. no.1
36
2-Operand instructions contd. Sl. no.1
37
2-Operand instructions contd. Sl. no.1
38
2-Operand instructions contd. Sl. no.1
39
2-Operand instructions Contd. Sl. No.2
40
MOV R/M, d8/d16
41
ADD R/M, d8/d16
42
ADD R/M, d8/d16 contd.
43
ADC R/M, d8/d16
44
SUB R/M, d8/d16
45
SBB R/M, d8/d16
46
AND R/M, d8/d16
47
OR R/M, d8/d16
48
XOR R/M, d8/d16
49
TEST R/M, d8/d16
50
CMP R/M, d8/d16
51
2-Operand Instructions contd. Sl. No. 3
52
2-Operand Instructions contd. Sl. No. 3
53
2-Operand Instructions contd. Sl. No. 4
54
2-Operand Instructions contd. Sl. No. 4
55
2-Operand Instructions contd. Sl. No. 4
56
2-Operand Instructions contd. Sl. No. 4
57
2-Operand Instructions contd. Sl. No. 5
58
2-Operand Instructions contd. Sl. No. 5
59
2-Operand Instructions contd. Sl. No. 4
60
2-Operand Instructions contd. Sl. No. 5
61
2-Operand Instructions contd. Sl. No. 6
62
2-Operand Instructions contd. Sl. No. 6
63
2-Operand Instructions contd. Sl. No. 6
64
2-Operand Instructions contd. Sl. No. 6
65
2-Operand Instructions contd. Sl. No. 6
66
2-Operand Instructions contd. Sl. No. 6
67
2-Operand Instructions contd. Sl. No. 6
68
2-Operand Instructions contd. Sl. No. 6
69
2-Operand Instructions contd. Sl. No. 7
70
2-Operand Instructions contd. Sl. No. 8
71
2-Operand Instructions contd. Sl. No. 9
Write a Comment
User Comments (0)
About PowerShow.com