Title: Instruction TemplateNeed
1Instruction 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
2Concept of Template
- In 8085, MOV r1, r2 (ex. MOV A, B) has the
following template
3Concept of Template contd.
4Concept of Template contd.
58086 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)
68086 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
78086 Template contd.
88086 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
9Case of MOD 11
Ex. Code for MOV AX, BX treated as Move from BX
to destination register AX
10Case 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
11Case of MOD 11 contd.
- Ex Code for MOV AL, BH treated as Move from BL
to destination register AL
12Case 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
1324 Memory Addressing modes
Dr. K. Udaya Kumar BNM Institute of
Technology
14Aid 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
15Case 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
16Case 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
17Case 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
18Case 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
19Direct Addressing
Ex Code for MOV BX, DS1234H Note When
MOD 00 and R/M 110 it is Direct Addressing
208086 Instruction set
218086 Instruction set contd.
228086 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
238086 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.
242-Operand instructions
252-Operand instructions contd. Sl. no.1
262-Operand instructions contd. Sl. no.1
272-Operand instructions contd. Sl. no.1
282-Operand instructions contd. Sl. no.1
292-Operand instructions contd. Sl. no.1
30V- Overflow flag
31V- Overflow flag contd.
32V- Overflow flag contd.
33V- Overflow flag contd.
342-Operand instructions contd. Sl. no.1
352-Operand instructions contd. Sl. no.1
362-Operand instructions contd. Sl. no.1
372-Operand instructions contd. Sl. no.1
382-Operand instructions contd. Sl. no.1
392-Operand instructions Contd. Sl. No.2
40MOV R/M, d8/d16
41ADD R/M, d8/d16
42ADD R/M, d8/d16 contd.
43ADC R/M, d8/d16
44SUB R/M, d8/d16
45SBB R/M, d8/d16
46AND R/M, d8/d16
47OR R/M, d8/d16
48XOR R/M, d8/d16
49TEST R/M, d8/d16
50CMP R/M, d8/d16
512-Operand Instructions contd. Sl. No. 3
522-Operand Instructions contd. Sl. No. 3
532-Operand Instructions contd. Sl. No. 4
542-Operand Instructions contd. Sl. No. 4
552-Operand Instructions contd. Sl. No. 4
562-Operand Instructions contd. Sl. No. 4
572-Operand Instructions contd. Sl. No. 5
582-Operand Instructions contd. Sl. No. 5
592-Operand Instructions contd. Sl. No. 4
602-Operand Instructions contd. Sl. No. 5
612-Operand Instructions contd. Sl. No. 6
622-Operand Instructions contd. Sl. No. 6
632-Operand Instructions contd. Sl. No. 6
642-Operand Instructions contd. Sl. No. 6
652-Operand Instructions contd. Sl. No. 6
662-Operand Instructions contd. Sl. No. 6
672-Operand Instructions contd. Sl. No. 6
682-Operand Instructions contd. Sl. No. 6
692-Operand Instructions contd. Sl. No. 7
702-Operand Instructions contd. Sl. No. 8
712-Operand Instructions contd. Sl. No. 9