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 / 22RSX / BYERSX.ARK / BROS-1.BYE < prev    next >
Text File  |  1985-12-14  |  10KB  |  351 lines

  1. ; BROS-1.BYE - Osborne OS-1 insert for BYERS3 - (85/12/14)
  2. ;
  3. ; rename this file to RSXIO.INC for automatic inclusion when
  4. ; assembling RSXMAST.MAC to create BYERSX.COM
  5. ;
  6. ; adapted from Paul Trainas B3OS-2 for BYE339
  7. ; by C.B. Falconer (85/11/16)
  8. ;
  9. ;    --------------------------------------------------
  10. ;
  11. ;            6850 ACIA
  12. ;
  13. ; Note:  This is an insert, not an overlay.  If your OS-1 does not
  14. ;     have the hardware mod to support DTR, (shown below) then
  15. ;     set the HARDMOD equate to false.
  16. ;
  17. ;
  18. ; MAIN LOGIC BOARD TRACE CUTS:
  19. ; --------------------------
  20. ; Solder Side:
  21. ;
  22. ; Cut trace running from pin 5 to pin 6 on inner row of pads used in
  23. ; mounting the RS-232 female serial connector at the front of the
  24. ; main logic board.  Pin 1 is pad with wide ground trace.
  25. ;
  26. ; Component side:
  27. ;
  28. ; Cut trace from pin 5 of UC4 (6850) to R20 (10K ohm).
  29. ; Cut trace that runs between pins 3 and 4 of UC4 (6850).
  30. ;
  31. ;
  32. ; PART ADDITIONS:
  33. ; --------------
  34. ; Solder side:
  35. ;
  36. ; Add jumper from pin 1 of UE3 (MC1458) to pin 5 of inner row of
  37. ;    RS-232 serial port pads.  Pin 1 has wide ground trace.
  38. ; Add jumper from pin 3 to pin 5 of UE3 (MC1458).
  39. ; Add jumper from pin 10 of UD4 (LM3400) to pin 5 of UC1 (74LS08).
  40. ; Add jumper from pin 4 of UC1 (74LS08) to pin 1 of UE20 (74LS04).
  41. ; Add jumper from pin 6 of UC1 (74LS08) to pin 5 of UA11 (74S04).
  42. ; Add jumper from pin 6 of UA11 (74S04) to pin 19 of UC15 (6821).
  43. ;
  44. ; Component side or solder side (whichever side you feel more
  45. ; comfortable using for mounting components):
  46. ;
  47. ; Add 10K ohm resistor from Vcc (+5 volts) to pin 2 of UE3 (MC1458).
  48. ; Add 220 ohm resistor from pin 5 of UC4 (6850) to pin 2 of UE3 (MC1458).
  49. ; Add 1k  ohm resistor from pin 19 of UC15 (6821) to Vcc (+5 volts).
  50. ;
  51. ; NEW RS-232 MODEM CABLE:
  52. ; ----------------------
  53. ;
  54. ;      OCC-1                MODEM
  55. ;
  56. ;     2    RXD              3    RXD
  57. ;     3    TXD              2    TXD
  58. ;     4    DCD (new function)      8    DCD
  59. ;     5    DTR (new function)     20    DTR
  60. ;     7    GND              7    GND
  61. ;
  62. ;    =   =    =   =    =   =    =   =    =   =    =   =    =
  63. ;
  64. ;
  65. hardmod    equ    no;    yes    if hardware mods have been done to
  66. ;                the Osborne O-1 to support DTR and
  67. ;                modified DCD.
  68. ;            no    if the O-1 is standard (no mods).
  69. ;                Other software may need revision.
  70. ;
  71. ;
  72. statm    equ    02A00H;        Status memory location
  73. data    equ    02A01H;        Data memory location
  74. cdata    equ    02C02H;        Video PIA data register
  75. cstat    equ    02C03H;        Video PIA status register
  76. ;
  77.     if    hardmod
  78. dcd     equ    40H;        Data carrier detect
  79.     else;        NOT hardmod
  80. dcd     equ    04H;        Data carrier detect
  81.     endif;        NOT hardmod
  82. ;
  83. ; MC6850 status bits
  84. drdy    equ    1;        data available
  85. ordy    equ    2;        output ready
  86. ;
  87. bd300    equ    056h; 22?;    300 baud
  88. bd1200    equ    055h; 21?;    1200 baud
  89. ;
  90. ; -------------------------------------------------------------------
  91. ;
  92. ; Disconnect and wait for an incoming call. Start any interrupt
  93. ; systems needed.  Return 0ffh for success, 0 failure (w/flags)
  94. ; a,f
  95. mdinit:    call    mdstop;        Hangup if we can
  96.     di
  97.     out    0
  98.     lda    cdata;        Read video PIA data register
  99.     out    1;        Reset for future loss of carrier
  100.     ei
  101.     push    d
  102.     lxi    d,2000;        Wait 2 seconds for modem to hangup
  103.     call    dodelay
  104.     pop    d
  105. ;    "    "
  106. ; Restart after mdstop. 0ffh success, 0 failure
  107. ; a,f
  108. mdgo:    lda    wrkbaud;    Modem port reset (enable DTR line)
  109.     if    hardmod; ???    
  110.      ani    0bfH;        Enable DTR
  111.     endif
  112.     call    bnkouts
  113.     di
  114.     out    0
  115.     lda    cdata;        Read video PIA data register
  116.     out    1;        Reset for future loss of carrier
  117.     ei
  118.     ori    0ffh;        success
  119.     ret
  120. ;
  121. ; Called by the main program after caller types BYE
  122. ; bring down any interrupt systems.  0ffh for success, 0 failure
  123. ; a,f
  124. mdquit:
  125. ;    "    "
  126. ; Hangup.  return 0ffh for success, 0 for failure
  127. ; a,f
  128. mdstop:    mvi    a,57H
  129.     call    bnkouts;    hangup modem
  130.     ori    0ffh
  131.     ret
  132. ;
  133. ; See if we still have a carrier. If so return 0ffh and nz flag
  134. ; if not, return 0 with the zero flag set
  135. ; a,f
  136. mdcarck:
  137.     if    hardmod
  138.      di;            Disable interrupts
  139.      out    0
  140.      lda    cstat;        Read video PIA status register
  141.      out    1
  142.      ei
  143.     else;        NOT hardmod
  144.      call    bnkins;        Get modem status
  145.      push    psw;        Save it
  146.      ani    dcd;        If carrier then reset DCD
  147.      cnz    mdinp
  148.      pop    psw
  149.     endif
  150.     cma;        Comp reg, bit set with LOSS of carrier
  151.     ani    dcd;    Mask out all but carrier LOSS bit (cb2)
  152.     rz
  153.     ori    0ffh;        have carrier
  154.     ret
  155. ;
  156. ; Input a character from the modem port
  157. ; a,f
  158. mdinp:    di
  159.     out    0;        Switch to shadow memory bank
  160.     lda    data;        Read data register RAM location
  161.     out    1;        Switch back to program memory bank
  162.     ei
  163.     push    psw;        Save the character
  164.     lda    sstat;        Load mirror ACIA status register
  165.     ani    not drdy;    Mask the DAV bit (reset DAV bit in
  166. ;                      mirror status register)
  167.     sta    sstat;        Save mutant status register to ram
  168.     pop    psw;        Get the character back
  169.     ret;            return to sender
  170. ;
  171. ; Check the status to see if a character is available.    If not, return
  172. ; with the zero flag set.  If yes, use 0FFH to clear the flag.
  173. ; a,f
  174. mdinst:    push    b
  175.     lda    sstat;        Load ACIA mirror status register
  176. ;                From last status read operation
  177.     mov    b,a
  178.     call    bnkins;        Input present ACIA status register
  179.     ora    b;        Do an OR operation on both former
  180. ;                  as well as present acia registers
  181.     sta    sstat;        Save both ACIA register states
  182.     pop    b
  183.     ani    drdy;        Mask DAV bit
  184.     rz;            not ready
  185.     ori    255;        ready
  186.     ret
  187. ;
  188. ; Send a character to the modem
  189. ; f
  190. mdoutp:    push    psw
  191.     di
  192.     out    0;        Switch to shadow memory bank
  193.     sta    data;        data to data register ram location
  194.     out    1;        Switch to program memory bank
  195.     ei
  196.     lda    sstat;        Load the clone register
  197.     ani    not ordy;    Mask the TBMT bit
  198.     sta    sstat;        Save the doppelganger register
  199.     pop    psw
  200.     ret;            return to sender
  201. ;
  202. ; See if the output is ready for another character
  203. ; a,f
  204. mdoutst:
  205.     push    b
  206.     call    bnkins;        Get present ACIA status register
  207.     mov    b,a;        Move it to 'B' register
  208.     lda    sstat;        Get mirror ACIA status register
  209.     ora    b;        Perform an OR on present and
  210.     pop    b;             mirror registers
  211.     sta    sstat;        Save the past and present status regs
  212.     ani    ordy
  213.     rz
  214.     ori    0ffh
  215.     ret
  216. ;
  217. bnkins:    di
  218.     out    0;        Switch to shadow memory bank
  219.     lda    statm;        Read status register ram location
  220.     out    1;        Switch back to progaram memory bank
  221.     ei
  222.     ret
  223. ;
  224. bnkouts:
  225.     di
  226.     out    0;        Switch to shadow memory bank
  227.     sta    statm;        data to control register ram location
  228.     out    1;        Switch to program memory bank
  229.     ei
  230.     ret
  231. ;
  232. ; The following routine sets the baudrate.
  233. ; 0 input value does nothing. Hi bits reserved for stops/parity
  234. ; Return 0ffh for failure, 0 for success (w/flags);
  235. ; a,f
  236. setbaud:
  237.     ani    0fh;        mask off stops/parity area
  238.     rz;            do nothing for 0 input
  239.     sui    2
  240.     jz    set300;        a was 2
  241.     cpi    4
  242.     jz    set1200;    a was 6
  243.     ori    0ffh;        no other speeds for Osborne
  244.     ret;            with failure flag
  245.  
  246. set300:    mvi    a,bd300;    Set 300 baud
  247.     jmp    stbaud
  248. ;
  249. set1200:
  250.     mvi    a,bd1200;    Set 1200 baud
  251. ;    "    "
  252. stbaud:    call    bnkouts
  253.     sta    wrkbaud;    Save incoming baud rate
  254.     xra    a;        Show baudrate was ok
  255.     ret
  256. ;
  257. ; Send an (a) millisec break
  258. ; a,f
  259. sendbk:    xra    a;        not on Osborne
  260.     ret;            with error signal
  261. ;
  262. ; Go off hook and connect. 0ffh for success, 0 for failure
  263. ; a,f
  264. mdansw:    xra    a;        Can't do this
  265.     ret
  266. ;
  267. ; Is the phone ringing.  0ffh=yes, 0 = no, with flags
  268. ; a,f
  269. mdring:    xra    a;        no
  270.     ret
  271. ;
  272. ; For disk control, the following indicates that the application
  273. ; will not require disk access in the immediate future.  If possible
  274. ; drive motors should be stopped.  No harm if unable to perform
  275. ; a,f
  276. dskstp:    ret
  277. ; For disk control, the following indicates that the application
  278. ; will require disk access in the immediate future.  If possible
  279. ; drive motors should be started.  No harm if unable to perform
  280. ; a,f
  281. dskrun:    ret
  282. ;
  283. ;    --------------- Timer interface ---------------
  284. ;
  285. ; These two routines are called with either
  286. ;   de = 0ffffh for a query (return current value in hl) )
  287. ;   de = other  to set the appropriate value, and return in (hl)
  288. ; The returned value should be 0ffffh if no timer system installed.
  289. ;
  290. ; The date is kept in the following format (note 0ffffh is invalid)
  291. ;    MSbit    yyyyyyy mmmm ddddd   LSbit
  292. ; with y field (0..127) the offset from 1980 (dates to 2107)
  293. ;      m field (1..12)  the numerical month  (Jan to Dec)
  294. ;      d field (1..31)  the day of month
  295. ; (Identical to MSDOS format)
  296. ; a,f,h,l
  297. sgdate:    lxi    h,0ffffh;    Not implemented
  298.     ret
  299. ;
  300. ; The time is kept in the following format (note 0ffffh is invalid)
  301. ;   MSbit     hhhhh mmmmmm sssss  LS bit
  302. ; with h field (0..23)  hour of day (0 is midnight)
  303. ;      m field (0..59)  minute of hour
  304. ;      s field (0..29)  seconds DIV 2 (resolution 2 seconds)
  305. ; (Identical to MSDOS format)
  306. ; a,f,h,l
  307. sgtime:    lxi    h,0ffffh;    Not implemented
  308.     ret
  309. ;
  310. ; This is used only where the host system has no real-time clock.
  311. ; This allows simulation of that clock, with lousy accuracy.
  312. ; Adds 1 minute to the internally stored time value.  If a clock
  313. ; system exists this should simply return.
  314. ; a,f,h,l (allowed)
  315. add1min:
  316.     ret
  317. ;
  318. ;    -------- I/O Dependant Function Key actions ---------
  319. ;
  320. ; The following are called when the ATTN char is followed by one
  321. ; of the digits '0' thru '9'.  It is suggested that the digit '0'
  322. ; be reserved for performing screen dumps.  A simple "ret" 
  323. ; eliminates any key from the function repetoire.
  324. ; a,f,h,l (allowed)
  325. f0k:
  326. f1k:
  327. f2k:
  328. f3k:
  329. f4k:
  330. f5k:
  331. f6k:
  332. f7k:
  333. f8k:
  334. f9k:    ret;        eliminate all these
  335. ;
  336. ;        ---------------------------------
  337. ;
  338. wrkbaud: db    bd1200;    [*] OCC1 ++
  339. sstat:     db    0;    RAM flag location for ACIA status register.
  340. ;            This is due to ACIA not keeping track of its
  341. ;            status register when data is going in both
  342. ;            directions i.e., data being sent out during
  343. ;            a display listing, and the remote user wants
  344. ;            to suspend screen display or abort listing
  345. ;            by generating a ^S or ^K or any other con-
  346. ;            trol character.
  347. ;
  348. ;    end
  349. ;        -----------------------------------
  350. Å