Assembly language program to Subtract two numbers by Static inputs

Code 

org 100h

.stack
.data
.code
main proc
        mov ax,6      ;this is the first value
        mov bx,3      ;this is the second value
        sub 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
         
        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

Output








Comments

Popular posts from this blog

Assembly language program to input an integer from user and display whether the number is even or odd

Assembly language program to input string from user and display it

Assembly language program to input string from user and display its length