home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CCP / 22PUBLIC.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  2KB  |  79 lines

  1. ;Date: 22 Jun 1981 (Monday) 1041-PST
  2. ;From: Neil Maron
  3. ;To:   All
  4. ;Re:   A safe public USER 0 for .COM files patch for CP/M 2.2
  5. ;
  6. ;This patch includes CCPPATCH so that the system will look on
  7. ;drive A: if your .COM file isn't on the logged in drive.  In
  8. ;addition, it makes "USER 0" public.  I consider it safer than
  9. ;the "BDOS22.PAT" which makes "USER 0" public but also may have
  10. ;certain bad side effects.  This of course is tested and is up
  11. ;in my system.
  12. ;
  13. ;This is for CP/M 2.2 .
  14. ;
  15. ;Patchfile>>>
  16. ;
  17. ;N.Maron 19jun81
  18. ;Patch to look on A: for .COM file then look on USER 0
  19. ;or look on USER 0 if d: given explicitly in command.
  20. ;
  21. msize    equ    54       ;CP/M system size in kilobytes
  22. ;
  23. ;Set for your system
  24. ;
  25. delta    equ    0000h       ;offset from standard CP/M size (probably 0 in
  26.                ; your case
  27. bias    equ    (msize-20)*1024-delta  ; offset from 20k CP/M
  28. ccp    equ    3400h+bias
  29. ;
  30. coa    equ    ccp+8ch    ;CCP console output routine from A
  31. gtusr    equ    CCP+113h   ;CCP get user number routine
  32. stusr    equ    CCP+115h   ;CCP set user number routine
  33. ocpmfcb equ    ccp+0d0h   ;CCP open file @ cpmfcb$ routine
  34. cpmtype$ equ    ccp+7d6h   ;type field in cpmfcb$
  35. cmdsk$    equ    ccp+7f0h   ;loc of disk given in command
  36. cmderr    equ    ccp+76bh   ;loc to type error in command
  37. win    equ    ccp+6deh   ;go here if we get file open
  38. ;
  39. patcharea equ    ?????       ;patch area in your CBIOS
  40.                ;(not in CCP or BDOS)
  41. ;
  42.     org    ccp+6dbh
  43.     jz    patch       ;replace "jz cpm+76bh"=jz cmderr
  44. ;
  45.     org    ccp+7f2h   ;replaces an unused area of NOP's
  46. ;
  47. patch:    lxi    h,cmdsk$   ;get drive from current command
  48.     ora    m       ;A=0 on entry, so fetches drive
  49.     jnz    patch1       ;if explicit drive given go try USER 0
  50.                ;(this will be escape even if we force A:)
  51.     inr    m       ;force explicit reference to drive A
  52.     lxi    d,cpmtype$ ;need DE set up to this on entry to CCP
  53.     jmp    ccp+6cdh   ;now go reenter CCP
  54. ;
  55. ;This is the addition to the above patch
  56. ;
  57.     org    patcharea  ;patch area in memory
  58. ;
  59. ;Arrive here because explicit drive set or can't find file on A:
  60. ;
  61. patch1: call    gtusr       ;get user code
  62.     ora    a       ;set flags
  63.     jz    cmderr       ;already user 0 so lose
  64.     mov    e,a       ;get old value into E for later
  65.     push    d       ;save it
  66.     mvi    e,0       ;set USER=0
  67.     call    stusr
  68.     call    ocpmfcb       ;try open again
  69.     pop    d       ;get old user code back before we save flags
  70.     push    psw       ;now save flags from call
  71.     call    stusr       ;now go set back to old user number
  72.     pop    psw       ;get flags back from OPEN call
  73.     jnz    win       ;go to win if we won
  74.     jmp    cmderr       ;too bad we lose
  75. ;
  76.     end
  77. ;
  78. ;<<<<End of patch file
  79.