TITLE   Multimodule program for string length   MODULE1.ASM
COMMENT |
        Objective: To show parameter passing via registers
            Input: Requests two integers from keyboard.
|          Output: Outputs the sum of the input integers.
BUF_SIZE  EQU  41   ; string buffer size
.MODEL SMALL
.STACK 100H
.DATA
prompt_msg   DB   'Please input a string: ',0
length_msg   DB   'String length is: ',0
string1      DB   BUF_SIZE DUP (?)

.CODE
INCLUDE io.mac
EXTRN   string_length:PROC
main  PROC
      .STARTUP
      PutStr  prompt_msg     ; request a string
      GetStr  string1,BUF_SIZE  ; read string input
      nwln
      mov     BX,OFFSET string1 ; BX := string pointer
      call    string_length  ; returns string length in AX
      PutStr  length_msg     ; display string length
      PutInt  AX
      nwln
done:
      .EXIT
main  ENDP
      END     main
