RTFM on that int 21h/0Ah. It requires a "special" buffer - a byte for "max length", and a zero byte to return "length entered", your entered text will begin at buffer + 2. It will not be zero-terminated. It will be CR terminated - you can overwrite the CR with zero, or '$' (more useful), or check the length byte at buffer + 1 and tell int 21h/40h the length.
; --- set the starting location in memory as well as the program
; --- to 16 bits
bits 16
org 0x100
; --- jump to main program
jmp main
; --- initialised data
outStr: db "Please enter a number, max of 5 digits long: "
cr_lf: db 0dh, 0ah, '$' ; caraige line feed
in_buf: db 6 ; length of input buffer
len_in: db 0 ; length of input string
inInt: db 6, 0
times 6 db ' ' ; reserve and init 6 bytes for input
; --- display routine - asumes value to show is in dx
displayMsg:
mov ah, 09h ; request display msg
int 21h ; display msg
ret ; return from function
; --- buffered input routine
inputInt:
mov ah, 0x0a ; request buffered input
int 21h ; get input
ret
; --- main program
main:
mov dx, outStr ; move address of msg to display to dx
call displayMsg ; display message
mov dx, in_buf ; move address of input buffer into dx
call inputInt ; get buffered input
mov dx, cr_lf ; move carraige return + line feed
call displayMsg ; write cr_lf to screen
int 20h ; terminate program
I used to be fond of David Lindauer's GRDB - like DEBUG only smarter...
Best,
Frank