You are on page 1of 1

maxleng equ 100 ; maxleng of inbuffer is 100 chars ;;; not knowing EQU?

then rep lace maxleng of inbuffer by 100. inbuffer db maxleng, ?, maxleng dup(?) ;;; defines special buffer for int 21h/0A H function ;;; mov mov int 0AH dx, ah, 21h require offset of special buffer in dx OFFSET inbuffer 0ah ;;; read string, if input length exceeds inbuffer[0] string is cut

;;; Now inbuffer[1] contains number of chars read in, inbuffer[2].. inbuffer[1+i nbuffer[1]] contains these chars ;;; For output place '$' in inbuffer[2+inbuffer[1]], be careful: must not exceed maxleng mov bx, 0; mov bl, inbuffer[1] mov inbuffer[bx+2], '$' ;;; terminate string by $ for output int 21h/09h ;;; mov mov int now output inbuffer to screen, starting from inbuffer[2] dx, offset inbuffer+2 ah,09H ;;; outputs $ terminated string to screen 21h

You might also like