home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / buffers.lbr / TDZS.MAC < prev    next >
Text File  |  1987-01-14  |  384b  |  18 lines

  1.     extrn    .dten, .couta;    hl := hl/10
  2. ;
  3. ; write (hl) in decimal to console, suppress leading zeroes.
  4. .tdzs::
  5.     push    psw
  6.     push    h;        save everything
  7.     call    .dten
  8.     push    psw;        save output digit
  9.     mov    a,h
  10.     ora    l
  11.     cnz    .tdzs;        not left digit, recursive
  12.     pop    psw;        last unlisted digit
  13.     pop    h;        restore input
  14.     adi    '0';        make ascii digit
  15.     call    .couta;        and output it
  16.     pop    psw
  17.     ret
  18. ,