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 / SIMTEL / CPMUG / CPMUG078.ARK / PATCH.ASM < prev    next >
Assembly Source File  |  1984-04-29  |  3KB  |  96 lines

  1. ;        TITLE    'CCP patch for CM/M 2.2'
  2. ;
  3. ;
  4. ;7/15/81
  5. ;
  6. ;patch courtesy of the WASHINGTON D.C. AREA CP/M USERS GROUP
  7. ;
  8. ;Used in conjunction with the Tip offered in Volume 1 No 1
  9. ;of 'LIFELINES' (June 1980)  by Andy Johnson-Laird and Cathy
  10. ;Strutynsky which makes USER 0 universal to all USERS 
  11. ;or all USER areas as in MP/M.
  12. ;
  13. ;
  14. ;This patch to the CCP prints the current USER number along
  15. ;with the standard prompt just like MP/M. Example:
  16. ;
  17. ; 0A>USER 5<cr>
  18. ; 5A>B:
  19. ; 5B>USER 0
  20. ; 0B>A:
  21. ; 0A>..........and so forth
  22. ;
  23. ;Note: Neither the first patch to make USER 0 universal nor
  24. ;      this patch will fit in the memory area for the CCP or
  25. ;      BDOS. 
  26. ;      
  27. ;      The patches are best implemented in a CPMXX.COM file
  28. ;      which you have saved; where XX is the size of your
  29. ;      system.
  30. ;
  31. ;      A free memory area in your bios should be found and
  32. ;      the patches assembled to operate at this address.
  33. ;
  34. ;      Load the CPMXX.COM file with DDT, compute offsets
  35. ;      to the appropriate load address for the patch and
  36. ;      jumps. Once the patches are implemented in the 
  37. ;      CPMXX.COM file; save it; and finally sysgen the
  38. ;      patched system.
  39. ;
  40. ;
  41. bdos        equ    0dd00h        ;Change this address to the
  42.                     ;start address of your bdos.
  43.                     ;
  44. ccp        equ    bdos - 800h    ;The CCP is 800h in length
  45.                     ;
  46.                     ;
  47. patch1area    equ    0fe06h        ;You will have to change
  48.                     ;this address to point to
  49.                     ;a free memory area large
  50.                     ;enough to hold the patch.
  51.                     ;Bios or Bios user's area
  52.                     ;is recommended.
  53.                     ;
  54.                     ;
  55. ;This code will be placed into your CCP at the start of ccp plus 388h
  56. ;and will cause a jump to the patch.
  57.                     ;
  58.     org    ccp+388h        ;The jump will be
  59.     jmp    patch1            ;overlaying:    call    XXXX
  60.                     ;next inst:    adi    41h
  61.                     ;
  62.                     ;
  63. ;This code will be placed in your BIOS at the location you have
  64. ;determined as free and indicated above as patch1area.
  65.                     ;
  66.                     ;
  67.     org    patch1area
  68. patch1:    call    ccp + 0113h        ;call ccp routine to
  69.                     ; get current user number.
  70.     cpi    09            ;check if zero thru nine
  71.                     ; or if two digits
  72.                     ; ten thru fifteen.
  73.     jnc    double            ;jump if two digits.
  74.     adi    30h            ;else convert to ascii.
  75. single:    call    ccp + 08ch        ;call ccp conout routine.
  76.     call    ccp + 01D0h        ;call ccp routine to
  77.                     ; get the drive number;
  78.                     ; this call was replaced by
  79.                     ; the jump patch1 instruction.
  80.     jmp    ccp + 38Bh        ;return where ccp left off.
  81.                     ;
  82. double:    adi    26h            ;subtract 10 from the user
  83.                     ; number; the remainder 
  84.                     ; will be the second digit.
  85.                     ; Add 30 to convert it to 
  86.                     ; ascii or just add 26h to
  87.                     ; accomplish both.
  88.     push    psw            ;save the second digit
  89.     mvi    a,31h            ;load an ascii 'one'
  90.     call    ccp + 08ch        ;call ccp conout routine
  91.     pop    psw            ;return second digit
  92.     jmp    single            ;output second digit
  93.                     ; and return
  94. ;
  95.     end
  96.