
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Program for adding 4 hex digits of a 16-bit number in 8085 Microprocessor
We write an 8085 assembly language program for the addition of 4 hex digits of a 16-bit number whose input is given from the keyboard and the result is displayed in the data field.
FILE NAME ADDHEX.ASM ORG C000H CURDT: EQU FFF9H UPDDT: EQU 06D3H GTHEX: EQU 052FH HXDSP: EQU 05A1H OBUFF: EQU FFFAH MVI A, 0EH SIM EI ; Unmask RST5.5 and enable interrupts MVI B, 00 CALL GTHEX ; Input a 4 digit number and display in address field CALL HXDSP ; Store the 4 hex digits in 4 locations starting from OBUFF LXI H, OBUUF MOV A, M MVI C, 03 AGAIN: INX H ADD M DCR C JNZ AGAIN ; When we are out of this loop, A will have the sum. STA CURDT CALL UPDDT ; Display sum in DATA field. HLT
In the above program we use the HXDSP monitor routine for the first time.
HXDSP monitor routine: This routine is used for the conversion of the value in DE register pair and which stores in the location of 4 bytes starting from the output buffer. The Least Significant unpacked hex byte gets stored in the Output Buffer. On the ALS kit the OBUFF is of location FFFAH, and HXDSP routine which STARTS AT 05A1H. Hence if (DE) + 3456, we will have
- Related Questions & Answers
- Program to convert a 16-bit binary number to BCD in 8085 Microprocessor
- 8085 program to reverse 16 bit number
- Program to multiply two 16-bit binary numbers in 8085 Microprocessor
- 8085 Program to Divide a 16-bit number by an 8-bit number
- 8085 Program to convert a 16-bit binary number to BCD
- 8085 program to find sum of digits of 8 bit number
- 8085 program to add two 16 bit numbers
- 8085 program to divide two 16 bit numbers
- Program to convert BCD to HEX in 8085 Microprocessor
- Program to convert HEX to BCD in 8085 Microprocessor
- Program to convert ASCII to HEX in 8085 Microprocessor
- Program to convert HEX to ASCII in 8085 Microprocessor
- Program for adding 2 numbers input from keyboard in 8085 Microprocessor
- 8085 Program to multiply two 16-bit binary numbers
- 8086 program to divide a 16 bit number by an 8 bit number
Advertisements