8085 program to print the table of input integer


In this program we will see how to generate table of an integer.

Problem Statement

Write 8085 Assembly language program to generate a table of input integer. The number is stored at F050, and the table will be stored at F051 onwards.

Discussion

Table generation is basically the multiplication table creation. We are taking the number and storing it to B. And initialize the counter as 0A (10 in decimal). In each step we are adding B with A and store value of A into memory, and decrease the counter by 1. These steps will repeat until the counter become 0.

Input

Address
Data


F050
4


 

Flow Diagram

 

Program

Address
HEX Codes
Labels
Mnemonics
Comments
F000
21, 50 F0
 
LXI H,F050H
memory location where number is stored
F003
46
 
MOV B,M
the number from memory pointed by HL pair
F004
0E, 0A
 
MVI C,0AH
Initialize counter as 0AH
F006
AF
 
XRA A
Clear Acc
F007
80
LOOP
ADD B
Acc = Acc + B
F008
23
 
INX H
Point to next location
F009
77
 
MOV M,A
Store A into memory
F00A
0D
 
DCR C
Decrease C by 1
F00B
C2, 07, F0
 
JNZ LOOP
If Z is not 1, jump to LOOP
F00E
76
 
HLT
Terminate the program

 

Output

Address
Data


F051
04
F052
08
F053
0C
F054
10
F055
14
F056
18
F057
1C
F058
20
F059
24
F05A
28


 

 

 

 

 

 

Updated on: 30-Jul-2019

398 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements