8085 Programs

December 23, 2016 | Author: apjcra | Category: N/A
Share Embed Donate


Short Description

Basic 8085 programs...

Description

8085 Programs:

JNC 410D

LARGEST NO.

[L1] ADDITION LXI MOV INX MOV MVI ADD JNC [Loop] INR [Loop] 4152 MOV STA HLT

H,4150 A,M H B,M C,00 B 410C

INR [L1] DCR JNZ [L2] STA MOV STA HLT

D C 4108 4150 A,D 4151

DIVISION C STA A,C 4153

SUBTRACTION LXI H, 4150 MOVA,M INX H MOV B,M MVI C,00 SUB B JNV 4110 [loop] INR C CMA ADI 01 [loop] STA 4152 MOV A,C STA 4153 HLT MULTIPLICATION MVI A,00 MVI B,data 1 MVI C,data 2 MVI D, 00 [L2] ADD B

LDA 4150 MOV B,A LDA 4151 MVI C,00 [L1] CMP B JC 4112 [L2] SUB B INR C JMP 4109 [L1] [L2] STA 4152 MOV A,C STA 4153 HLT SMALLEST NO. LXI H,4150 MOV B,M INX H MOV A,M DCR B [L1] INX H CMP M JC 410D [L2] MOV A,M [L2] DCR B JNZ 4107 [L1] STA 4200 HLT

LXI MOV INX MOV DCR [L1] INX CMP JNC [L2] MOV [L2] DCR JNZ [L1] STA HLT

H,4150 B,M H A,M B H M 410D A, M B 4107 4200

ASCENDING ORDER

L5 L4

LDA 4200 MOV B,A DCR B MOV C,B LXI H,4201 MOV A,M INX H CMP M JC 4114

[L3]

L3

MOV D,M MOV M,A DCX H MOV M,B INX H DCR C JZ 411B

[L2] JMP 4109 [L4] L2 DCR B JZ 4122 [L1] JMP 4105 [L5] L1 HLT

DESCENDING ORDER

L5 L4

LDA MOV DCR MOV LXI MOV INX CMP JNC

4200 B,A B C,B H,4201 A,M H M 4114

[L3]

L3

MOV D,M MOV M,A DCX H MOV M,B INX H DCR C JZ 411B

[L2] JMP 4109 [L4] L2 DCR B JZ 4122 [L1] JMP 4105 [L5] L1 HLT

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF