You are on page 1of 3

org 100h

MOV AH, 0Eh ; select sub-function.


MOV AL, 'H' ; ASCII code: 72
INT 10h ; print it!
MOV AL, 'e' ; ASCII code: 101
INT 10h ; print it!
MOV AL, 'l' ; ASCII code: 108
INT 10h ; print it!
MOV AL, 'l' ; ASCII code: 108
INT 10h ; print it!
MOV AL, 'o' ; ASCII code: 111
INT 10h ; print it!
MOV AL, '!' ; ASCII code: 33
INT 10h ; print it!
ret

org 100h
MOV AX, 0B800h
MOV DS, AX
MOV [2E8h], 'A'
MOV [2EAh], 'l'
MOV [2ECh], 'i'
MOV [2EEh], 'm'
MOV [2F4h], 'H'
MOV [2F6h], 'a'
MOV [2F8h], 's'
MOV [2FAh], 'a'
MOV [2FCh], 'n'
;----------
MOV [338h], '2'
MOV [33Ah], '2'
MOV [33Ch], '3'
MOV [33Eh], '1'
;----------
MOV [388h], 'K'
MOV [38Ah], 'I'
MOV [38Ch], 'E'
MOV [38Eh], 'T'
ret
org 100h
game: mov dx, offset msg1
mov ah, 9
int 21h
; read character in al:
mov ah, 1
int 21h
cmp al, '0'
jb stop
cmp al, '9'
ja stop
cmp al, '5'
jb below
ja above
mov dx, offset equal_5
jmp print
below: mov dx, offset below_5
jmp print
above: mov dx, offset above_5
print: mov ah, 9
int 21h
jmp game ; loop.

stop: ret ; stop

msg1 db "enter a number or any other character to exit: $"


equal_5 db " is five! (equal)", 0Dh,0Ah, "$"
below_5 db " is below five!" , 0Dh,0Ah, "$"
above_5 db " is above five!" , 0Dh,0Ah, "$"

You might also like