How to get Input Output form User in ASM.


Following operations is used to get input from user in Assembly language.

MOV ah,01h
int 21h
The input is stored in AL register.

Following operations is used to show output on the screen in Assembly language.

MOV ah,02h
int 21h
The output is show from  DL register.

Sample Program

.model small
.data
input db ?
.code
mov ax,@data
mov ds,ax

mov ah,01h
int 21h
mov input,al

mov dl,input
mov ah,02h
int 21h
mov ah,4ch
int 21h
end

Output:


Comments