
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Print Table of Input Integer in 8085
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 |
… |
… |
Advertisements