8086 Microprocessor ALP Program To Add Two 4 Bit Numbers


Program
assume cs:code,ds:data
data segment
m1 db 0ah,0dh,"Enter 1st no.:$"
m2 db 0ah,0dh,"Enter 2nd no.:$"
m3 db 0ah,0dh,"Result:$"
data ends
code segment
start:mov ax,data
mov ds,ax
lea dx,m1
mov ah,09h
int 21h
mov ah,01h
int 21h
sub al,30h
mov bh,al
mov ah,01h
int 21h
sub al,30h
mov bl,al
lea dx,m2
mov ah,09h
int 21h
mov ah,01h
int 21h
sub al,30h
mov ch,al
mov ah,01h
int 21h
sub al,30h
mov ah,ch
add ax,bx
add al,30h
add ah,30h
mov cx,ax
lea dx,m3
mov ah,09h
int 21h
mov dx,cx
mov ah,02h
int 21h
mov ah,4ch
int 21h
code ends
end start
code ends
end start

No comments:

Post a Comment

Post Your valuable comments here ..........