Assembly language program to Add two numbers by Static inputs
Code
org 100h.stack
.data
.code
main proc
mov ax,4 ;this is the first value
mov bx,3 ;this is the second value
add ax,bx ;the result will save in first register (ax)
mov dx,ax ;move ax to dx register for display
add dx,48 ;in assembly language ASSCI values are added so convert ASSCI value we add 48
add dx,48 ;in assembly language ASSCI values are added so convert ASSCI value we add 48
mov ah,02 ;give 02 to ah register (used for display)
int 21h ;now generate dos interrupt
mov ah,4ch ;give 4ch to ah (used terminatey)
int 21h ;now generate dos interrupt
main endp
end main
int 21h ;now generate dos interrupt
mov ah,4ch ;give 4ch to ah (used terminatey)
int 21h ;now generate dos interrupt
main endp
end main
Comments
Post a Comment