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 / KAYPRO / ADVENT1.ARK / FB83PAT.ASM < prev    next >
Assembly Source File  |  1986-09-19  |  4KB  |  140 lines

  1. ; 6-16-86 GSD   added ID string for TRPATCH
  2. ; 5-21-86 GSD    fixed bug in '83 patches
  3. ; 4-3-86 Gary Dickinson Advent Products, Inc.
  4. ;
  5. ; Patches to Phil Becker's FASTBACK and FASTREST programs
  6. ; to enable them to operate with '83 and '84 model Kaypro computers
  7. ;
  8. ; These patches have been tested on FASTBACK 1.1, FASTREST 1.1A, and
  9. ; FASTREST 1.1B.
  10. ;
  11. ; The patches assemble with DRI MAC assembler and are intended to be
  12. ; patched into either FASTBACK.COM or FASTREST.COM using DDT.
  13. ;
  14. ; This code selects the first floppy disk drive which must be a
  15. ; standard double sided 48 TPI disk drive.
  16. ;
  17. ; This code takes into account the differences between the following
  18. ; types of 8 bit Kaypro Computers:
  19. ;
  20. ;    1.  '83 Kaypros (single serial port, no graphics)
  21. ;    2.  '84 Kaypros (two serial ports, graphics)
  22. ;       3.  Kaypro 10s (two serial ports, graphics, hard disk controller
  23. ;           reset logic tied to floppy disk select logic.
  24. ;
  25. ;
  26. ; The following table relates the bit port definitions for the 3 types
  27. ; of Kaypro Computers:
  28. ;
  29. ; +--------+------+-------+-------+-------+-------+-------+------+------+
  30. ; |  BIT   |  D7  |  D6   |  D5   |  D4   |  D3   |  D2   |  D1  |  D0  |
  31. ; +--------+------+-------+-------+-------+-------+-------+------+------+
  32. ; | '84/10 | BANK |  (1)  | DDEN* | MTRON | STRB* | SIDE* |  B*  |  A*  |
  33. ; +--------+------+-------+-------+-------+-------+-------+------+------+
  34. ; |  '84   | BANK | MTRON*| DDEN* | STRB* |  (2)  | SIDE  |  B   |  A   |
  35. ; +--------+------+-------+-------+-------+-------+-------+------+------+
  36. ;
  37. ; Notes:    
  38. ;      (1)  This bit when read is the BUSY* status for the parallel port.
  39. ;           This bit as an output controlls the alternate character gen-
  40. ;        erator logic that has probably never been used.
  41. ;      (2)  This bit when read is the BUSY* status for the parallel port.    
  42. ;       *   These bits are active LOW
  43. ;
  44. ;
  45. TRUE    EQU    0ffffh
  46. FALSE    EQU    NOT TRUE
  47.  
  48. K10    EQU    FALSE   ; set true if Kaypro 10
  49. K84    EQU    FALSE    ; set true if '84 Kaypro that is not K10
  50. K83    EQU    TRUE     ; set true if '83 Kaypro
  51. FBACK    EQU    TRUE    ; set true if FASTBACK, FALSE if FASTREST
  52. FRVERS    EQU    11BH    ; FASTREST version 1.1B (11AH for version 1.1A)
  53.  
  54.     if    FBACK    ; FASTBACK.COM Version 1.1
  55. VMSG    EQU    02C0H
  56.     org    02d2H    ; ID string
  57.     db    '1.1'
  58. SELDRV    EQU    0E4EH
  59. TGLSID    EQU    0E89H
  60.     else    
  61.     if    FRVERS EQ 11AH    ; FASTREST.COM Version 1.1A
  62. VMSG    EQU    02C0H
  63.     org    02d2H    ; ID string
  64.     db    '1.1a'
  65. SELDRV    EQU    1405H
  66. TGLSID    EQU    1435H
  67.     endif
  68.     if    FRVERS EQ 11BH    ; FASTREST.COM Version 1.1B
  69. VMSG    EQU    02C0H
  70.     org    02d2H    ; ID string
  71.     db    '1.1b'
  72. SELDRV    EQU    1405H
  73. TGLSID    EQU    1438H
  74.     endif
  75.     endif
  76.  
  77.     if    K84 OR K10    ; '84 and K10 port and bit addresses
  78.  
  79. BITPORT    EQU    014H    ; bit port address
  80. BANK    EQU    080H    ; Bank select bit pattern
  81. DDEN    EQU    020H    ; Double density bit pattern
  82. MTRON    EQU    010H    ; Motor on bit
  83. STROBE    EQU    008H    ; Parallel port strobe
  84. SIDSEL    EQU    004H    ; side select bit
  85. BSEL    EQU    002H    ; B: drive select
  86. ASEL    EQU    001H    ; A: drive select
  87. STATE    EQU    DDEN OR SIDSEL OR BSEL OR ASEL    ; negative true bits
  88.  
  89.     else        ; '83 port and bit addresses
  90.  
  91. BITPORT    EQU    01CH    ; bit port address
  92. BANK    EQU    080H    ; Bank select bit pattern
  93. MTRON    EQU    040H    ; Motor on bit
  94. DDEN    EQU    020H    ; Double density bit pattern
  95. STROBE    EQU    010H    ; Parallel port strobe
  96. SIDSEL    EQU    004H    ; side select bit
  97. BSEL    EQU    002H    ; B: drive select
  98. ASEL    EQU    001H    ; A: drive select
  99. STATE    EQU    MTRON OR DDEN    ; negative true bits
  100.     endif
  101.  
  102.     if    K10    
  103. BITMSK    EQU    002H    ; mask for hard disk reset
  104.     else
  105. BITMSK    EQU    000H    ; no hard disk reset
  106.     endif
  107.  
  108.     org    VMSG    ; version message
  109.  
  110.     if    K10
  111.     db    'Kaypro 10 Version'
  112.     endif
  113.     if    K84
  114.     db    'Kaypro 84 Version'
  115.     endif
  116.     if    K83
  117.     db    'Kaypro 83 Version'
  118.     endif
  119.  
  120.     org    SELDRV    ; code to select floppy disk drive
  121.  
  122.     in    BITPORT    
  123.     ani    BANK OR STROBE OR BITMSK
  124.     ori    ((MTRON OR ASEL OR DDEN) XOR STATE) AND NOT BITMSK
  125.     out    BITPORT
  126.  
  127.  
  128.     org    TGLSID        ; code to switch sides on the diskette
  129.  
  130.     ani    SIDSEL        ; isolate side select bit        
  131.     xri    STATE        ; correct side select polarity
  132.     mov    b,a
  133.     in    BITPORT
  134.     ani    BANK OR STROBE OR BITMSK    ; preserve these bits
  135.     ori    ((MTRON OR ASEL OR DDEN) XOR STATE) AND NOT (BITMSK OR SIDSEL)
  136.     ora    b        ; add back side select bit
  137.     out    BITPORT
  138.  
  139.     end
  140.