home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / bye3 / b3os-2.ins < prev    next >
Text File  |  1994-07-13  |  8KB  |  274 lines

  1.  
  2. ; B3OS-2.INS - Osborne OS-1 insert for BYE3 - 07/30/85
  3. ;
  4. ;            6850 ACIA
  5. ;
  6. ; Note:  This is an insert, not an overlay.  If your OS-1 does not have
  7. ;     have the hardware mod to support DTR, (shown below) then set
  8. ;     the NODTR option in BYE3 to "YES".  Also set:
  9. ;
  10. ;            IMODEM   EQU   YES
  11. ;
  12. ;
  13. ; MAIN LOGIC BOARD TRACE CUTS:
  14. ; --------------------------
  15. ; Solder Side:
  16. ;
  17. ; Cut  trace  running  from pin 5 to pin 6 on inner  row  of  pads
  18. ; used in mounting the    RS-232    female serial connector at the front
  19. ; of  main logic board.  Pin 1 is pad with wide ground trace.
  20. ;
  21. ; Component side:
  22. ;
  23. ; Cut trace from pin 5 of UC4 (6850) to R20 (10K ohm).
  24. ; Cut trace that runs between pins 3 and 4 of UC4 (6850).
  25. ;
  26. ;
  27. ; PART ADDITIONS:
  28. ; --------------
  29. ; Solder side:
  30. ;
  31. ; Add jumper from pin 1 of UE3 (MC1458) to pin 5 of inner row of
  32. ;    RS-232 serial port pads.  Pin 1 has wide ground trace.
  33. ; Add jumper from pin 3 to pin 5 of UE3 (MC1458).
  34. ; Add jumper from pin 10 of UD4 (LM3400) to pin 5 of UC1 (74LS08).
  35. ; Add jumper from pin 4 of UC1 (74LS08) to pin 1 of UE20 (74LS04).
  36. ; Add jumper from pin 6 of UC1 (74LS08) to pin 5 of UA11 (74S04).
  37. ; Add jumper from pin 6 of UA11 (74S04) to pin 19 of UC15 (6821).
  38. ;
  39. ; Component side or solder side (whichever side you feel more
  40. ; comfortable using for mounting components):
  41. ;
  42. ; Add 10K ohm resistor from Vcc (+5 volts) to pin 2 of UE3 (MC1458).
  43. ; Add 220 ohm resistor from pin 5 of UC4 (6850) to pin 2 of UE3 (MC1458).
  44. ; Add 1k  ohm resistor from pin 19 of UC15 (6821) to Vcc (+5 volts).
  45. ;
  46. ; NEW RS-232 MODEM CABLE:
  47. ; ----------------------
  48. ;
  49. ;      OCC-1                MODEM
  50. ;
  51. ;     2    RXD              3    RXD
  52. ;     3    TXD              2    TXD
  53. ;     4    DCD (new function)      8    DCD
  54. ;     5    DTR (new function)     20    DTR
  55. ;     7    GND              7    GND
  56. ;
  57. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  58. ;
  59. ; 07/30/85  Restored to original format            - pst
  60. ; 07/17/85  Revised for use with BYE3            - Kevin Murphy
  61. ;
  62. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  63. ;
  64. HARDMOD    EQU    YES    ; YES, if hardware mods have been done to Osborne
  65.             ;      O-1 to support DTR and modified DCD.
  66.             ; NO,  if the O-1 is standard (no mods).  If NO
  67.             ;      you must be using a Hayes Compatible modem and
  68.             ;      set NODTR to yes in the main equates.
  69.  
  70. ;
  71. STATM    EQU    02A00H        ; Status memory location
  72. DATA    EQU    02A01H        ; Data memory location
  73. CDATA    EQU    02C02H        ; Video PIA data register
  74. CSTAT    EQU    02C03H        ; Video PIA status register
  75. ;
  76.      IF    HARDMOD
  77. DCD    EQU    40H        ; Data carrier detect
  78.      ENDIF
  79. ;
  80.      IF    NOT HARDMOD
  81. DCD    EQU    04H        ; Data carrier detect
  82.      ENDIF
  83. ;
  84. RDAV    EQU    11111110B    ; Reversed DAV
  85. DAV    EQU    00000001B    ; Normal DAV
  86. ;
  87. RTBMT    EQU    11111101B    ; Reversed TBMT
  88. TBMT    EQU    00000010B    ; Normal TBMT
  89. ;
  90. BD300    EQU    22        ; 300 baud
  91. BD1200    EQU    21        ; 1200 baud
  92. ;
  93. ;-----------------------------------------------------------------------
  94. ;
  95. ; See if we still have a carrier - if not, return with the zero flag set
  96. ;
  97. MDCARCK:
  98.      IF    HARDMOD
  99.     DI        ; Disable interrupts
  100.     OUT    0
  101.     LDA    CSTAT    ; Read video PIA status register
  102.     OUT    1
  103.     EI
  104.      ENDIF
  105. ;
  106.      IF    NOT HARDMOD
  107.     CALL    BNKINS    ; Get modem status
  108.     PUSH    PSW    ; Save it
  109.     ANI    DCD    ; If carrier is then reset DCD
  110.     CNZ    MDINP
  111.     POP    PSW
  112.      ENDIF
  113. ;
  114.     CMA        ; Comp register, bit set with LOSS of carrier
  115.     ANI    DCD    ; Mask out everything but carrier LOSS bit (cb2)
  116.     RZ
  117.     ORI    255
  118.     RET
  119. ;
  120. ; Disconnect and wait for an incoming call
  121. ;
  122. MDINIT:    MVI    A,57H        ; Hangup if we can
  123.     CALL    BNKOUTS
  124. ;
  125.     DI
  126.     OUT    0
  127.     LDA    CDATA        ; Read video PIA data register
  128.     OUT    1        ; Reset for future loss of carrier
  129.     EI
  130. ;
  131.     PUSH    B
  132.     MVI    B,20        ; Wait 2 seconds for modem to hangup
  133. OFFTI:    CALL    DELAY
  134.     DCR    B
  135.     JNZ    OFFTI
  136. ;
  137.     LDA    WRKBAUD        ; Modem port reset (enable DTR line)
  138.     ANI    0BFH        ; Enable DTR
  139.     CALL    BNKOUTS
  140. ;
  141.      IF    IMODEM
  142.     CALL    IMINIT        ; Initialize intelligent modem
  143.      ENDIF
  144. ;
  145.     DI
  146.     OUT    0
  147.     LDA    CDATA        ; Read video PIA data register
  148.     OUT    1        ; Reset for future loss of carrier
  149.     EI
  150. ;
  151.     RET
  152. ;
  153. ; Input a character from the modem port
  154. ;
  155. MDINP:    CALL    BNKIND    ; Input data from the outside
  156.     PUSH    PSW    ; Save the character
  157.     LDA    SSTAT    ; Load mirror ACIA status register
  158.     ANI    RDAV    ; Mask the DAV bit (reset DAV bit in mirror
  159.             ;               status register)
  160.     STA    SSTAT    ; Save our mutant status register to ram
  161.     POP    PSW    ; Get the character back
  162.     RET        ; Return to sender
  163. ;
  164. ; Check the status to see if a character is available.    If not, return
  165. ; with the zero flag set.  If yes, use 0FFH to clear the flag.
  166. ;
  167. MDINST:    PUSH    B
  168.     LDA    SSTAT    ; Load ACIA mirror status register
  169.             ; From last status read operation
  170.     MOV    B,A
  171.     CALL    BNKINS    ; Input present ACIA status register
  172.     ORA    B    ; Perform an OR operation on both former
  173.             ;   as well as present acia registers
  174.     STA    SSTAT    ; Save both ACIA register states
  175.     POP    B
  176.     ANI    DAV    ; Mask DAV bit
  177.     RZ
  178.     ORI    255
  179.     RET
  180. ;
  181. ; Send a character to the modem
  182. ;
  183. MDOUTP:    CALL    BNKOUTD    ; Send the data character modem
  184.     LDA    SSTAT    ; Load the clone register
  185.     ANI    RTBMT    ; Mask the TBMT bit
  186.     STA    SSTAT    ; Save the doppelganger register
  187.     RET        ; Return to sender
  188. ;
  189. ; See if the output is ready for another character
  190. ;
  191. MDOUTST:PUSH    B
  192.     CALL    BNKINS    ; Get present ACIA status register
  193.     MOV    B,A    ; Move it to 'B' register
  194.     LDA    SSTAT    ; Get mirror ACIA status register
  195.     ORA    B    ; Perform an OR on present and mirror registers
  196.     POP    B
  197.     STA    SSTAT    ; Save the past and present status registers
  198.     ANI    TBMT
  199.     RZ
  200.     ORI    255
  201.     RET
  202. ;
  203. ; Called by the main program after caller types BYE
  204. ;
  205. MDQUIT:
  206.      IF    IMODEM
  207.     CALL    IMQUIT
  208.      ENDIF
  209. ;
  210. ; Called by the main program after caller types BYE
  211. ;
  212. MDSTOP:    MVI    A,57H
  213.     CALL    BNKOUTS    ; hangup modem
  214.     RET
  215. ;
  216. BNKINS:    DI        ; Disable interrupts
  217.     OUT    0    ; Switch banks to shadow memory bank
  218.     LDA    STATM    ; Read status register ram location
  219.     OUT    1    ; Switch banks back to progaram memory bank
  220.     EI        ; Reenable interrupts
  221.     RET        ; Go home
  222. ;
  223. BNKIND:    DI        ; Disable interrupts
  224.     OUT    0    ; Switch banks to shadow memory bank
  225.     LDA    DATA    ; Read data register RAM location
  226.     OUT    1    ; Switch banks back to program memory bank
  227.     EI        ; Reenable interrupts
  228.     RET        ; Go home
  229. ;
  230. BNKOUTS:DI        ; Disable interrupts
  231.     OUT    0    ; Switch banks to shadow memory bank
  232.     STA    STATM    ; Send data to control register ram location
  233.     OUT    1    ; Switch banks to program memory bank
  234.     EI        ; Reenable interrupts
  235.     RET        ; Go home
  236. ;
  237. BNKOUTD:DI        ; Disable interrupts
  238.     OUT    0    ; Switch banks to shadow memory bank
  239.     STA    DATA    ; Send data to control register ram location
  240.     OUT    1    ; Switch banks to program memory bank
  241.     EI        ; Reenable interrupts
  242.     RET        ; Go home
  243. ;
  244. ; The following routine sets the baudrate.  BYE3 asks for the maximum
  245. ; speed you have available.
  246. ;
  247. SET300:    MVI    A,BD300        ; Set 300 baud
  248.     JMP    SETBAUD
  249. ;
  250. SET1200:MVI    A,BD1200    ; Set 1200 baud
  251. ;
  252. SETBAUD:CALL    BNKOUTS
  253.     STA    WRKBAUD        ; Save incoming baud rate
  254.     XRA    A        ; Show baudrate was ok
  255.     RET
  256. ;
  257. SET2400:ORI    255    ; Osborne can't handle 2400 baud
  258.     RET
  259. ;
  260. ;----------------------------------------------------------------
  261. ;
  262. WRKBAUD:DB    16H    ; [*] OCC1 ++
  263. SSTAT:    DB    0    ; RAM flag location for ACIA status register.
  264.             ;   This is due to ACIA not keeping track of its
  265.             ;   status register when data is going in both
  266.             ;   directions i.e., data being sent out during
  267.             ;   a display listing, and the remote user wants
  268.             ;   to suspend screen display or abort listing
  269.             ;   by generating a ^S or ^K or any other con-
  270.             ;   trol character.
  271. ;
  272. ;    end
  273. ;-----------------------------------------------------------------------
  274.