; CS2011, A Term 1999
; Prof. Sergio A. Alvarez

title I/O Procedure Tests

; topmatter goes here

main proc
.startup
;
.exit
main endp

getstring proc
; reads a string from the console using DOS function 0Ah
; preconditions:  DX contains the offset of the input record rec
;   rec[0] contains max, the maximum allowable number of input characters
; postconditions: the string entered by the user has been stored in
;   rec[2] ... rec[stringlength + 1] (assuming stringlength is < max)
;   no registers have been altered
;
; implementation goes here
;
getstring endp

writemessage proc
; writes a '$'-terminated string to the console using DOS function 09h
; preconditions:  DX contains the offset of the output string
;   the last character of the string is '$'
; postconditions: the string has been written to the console
;   no registers have been altered
   push ax
   mov ah,09
   int 21h
   pop ax
   ret
writemessage endp

