8085 micro processor programs

27
8085 Programs Dr Vinita Kumari

Upload: sayyed-amir-hussain

Post on 23-Jan-2018

131 views

Category:

Education


1 download

TRANSCRIPT

Page 1: 8085 Micro Processor programs

8085 ProgramsDr Vinita Kumari

Page 2: 8085 Micro Processor programs

1's COMPLEMENT OF AN 8-BIT NUMBER

(CMA)

Page 3: 8085 Micro Processor programs

// The number to be complemented is stored in C050

// Answer is stored in C051

# BEGIN 0000H

LDA C050

CMA

STA C051

HLT

// EXAMPLE-> C050=96

// Answer-> C051=69

# ORG C050

# DB 96H

Page 4: 8085 Micro Processor programs

1's COMPLEMENT OF A 16-BIT NUMBER

(stored in memory)

Page 5: 8085 Micro Processor programs

// The 16bit number is stored in C050,C051

// The answer is stored in C052,C053

# BEGIN 0000H

LXI H,C050

MOV A,M

CMA

STA C052

INX H

MOV A,M

CMA

STA C053

HLT

// EXAMPLE-> C050=85,C051=54

// Answer-> C052=7A,C053=AB

# ORG C050

# DB 85H,54H

Page 6: 8085 Micro Processor programs

LXI H,C050

LXI B, C053

MOV A,M

CMA

STAX B

INX H

INX B

MOV A,M

CMA

STAX B

HLT

Page 7: 8085 Micro Processor programs

2's COMPLEMENT OF AN 8-BIT NUMBER

Page 8: 8085 Micro Processor programs

// The number to be complemented is stored in C050

// Answer is stored in C051

# BEGIN 0000H

LDA C050

CMA

INR A

STA C051

HLT

// EXAMPLE-> C050=96

// Answer-> C051=6A

# ORG C050

# DB 96H

Page 9: 8085 Micro Processor programs

Addition of two 8 bit numbers and sum

is 16-bit

Page 10: 8085 Micro Processor programs

Addition of two 8 bit numbers and sum

is 16-bit (Addition with carry)

Page 11: 8085 Micro Processor programs

LXI B, 8501

LXI H,8502

MVI C,00

LDAX B

ADD M

JNC NEXT

INR C

NEXT: INX H

MOV M,A

INX H

MOV M,C

HLT

Page 12: 8085 Micro Processor programs

Transfer of a block of number from one

location to another location

Page 13: 8085 Micro Processor programs

Transfer of a block of number

from one location to another

location

Page 14: 8085 Micro Processor programs

Largest of two numbers (CMP)

Page 15: 8085 Micro Processor programs

Largest of two numbers

Page 16: 8085 Micro Processor programs

Largest number from an array

Page 17: 8085 Micro Processor programs

Largest number from an array

Page 18: 8085 Micro Processor programs

Smallest of two numbers

Page 19: 8085 Micro Processor programs

Smallest of two numbers

Page 20: 8085 Micro Processor programs

Smallest number from array

Page 21: 8085 Micro Processor programs

Smallest number from array

Page 22: 8085 Micro Processor programs

Multiplication of 8 bit numbers with successive addition

Page 23: 8085 Micro Processor programs
Page 24: 8085 Micro Processor programs
Page 25: 8085 Micro Processor programs

Division of 8 bit numbers

Page 26: 8085 Micro Processor programs
Page 27: 8085 Micro Processor programs