home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / PSTRING.AZM / PSTRING.ASM
Encoding:
Assembly Source File  |  1991-06-25  |  768 b   |  35 lines

  1. ;----------------------------------------------------------------
  2. ;        This is a module in the ASMLIB library
  3. ;
  4. ; Print the string -> by DE terminated with a $ or a null.
  5. ;
  6. ;            Written         R.C.H.     16/8/83
  7. ;            Last Update    R.C.H.       20/11/83
  8. ;----------------------------------------------------------------
  9. ;
  10.     name    'pstring'
  11. ;
  12.     public    pstring
  13.     extrn    dispatch
  14.     maclib    z80
  15. ;
  16. pstring:
  17.     push    psw
  18.     push    d
  19. pstring2:
  20.     ldax    d            ; get the character
  21.     inx    d            ; always point to next character
  22.     ora    a
  23.     jrz    pstring3        ; return if a null (00 hex)
  24.     cpi    '$'            ; end of string ??
  25.     jrz    pstring3
  26.     call    dispatch        ; print it
  27.     jr    pstring2
  28. pstring3:
  29.     pop    d
  30.     pop    psw
  31.     ret
  32. ;
  33.     end
  34.  
  35.