dElmARk Admin
Posts : 92 Join date : 09/04/2012
| Subject: Display Message and Character input Mon Dec 10, 2012 12:33 pm | |
| - Code:
-
Title "EXP. 4 - program 2"
.MODEL SMALL
.DATA MESSAGE DB 'Enter Character: ','$' MESSAGE2 DB 'the character you typed is: ','$' .STACK 200
.CODE MOV AX, @DATA MOV DS,AX INT 21H ;Display message MOV AH,02 ;Function 02h, display character MOV DL,AL ;Load character to be displayed INT 21H LEA DX, MESSAGE MOV AH,09H INT 21H MOV AH,08H ;Function read without echo INT 21H ;Character read is returned in AL register. No Echo on the display MOV BL,AL ;Save character in BL register LEA DX, MESSAGE2 MOV AH,09H ;Display MESSAGE2 INT 21H MOV AH,02 ;Function 02h, displa character MOV DL,BL ;Load character to be displayed from BL INT 21H MOV AH,4CH ;Exit to DOS INT 21H END | |
|