home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / modem / byepc300.arc / BYEXLIB.ARC / SETNAME.ASM < prev    next >
Assembly Source File  |  1987-10-26  |  1KB  |  52 lines

  1.            INCLUDE MODEL.INC
  2. ;
  3. ;---------------------------------------------------------------------------
  4. ;   Function:    void _bye_setname(s)
  5. ;
  6. ;   Parms:    int *s;  -> ptr to string buffer
  7. ;
  8. ;   Purpose:    This function copies a null terminated string up
  9. ;        to 64 characters in length. The string contains the
  10. ;        callers name for the caller currently on line.
  11. ;
  12. ;   Return:    void
  13. ;---------------------------------------------------------------------------
  14. ;
  15.            PUBLIC __bye_setname
  16.  
  17. __bye_setname  PROC
  18.  
  19.            push bp            ;standard 'C' function entry
  20.            mov  bp,sp
  21.            push ds
  22.            push es
  23.            push si
  24.            push di
  25.  
  26.            mov  ah,21        ;AH=21 for get name ptr
  27.            int  BYE_VECT        ;ES:BX = name ptr buffer
  28.            mov  di,bx        ;DI = BX
  29.          IF @datasize
  30.            lds  si,ARG1        ;DS:SI = far ptr source string
  31.          ELSE
  32.            mov  si,ARG1        ;DS:SI = near ptr source string
  33.          ENDIF
  34.  
  35.            cld            ;clear direction flag
  36. setn_loop:     lodsb            ;get a byte at DS:SI in AL
  37.            stosb            ;store a byte at ES:DI
  38.            cmp  al,0        ;end of the string yet?
  39.            jne  SHORT setn_loop    ;no, keep looping
  40.  
  41. setn_end:      pop  di
  42.            pop  si
  43.            pop  es
  44.            pop  ds
  45.            mov  sp,bp        ;standard 'C' exit
  46.            pop  bp
  47.            ret
  48.  
  49. __bye_setname  ENDP
  50.            END
  51.  
  52.