home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / zslsrc36.lbr / SDATS3.ZZ0 / SDATS3.Z80
Encoding:
Text File  |  1991-10-06  |  1.1 KB  |  59 lines

  1. ; Library:    ZSLIB
  2. ; Version:    3.4
  3. ; Module:    SDATS3
  4. ; Version:    1.0
  5. ; Author:    Gene Pizzetta
  6. ; Date:        October 6, 1991
  7. ;
  8. ; SDATS3 -- Prints short form of date in American or European format, e.g.,
  9. ; "03/02/88" or "02.03.88" with switched output.
  10. ;
  11. ; Entry:  HL = address of date as BCD yy mm dd
  12. ;      A = date format flag (0=American, FFh=European)
  13. ; Exit:   None
  14. ; Uses:   None
  15. ;
  16.     PUBLIC    SDATS3
  17. ;
  18.     EXTRN    ZOUT            ; ZSLIB
  19.     EXTRN    SA2HC            ; SYSLIB
  20. ;
  21. SDATS3:    push    hl
  22.     push    af
  23.     or    a        ; test flag
  24. ; Print month, or day if European
  25.     inc    hl        ; -> month
  26.     jr    z,DoMon
  27.     inc    hl        ; -> day
  28. DoMon:    call    SM2HC
  29.     call    SLASH
  30. ; Print day, or month if European
  31.     inc    hl        ; -> day
  32.     jr    z,DoDay
  33.     dec    hl
  34.     dec    hl        ; -> month
  35. DoDay:    call    SM2HC
  36.     call    SLASH
  37. ; Print year
  38.     dec    hl
  39.     jr    nz,DoYear
  40.     dec    hl
  41. DoYear:    call    SM2HC
  42.     pop    af
  43.     pop    hl
  44.     ret
  45. ;
  46. ; Subroutines
  47. ;
  48. SLASH:    ld    a,'/'
  49.     jr    z,DOut
  50.     ld    a,'.'
  51. DOut:    jp    ZOUT
  52. ;
  53. ; SM2HC - Print value at (HL) as 2 hex chars.
  54. ;
  55. SM2HC:    ld    a,(hl)
  56.     jp    SA2HC        ; Display & return
  57. ;
  58.     end
  59.