Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
PutStrO
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
 
;---------------------------- cut here ----------------------------------
;* PUTSTRO.ASM is a program module containing a procedure to be
;* called by HELLOMO.ASM.
 
_TEXT   SEGMENT WORD PUBLIC 'CODE'      ; Code segment
        ASSUME  cs:_TEXT
 
        PUBLIC  C putstr                ; Declare a C public symbol
putstr  PROC    NEAR C                  ; Define a near C procedure
        push    bp                      ; Set up stack frame
        mov     bp, sp
 
        mov     ah, 02h                 ; Display character function
        mov     di, [bp+4]              ; Load address of string
next:
        mov     dl, [di]                ; Load each character through [DI]
        or      dl, dl                  ; Done if character is zero
        jz      exit
        int     21h                     ; DOS displays character
        inc     di                      ; Point to next character
        jmp     next
exit:
        pop     bp                      ; Destroy stack from and return
        ret
 
putstr  ENDP
 
_TEXT   ENDS
        END
                                    -♦-