home *** CD-ROM | disk | FTP | other *** search
- ; 8-Sep-86 16:23:36-PDT,1153;000000000000
- ; Return-Path: <pwu@unix.macc.wisc.edu>
- ; Received: FROM UNIX.MACC.WISC.EDU BY B.ISI.EDU WITH TCP ; 8 Sep 86 16:19:27 PDT
- ; Received: by unix.macc.wisc.edu;
- ; id AA04992; 4.12/5; Mon, 8 Sep 86 17:32:20 cdt
- ; Date: Mon, 8 Sep 86 17:32:20 cdt
- ; From: Peter Wu <pwu@unix.macc.wisc.edu>
- ; Message-Id: <8609082232.AA04992@unix.macc.wisc.edu>
- ; To: info-ibmpc-request@mosis
- ; Subject: putn.asm
- ;
- ; allows C program to call cputs with multiple arguments.
- ; E.g. putn("How ", "are ", "you?", 0);
- ; the last argument must be either 0 or ""
-
- _text segment public byte 'code'
- assume cs:_text
-
- extrn _cputs:near
-
- public _putn
- _putn proc near
- push si
- push di
- push bp
- mov bp,sp
-
- mov si,8
- loop:
- mov di,[bp+si] ; get next string
- or di,di ; is it NULL
- je done ; if so, nothing more to print
- or byte ptr [di],0 ; it is "" (null string)
- je done ; if so, nothing more to print
-
- ; now call cputs to print the string
- push di ; push parameter on stack
- call _cputs
- pop di ; get rid of parameter on stack
-
- add si,2 ; point to next parameter
- jmp loop
-
- done:
- pop bp
- pop di
- pop si
- ret
- _putn endp
- _text ends
- end
- ; -----------------------------------------------------------------------