0% found this document useful (0 votes)
21 views10 pages

Micro Project of Microprocessor

The document outlines a project to develop an Assembly Language Program (ALP) for converting hexadecimal numbers to Binary Coded Decimal (BCD) representations. It details the objectives, including understanding number systems, implementing conversion algorithms, and optimizing the code for performance, while ensuring thorough testing and documentation. The ALP aims to provide a reliable tool for programmers in embedded systems and low-level programming applications.

Uploaded by

nkumbhare566
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views10 pages

Micro Project of Microprocessor

The document outlines a project to develop an Assembly Language Program (ALP) for converting hexadecimal numbers to Binary Coded Decimal (BCD) representations. It details the objectives, including understanding number systems, implementing conversion algorithms, and optimizing the code for performance, while ensuring thorough testing and documentation. The ALP aims to provide a reliable tool for programmers in embedded systems and low-level programming applications.

Uploaded by

nkumbhare566
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

The success of any organization such as CCP vocational a student management system makes it

possible for parents to gain total visibility into their children's school activities, assignments,
attendance, and performance. It also means a smoother transition between classes and grades, as all
teachers have access to a single source of truth about their students’ performance.The aims of a
project to develop an ALP (Assembly Language Program) for converting hexadecimal to equivalent
BCD (Binary Coded Decimal) could include:

1. Understanding hexadecimal and BCD representations.


2. Implementing algorithms for conversion between hexadecimal and BCD.
3. Developing efficient and optimized assembly language code for the conversion process.

4. Handling edge cases and errors in the conversion process.


5. Testing the ALP thoroughly to ensure accuracy and reliability.
6. Documenting the code with comments and explanations for clarity and future reference.
7. Providing user-friendly interfaces if necessary.
8. Optimizing the code for performance if required.

This project aims to develop an Assembly Language Program (ALP) for converting hexadecimal
numbers to their equivalent Binary Coded Decimal (BCD) representations. The conversion process
involves understanding the hexadecimal and BCD number systems and implementing efficient
algorithms to perform the conversion accurately. The ALP will be designed to handle various input
formats and edge cases, ensuring robustness and reliability. Through thorough testing and
optimization, the ALP aims to achieve high performance while maintaining accuracy.
Additionally, the project will focus on documenting the code for clarity and providing
user-friendly interfaces for ease of use. Overall, the developed ALP will serve as a valuable tool for
converting hexadecimal numbers to BCD representations in embedded systems and other
applications requiring low-level programming.

3
The conversion of hexadecimal numbers to Binary Coded Decimal (BCD) is a fundamental
operation in computer systems, especially in embedded systems and low-level programming. BCD
representation is commonly used for storing and manipulating decimal numbers in digital
systems. However, many applications require converting hexadecimal data into BCD format for
various purposes such as interfacing with display devices or performing arithmetic operations.

This project focuses on the development of an Assembly Language Program (ALP) to efficiently
convert hexadecimal numbers to their equivalent BCD representations. The ALP will be designed
to handle input hexadecimal numbers of varying lengths and will produce accurate BCD output.
The conversion process involves breaking down each hexadecimal digit into its binary equivalent
and then grouping them into sets of four bits, which correspond to decimal digits in the BCD
representation.

The project will explore various algorithms and optimization techniques to ensure the conversion
process is both accurate and efficient. Additionally, the ALP will be tested rigorously to verify its
functionality across different input scenarios and edge cases. Documentation will be provided to
explain the implementation details and usage of the ALP, making it accessible to developers and
researchers interested in low-level programming.

Overall, the developed ALP will serve as a valuable resource for programmers working with
embedded systems and other applications requiring the conversion of hexadecimal data to BCD
format. It will contribute to the advancement of digital systems by providing a reliable and
optimized solution for this essential computational task.

4
SR.NO. NAME OF SPECIFICATIONS QUANTITY
RESOURCES

1. Computer System Windows 10 1

2. Software TASM 1.4 1

3. Software Microsoft Word 1

5
In this program we convert hexadecimal number into equivalent BCD. In program we have to use
directives. This program divide into three parts: memory models, declare or initialize data, main
code.
In this program, MODEL SMALL is a memory model, it determines size of code and data
pointers.The stack often holds temporary & local variables. Use the STACK directive only when
writing a main module in assembly language. The STACK used to create stack segment. The DATA
directive create a near data segment. This segment contains the frequently use data for program.
The CODE directive in program instruct the assembler to start the code segment.Declare &
Initialize the variables BIN=019AH, BCD. After that initialize data segment & start main
code.First we store ax register in bin variable....store 64h in el register....el register divide to ax
register after that we store remainder and quotient...then store AH in AL register.... & clear
accumulator...after that we store AH register in CL register & store 04 in CL register. By using
ROR instruction we rotate carry to right side and store result... & terminate the program.

