home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / datenull.ark / DATENULL.MAC < prev    next >
Encoding:
Text File  |  1989-12-05  |  3.1 KB  |  109 lines

  1. ;   DateNull.MAC
  2. ; Traps F_MAKE System Call 22 and sets a null file date under CP/M+ ONLY!
  3. ;
  4. ;    m80 =datenull
  5. ;
  6. ;    link datenull[op]
  7. ;    rename datenull.rsx=datenull.prl
  8. ;
  9. ; In this case by installing in NULU.COM it will prevent the system from
  10. ; stamping extracted files with current date as "update" or "creation"
  11. ; dates (see DateNull.Doc):
  12. ;    gencom NULU datenull.rsx
  13. ;
  14. ; ------------------------------------------------------------------------
  15. ; December 5, 1989
  16. ;
  17. ; The heart of this RSX is a CP/M+ "Set File Date and Time Stamp" function.
  18. ; It does this by denying the system access to the BIOS Time function while
  19. ; the system time is set to the time to be stamped and the file is "made",
  20. ; in this case by F_Make (BDOS 22).
  21. ;
  22. ; This affects only Creation and Update stamping when the referenced drive
  23. ; has a directory label that requests such stamping and File Control Block
  24. ; (FCB) extent field is equal to zero.
  25. ;
  26. ; This RSX has no bearing on Access date/time stamping by F_Open (BDOS 15)
  27. ; or on Update stamping by the first F_Write (BDOS 21), first F_WriteRand
  28. ; (BDOS 34), or first F_WriteZF (BDOS 40) to follow an F_Open call.
  29. ;
  30. ; The hardware clock is undisturbed by all this and real time is restored
  31. ; to the system once it regains access to this clock via the BIOS Time
  32. ; function.
  33. ;
  34. ; Gary R. Welles, P.O. Box 1, Old Mystic, CT  06372-0001
  35. ; MCI Mail/Telex 650 117-8863 MCI UW
  36. ; ------------------------------------------------------------------------
  37.     .Z80
  38.     
  39. ;    RSX Header
  40. ;
  41. Serial:    db    0,0,0,0,0,0    ; CP/M serial number filled in by loader
  42. Start:    jp    Main        ; jump to start of program
  43. Next:    db    0C3h        ; JMP
  44.     dw    0        ; Addr of NEXT RSX or BDOS provided by loader
  45. Prev:    dw    0        ; Addr of Previous RSX provided by loader
  46. Remove:    db    0FFh        ; Remove after one use, 0h if not removed
  47. NonBank:
  48.     db    0        ; Banked System
  49. Name:    db    'DateNull'    ; Must be exactly 8 characters
  50. Loader:    db    0,0,0        ; Provided by loader
  51. ;
  52. ; -----------------------------------------------------------------------
  53.  
  54. ;    BDOS Functions
  55.  
  56. cpm    equ    5
  57.  
  58. F_Make    equ    22    ;Make file
  59. T_Set    equ    104    ;Set date and time
  60.  
  61. ;    BIOS Functions
  62.  
  63. wboot    equ    1    ;Bios Warm Boot address
  64. time    equ    75    ;Offset to BIOS Time function
  65.  
  66. ;    Z80 instructions
  67.  
  68. on    equ    0C3h    ;Z80 jump (jp)
  69. off    equ    0C9h    ;Z80 return (ret)
  70.  
  71. ;CP/M date and time
  72. ;
  73. ; The date is represented as a 16-bit integer with day 1
  74. ; corresponding to January 1, 1978.  The time is represented
  75. ; as two bytes: hours and minutes are stored as two BCD digits.
  76.  
  77. DaT:    db    0,0    ;Date field
  78.     db    0    ;Hour field
  79.     db    0    ;Minute field
  80.  
  81. Main:
  82.     ld    a,c    ; Put BDOS Call number in A
  83.     cp    F_Make    ; Check to see if this is F_Make
  84.     jp    nz,Next    ; pass the call to next RSX or BDOS if not
  85.  
  86.     push    ix    ;save calling program registers
  87.     push    de
  88.     push    bc
  89.  
  90.     ld    ix,(wboot)    ;Block system access to
  91.     ld    (ix+time),off    ; the current time
  92.  
  93.     ld    c,T_Set        ;Set system time
  94.     ld    de,DaT
  95.     call    cpm
  96.  
  97.     pop    bc        ;do F_Make as requested
  98.     pop    de
  99.     call    Next
  100.  
  101.     ld    ix,(wboot)    ;Restore system access to
  102.     ld    (ix+time),on    ; the current time
  103.     pop    ix
  104.     ret
  105.  
  106.     end
  107.