home *** CD-ROM | disk | FTP | other *** search
- ; DateNull.MAC
- ; Traps F_MAKE System Call 22 and sets a null file date under CP/M+ ONLY!
- ;
- ; m80 =datenull
- ;
- ; link datenull[op]
- ; rename datenull.rsx=datenull.prl
- ;
- ; In this case by installing in NULU.COM it will prevent the system from
- ; stamping extracted files with current date as "update" or "creation"
- ; dates (see DateNull.Doc):
- ;
- ; gencom NULU datenull.rsx
- ;
- ; ------------------------------------------------------------------------
- ; December 5, 1989
- ;
- ; The heart of this RSX is a CP/M+ "Set File Date and Time Stamp" function.
- ;
- ; It does this by denying the system access to the BIOS Time function while
- ; the system time is set to the time to be stamped and the file is "made",
- ; in this case by F_Make (BDOS 22).
- ;
- ; This affects only Creation and Update stamping when the referenced drive
- ; has a directory label that requests such stamping and File Control Block
- ; (FCB) extent field is equal to zero.
- ;
- ; This RSX has no bearing on Access date/time stamping by F_Open (BDOS 15)
- ; or on Update stamping by the first F_Write (BDOS 21), first F_WriteRand
- ; (BDOS 34), or first F_WriteZF (BDOS 40) to follow an F_Open call.
- ;
- ; The hardware clock is undisturbed by all this and real time is restored
- ; to the system once it regains access to this clock via the BIOS Time
- ; function.
- ;
- ; Gary R. Welles, P.O. Box 1, Old Mystic, CT 06372-0001
- ; MCI Mail/Telex 650 117-8863 MCI UW
- ; ------------------------------------------------------------------------
- .Z80
-
- ; RSX Header
- ;
- Serial: db 0,0,0,0,0,0 ; CP/M serial number filled in by loader
- Start: jp Main ; jump to start of program
- Next: db 0C3h ; JMP
- dw 0 ; Addr of NEXT RSX or BDOS provided by loader
- Prev: dw 0 ; Addr of Previous RSX provided by loader
- Remove: db 0FFh ; Remove after one use, 0h if not removed
- NonBank:
- db 0 ; Banked System
- Name: db 'DateNull' ; Must be exactly 8 characters
- Loader: db 0,0,0 ; Provided by loader
- ;
- ; -----------------------------------------------------------------------
-
- ; BDOS Functions
-
- cpm equ 5
-
- F_Make equ 22 ;Make file
- T_Set equ 104 ;Set date and time
-
- ; BIOS Functions
-
- wboot equ 1 ;Bios Warm Boot address
- time equ 75 ;Offset to BIOS Time function
-
- ; Z80 instructions
-
- on equ 0C3h ;Z80 jump (jp)
- off equ 0C9h ;Z80 return (ret)
-
- ;CP/M date and time
- ;
- ; The date is represented as a 16-bit integer with day 1
- ; corresponding to January 1, 1978. The time is represented
- ; as two bytes: hours and minutes are stored as two BCD digits.
-
- DaT: db 0,0 ;Date field
- db 0 ;Hour field
- db 0 ;Minute field
-
- Main:
- ld a,c ; Put BDOS Call number in A
- cp F_Make ; Check to see if this is F_Make
- jp nz,Next ; pass the call to next RSX or BDOS if not
-
- push ix ;save calling program registers
- push de
- push bc
-
- ld ix,(wboot) ;Block system access to
- ld (ix+time),off ; the current time
-
- ld c,T_Set ;Set system time
- ld de,DaT
- call cpm
-
- pop bc ;do F_Make as requested
- pop de
- call Next
-
- ld ix,(wboot) ;Restore system access to
- ld (ix+time),on ; the current time
- pop ix
- ret
-
- end