6
In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings
of decimal numbers where each decimal digit is represented by a fixed of bits, usually four or eight,
Hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. If
uses sixteen distinct symbols, most often the symbols "0"-"9" to represent values zero to nine, and
"A" -"F" (or alternatively "a"- "T") to represent values ten to fifteen.

Program outcomes achieved:


< Basic knowledge: An ability to apply knowledge of basic mathematics, science and engineering
to solve the engineering problems.
<Discipline knowledge: Apply basic electronics knowledge to solve board base computer
engineering related problems.

<Experiments and practice: plan to perform Experiments and practices to use the results to solve
board base computer engineering related problems.

Application:
Computer understands information composed of only Zeros and Ones. Therefore, when we type
some letters or words, data is processed by the computer in the form of Os and Is. A computer can
understand positional number system where there are only a few symbols called digits and these
symbols represent different values depending on the position they occupy in the number.
Computer is usually designed to process hexadecimal number. BCD stands for binary coded
decimal in which the digits of a decimal number are encoded and are grouped into four binary
digits one at a time. Its mainly used for accurate representation of decimal number and it's
conversion to and fro with other number system.

7
Step I : Initialize the data segment.
Step II : Initialize BX = 0000 H and DH = 00H.
Step III : Load the number in AX.
Step IV : Compare number with 10000 decimal. If below goto step VII else goto step V
Step V : Subtract 10,000 decimal from AX and add 1 decimal to DH
Step VI : Jump to step IV.
Step VII : Compare number in AX with 1000, if below goto step X else goto step VIII.
Step VIII : Subtract 1000 decimal from AX and add 1000 decimal to BX.
Step IX : Jump to step VII.
Step X : Compare the number in AX with 100 decimal if below goto step XIII
Step XI : Subtract 100 decimal from AX and add 100 decimal to BX.
Step XII : Jump to step X
Step XIII : Compare number in AX with 10. If below goto step XVI
Step XIV : Subtract 10 decimal from AX and add 10 decimal to BX..
Step XV : Jump to step XIII.
Step XVI : Add remainder in AX with result in BX.
Step XVII : Display the result in DH and BX.
Step XVIII : Stop.

8
9
model small
.data
menu db 10d,13d," MENU"
db 10d,"1. Hex to BCD"
db 10d,"2. BCD to Hex"
db 10d,"3. Exit"
db 10d,"Enter your choice: $"
m1 db 10d,"Enter 4 Digit Hex Number: $"
m2 db 10d,"Equivalent BCD Number: $"
num dw 0000h
arr db 5 dup(0)
count db 00h

m3 db 10d,"Enter 5 Digit BCD Number: $"


m4 db 10d,"Equivalent Hex Number: $"
num1 dw 10000D
num2 dw 10d
num3 dw ?

.code
mov ax,@data
mov ds,ax

main: lea dx,menu


mov ah,09H
int 21h

mov ah,01h
int 21h
cmp al,'1'
je case1
cmp al,'2'
je case2
jmp exit
exit: mov ah,4Ch
int 21h
case1: call hextobcd
jmp main
case2: call bcdtohex
jmp main

hex to bcd proc


lea dx,m1
mov ah,09h
int 21h

mov ch,04h
loop1: mov ah,01h
int 21h
cmp al,39h
jbe skip1
sub al,07h
10
skip1: sub al,30h
mov ah,00h
add num,ax
rol num,04
dec ch
jnz loop1

rol num,04

mov ax,num
mov dx,0000h
mov bx,000Ah
lea si,arr
loop2:div bx
mov [si],dx
inc si
inc count
mov dx,0000h
cmp ax,0000h
jnz loop2

lea dx,m2
mov ah,09h
int 21h
dec si
mov ch,05h
loop3: mov dl,[si]
cmp dl,09h
jbe skip2
add dl,07h
skip2: add dl,30h

mov ah,02h
int 21h
dec si
dec ch
jnz loop3
ret
endp
bcd to hex proc
lea dx,m3
mov ah,09h
int 21h
mov bx,0000h
lea si,count
mov dl,05h
mov [si],dl
loop4: mov ah,01h
int 21h

cmp al,39h
jbe skip3
sub al,07h
skip3: sub al,30h
mov ah,00h
mul num1
add bx,ax
mov dx,0000h
11
mov ax,num1
div num2
mov num1,ax
dec count
jnz loop4

lea dx,m4
mov ah,09h
int 21h
mov ch,04h
loop5: rol bx,04h
mov num3,bx
and bx,000Fh
cmp bl,09h
jbe skip4
add bl,07h
skip4: add bl,30h

mov dl,bl
mov ah,02h
int 21h
mov bx,num3
dec ch
jnz loop5

ret
endp
end

http .// w w w.tutoria lsp oint.com /assem bly p rogra m m in g/


"A ssem bly L an guage for x 86 P rocessors" by Kip R. Irv in e
"Program m in g from the Groun d U p" by Jona tha n Bartlett.

12

You might also like