home *** CD-ROM | disk | FTP | other *** search
- no equ 0
- yes equ not no
- cr equ 13
- lf equ 10
- no_err equ 01
-
- vers equ 10 ; Release
-
- test equ no
-
- our_call equ 98 ; Our function code
-
- common /_bbios/ ; Define bios entry points
- bbios equ $
- cseg
-
- timebsx:
- jp entry ; Entry routine
- jp $-$ ; Next module
- dw init ; Initialization entry
- dw deinit ; Uninit entry
- db 'BSX' ; BSX id
- db 'ZSDOS Time Read (98) v. ',vers/10 + '0','.',vers mod 10 + '0',0
- maclib xsys
-
-
- entry:
- ld a,c ; Get function in A
- cp a,our_call ; Is it us
- jr nz,timebsx+bsxh_nxt ; No, go to next module
-
- ld (stksv),sp ; Save stack pointer
- ld sp,stksv ; And get one of our own
- ld (mov_des),de ; Save address of users buffer
-
- ld de,buffer ; Point to time buffer
- ld c,1 ; Read clock function
- ld a,os_index ; Show where we are
- call bbios+b_time ; Call BIOS
-
- ld de,mov_buf ; Point to move buffer
- call bbios+b_move ; Do move
-
- ld a,no_err ; Assume everything ok
- ld sp,(stksv) ; Restore stack pointer
- ret ; And go back
-
- ; Clock buffer
- ; The first 6 bytes of the XBIOS clock buffer are exactly the
- ; desired return format: YY MM DD HH MM SS ( BCD )
-
- buffer: ds tmb_length
-
- ; Move buffer
- mov_buf:
- dw buffer ; Source Address
- db os_index ; And bank
- mov_des:
- dw $-$ ; Destination Address
- db tpa_index ; And bank
- dw 6 ; Length of move, 6 bytes
-
- deinit:
- xor a,a ; Show O.K.
- ret
-
- ds 20 ; Stack area
- stksv: dw 0 ; Stack save
-
- end_of_code equ $-1 ; End of module
-
- init:
- ld de,end_of_code ; Show end
- xor a,a ; Show successful
- ret
- end