Skip to content

Instantly share code, notes, and snippets.

@Karl-Han
Created April 15, 2019 14:27
Show Gist options
  • Save Karl-Han/88a688796e59fdcfdbaa4be742917f91 to your computer and use it in GitHub Desktop.
Save Karl-Han/88a688796e59fdcfdbaa4be742917f91 to your computer and use it in GitHub Desktop.
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