Q. Show a string in assembly language?
MOV AH, 09H
MOV DX, OFFSET BUFF
INT 21H
Here data in input buffer stored in data segment is intended to be displayed on monitor.
A complete program:
Input a letter from keyboard and respond. "The letter you typed is ___".
CODE SEGMENT
; set the DS register
MOV AX, DATA
MOV DS, AX
; Read Keyboard
MOV AH, 08H
INT 21H
; Save input
MOV BL, AL
; Display first part of Message
MOV AH, 09H
MOV DX, OFFSET MESSAGE
INT 21 H
; Display character of BL register
MOV AH, 02H
MOV DL, BL
INT 21 H
; Exit to DOS
MOV AX, 4C00H
INT 21H
CODE ENDS
DATA SEGMENT
MESSAGE DB "The letter you typed is $"
DATA ENDS
END.