home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / xbnote.lbr / DOS98.ZZ0 / DOS98.Z80
Encoding:
Text File  |  1990-12-07  |  1.6 KB  |  77 lines

  1. no    equ    0
  2. yes    equ    not no
  3. cr    equ    13
  4. lf    equ    10
  5. no_err  equ    01
  6.  
  7. vers    equ    10            ; Release
  8.  
  9. test    equ    no
  10.  
  11. our_call equ    98             ; Our function code
  12.  
  13.     common    /_bbios/        ; Define bios entry points
  14. bbios    equ    $
  15.     cseg
  16.  
  17. timebsx:
  18.     jp    entry            ; Entry routine
  19.     jp    $-$            ; Next module
  20.     dw    init            ; Initialization entry
  21.     dw    deinit            ; Uninit entry
  22.     db    'BSX'            ; BSX id
  23.     db    'ZSDOS Time Read (98) v. ',vers/10 + '0','.',vers mod 10 + '0',0
  24.     maclib    xsys
  25.  
  26.  
  27. entry:
  28.     ld    a,c            ; Get function in A
  29.     cp    a,our_call        ; Is it us
  30.     jr    nz,timebsx+bsxh_nxt    ; No, go to next module
  31.  
  32.     ld    (stksv),sp        ; Save stack pointer
  33.     ld    sp,stksv        ; And get one of our own
  34.     ld    (mov_des),de        ; Save address of users buffer
  35.  
  36.     ld    de,buffer        ; Point to time buffer
  37.     ld    c,1            ; Read clock function
  38.     ld    a,os_index        ; Show where we are
  39.     call    bbios+b_time        ; Call BIOS
  40.  
  41.     ld    de,mov_buf        ; Point to move buffer
  42.     call    bbios+b_move        ; Do move
  43.  
  44.     ld    a,no_err        ; Assume everything ok
  45.     ld    sp,(stksv)        ; Restore stack pointer
  46.     ret                ; And go back
  47.  
  48. ; Clock buffer
  49. ; The first 6 bytes of the XBIOS clock buffer are exactly the 
  50. ; desired return format: YY MM DD HH MM SS ( BCD )
  51.  
  52. buffer:    ds    tmb_length
  53.  
  54. ; Move buffer
  55. mov_buf:
  56.     dw    buffer         ; Source Address
  57.     db    os_index    ; And bank
  58. mov_des:
  59.     dw    $-$        ; Destination Address
  60.     db    tpa_index    ; And bank
  61.     dw    6              ; Length of move, 6 bytes
  62.  
  63. deinit:
  64.     xor    a,a        ; Show O.K.
  65.     ret
  66.  
  67.     ds    20        ; Stack area
  68. stksv:    dw    0        ; Stack save
  69.  
  70. end_of_code equ    $-1        ; End of module
  71.  
  72. init:
  73.     ld    de,end_of_code    ; Show end
  74.     xor    a,a        ; Show successful
  75.     ret
  76.     end
  77.