Created
April 15, 2019 14:27
-
-
Save Karl-Han/88a688796e59fdcfdbaa4be742917f91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data segment | |
err db 'ERROR','$' | |
data ends | |
stack1 segment para stack | |
dw 10h dup(0) | |
stack1 ends | |
codeseg segment | |
start: | |
assume cs:codeseg, ds:data, ss:stack1 | |
mov ax, data | |
mov ds, ax | |
mov ah, 01h | |
int 21h | |
sub al, 30h | |
cmp al, 9 | |
jg error | |
xor ch, ch | |
mov cl, al | |
jcxz done | |
mov dl, '?' | |
mov ah, 02h | |
print: | |
int 21h | |
loop print | |
done: | |
mov ah, 4ch | |
int 21h | |
error: | |
mov dx, offset err | |
mov ah, 09h | |
int 21h | |
jmp done | |
codeseg ends | |
end start | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment