9
August 17, 2022 80186 Instruction ( Inst n ) Set 75+ Instructions Summarized.

80186 Microprocessor Instruction Set

Embed Size (px)

DESCRIPTION

I even did this :). How did I do it?? I don't even remember presenting this.

Citation preview

Page 1: 80186 Microprocessor Instruction Set

April 8, 2023

80186 Instruction ( Instn ) Set 75+ Instructions Summarized.

Page 2: 80186 Microprocessor Instruction Set

Instruction and Instruction Set 1.

• An instruction is the basic command, in other words it is the most rudimentary programming command.

• Instruction set refers to the set of all the instructions that can be executed by a microprocessor.

• Instruction = Op-Code+Operands• Op-Code identifies the action to be

taken and operands specify source and destination.

Page 3: 80186 Microprocessor Instruction Set

Instruction and Instruction Set 2.

• Op-Codes are also referred to as mnemonic, written in abbreviated form for ex: move is only mov as an instruction.

• Instructions can use CPU register (including accumulator), memory locations or I/O ports as per need.

• Simple instruction format : op-code destination, source mov ax, bx (comma separated.)

Page 4: 80186 Microprocessor Instruction Set

Basic Instruction Know How?

• When two operands are required for an instruction they are separated by comma. For example: REG, memory

• When there are two operands, both operands must have the same size (except shift and rotate instructions). For example: AL, DL-- DX, AX

• Some instructions allow several operand combinations. For example:memory, immediate -- REG, immediatememory, REG -- REG, REG

Page 5: 80186 Microprocessor Instruction Set

Categorization of Instructions of 186 Mp.

Page 6: 80186 Microprocessor Instruction Set

Examples of Instructions 1.

• Data Transfer Instructions• General Purpose

• MOV ax,bx ;will move contents of bx to ax

• Conversion• CBW ; will convert 8 bits to word 16 bits ie

if ;al<80h, then ah <- 00, if al>7f, then ah<-ffh

• Arithmetic Instructions• Addition

• ADD dx,ch; add dx and ch and put result in dx

• Division• DIV bl; divide ah by bl and put result in ax

Page 7: 80186 Microprocessor Instruction Set

Examples of Instructions 2.

• String• LODSB; accesses data segment, al<-

;ds:[si]• CMPSB ; compare string byte pointer by

;ds:[si] and es:[si]

• Logical • AND cx,dx ; perform bit by bit and

;between cx and dx, result in ;cx.

• TEST cx,dx ;same as AND but will only ;update flags not cx’s

contents.

Page 8: 80186 Microprocessor Instruction Set

Examples of Instructions 3.

• Shift And Rotate • SHL ax,1;shift word operand 1 to left• ROR membds,cl ; rotate data right cl

;times.

• Program Control• Conditional Transfer

• JO ;jump if zero flag is on• REPNE scasb;repeat if zf=0 cx is not equal to 0

• Iteration• LOOP mems ;cx<-cx-1, if cx is not equal to 0,

;the ip<-mems (short range)

Page 9: 80186 Microprocessor Instruction Set

Examples of Instructions 4 & 186 Additions

• Processor Control• NOP ;uses 3 clock cycles & increments ip

;to point to next instruction

• Instruction added in 186 processor• ENTER Make stack frame for

procedure parameters• LEAVE High-level procedure exit• PUSHA Push all general registers• POPA Pop all general registers• BOUND Check array index against

bounds• IMUL Signed (integer) multiply• INS Input from port to string• OUTS Output string to port