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 >
Wrap
Text File
|
1985-12-14
|
10KB
|
351 lines
; BROS-1.BYE - Osborne OS-1 insert for BYERS3 - (85/12/14)
;
; rename this file to RSXIO.INC for automatic inclusion when
; assembling RSXMAST.MAC to create BYERSX.COM
;
; adapted from Paul Trainas B3OS-2 for BYE339
; by C.B. Falconer (85/11/16)
;
; --------------------------------------------------
;
; 6850 ACIA
;
; Note: This is an insert, not an overlay. If your OS-1 does not
; have the hardware mod to support DTR, (shown below) then
; set the HARDMOD equate to false.
;
;
; MAIN LOGIC BOARD TRACE CUTS:
; --------------------------
; Solder Side:
;
; Cut trace running from pin 5 to pin 6 on inner row of pads used in
; mounting the RS-232 female serial connector at the front of the
; main logic board. Pin 1 is pad with wide ground trace.
;
; Component side:
;
; Cut trace from pin 5 of UC4 (6850) to R20 (10K ohm).
; Cut trace that runs between pins 3 and 4 of UC4 (6850).
;
;
; PART ADDITIONS:
; --------------
; Solder side:
;
; Add jumper from pin 1 of UE3 (MC1458) to pin 5 of inner row of
; RS-232 serial port pads. Pin 1 has wide ground trace.
; Add jumper from pin 3 to pin 5 of UE3 (MC1458).
; Add jumper from pin 10 of UD4 (LM3400) to pin 5 of UC1 (74LS08).
; Add jumper from pin 4 of UC1 (74LS08) to pin 1 of UE20 (74LS04).
; Add jumper from pin 6 of UC1 (74LS08) to pin 5 of UA11 (74S04).
; Add jumper from pin 6 of UA11 (74S04) to pin 19 of UC15 (6821).
;
; Component side or solder side (whichever side you feel more
; comfortable using for mounting components):
;
; Add 10K ohm resistor from Vcc (+5 volts) to pin 2 of UE3 (MC1458).
; Add 220 ohm resistor from pin 5 of UC4 (6850) to pin 2 of UE3 (MC1458).
; Add 1k ohm resistor from pin 19 of UC15 (6821) to Vcc (+5 volts).
;
; NEW RS-232 MODEM CABLE:
; ----------------------
;
; OCC-1 MODEM
;
; 2 RXD 3 RXD
; 3 TXD 2 TXD
; 4 DCD (new function) 8 DCD
; 5 DTR (new function) 20 DTR
; 7 GND 7 GND
;
; = = = = = = = = = = = = =
;
;
hardmod equ no; yes if hardware mods have been done to
; the Osborne O-1 to support DTR and
; modified DCD.
; no if the O-1 is standard (no mods).
; Other software may need revision.
;
;
statm equ 02A00H; Status memory location
data equ 02A01H; Data memory location
cdata equ 02C02H; Video PIA data register
cstat equ 02C03H; Video PIA status register
;
if hardmod
dcd equ 40H; Data carrier detect
else; NOT hardmod
dcd equ 04H; Data carrier detect
endif; NOT hardmod
;
; MC6850 status bits
drdy equ 1; data available
ordy equ 2; output ready
;
bd300 equ 056h; 22?; 300 baud
bd1200 equ 055h; 21?; 1200 baud
;
; -------------------------------------------------------------------
;
; Disconnect and wait for an incoming call. Start any interrupt
; systems needed. Return 0ffh for success, 0 failure (w/flags)
; a,f
mdinit: call mdstop; Hangup if we can
di
out 0
lda cdata; Read video PIA data register
out 1; Reset for future loss of carrier
ei
push d
lxi d,2000; Wait 2 seconds for modem to hangup
call dodelay
pop d
; " "
; Restart after mdstop. 0ffh success, 0 failure
; a,f
mdgo: lda wrkbaud; Modem port reset (enable DTR line)
if hardmod; ???
ani 0bfH; Enable DTR
endif
call bnkouts
di
out 0
lda cdata; Read video PIA data register
out 1; Reset for future loss of carrier
ei
ori 0ffh; success
ret
;
; Called by the main program after caller types BYE
; bring down any interrupt systems. 0ffh for success, 0 failure
; a,f
mdquit:
; " "
; Hangup. return 0ffh for success, 0 for failure
; a,f
mdstop: mvi a,57H
call bnkouts; hangup modem
ori 0ffh
ret
;
; See if we still have a carrier. If so return 0ffh and nz flag
; if not, return 0 with the zero flag set
; a,f
mdcarck:
if hardmod
di; Disable interrupts
out 0
lda cstat; Read video PIA status register
out 1
ei
else; NOT hardmod
call bnkins; Get modem status
push psw; Save it
ani dcd; If carrier then reset DCD
cnz mdinp
pop psw
endif
cma; Comp reg, bit set with LOSS of carrier
ani dcd; Mask out all but carrier LOSS bit (cb2)
rz
ori 0ffh; have carrier
ret
;
; Input a character from the modem port
; a,f
mdinp: di
out 0; Switch to shadow memory bank
lda data; Read data register RAM location
out 1; Switch back to program memory bank
ei
push psw; Save the character
lda sstat; Load mirror ACIA status register
ani not drdy; Mask the DAV bit (reset DAV bit in
; mirror status register)
sta sstat; Save mutant status register to ram
pop psw; Get the character back
ret; return to sender
;
; Check the status to see if a character is available. If not, return
; with the zero flag set. If yes, use 0FFH to clear the flag.
; a,f
mdinst: push b
lda sstat; Load ACIA mirror status register
; From last status read operation
mov b,a
call bnkins; Input present ACIA status register
ora b; Do an OR operation on both former
; as well as present acia registers
sta sstat; Save both ACIA register states
pop b
ani drdy; Mask DAV bit
rz; not ready
ori 255; ready
ret
;
; Send a character to the modem
; f
mdoutp: push psw
di
out 0; Switch to shadow memory bank
sta data; data to data register ram location
out 1; Switch to program memory bank
ei
lda sstat; Load the clone register
ani not ordy; Mask the TBMT bit
sta sstat; Save the doppelganger register
pop psw
ret; return to sender
;
; See if the output is ready for another character
; a,f
mdoutst:
push b
call bnkins; Get present ACIA status register
mov b,a; Move it to 'B' register
lda sstat; Get mirror ACIA status register
ora b; Perform an OR on present and
pop b; mirror registers
sta sstat; Save the past and present status regs
ani ordy
rz
ori 0ffh
ret
;
bnkins: di
out 0; Switch to shadow memory bank
lda statm; Read status register ram location
out 1; Switch back to progaram memory bank
ei
ret
;
bnkouts:
di
out 0; Switch to shadow memory bank
sta statm; data to control register ram location
out 1; Switch to program memory bank
ei
ret
;
; The following routine sets the baudrate.
; 0 input value does nothing. Hi bits reserved for stops/parity
; Return 0ffh for failure, 0 for success (w/flags);
; a,f
setbaud:
ani 0fh; mask off stops/parity area
rz; do nothing for 0 input
sui 2
jz set300; a was 2
cpi 4
jz set1200; a was 6
ori 0ffh; no other speeds for Osborne
ret; with failure flag
set300: mvi a,bd300; Set 300 baud
jmp stbaud
;
set1200:
mvi a,bd1200; Set 1200 baud
; " "
stbaud: call bnkouts
sta wrkbaud; Save incoming baud rate
xra a; Show baudrate was ok
ret
;
; Send an (a) millisec break
; a,f
sendbk: xra a; not on Osborne
ret; with error signal
;
; Go off hook and connect. 0ffh for success, 0 for failure
; a,f
mdansw: xra a; Can't do this
ret
;
; Is the phone ringing. 0ffh=yes, 0 = no, with flags
; a,f
mdring: xra a; no
ret
;
; For disk control, the following indicates that the application
; will not require disk access in the immediate future. If possible
; drive motors should be stopped. No harm if unable to perform
; a,f
dskstp: ret
;
; For disk control, the following indicates that the application
; will require disk access in the immediate future. If possible
; drive motors should be started. No harm if unable to perform
; a,f
dskrun: ret
;
; --------------- Timer interface ---------------
;
; These two routines are called with either
; de = 0ffffh for a query (return current value in hl) )
; de = other to set the appropriate value, and return in (hl)
; The returned value should be 0ffffh if no timer system installed.
;
; The date is kept in the following format (note 0ffffh is invalid)
; MSbit yyyyyyy mmmm ddddd LSbit
; with y field (0..127) the offset from 1980 (dates to 2107)
; m field (1..12) the numerical month (Jan to Dec)
; d field (1..31) the day of month
; (Identical to MSDOS format)
; a,f,h,l
sgdate: lxi h,0ffffh; Not implemented
ret
;
; The time is kept in the following format (note 0ffffh is invalid)
; MSbit hhhhh mmmmmm sssss LS bit
; with h field (0..23) hour of day (0 is midnight)
; m field (0..59) minute of hour
; s field (0..29) seconds DIV 2 (resolution 2 seconds)
; (Identical to MSDOS format)
; a,f,h,l
sgtime: lxi h,0ffffh; Not implemented
ret
;
; This is used only where the host system has no real-time clock.
; This allows simulation of that clock, with lousy accuracy.
; Adds 1 minute to the internally stored time value. If a clock
; system exists this should simply return.
; a,f,h,l (allowed)
add1min:
ret
;
; -------- I/O Dependant Function Key actions ---------
;
; The following are called when the ATTN char is followed by one
; of the digits '0' thru '9'. It is suggested that the digit '0'
; be reserved for performing screen dumps. A simple "ret"
; eliminates any key from the function repetoire.
; a,f,h,l (allowed)
f0k:
f1k:
f2k:
f3k:
f4k:
f5k:
f6k:
f7k:
f8k:
f9k: ret; eliminate all these
;
; ---------------------------------
;
wrkbaud: db bd1200; [*] OCC1 ++
sstat: db 0; RAM flag location for ACIA status register.
; This is due to ACIA not keeping track of its
; status register when data is going in both
; directions i.e., data being sent out during
; a display listing, and the remote user wants
; to suspend screen display or abort listing
; by generating a ^S or ^K or any other con-
; trol character.
;
; end
; -----------------------------------
Å