instruction 8085

26
1 Detailed Review of the 8085 Instruction Set

Upload: just4u2cjoshy

Post on 16-Nov-2014

1.504 views

Category:

Documents


6 download

DESCRIPTION

Instruction 8085

TRANSCRIPT

Page 1: Instruction 8085

1

Detailed Review of the 8085 Instruction Set

Page 2: Instruction 8085

2

8085 Instruction Set

The 8085 instructions can be classified as follows:

Data transfer operations

Arithmetic operations (ADD, SUB, INR, DCR)

Logic operations

Branching operations (JMP, CALL, RET)

• Between registers• Between memory location and a register• Direct write to a register / memory• Between I/O device and accumulator

Page 3: Instruction 8085

3

8085 Instruction Types

Page 4: Instruction 8085

4

8085 Instruction Types

Page 5: Instruction 8085

5

8085 Instruction Types

Page 6: Instruction 8085

6

Simple Data Transfer Operations

Examples:

MOV B,A 47 From ACC to REG MOV C,D 4A Between two REGs MVI D,47 16 Direct-write into REG D

47

Page 7: Instruction 8085

7

Simple Data Transfer Operations

Example:

OUT 05 D305

Contents of ACC sent to output port number 05.

Page 8: Instruction 8085

8

Simple Memory Access Operations

Page 9: Instruction 8085

9

Simple Memory Access Operations

Page 10: Instruction 8085

10

Arithmetic Operations

Page 11: Instruction 8085

11

Arithmetic Operations

Page 12: Instruction 8085

12

Arithmetic Operations

Page 13: Instruction 8085

13

Arithmetic Operations

Page 14: Instruction 8085

14

Overview of Logic Operations

Page 15: Instruction 8085

15

Logic Operations

Page 16: Instruction 8085

16

Logic Operations

Page 17: Instruction 8085

17

Logic Operations

Page 18: Instruction 8085

18

Branching Operations

Note: This is an unconditional jump operation. It will always force the program counter to a fixed memory address continuous loop !

Page 19: Instruction 8085

19

Branching Operations

Conditional jump operations are very useful for decision making during the execution of the program.

Page 20: Instruction 8085

20

Example

Write a 8085 machine code program:

Read two different memory locations

Add the contents

Send the result to output port 02 (display) if there is no overflow

Display “FF” if there is an overflow

Stop

Page 21: Instruction 8085

21

Example

2000 LDA 2050 3A2001 502002 202003 MOV B,A 472004 LDA 2051 3A2005 512006 202007 ADD B 802008 JNC 2013 D22009 132010 202011 MVI A,FF 3E2012 FF2013 STA 2053 322014 532015 HLT 20

Load contents of memory location 2050 into accumulator

Load contents of memory location 2051 into accumulator

Save the first number in B

Add accumulator with B

Jump to 2013 if no carry !

Direct write FF into accumulator

Store accumulator contents at 2053

Stop

Page 22: Instruction 8085

22

8255Features:• 3 8-bit IO ports PA, PB, PC • PA can be set for Modes 0, 1, 2. PB for 0,1 and

PC for mode 0 and for BSR. • PC has 2 4-bit parts: PC upper (PCU) and PC

lower (PCL), each can be set independently for 1 or O. Each PC bit can be set/reset individually in BSR mode.

• PA and PCU are Group A (GA) and PB and PCL are Group B (GB)

Page 23: Instruction 8085

23

Pin configuration

Page 24: Instruction 8085

24

A1 A0 Select

0 0 PA

0 1 PB

1 0 PC

1 1 Control reg.

Page 25: Instruction 8085

25

Page 26: Instruction 8085

26