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 / IMP / I2OS-5.AZM / I2OS-5.ASM
Assembly Source File  |  2000-06-30  |  32KB  |  986 lines

  1.  
  2. ; I2OS-4.ASM  -  Osborne OS-1 overlay file  for IMP2  - 06/01/87
  3. ;
  4. ;               6850  ACIA
  5. ;  NOTE:
  6. ;
  7. ;    This overlay will NOT work with the Osborne COMM-PAC modem or
  8. ;    CTS DATACOMM modem.  Both of these modems fit in the Osborne 1
  9. ;    left diskette storage pocket and connect to the 9 pin modem
  10. ;    socket.  These two modems are 300 bps only and do not have the
  11. ;    faster baud rates necessary to take advantage of the IMP2 pro-
  12. ;    gram.
  13. ;
  14. ;    The new 1K CRC protocol is not supported at 300 bps in IMP or
  15. ;    KMD.  KMD batch transfers with IMP and KMD are supported only
  16. ;    with 1K CRC protocol at 1200 and 2400 bps.
  17. ;
  18. ;    No real advantage is gained with using IMP at 300 bps.    Osborne
  19. ;    COMM-PAC and CTS DATACOM users should continue to use MDM740.
  20. ;
  21. ;-----------------------------------------------------------------------
  22. ;
  23. ; Edit this file for your preferences then follow the "TO USE:" example
  24. ; shown below.
  25. ;
  26. ; Many terminals will clear the screen with a CTL-Z.  If yours does, put
  27. ; a 1AH at CLEAR: (010AH).  Many terminals use two characters, the first
  28. ; normally an ESC.  For example, ESC *.  In this case put '*' at CLEAR:
  29. ; (The ESC will automatically be typed with no CTL-character present.)
  30. ; If you don't know what your terminal uses, put a 0 at CLEAR: and IMP2
  31. ; will scroll up 24 blank lines to clear the CRT for things like MENU,
  32. ; looking at the function key table, typing CTL-Z in command mode, etc.
  33. ;
  34. ; Use the "SET" command to change the baudrate when desired.  The value
  35. ; at MSPEED controls the baudrate when the program is first called up.
  36. ;
  37. ;    TO USE: First edit this file filling in answers for your own
  38. ;        equipment.  Then assemble with ASM.COM or equivalent
  39. ;        assembler.  Then use MLOAD to merge into the main file:
  40. ;
  41. ;        MLOAD IMP.COM=IMP2xx.COM,I2OS-x.HEX
  42. ;
  43. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  44. ;
  45. ; 06/01/87  Improved the GOODBYE routine, added BREAK routine, needs
  46. ;        IMP245 to use it.        - Irv Hoff
  47. ; 05/27/86  * Re-edited NUEVO routines to correct assembly errors.
  48. ;        * Re-edited documentation on hardware modifications.
  49. ;        * Software selection for 2400 bps operation now available
  50. ;          with Osborne ROM version 1.45.
  51. ;                    - Roy Robinson
  52. ;                      FOG #4 RCP/M
  53. ;
  54. ; 10/27/85  * Modified for DTR control of modem.
  55. ;        * Added NUEVO equate to provide software selection for 2400
  56. ;          bps.            - Roy Robinson
  57. ;
  58. ; 06/27/85  Written for use with IMP2    - Irv Hoff
  59. ;
  60. ;
  61. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  62. ;
  63. ; DOCUMENTATION FOR THIS IMP OVERLAY:
  64. ;
  65. ; SUMMARY:
  66. ;
  67. ; If you intend to use this overlay with none of the hardware modifica-
  68. ; tions described below, set the ROM145 and DTRMOD equates to NO.  Your
  69. ; version of IMP2 will have the following baud rate selections: 300 and
  70. ; 1200 bps.
  71. ;
  72. ; The NUEVO equate allows the use of a separate "piggy-back" 80 column
  73. ; video board with the optional baud rate generator installed.    This
  74. ; board is made by NUEVO Electronics Corporation.  You may contact NUEVO
  75. ; Electronics at the VOICE phone number (713) 341-6001.
  76. ;
  77. ; The DTRMOD equate allows hardware control of the external modem.  The
  78. ; DTR signal line can force the modem to hangup the telephone line.
  79. ;
  80. ; The ROM145 equate allows the use of a special ROM for supporting soft-
  81. ; ware selection of 300/1200/2400 bps with IMP2.
  82. ;
  83. ; ------------
  84. ; The NUEVO equate:
  85. ;
  86. ; If you have the NUEVO 80 column video board with the optional baud
  87. ; rate generator installed, set the NUEVO equate to YES.  You will have
  88. ; the following baud rate selections: 300, 1200, 2400, 4800, 9600 and
  89. ; 19200 bps.  Setting either the HS2400 or HS1200 equate to YES, along
  90. ; with the matching MSPEED value will configure IMP for 2400 or 1200
  91. ; bps respectively when the program is called up.
  92. ;
  93. ; If your NUEVO 80 column board does NOT have the optional baud rate
  94. ; generator, set the NEUVO equate to NO.  You will have the following
  95. ; baud rate selections: 300 and 1200 bps.
  96. ; Contact NUEVO if you wish to install the baud rate generator on your
  97. ; NUEVO 80 column board.
  98. ;
  99. ; Be sure the ROM145 equate is set to NO if the NUEVO equate is set YES.
  100. ;
  101. ;
  102. ; ------------
  103. ; The DTRMOD equate:
  104. ;
  105. ; If you install the DTR modification on your Osborne 1 main logic board
  106. ; set the DTRMOD equate to YES.  If you are using an UNMODIFIED main
  107. ; logic board, set the DTRMOD equate to NO.  The DTR modification gives
  108. ; the Osborne 1 the feature of forcing the modem to hang up the phone by
  109. ; dropping the 6850 ACIA RTS line.  This control line is then connected
  110. ; to the modem DTR input.
  111. ;
  112. ; The DTR modification is highly recommended if your modem does not
  113. ; accept the Hayes/Racal-Vadic modem software command format.
  114. ;
  115. ; If you do use the DTR modification, you will need to build a special
  116. ; RS-232 cable from your Osborne 1 serial port to your external modem.
  117. ; Your modem must support DTR line control and you must set the proper
  118. ; modem switch(es) or program the modem internal memory to monitor the
  119. ; DTR signal.
  120. ;
  121. ; Below is the RS-232 cable diagram for an external modem using DTR
  122. ; control and the Osborne OS-1:
  123. ;
  124. ;
  125. ;      MODEM                OCC-1
  126. ;
  127. ;     2    TXD              3    TXD
  128. ;     3    RXD              2    RXD
  129. ;     7    GND              7    GND
  130. ;    20    DTR              5    RTS (new function)
  131. ;
  132. ;
  133. ;
  134. ;          INSTALLATION OF THE DTR MODIFICATION
  135. ;
  136. ; The main logic board is divided into zones which are identified on the
  137. ; component side of the board by LETTER co-ordinates found on the left
  138. ; edge of the board and by NUMBER co-ordinates found on the rear edge of
  139. ; the board i.e., the 6850 ACIA device is located in zone C5 and the
  140. ; MC1458 device is located in zone E3.    The NUMBER co-ordinates are also
  141. ; found near the center axis along the length of the main logic board.
  142. ; The front edge of the logic board has the printer connector, serial
  143. ; connector, and video controls mounted at this edge.
  144. ;
  145. ;
  146. ; A WORD OF CAUTION:
  147. ; If you are unsure how to identify IC devices and count device pin num-
  148. ; bers, find a friend who does, attend a user group meeting, or take
  149. ; your computer to a computer store/service center for further help.
  150. ; This advice ALSO applies if you do not have experience in good solder-
  151. ; ing techniques.  I have seen these expensive boards burned with traces
  152. ; and pads damaged by people using improper soldering irons.  These
  153. ; boards have been ruined by users using acid core solder instead of
  154. ; good quality electronic solder.  I have seen boards damaged by solder
  155. ; bridges and poorly laid out component installation.  Please, if you
  156. ; don't know what you are doing, find someone who does.  You may contact
  157. ; FOG, an international user group, if you have any questions about
  158. ; these modifications.    You may contact FOG by calling the VOICE number:
  159. ; (415) 755-2000 or by writing to:
  160. ;
  161. ;            FOG
  162. ;            P. O. BOX 3474,
  163. ;            Daly City, CA  94015-0474
  164. ;
  165. ;
  166. ;
  167. ;    OSBORNE 1 MAIN LOGIC BOARD TRACE CUTS:
  168. ;
  169. ;    On the main logic board - SOLDER SIDE:
  170. ;
  171. ; 1.    Cut the trace running from pin 5 to pin 6 on the inner row of
  172. ;    pads used to mount the RS-232 female serial connector at the
  173. ;    front edge of the main logic board.  Pins 5 and 6 are the only
  174. ;    ADJACENT pins with a trace connecting them.  Do not confuse this
  175. ;    trace with another trace which connects pins 6 and 8.  Pin 1 is
  176. ;    the pad with a wide ground trace.
  177. ;
  178. ;    On the main logic board - COMPONENT SIDE:
  179. ;
  180. ; 2.    Cut the trace from pin 5 of the 6850 ACIA device in zone C5 to
  181. ;    resistor R20 (10K ohm) in zone D5.
  182. ;
  183. ;    PART ADDITIONS:
  184. ;
  185. ;    On the main logic board SOLDER SIDE:
  186. ;
  187. ; 3.    Add a jumper wire from pin 1 of the MC1458 device in zone E3 to
  188. ;    pin 5 on the inner row of RS-232 serial port pads.  Pin 1 of the
  189. ;    serial port is the pad with a wide ground trace.
  190. ;
  191. ; 4.    Add a jumper wire from pin 3 of the MC1458 device in zone E3 to
  192. ;    pin 5 of the same MC1458 device in zone E3.
  193. ;
  194. ;    On the main logic board COMPONENT SIDE or SOLDER SIDE:
  195. ;
  196. ;           (whichever side you feel is easier for mounting
  197. ;           two 1/4 watt resistors)
  198. ;
  199. ; 5.    Mount a 10K ohm resistor from Vcc which is +5 volts (pin 14 of
  200. ;    the 74LS02 device in zone D2 is a good solder point) to pin 2 of
  201. ;    the MC1458 device in zone E3.
  202. ;
  203. ; 6.    Mount a 220  ohm resistor from pin 5 of the 6850 ACIA device in
  204. ;    zone C5 to pin 2 of the MC1458 device in zone E3.  Pin 2 of the
  205. ;    MC1458 device in zone E3 should now have two resistor leads
  206. ;    soldered to it.
  207. ;
  208. ;
  209. ; ------------
  210. ; The ROM145 equate:
  211. ;
  212. ; This equate uses a new Osborne 1 Monitor ROM, Version 1.45. This ROM
  213. ; allows 300/1200/2400 baud software selection for the 6850 ACIA.  The
  214. ; ROM is used with a hardware modification to the Osborne 1 main logic
  215. ; board.  The hardware modification involves installation of five jumper
  216. ; wires.
  217. ;
  218. ; The code in the new 1.45 ROM changes the 6821 control byte value for
  219. ; the video PIA register A. The CA2 Peripheral Control Line now becomes
  220. ; an output control line rather than an input status line.
  221. ;
  222. ; If the modification is installed you will be unable to use the Osborne
  223. ; COMM-PAC or CTS DATA-COMM modems.  The CA2 line was originally a modem
  224. ; input status line for these modems.  With the new ROM, the CA2 line is
  225. ; now an output control line used for selecting one of two clock fre-
  226. ; quencies input to the 6850 ACIA.
  227. ;
  228. ; If you have a single density Osborne 1 computer (ROM versions 1.3 and
  229. ; lower).  You cannot install this modification.  Contact FOG for fur-
  230. ; ther help.
  231. ;
  232. ; The new ROM 1.45 is available from FOG, a non-profit international
  233. ; computer user group.
  234. ;
  235. ; You may contact FOG by calling the VOICE number (415) 755-2000 or by
  236. ; writing to:
  237. ;
  238. ;               FOG
  239. ;               P. O. BOX 3474,
  240. ;               Daly City, CA  94015-0474
  241. ;
  242. ;
  243. ; INSTALLATION OF ROM 1.45 MODIFICATION:
  244. ;
  245. ;    On the main logic board - COMPONENT SIDE:
  246. ;
  247. ; 1.    Replace the old ROM with the new ROM version 1.45.  This ROM is
  248. ;    found at location D12.    Note the orientation of pin 1 for the
  249. ;    ROM.
  250. ;
  251. ; 2.    Remove Jumper J1 located next to the 6850 ACIA device located
  252. ;    in zone C5.  There is a silkscreen notation "J1" adjacent to the
  253. ;    jumper.  This will expose two pins which we will refer to as the
  254. ;    Jumper J1 FRONT pin and the Jumper J1 REAR pin.
  255. ;
  256. ;    Jumper J1 FRONT pin is the pin toward the front edge of the main
  257. ;    logic board.  The front edge has the printer connectors and video
  258. ;    controls mounted at the edge.  Since we will be mounting jumpers
  259. ;    on the solder side of the main logic board, you will be able to
  260. ;    identify the Jumper J1 FRONT pin because this pin has a trace
  261. ;    leading to pin 7 of the 74LS161 device at zone C3 on the solder
  262. ;    side of the main logic board.
  263. ;    Jumper J1 REAR pin has no trace on the solder side of the board
  264. ;    and is located toward the rear edge of the main logic board.
  265. ;
  266. ;    On the main logic board - SOLDER SIDE
  267. ;
  268. ; 3.    Mount a jumper wire from pin 4 of the 74LS08 device in zone A5
  269. ;    to the REAR pin of Jumper J1. This REAR J1 pin is the pin which
  270. ;    is closer to the 74LS08 device.
  271. ;
  272. ; 4.    Mount a jumper wire from pin 5 of the 74LS08 device in zone A5
  273. ;    to pin 39 of the 6821 device found within zones C15, C16, C17,
  274. ;    and C18.  (The 6821 is a 40 pin device and occupies several
  275. ;    zones.)
  276. ;
  277. ; 5.    Mount a jumper wire from pin 6 of the 74LS08 device in zone A5
  278. ;    to pin 5 of the 74LS02 device in zone D2.
  279. ;
  280. ; 6.    Mount a jumper wire from pin 5 of the 74LS02 device in zone D2
  281. ;    to pin 6 of the same 74LS02 device in zone D2.    Pin 5 of the
  282. ;    74LS02 device in zone D2 now has two jumpers soldered to it.
  283. ;
  284. ; 7.    Mount a jumper wire from pin 4 of the 74LS02 device in zone D2
  285. ;    to the FRONT pin of Jumper J1.    This FRONT J1 pin is the pin
  286. ;    which is closer to the 74LS02 device.
  287. ;
  288. ;-----------------------------------------------------------------------
  289. ;
  290. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  291. ;
  292. ;*    TAMPERING WITH YOUR MAIN LOGIC BOARD MAY VOID ANY WARRANTY
  293. ;     OR SERVICE AGREEMENTS ON YOUR COMPUTER.
  294. ;
  295. ;*    UNPLUG YOUR COMPUTER FROM THE AC OUTLET BEFORE DISASSEMBLING
  296. ;     THE COMPUTER.  USE COMMON SENSE.
  297. ;
  298. ;*    ALTHOUGH THE MODIFICATION HAS BEEN TESTED ON SEVERAL MAIN
  299. ;     LOGIC BOARDS HAVING DIFFERENT REVISION LEVELS, THE MODIFI-
  300. ;     CATION IS DONE AT YOUR OWN RISK.
  301. ;
  302. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  303. ;
  304. ;
  305. YES    EQU    0FFH
  306. NO    EQU    0
  307. ;
  308. ;
  309. ;    EQUATES FOR MODIFICATIONS TO STANDARD OZZIE MAIN LOGIC BOARD
  310. ;
  311. DTRMOD    EQU    NO    ; YES, if hardware mods have been installed on
  312.             ;   Osborne 1 main logic board to support DTR
  313.             ;   control of external modem.
  314.             ; NO, if you have an UNMODIFIED main logic
  315.             ;   board
  316.             ;   (see discussion above)
  317. ;
  318. NUEVO    EQU    NO    ; YES, if Nuevo 80 column upgrade WITH Baud Rate
  319.             ;   Generator option has been installed
  320.             ; NO, if you do not have a Nuevo 80 column up-
  321.             ;   grade or if your Nuevo 80 column upgrade
  322.             ;   DOES NOT have the Baud Rate Generator op-
  323.             ;   tion installed.  (See discussion above.)
  324. ;
  325. ROM145    EQU    NO    ; YES, if hardware mods have been installed on
  326.             ;   Osborne 1 main logic board to support 2400
  327.             ;   bps WITH ROM version 1.45.
  328.             ; NO, if the ROM monitor is NOT Version 1.45
  329.             ;   (see discussion above)
  330. ;
  331. ;
  332. ; Values shown are for the 6850 ACIA serial I/O device
  333. ;
  334. PORT    EQU    2A00H    ; OCC-1 base address
  335.             ; (memory mapped for data and status)
  336. MDCTL1    EQU    PORT    ; Modem control address (memory mapped i/o)
  337. MDDATP    EQU    PORT+1    ; Modem data address (memory mapped i/o)
  338. MDRCV    EQU    01H    ; Modem receive data register full (RDRF)
  339. MDSND    EQU    02H    ; Modem transmit data register empty (TDRE)
  340. MDTXE    EQU    02H    ; Modem transmit buffer empty (set to MDSND)
  341. RMDRCV    EQU    0FEH    ; Used with SSTAT routines
  342. RMDSND    EQU    0FDH    ; Used with SSTAT routines
  343. ;
  344. ;
  345. ; NOTE: The 6850 ACIA, "an early generation serial I/O chip", has
  346. ;    only one output status bit with the mask value: 02h.
  347. ;    This output status bit is defined as "Transmit Data Register
  348. ;    Empty"    and is roughly equivalent to the "Transmit Buffer
  349. ;    Empty" status bit found in modern I/O chips.  Most modern
  350. ;    I/O chips have an additional output status bit which is a
  351. ;    "Transmit Ready" status bit.  The 6850 ACIA does not have
  352. ;    this status bit.  Without this second status bit available,
  353. ;    the timing routines for the ASCII upload function in IMP2
  354. ;    which involve inter-character timing delay and end-of-line
  355. ;    timing delay do not work as efficiently.
  356. ;    For the Osborne 1 you will not have as effective a range of
  357. ;    timing delay values as on computers using more advanced I/O
  358. ;    chips .  You will have enough delay timing for most ASCII
  359. ;    upload applications.
  360. ;
  361. ;-----------------------------------------------------------------------
  362. ;
  363. ESC    EQU    '['-40H ; ^[ = Escape
  364. BELL    EQU    'G'-40H ; ^G = Bell character
  365. LF    EQU    'J'-40H ; ^J = Linefeed
  366. NEXTRY    EQU    'K'-40H ; ^K = Try next phone number, abort this try
  367. CR    EQU    'M'-40H ; ^M = Carriage return
  368. CLEARSC EQU    'Z'-40H ; ^Z = Clears screen, command mode only
  369. EOFCHAR EQU    'Z'-40H ; ^Z = End of file
  370. ;
  371. ;
  372. ;-----------------------------------------------------------------------
  373. ;
  374. ;
  375.     ORG    0100H
  376. ;
  377. ;
  378.     DS    3    ; Skip the data area below
  379. ;
  380. ;
  381. ; These routines and equates are at the beginning of the program so
  382. ; they can be patched by a monitor or overlay file without re-assembling
  383. ; the program.
  384. ;
  385. MSPEED:  DB    5    ; 0=110 1=300 2=450 3=600 4=710 5=1200        103H
  386.             ; 6=2400 7=4800 8=9600 9=19200 default
  387. HS2400:  DB    NO    ; Yes=2400 bps highest speed            104H
  388. HS1200:  DB    YES    ; Yes=1200 bps highest speed            105H
  389. RACAL:     DB    NO    ; Yes=Racal-Vadic 1200V or 2400V or 2400PA    106H
  390. PROMODM: DB    NO    ; Yes=Prometheus ProModem 1200 bps        107H
  391. RESVD1:  DB    NO    ; Reserved for special modems            108H
  392. RESVD2:  DB    NO    ; Reserved for special modems            109H
  393. ;
  394. ;
  395. CLEAR:     DB    1AH    ; Clear screen character (ESC not needed)    10AH
  396. CLOCK:     DB    40    ; Clock speed in MHz x10, 25.5 MHz max.     10BH
  397.             ; 20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  398. BYTDLY:  DB    4    ; 0=0 delay  1=10ms  5=50 ms - 9=90 ms        10CH
  399.             ;   default time to send character in ter-
  400.             ;   minal mode file transfer for slow BBS
  401. CRDLY:     DB    4    ; 0=0 delay 1=100 ms 5=500 ms - 9=900 ms    10DH
  402.             ;   default time for extra wait after CRLF
  403.             ;   in terminal mode file transfer
  404. NOFCOL:  DB    4    ; Number of directory columns shown        10EH
  405. TCHPUL:  DB    'T'    ; T=tone, P=Pulse (Hayes 2400 modems)        10FH
  406. ;.....
  407. ;
  408. ;
  409. ADDLFD:  DB    NO    ; Yes=add LF after CR to send file in terminal    110H
  410.             ;   mode (normally added by remote echo)
  411. CONVRUB: DB    YES    ; Yes=convert rub to backspace            111H
  412. CRCDFLT: DB    YES    ; Yes=default to CRC checking            112H
  413. IGNRCTL: DB    YES    ; Yes=CTL-chars above ^M not displayed        113H
  414. ;.....
  415. ;
  416. ;
  417. EXTCHR:  DB    '['-40H ; ESC = preceeds local control character    114H
  418. EXITCHR: DB    'E'    ; Exit character                115H
  419. FILESND: DB    'F'    ; Send file when in terminal mode        116H
  420. NOCONCT: DB    'N'    ; Disconnect from phone line            117H
  421. LOGCHR:  DB    'L'    ; Send logon                    118H
  422. LSTCHR:  DB    'P'    ; Toggle printer                119H
  423. UNSAVCH: DB    'R'    ; Close input text buffer            11AH
  424. SAVECHR: DB    'Y'    ; Open input text buffer            11BH
  425. CLEARS:  DB    'Z'    ; Clears screen, terminal mode            11CH
  426. BRKCHR:  DB    'Q'    ; Send a break tone                11DH
  427. NODTR:     DB    NO    ; YES if no DTR and need ATH0 to disconnect    11EH
  428. ;.....
  429. ;
  430. ;
  431. ; Handles in/out ports for data and status
  432. ;
  433. I$MDCTL1: JMP    OSTAT        ;                    11FH
  434.       DB    0,0,0,0,0,0,0    ; Spares if needed            122H
  435. ;
  436. I$MDTXE:  JMP    OSTAT        ;                    129H
  437.       DB    0,0,0,0,0,0,0    ; Spares if needed            12CH
  438. ;
  439. I$MDDATP: JMP    OSIN        ;                    133H
  440.       DB    0,0,0,0,0,0,0    ; Spares if needed            136H
  441. ;
  442. O$MDDATP: JMP    OSOUT        ;                    13DH
  443.       DB    0,0,0,0,0,0,0    ; Spares if needed            140H
  444. ;.....
  445. ;
  446. ;
  447. A$MDRCV:  ANI    MDRCV        ;                    147H
  448.       RET            ;                    149H
  449. ;
  450. C$MDRCV:  CPI    MDRCV        ;                    14AH
  451.       RET            ;                    14CH
  452. ;
  453. A$MDSND:  ANI    MDSND        ;                    14DH
  454.       RET            ;                    14FH
  455. ;
  456. C$MDSND:  CPI    MDSND        ;                    150H
  457.       RET            ;                    152H
  458. ;
  459. A$MDTXE:  ANI    MDTXE        ;                    153H
  460.       RET            ;                    155H
  461. ;
  462. C$MDTXE:  CPI    MDTXE        ;                    156H
  463.       RET            ;                    158H
  464. ;.....
  465. ;
  466. ;
  467. ; Special exit vector, used by some computers to reset interrupt vectors
  468. ;
  469. J$EXITVEC:
  470.       JMP    RSTINT        ;                    159H
  471. ;.....
  472. ;
  473. ;
  474. ; Jump vectors needed by each overlay
  475. ;
  476. J$GOODBYE:JMP    GOODBYE     ; Disconnects modem by dropping DTR    15CH
  477. J$INITMOD:JMP    INITMOD     ; Initializes modem, autosets baudrate    15FH
  478. J$STUPR:  JMP    STUPR        ; SET routine to change baudrate    162H
  479. J$SYSVR:  JMP    SYSVR        ; Signon message            165H
  480. ;.....
  481. ;
  482. ;
  483. ; "AT" command strings, can be replaced in individual overlay if needed
  484. ;
  485. J$STRNGA: DS    3        ; 1200 bps "AT" string            168H
  486. J$STRNG1: DS    3        ; 2400 bps "AT" string            16BH
  487. ;
  488. ;
  489. ; Next fourteen lines should not be changed by user overlay as these go
  490. ; to specific locations in the main program, not in the overlay.
  491. ;
  492. ;
  493. J$CMDSPL: DS    3        ; Allows entry of baudrate on CMD line    16EH
  494. J$CRLF:   DS    3        ; Turns up one new line on display    171H
  495. J$DIAL:   DS    3        ; Start of dialing routine        174H
  496. J$DSCONT: DS    3        ; Terminates modem use            177H
  497. J$GOLST:  DS    3        ; Printer routine, needed by Apple //e    17AH
  498. J$ILPRT:  DS    3        ; Prints an inline string, 0 to end    17DH
  499. J$INBUF:  DS    3        ; Stores a keybd string for comparison    180H
  500. J$INLNCP: DS    3        ; Inline "compare strings" routine    183H
  501. J$INMDM:  DS    3        ; Max .1 sec wait for modem character    186H
  502. J$RCVRSP: DS    3        ; For 3801 I/O use (TV-803)        189H
  503. J$SNDCHR: DS    3        ; Sends a character to the modem    18CH
  504. J$SNDSTR: DS    3        ; Sends a string to the modem, $ to end 18FH
  505. J$TIMER:  DS    3        ; .1 second timer (amount in 'B' reg.)    192H
  506. J$BREAK:  JMP    SENDBRK     ; Break routine             195H
  507. J$NEW2:   DB    0,0,0        ; For future needs            198H
  508. ;.....
  509. ;
  510. ;
  511. ; For 2400 bps auto-stepdown units
  512. ;
  513. MANUAL:   DB    0        ; For manual selection flag        19BH
  514. J$300:      JMP    OK300        ; Sets baudrate to 300 baud        19CH
  515. J$1200:   JMP    OK1200        ; Sets baudrate to 1200 bps        19FH
  516. J$2400:   JMP    OK2400        ; Sets baudrate to 2400 bps        1A2H
  517. ;.....
  518. ;
  519. ;
  520. LOGPTR:   DW    LOGON        ; Pointer to display LOGON message    1A5H
  521. ;
  522. SYSVR:    CALL    J$ILPRT     ; Display the following line        1A7H
  523.     DB    'Version for Osborne 1'     ;            1AAH
  524. ;
  525.      IF    NUEVO
  526.     DB    ' with Neuvo BRG option'
  527.      ENDIF            ; NUEVO
  528. ;
  529.      IF    DTRMOD
  530.     DB    ' and DTR mod',CR,LF
  531.      ENDIF            ; DTRMOD
  532. ;
  533.      IF    NOT    DTRMOD
  534.     DB    ' without DTR mod',CR,LF
  535.      ENDIF            ; NOT DTRMOD
  536. ;
  537.     DB    CR,LF,0
  538.     RET
  539. ;.....
  540. ;
  541. ;
  542. ;-----------------------------------------------------------------------
  543. ;
  544. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  545. ;     end of your last routine should terminate by 0400H (601 bytes
  546. ;     available after start of SYSVER).
  547. ;
  548. ;-----------------------------------------------------------------------
  549. ;
  550. ; You can put in a message at this location which can be called up with
  551. ; (special character-L).  You can put in several lines.  End with a 0.
  552. ;
  553. LOGON:    DB    'Greetings from an Osborne 1 user',CR,LF,0
  554. ;
  555. ;-----------------------------------------------------------------------
  556. ;
  557. ; This routine sends a 300 ms break tone
  558. ;
  559. SENDBRK:
  560.      IF    NOT DTRMOD
  561.     RET
  562.      ENDIF            ; NOT DTRMOD
  563. ;
  564.      IF    DTRMOD        ; Stop any incoming characters
  565.     MVI    C,77H        ; Send break, RTS active,
  566.     CALL    STBAUD        ; Send to status port routine
  567.     MVI    B,3        ; Delay 300 ms. fora break tone
  568.     CALL    J$TIMER
  569.     JMP    GOODBYE1
  570.      ENDIF            ; DTRMOD
  571. ;.....
  572. ;
  573. ;
  574. ; This routine sets the ACIA RTS output low for 300 ms. to disconnect
  575. ; the phone.  The RTS output from 6850 is connected to the DTR input of
  576. ; the modem.
  577. ; This routine drops DTR for 300 ms to disconnect the phone.
  578. ;
  579. GOODBYE:
  580.      IF    NOT DTRMOD
  581.     RET
  582.      ENDIF            ; NOT DTRMOD
  583. ;
  584.      IF    DTRMOD
  585.     MVI    C,77H        ; Send break, RTS active,
  586.     CALL    STBAUD        ; Send to status port routine
  587.     MVI    B,3        ; Delay 300 ms. to hang up the phone
  588.     CALL    J$TIMER
  589.     MVI    C,57H        ; Disable break and RTS to hang-up modem
  590.     CALL    STBAUD        ; Send to status port routine
  591.     MVI    B,10        ; Delay 1 second to hang up phone
  592.     CALL    J$TIMER
  593. ;
  594. GOODBYE1:
  595.     LDA    BAUDRTE     ; RTS active, same baud rate
  596.     MOV    C,A
  597.     JMP    STBAUD        ; Send to status port routine
  598.     RET
  599.      ENDIF            ; DTRMOD
  600. ;.....
  601. ;
  602. ;
  603. ; You can use this area for any special initialization or setup you may
  604. ; wish to include.  Each must stop with a RET.    You can check the other
  605. ; available overlays for ideas how to write your own routines if that
  606. ; may be of some help.
  607. ;
  608. ;
  609.      IF ROM145 AND NOT NUEVO
  610. B$SET:    JMP    BRATE        ; Jump to relocated routine which se-
  611.                 ;   lects high/low clock rate for ACIA
  612.                 ;   TXD/RXD clock inputs.
  613.      ENDIF            ; ROM145 AND NOT NUEVO
  614. ;
  615. ;.....
  616. ;
  617. ;
  618. INITMOD:
  619.     LHLD    0005H+1     ; Find start of bdos
  620.     LXI    D,-0100H    ; Go to first page ahead of bdos
  621.     DAD    D        ; HL now positioned one page below bdos
  622.     PUSH    H        ; Save the address
  623.     LXI    D,BDJ        ; Point to our routine to put there
  624.     LXI    B,CDLEN+2    ; Set length of code
  625.     XCHG
  626.     DB    0EDH,0B0H    ; Z80 LDIR instruction
  627. ;
  628.     LHLD    0005H+1     ; Get BDOSs address back once more
  629.     POP    D        ; Get starting address off the stack
  630.     PUSH    D        ; Put it back on the stack
  631.     INX    D        ; Point to address position
  632.     XCHG            ; Put into HL register pair
  633.     MOV    M,E        ; Store 'LSP' address
  634.     INX    H        ; Get 'LSP' location
  635.     MOV    M,D        ; Store 'MSP' address
  636.     POP    H        ; Get the address back once more
  637.     SHLD    0005H+1     ; New address to protect from overwrite
  638. ;
  639.     LXI    D,OSIN-BDJ    ; Get OSICN length for relocation
  640.     DAD    D        ; Commute address of the OSIN routine
  641.     SHLD    I$MDDATP+1    ; Patch call for "GET CHARACTER" routine
  642. ;
  643.     LXI    D,OSOUT-OSIN    ; Get OSOUT length for relocation
  644.     DAD    D        ; Commute address of the OSOUT routine
  645.     SHLD    O$MDDATP+1    ; Patch call for "SEND CHARACTER" routine
  646. ;
  647.     LXI    D,OSTAT-OSOUT    ; Get OSTAT length for relocation
  648.     DAD    D        ; Commute address of OSTAT routine
  649.     SHLD    I$MDCTL1+1    ; Patch call for "GET I/O STATUS" routine
  650.     SHLD    I$MDTXE+1    ; Patch call for "TRANSMIT BUFFER EMPTY"
  651.                 ; routine
  652. ;
  653.      IF    ROM145 AND NOT NUEVO
  654.     LXI    D,BRATE-OSTAT    ; Get BRATE length for relocation
  655.     DAD    D        ; Commute address of BRATE routine
  656.     SHLD    B$SET+1     ; Patch call for "RX/TX CLOCK SELECT" routine
  657.      ENDIF            ; ROM145 AND NOT NUEVO
  658. ;
  659. ;
  660. ;  Set-up program default baud rate, then finish with initialization
  661. ;
  662.     LDA    MSPEED        ; Get program default baud rate value
  663.     CPI    1        ; 300 bps
  664.     JZ    OK300
  665.     CPI    5        ; 1200 bps
  666.     JZ    OK1200
  667. ;
  668.      IF    NUEVO OR ROM145
  669.     CPI    6        ; 2400 bps
  670.     JZ    OK2400
  671.      ENDIF            ; NUEVO OR ROM145
  672. ;
  673.     JMP    STUPR1        ; Else ask what is wanted
  674. ;
  675. ;.....
  676. ;
  677. ;
  678. ;-----------------------------------------------------------------------
  679. ;
  680. RSTINT:
  681.     JMP    0000H        ; Osborne 1 likes this jump upon exit
  682. ;
  683. ;.....
  684. ;
  685. ;
  686. ;-----------------------------------------------------------------------
  687. ;
  688. STUPR:    CALL    J$CMDSPL    ; Gives us CMDBUF+6
  689.     JNC    STUPR2
  690. ;
  691. STUPR1: CALL    J$ILPRT
  692. ;
  693.      IF    NOT NUEVO AND NOT ROM145
  694.     DB    'Input Baud Rate (300, 1200): ',0
  695.      ENDIF            ; NOT NUEVO AND NOT ROM145
  696. ;
  697.      IF    NUEVO AND NOT ROM145
  698.     DB    'Input Baud Rate (300, 1200, 2400, 4800, 9600, 19200): ',0
  699.      ENDIF            ; NUEVO AND NOT ROM145
  700. ;
  701.      IF    ROM145 AND NOT NUEVO
  702.     DB    'Input Baud Rate (300, 1200, 2400): ',0
  703.      ENDIF            ; ROM145 AND NOT NUEVO
  704. ;
  705.     LXI    D,BAUDBUF    ; Point to new input buffer
  706.     CALL    J$INBUF
  707.     CALL    J$CRLF
  708.     LXI    D,BAUDBUF+2
  709. ;
  710. STUPR2: CALL    J$INLNCP    ; Compare BAUDBUF+2 with chars. below
  711.     DB    '300',0
  712.     JNC    OK300        ; Go if got match
  713.     CALL    J$INLNCP
  714.     DB    '1200',0
  715.     JNC    OK1200
  716. ;
  717.      IF    NUEVO OR ROM145
  718.     CALL    J$INLNCP
  719.     DB    '2400',0
  720.     JNC    OK2400
  721.      ENDIF            ; NUEVO OR ROM145
  722. ;
  723.      IF    NUEVO AND NOT ROM145
  724.     CALL    J$INLNCP
  725.     DB    '4800',0
  726.     JNC    OK4800
  727.     CALL    J$INLNCP
  728.     DB    '9600',0
  729.     JNC    OK9600
  730.     CALL    J$INLNCP
  731.     DB    '19200',0
  732.     JNC    OK19200
  733.      ENDIF            ; NUEVO AND NOT ROM145
  734. ;
  735.     CALL    J$ILPRT     ; All matches failed, tell operator
  736.     DB    '++ Incorrect entry ++',CR,LF,BELL,CR,LF,0
  737.     JMP    STUPR1        ; Try again
  738. ;
  739. ;.....
  740. ;
  741. ;
  742.      IF    (NOT NUEVO AND NOT ROM145)
  743. OK300:    MVI    A,1        ; MSPEED 300 baud value
  744.      ENDIF            ; (NOT NUEVO AND NOT ROM145)
  745. ;
  746.      IF    (NOT NUEVO AND NOT ROM145) AND DTRMOD
  747.     MVI    C,16H        ; X64 clock, 8 DB 1 SB, RTS active
  748.      ENDIF            ; (NOT NUEVO AND NOT ROM145) AND DTRMOD
  749. ;
  750.      IF    (NOT NUEVO AND NOT ROM145) AND NOT DTRMOD
  751.     MVI    C,56H        ; X64 clock, 8 DB 1 SB, RTS inactive
  752.      ENDIF            ; NOT NUEVO AND NOT ROM145 AND NOT DTRMOD
  753. ;
  754.      IF    (NOT NUEVO AND NOT ROM145)
  755.     JMP    LOADBD        ; Load ACIA control byte
  756. ;
  757. OK1200: MVI    A,5        ; MSPEED 1200 baud value
  758.      ENDIF            ; (NOT NUEVO AND NOT ROM145)
  759. ;
  760.      IF    (NOT NUEVO AND NOT ROM145) AND DTRMOD
  761.     MVI    C,15H        ; X16 clock, 8 DB 1 SB, RTS active
  762.      ENDIF            ; (NOT NUEVO AND NOT ROM145) AND DTRMOD
  763. ;
  764.      IF    (NOT NUEVO AND NOT ROM145) AND NOT DTRMOD
  765.     MVI    C,55H        ; X16 clock, 8 DB 1 SB, RTS inactive
  766.      ENDIF            ; (NOT NUEVO AND NOT ROM145) AND NOT DTRMOD
  767. ;
  768.      IF    (NOT NUEVO AND NOT ROM145)
  769. OK2400:             ; Needs to be here even if not supported
  770. ;
  771. LOADBD: STA    MSPEED
  772.     MOV    A,C        ; Move ACIA control byte from C to A
  773.     STA    BAUDRTE     ; Save ACIA control byte
  774.      ENDIF            ; (NOT NUEVO AND NOT ROM145)
  775. ;
  776. ;....
  777. ;
  778. ;
  779.      IF    (ROM145 AND NOT NUEVO)
  780. OK300:    MVI    A,1        ; MSPEED 300 baud value
  781.      ENDIF            ; (ROM145 AND NOT NUEVO)
  782. ;
  783.      IF    (ROM145 AND NOT NUEVO) AND DTRMOD
  784.     MVI    C,16H        ; X64 clock, 8 DB 1 SB, RTS active
  785.      ENDIF            ; (ROM145 AND NOT NUEVO) AND DTRMOD
  786. ;
  787.      IF    (ROM145 AND NOT NUEVO) AND NOT DTRMOD
  788.     MVI    C,56H        ; X64 clock, 8 DB 1 SB, RTS inactive
  789.      ENDIF            ; (ROM145 AND NOT NUEVO) AND NOT DTRMOD
  790. ;
  791.      IF    (ROM145 AND NOT NUEVO)
  792.     MVI    B,3FH        ; Get low baud parameter
  793.     JMP    LOADBD        ; Load ACIA control byte
  794. ;
  795. OK1200: MVI    A,5        ; MSPEED 1200 baud value
  796.      ENDIF            ; (ROM145 AND NOT NUEVO)
  797. ;
  798.      IF    (ROM145 AND NOT NUEVO) AND DTRMOD
  799.     MVI    C,15H        ; X16 clock, 8 DB 1 SB, RTS active
  800.      ENDIF            ; (ROM145 AND NOT NUEVO) AND DTRMOD
  801. ;
  802.      IF    (ROM145 AND NOT NUEVO) AND NOT DTRMOD
  803.     MVI    C,55H        ; X16 clock, 8 DB 1 SB, RTS inactive
  804.      ENDIF            ; (ROM145 AND NOT NUEVO) AND NOT DTRMOD
  805. ;
  806.      IF    (ROM145 AND NOT NUEVO)
  807.     MVI    B,3FH        ; Get low baud parameter
  808.     JMP    LOADBD        ; Load ACIA control byte
  809. ;
  810. OK2400: XRA    A        ;
  811.     STA    MANUAL        ; Reset to maximum auto-speed for
  812.     MVI    A,6        ; 2400 bps auto-step down modems
  813.      ENDIF            ; (ROM145 AND NOT NUEVO)
  814. ;
  815.      IF    (ROM145 AND NOT NUEVO) AND DTRMOD
  816.     MVI    C,15H        ; X16 clock, 8 DB 1 SB, RTS active
  817.      ENDIF            ; (ROM145 AND NOT NUEVO) AND DTRMOD
  818. ;
  819.      IF    (ROM145 AND NOT NUEVO) AND NOT DTRMOD
  820.     MVI    C,55H        ; X16 clock, 8 DB 1 SB, RTS inactive
  821.      ENDIF            ; (ROM145 AND NOT NUEVO) AND NOT DTRMOD
  822. ;
  823.      IF    (ROM145 AND NOT NUEVO)
  824.     MVI    B,37H        ; Get high baud parameter
  825. ;
  826. LOADBD: STA    MSPEED
  827.     MOV    A,C
  828.     STA    BAUDRTE
  829.     CALL    B$SET        ; Select high/low baud rate status bit
  830.      ENDIF            ; (ROM145 AND NOT NUEVO)
  831. ;
  832. ;..
  833. ;
  834. ;
  835.      IF    (NUEVO AND NOT ROM145)
  836. OK300:    MVI    A,1        ; MSPEED 300 baud value
  837.     MVI    B,05H        ; Get 300 bps byte
  838.     JMP    LOADBD        ; Load baud rate generator control byte
  839. ;
  840. OK1200: MVI    A,5        ; MSPEED 1200 baud value
  841.     MVI    B,07H        ; Get 1200 bps byte
  842.     JMP    LOADBD        ; Load baud rate generator control byte
  843. ;
  844. OK2400: XRA    A        ; Reset to maximum auto-speed for
  845.     STA    MANUAL        ; 2400 bps auto-step down modems
  846.     MVI    A,6        ; MSPEED 2400 baud value
  847.     MVI    B,0AH        ; Get 2400 bps byte
  848.     JMP    LOADBD        ; Load baud rate generator control byte
  849. ;
  850. OK4800: MVI    A,7        ; MSPEED 4800 baud value
  851.     MVI    B,0CH        ; Get 4800 bps byte
  852.     JMP    LOADBD        ; Load baud rate generator control byte
  853. ;
  854. OK9600: MVI    A,8        ; MSPEED 9600 baud value
  855.     MVI    B,0EH        ; Get 9600 bps byte
  856.     JMP    LOADBD        ; Load baud rate generator control byte
  857. ;
  858. OK19200:
  859.     MVI    A,9        ; MSPEED 19200 baud value
  860.     MVI    B,0FH        ; Get 19200 bps byte
  861. ;
  862. LOADBD: STA    MSPEED        ; Save MSPEED byte
  863.     MOV    A,B        ; Move baud rate byte from B to A
  864.     OUT    6        ; Send baud rate divisor to Nuevo baud
  865.                 ; rate generator
  866.      ENDIF            ; (NUEVO AND NOT ROM145)
  867. ;
  868.      IF    (NUEVO AND NOT ROM145) AND DTRMOD
  869.     MVI    C,15H        ; 16X clock, 8 DB 1 SB, RTS active
  870.      ENDIF            ; (NUEVO AND NOT ROM145) AND DTRMOD
  871. ;
  872.      IF    (NUEVO AND NOT ROM145) AND NOT DTRMOD
  873.     MVI    C,55H        ; 16X clock, 8 DB 1 SB, RTS inactive
  874.      ENDIF            ; (NUEVO AND NOT ROM145) AND NOT DTRMOD
  875. ;
  876.      IF    (NUEVO AND NOT ROM145)
  877.     MOV    A,C
  878.     STA    BAUDRTE     ; Save ACIA control byte
  879.      ENDIF            ; (NUEVO AND NOT ROM145)
  880. ;
  881. ;.....
  882. ;
  883. ;
  884. STBAUD: PUSH    H
  885.     CALL    OSET
  886.     POP    H
  887.     RET
  888. ;
  889. ;.....
  890. ;
  891. ;
  892. OSET:    LHLD    1        ; Get bios+3 address
  893.     MVI    L,3CH        ; Extended bios routine for baud rate select
  894.     PCHL            ; branch to it
  895. ;
  896. ;.....
  897. ;
  898. ;
  899. BAUDBUF:DB    10,0
  900.     DS    10
  901. ;
  902. BAUDRTE:  DB    0    ; RAM location for baud rate byte
  903. SSTAT:      DB    0    ; RAM location serves as a secondary status register
  904.             ;   for 6850 ACIA status register.
  905.             ;   This RAM register is used because the  6850 ACIA
  906.             ;   clobbers its own internal status register
  907.             ;   (with regard to TBE and RDA status bits) when
  908.             ;   data is traveling in both directions via the
  909.             ;   serial port -- important for ascii text uploads.
  910. ;
  911. ;.....
  912. ;
  913. ;
  914. ; --- ROUTINES THAT ARE PLACED JUST UNDER BDOS AND OVERLAY THE CCP
  915. ;
  916. BDJ:    JMP    $-$        ; This gets patched to jump to bdos entry
  917. ;
  918. OSIN:    LDA    SSTAT        ; Update SSTAT location in RAM
  919.     ANI    RMDRCV        ; before inputing data
  920.     STA    SSTAT
  921. ;
  922.     DI            ; Disable interrupts
  923.     OUT    0        ; Switch to alternate bank
  924.     LDA    MDDATP        ; Get data input
  925.     OUT    1        ; Switch to main bank
  926.     EI            ; Re-enable interrupts
  927.     RET
  928. ;
  929. ;.....
  930. ;
  931. ;
  932. OSOUT:    DI            ; Disable interrupts
  933.     OUT    0        ; Switch to alternate bank
  934.     STA    MDDATP        ; Send data output
  935.     OUT    1        ; Switch to main bank
  936.     EI            ; Re-enable interrupts
  937. ;
  938.     LDA    SSTAT        ; Update SSTAT location in RAM
  939.     ANI    RMDSND        ; after outputing data
  940.     STA    SSTAT
  941.     RET
  942. ;
  943. ;.....
  944. ;
  945. ;
  946. OSTAT:    DI            ; Disable interrupts
  947.     OUT    0        ; Switch to alternate bank
  948.     LDA    MDCTL1        ; Get status byte
  949.     OUT    1        ; Switch to main bank
  950.     EI            ; Re-enable interrupts
  951. ;
  952.     PUSH    B        ; Update SSTAT location in RAM
  953.     MOV    B,A        ; using current ACIA status register
  954.     LDA    SSTAT        ; and earlier ACIA status register
  955.     ORA    B
  956.     STA    SSTAT
  957.     POP    B
  958.     RET
  959. ;
  960. ;.....
  961. ;
  962. ;
  963.      IF    (ROM145 AND NOT NUEVO)
  964. BRATE:    DI            ; disable interrupts
  965.     OUT    0        ; Switch to alternate bank
  966.     MOV    A,B
  967.     STA    2C01H        ; Send data to 6821 control register
  968.     MVI    A,0EAH        ; Reset video horizontal offset and DD bit
  969.     STA    0EF61H        ; Update BIOS RAM location
  970.     STA    2C00H        ; Output data byte to 6821 PIA
  971.     OUT    1        ; Switch to main bank
  972.     EI
  973.     RET
  974.      ENDIF            ; (ROM145 AND NOT NUEVO)
  975. ;
  976. ;.....
  977. ;
  978. ;
  979. CDLEN    EQU    $-BDJ        ; Length of code to relocate
  980. ;
  981. ;                   fini
  982. ;-----------------------------------------------------------------------
  983. ;
  984. ; NOTE:  Must terminate by 0400H
  985.     END
  986.