home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpm
/
mex
/
mexxapii.lbr
/
MXH-AP52.AQM
/
MXH-AP52.ASM
Wrap
Assembly Source File
|
1986-12-08
|
22KB
|
769 lines
; TITLE 'MEX Overlay for Apple ][ / SSC / Smartmodem'
;
; MXH-AP52.ASM
;
REV EQU 52 ; 01 Nov 1986
;
; This overlay is specific for the following hardware:
;
; Apple ][ +/e with PCPI Applicard
; Apple Super Serial Card
;
; - Jim Lill via "Sparrow" 716-377-1113
;------------------------------------------------------------------
; REVISION HISTORY:
;------+---------+----------------+--------------------------------
; Rev. | Date | Author | Description
;------+---------+----------------+--------------------------------
; 5.2 |1 Nov 86 | Jim Lill | -eliminated Modem specific section
; | | | requires use of Modem overlay
; | | | such as MXO-SM14 or MXM-2413
; | | | Seems to work better with MXM-2413
;------+---------+----------------+--------------------------------
; 5.1 |5 Apr 86 | Jim Lill | -changed CLSMSG and EOSMSG
; | | | -added INITBAUD equate for setting
; | | | MSPEED and baud in INITMOD
;------+---------+----------------+--------------------------------
; 5.0 |1 Apr 86 | Jim Lill | created adaption, includes DCD
; | | | and a spot for RND detect.
;------+---------+----------------+--------------------------------
; IMPORTANT NOTE:
; This overlay is based on MXO-AP50.ASM by Henry Middlebrook
; Refer to it for additional info. The changes in this overlay
; could be easily adapted to other Middlebrook work like AP34
; To find changes, search for "MEXplus"
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; PORT OVERLAY SECTION
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
BELL EQU 07H ;bell
CR EQU 0DH ;carriage return
ESC EQU 1BH ;escape
LF EQU 0AH ;linefeed
TAB EQU 09H ;tab
YES EQU 0FFH
NO EQU 0
;
;----------------------------------------------------------------------
; Apple Super Serial Card equates
; -------------------------------
;
SSCSLOT EQU 2 ;Slot of Super Serial Card
;
INITBAUD EQU 5 ;Initial Baud Rate
; 0=110 5=1200
; 1=300 6=2400
; 2=450 7=4800
; 3=600 8=9600
; 4=710 9=19200
;
MODDATP EQU 0C088H + (SSCSLOT*10H) ;data port of ACIA
MODSTAP EQU 0C089H + (SSCSLOT*10H) ;status port of ACIA
MODCTLP EQU 0C08BH + (SSCSLOT*10H) ;control port of ACIA
MODCMDP EQU 0C08AH + (SSCSLOT*10H) ;command port of ACIA
;
;
RDBYTE EQU 0FFE0H ;Read a Byte from Apple (A = BYTE)
WRBYTE EQU 0FFE3H ;Write a Byte to Apple (C = BYTE)
RDWORD EQU 0FFE6H ;Read 2 Bytes from Apple (DE = BYTES)
WRWORD EQU 0FFE9H ;Write 2 Bytes to Apple (DE = BYTES)
RDNBYTS EQU 0FFECH ;Read N Bytes (DE = COUNT, HL = BUFFER)
WRNBYTS EQU 0FFEFH ;Write N Bytes (DE = COUNT, HL = BUFFER)
;
PEEK1BYTE EQU 6 ;Command to Peek 1 Byte in the Apple
POKE1BYTE EQU 7 ;Command to Poke 1 Byte to the Apple
;
; New DCD routine equate MEXplus
;
CTSMSK EQU 00100000B ;mask to test for carrier
;
; Status bit equates for CCS serial port
;
MDSNDB EQU 10H
MDSNDR EQU 10H
MDRCVB EQU 08H
MDRCVR EQU 08H
;
; Equates for PSW (Parity, Stop Bit, Word Length) used by SSC ACIA
; In these bytes the high nibble is the Word Length mask, the low
; nibble is the Parity mask for the ACIA PSWFIX routine.
;
P8N1 EQU 010H ;8 NONE 1
P7E1 EQU 036H ;7 EVEN 1
P7O1 EQU 032H ;7 ODD 1
P7N1 EQU 030H ;7 NONE 1
;
BRKMSK EQU 0CH ;mask byte for BREAK function
DISCB EQU 0AH ;command byte for ACIA to drop DTR
;
;----------------------------------------------------------------------
;
; MEX Service Processor Calls
;
MEX EQU 0D00H ;address of the service processor
INMDM EQU 255 ;get char from port to A, CY=no more in 100 ms
TIMER EQU 254 ;delay 100ms * reg B
TMDINP EQU 253 ;B=# secs to wait for char, cy=no char
CHEKCC EQU 252 ;check for ^C from KBD, Z=present
SNDRDY EQU 251 ;test for modem-send ready
RCVRDY EQU 250 ;test for modem-receive ready
SNDCHR EQU 249 ;send a character to the modem (after sndrdy)
RCVCHR EQU 248 ;recv a char from modem (after rcvrdy)
LOOKUP EQU 247 ;table search: see CMDTBL comments for info
PARSFN EQU 246 ;parse filename from input stream
BDPARS EQU 245 ;parse baud-rate from input stream
SBLANK EQU 244 ;scan input stream to next non-blank
EVALA EQU 243 ;evaluate numeric from input stream
LKAHED EQU 242 ;get nxt char w/o removing from input
GNC EQU 241 ;get char from input, cy=1 if none
ILP EQU 240 ;inline print
DECOUT EQU 239 ;decimal output
PRBAUD EQU 238 ;print baud rate
PRNTBL EQU 237 ;print command table in columns (HL=addr)
PRID EQU 236 ;print MEX ID string on console
;
CONOUT EQU 2 ;simulated BDOS function 2: console char out
PRINT EQU 9 ;simulated BDOS function 9: print string
INBUF EQU 10 ;input buffer, same structure as BDOS 10
;
;
;======================================================================
;
ORG 100H ;we begin
;
; changed jumps for MEXplus
;
DB 0C3H ;flags a LOADable file (for 8080)
DS 2 ;MEX has a JMP START here
;
; The following variables are located at the beginning of the program
; to facilitate modification without the need of re-assembly. They will
; be moved in MEX 2.0.
;
PMODEM: DB YES ;\ / These two locations are 103H
SMODEM: DB NO ;/ \ not referenced by MEX. 104H
TPULSE: DB 'T' ;Tone/Pulse (used only in Smodem overlay) 105H
CLOCK: DB 70 ;70-72 valid range for PCPI 106H
MSPEED: DB INITBAUD;sets display time for sending a file 107H
;uses INITBAUD equate, changes during
;use via PBAUD routine
BYTDLY: DB 1 ;default time to send character in 108H
;terminal mode file transfer (0-9)
;0=0 delay, 1=10 ms, 5=50 ms, 9=90 ms
CRDLY: DB 1 ;end-of-line delay in terminal 109H
;mode file transfer for slow BBS systems
;0=0 delay, 1=100 ms, 5=500 ms, 9=900 ms
COLUMS: DB 5 ;number of directory columns 10AH
SETFL: DB YES ;yes=user-defined SET command 10BH
SCRTST: DB YES ;yes=if home cursor and clear screen 10CH
;routine at CLRSCRN
DB 0 ;was once ACKNAK, now spare 10DH
BAKFLG: DB NO ;yes=make .BAK file 10EH
CRCDFL: DB YES ;yes=default to CRC checking 10FH
;no=default to Checksum checking
TOGCRC: DB YES ;yes=allow toggling of Checksum to CRC 110H
CVTBS: DB NO ;yes=convert backspace to rub 111H
TOGLBK: DB YES ;yes=allow toggling of bksp to rub 112H
ADDLF: DB NO ;no=no LF after CR to send file in 113H
;terminal mode (added by remote echo)
TOGLF: DB YES ;yes=allow toggling of LF after CR 114H
TRNLOG: DB NO ;yes=allow transmission of logon 115H
;write logon sequence at location LOGON
SAVCCP: DB YES ;yes=do not overwrite CCP 116H
LOCNXT: DB NO ;yes=local cmd if EXTCHR precedes 117H
;no=not local cmd if EXTCHR precedes
TOGLOC: DB YES ;yes=allow toggling of LOCNXTCHR 118H
LSTTST: DB YES ;yes=allow toggling of printer on/off 119H
;in terminal mode. Set to no if using
;the printer port for the modem
XOFTST: DB YES ;yes=allow testing of XOFF from remote 11AH
;while sending a file in terminal mode
XONWT: DB NO ;yes=wait for XON after sending CR while 11BH
;transmitting a file in terminal mode
TOGXOF: DB YES ;yes=allow toggling of XOFF testing 11CH
IGNCTL: DB NO ;yes=do not send control characters 11DH
;above CTL-M to CRT in terminal mode
;no=send any incoming CTL-char to CRT
EXTRA1: DB 0 ;for future expansion 11EH
EXTRA2: DB 0 ;for future expansion 11FH
BRKCHR: DB '@'-40H ;^@ = Send a 300 ms. break tone 120H
NOCONN: DB 'N'-40H ;^N = Disconnect from phone line 121H
LOGCHR: DB 'L'-40H ;^L = Send logon 122H
LSTCHR: DB 'P'-40H ;^P = Toggle printer 123H
UNSVCH: DB 'R'-40H ;^R = Close input text buffer 124H
TRNCHR: DB 'T'-40H ;^T = Transmit file to remote 125H
SAVCHR: DB 'Y'-40H ;^Y = Open input text buffer 126H
EXTCHR: DB '^'-40H ;^^ = Send next character 127H
;
; Equates used only by PMMI routines grouped together here.
;
PRATE: DB 125 ;125=20pps dialing, 250=10pps 128H
DB 0 ;not used 129H
;
; Jump table accessed by MEX to write/read serial port
;
IN$MODSTAP: JMP RD$MODSTAP ;read ACIA status port 12AH
DS 7
OUT$MODDATP: JMP WR$MODDATP ;send character to ACIA 134H
DS 7
IN$MODDATP: JMP RD$MODDATP ;read character from ACIA 13EH
DS 7
;
; Bit-test routines. These will be merged with the above
; routines in MEX 2.0 to provide a more reasonable format
;
MASKR: ANI MDRCVB ! RET ;bit to test for receive ready 148H
TESTR: CPI MDRCVR ! RET ;value of rcv. bit when ready 14BH
MASKS: ANI MDSNDB ! RET ;bit to test for send ready 14EH
TESTS: CPI MDSNDR ! RET ;value of send bit when ready 151H
;---------------------------------------------------------------------------
; MEXplus changes:
; - was unused area. >>> MUST total 12bytes <<<
; - now used for the Ringing and Carrier Detect jumps
;
; Note: There seems to be a conflict between other MXH overlays and
; what is in the MexPlus Dist. Notes dated 2/20/86 regarding
; the correct location of the two JMP. Other overlays inspected
; have DCD at 154H and RNG at 157H. Notes say DCD at 157H and
; RNG at 15AH. The following does work......
;
DCDTEST: JMP DCDVEC ;jump to carrier-detect routine 154H
RNGTEST: JMP RNGVEC ;jump to ring detect routine 157H
;
DS 6 ;remainder of space
;
;---------------------------------------------------------------------------
;
LOGON: DS 2 ;not used by MEX 160H
DIALV: DS 3 ;dial a digit in A (ref SMOVL) 162H
DISCV: JMP DISCON ;drops DTR to hang-up fast! 165H
GOODBV: JMP GOODBYE ;called before exit to CPM 168H
INMODV: JMP INITMOD ;go to user written routine 16BH
NEWBDV: JMP PBAUD ;changes baud with phone # 16EH
NOPARV: RET ! NOP ! NOP ;set modem for no-parity 171H
PARITV: RET ! NOP ! NOP ;set modem parity 174H
SETUPV: JMP SETCMD ; 177H
SPMENV: DS 3 ;not used by MEX 17AH
VERSNV: JMP SYSVER ; 17DH
BREAKV: JMP SENDBRK ; 180H
;
; The following jump vector provides the overlay with access to special
; routines in the main program (retained and supported in the main pro-
; gram for MDM overlay compatibility). These should not be modified by
; the overlay.
;
; Note that for MEX 2.0 compatibility, you should not try to use these
; routines, since this table will go away with MEX 2.0 (use the MEX
; service call processor instead).
;
ILPRTV: DS 3 ;replace with MEX function 9 183H
INBUFV: DS 3 ;replace with MEX functin 10 186H
ILCMPV: DS 3 ;replace with table lookup funct 247 189H
INMDMV: DS 3 ;replace with MEX function 255 18CH
NXSCRV: DS 3 ;not supported by MEX 18FH
TIMERV: DS 3 ;replace with MEX function 254 192H
;
; Clear/screen and clear/end-of-screen. Each routine must use the
; full 9 bytes alloted (may be padded with nulls).
;
;
CLREOS: LXI D,EOSMSG ; 195H
MVI C,PRINT
CALL MEX
RET ; 19DH
;
CLS: LXI D,CLSMSG ; 19EH
MVI C,PRINT
CALL MEX
RET ; 1A6H
;
;
; *** END OF FIXED FORMAT AREA ***
;--------------------------------------------------------------------------
; Make sure MEXplus has all of its' reserved area..
;
ORG 0200H
;--------------------------------------------------------------------------
; Overlay Fixed Messages Area
;
; these codes changed to match PCPI CONFIGSV values for Televideo 950
;
;
EOSMSG: DB ESC,89,0,0,'$' ;clear to end of screen message
;
CLSMSG: DB ESC,42,0,0,'$' ;clear screen message
;
VERMSG: DB CR,LF,'MEX for Apple ][ / PCPI / SSC, '
DB 'Overlay Version: ',REV/10+'0','.'
DB REV MOD 10+'0'
DB CR,LF,LF,'$'
DB 0,'Overlay by Middlebrook/Lill',0,'$'
;
;----------------------------------------------------------------------
; These routines are specific to the Apple ][+ with Applicard. The
; routines read modem hardware (Apple Super Serial Card ACIA) directly
; from the Applicard.
;
; Read the Command Port of ACIA
;
RD$MODCMDP: PUSH D
LXI D,MODCMDP
CALL PEEK
POP D
RET
;
; Write to the Command Port of ACIA
;
WR$MODCMDP: PUSH D
LXI D,MODCMDP
CALL POKE
POP D
RET
;
; Read the Status Port of the ACIA
;
RD$MODSTAP: PUSH D
LXI D,MODSTAP
CALL PEEK
POP D
RET
;
; Write to the Control Port of the ACIA
;
WR$MODCTLP: PUSH D
LXI D,MODCTLP
CALL POKE
POP D
RET
;
; Read the Control Port of the ACIA
;
RD$MODCTLP: PUSH D
LXI D,MODCTLP
CALL PEEK
POP D
RET
;
; Read Data Port of ACIA
;
RD$MODDATP: PUSH D
LXI D,MODDATP
CALL PEEK
POP D
RET
;
; Write to the Serial Data Port of the ACIA
;
WR$MODDATP: PUSH D
LXI D,MODDATP
CALL POKE
POP D
RET
;
; Peek at 1 byte from Apple 6502 address space
; ENTRY: DE = Address in Apple
; EXIT: A = Data
;
PEEK: PUSH B
MVI C,PEEK1BYTE
CALL WRBYTE
CALL WRWORD
CALL RDBYTE
POP B
RET
;
; Poke 1 byte to Apple 6502 address space
; ENTRY: DE = Address in Apple
; EXIT: A = Data
;
POKE: PUSH B
MOV B,A
MVI C,POKE1BYTE
CALL WRBYTE
CALL WRWORD
MOV C,B
CALL WRBYTE
POP B
RET
;
;----------------------------------------------------------------------
; The new stuff for MEXplus
;
; Data Carrier Detect Routine
;
DCDVEC: CALL RD$MODSTAP ;read SSC status port
ANI CTSMSK ;isolate carrier bit
JNZ NOCARR ;0=carrier detected
CMA ;make it 0ffh
RET ;
NOCARR: XRA A ;make it 0
RET ;
;
; Ring Detect Routine
;
RNGVEC: JMP DCDVEC ;overlay doesn't know
;
;----------------------------------------------------------------------
;
; This routine sends a timed Break to modem from SSC card.
;
SENDBRK:CALL RD$MODCMDP ;get current command status
STA CMDSV
ORI BRKMSK ;mask to make ACIA send BREAK
CALL WR$MODCMDP ;send command
MVI B,5
MVI C,TIMER ;wait 500 msecs
CALL MEX
LDA CMDSV ;get old command state
CALL WR$MODCMDP ;put it back
RET
;
;.....
;
; You can add your own routine here to set DTR low and/or send a break
; tone to disconnect when exiting to CPM.
;
GOODBYE: RET ;just return so exit to system
;will not cause disconnect
;.....
;
; The following is used to initialize the SSC card for eight data bits,
; no parity, one stop bit, and baud=INITBAUD
;
INITMOD:MVI A,0BH ;default No Parity byte for ACIA
STA PARSV ;save it
MVI A,10H ;default 8 Data, 1 Stop Bits for ACIA
STA WRDSV ;save it
MVI A,INITBAUD ;set to initial baud equate
JMP PBAUD ;let PBAUD setup ACIA
;
; This is the secondary entry used by the overlay to set baud,
; parity, and stop bit parameters of ACIA.
;
INITMOD1:
LDA PARSV ;get current parity byte
ORI 0BH ;enable DTR, RECV IRQ, and RTS
STA CMDSV ;save byte for other uses
CALL WR$MODCMDP ;send to command port
PUSH H
LXI H,BAUDSV ;get address of current baud byte
LDA WRDSV ;get current word length byte
ORA M ;put 'em together
STA CTLSV ;...and save for other uses
POP H
CALL WR$MODCTLP ;now send to control port
RET
;
CMDSV: DB 0 ;temporary storage
CTLSV: DB 0 ;temporary storage
;
;.....
;
; This routine drops DTR to force modem to disconnect. Does NOT do
; any initialization.
;
DISCON: CALL RD$MODCMDP ;get current command status
STA CMDSV ;save it
MVI A,DISCB ;get disconnect byte (drops DTR)
CALL WR$MODCMDP ;send to ACIA
MVI B,10
MVI C,TIMER ;wait 1 second
CALL MEX
LDA CMDSV ;get back command status
CALL WR$MODCMDP ;put it back in ACIA register
MVI B,10
MVI C,TIMER ;wait another second
CALL MEX
RET ;back to program
;
;.....
;
; This routine changes the modem baud rate with phone list entry
;
; Set baud-rate code in A (if supported by your modem overlay). PMMI
; supports only five rates, which are validated here. NOTE: this routine
; (ie, the one vectored through NEWBDV) should update MSPEED with the
; passed code, but ONLY if that rate is supported by the hardware.
;
PBAUD: PUSH H ;don't alter anybody
PUSH D
PUSH B
MOV E,A ;code to DE
MVI D,0
LXI H,BAUDTB ;offset into table
DAD D
MOV A,M ;fetch code
ORA A ;0 means unsupported code
JZ PBEXIT ;exit if so
STA BAUDSV ;good rate, save it for INITMOD1
CALL INITMOD1 ;set baud (and PSW)
MOV A,E ;get speed code back
STA MSPEED ;make it current
JMP PBEXIT + 1 ;jump error flag set
PBEXIT: STC ;set return error for STBAUD caller
POP B ;all done
POP D
POP H
RET
;
; Table of baud rate parameters for supported rates
;
BAUDTB: DB 03H,06H,0,07H,0 ;110,300,450,610,710
DB 08H,0AH,0CH,0EH,0FH ;1200,2400,4800,9600,19200
BAUDSV: DB 06H ;current baud byte
;
;.....
;
; Sign-on message
;
SYSVER: LXI D,VERMSG
MVI C,PRINT
CALL MEX
RET
;
;.....
;
; Newline on console
;
CRLF: MVI A,CR
CALL TYPE
MVI A,LF ;fall into TYPE
;
; type char in A on console
;
TYPE: PUSH H ;save 'em
PUSH D
PUSH B
MOV E,A ;align output character
MVI C,CONOUT ;print via MEX
CALL MEX
POP B
POP D
POP H
RET
;
;----------------------------------------------------------------------
;
; The remainder of this overlay implements a very versatile SET command
; -- if you prefer not to write a SET for your modem, you may delete the
; code from here to the END statement. Control is passed here after
; MEX parses a SET command.
;
;
SETCMD: MVI C,SBLANK ;any arguments?
CALL MEX
JC SETSHO ;if not, go print out values
LXI D,CMDTBL ;parse command
CALL TSRCH ;from table
PUSH H ;any address on stack
RNC ;if we have one, execute it
POP H ;nope, fix stack
SETERR: LXI D,SETEMS ;print error
MVI C,PRINT
CALL MEX
RET
;
SETEMS: DB CR,LF,'SET command error',CR,LF,'$'
;
; SET command table ... note that tables are constructed of command-
; name (terminated by high bit=1) followed by word-data-value returned
; in HL by MEX service processor LOOKUP. Table must be terminated by
; a binary zero.
;
; Note that LOOKUP attempts to find the next item in the input stream
; in the table passed to it in HL ... if found, the table data item is
; returned in HL; if not found, LOOKUP returns carry set.
;
CMDTBL: DB '?'+80H ;"set ?"
DW STHELP
DB 'BAU','D'+80H ;"set baud"
DW STBAUD
DB 'PS','W'+80H ;"set PSW"
DW STPSW
DB 'TON','E'+80H ;'set TONE/PULSE byte to 'T'
DW STTONE
DB 'PULS','E'+80H ;'set TONE/PULSE byte to 'P'
DW STPULSE
DB 0 ;<<=== table terminator
;
; SET <no-args>: print current statistics
;
SETSHO: LXI H,SHOTBL ;get table of SHOW subroutines
SETSLP: MOV E,M ;get table address
INX H
MOV D,M
INX H
MOV A,D ;end of table?
ORA E
RZ ;exit if so
PUSH H ;save table pointer
XCHG ;adrs to HL
CALL GOHL ;do it
CALL CRLF ;print newline
MVI C,CHEKCC ;check for console abort
CALL MEX
POP H ;it's done
JNZ SETSLP ;continue if no abort
RET
;
GOHL: PCHL
;
; Table of SHOW subroutines
;
SHOTBL:
DW BDSHOW ;displays current baud
DW PSWSHOW ;displays current PSW
DW TPSHOW ;displays current TPULSE byte (0105H)
DW CRLF
DW 0 ;<<== table terminator
;
; SET ? processor
;
STHELP: CALL CLS ;clear screen
LXI D,HLPMSG
MVI C,PRINT
CALL MEX
RET
;
; The help message
;
HLPMSG: DB CR,LF,'SET Commands available are:',CR,LF,LF
DB 'SET BAUD <110, 300, 600, 1200, 2400, 4800,'
DB ' 9600, or 19200>',CR,LF
DB 'SET PSW <8N1, 7E1, 7O1, or 7N1> -- Word Length,'
DB ' Parity, Stop Bits',CR,LF
DB 'SET TONE (Sets flag for TONE dialing)',CR,LF
DB 'SET PULSE (Sets flag for PULSE dialing)'
DB CR,LF,LF,'$'
;
; SET BAUD processor
;
STBAUD: MVI C,BDPARS ;function code
CALL MEX
JC SETERR ;invalid code
CALL PBAUD ;try to set it
JC SETERR ;unsupported code
BDSHOW: CALL ILPRT ;display baud
DB 'Baud rate:',TAB,' ',0
LDA MSPEED
MVI C,PRBAUD ;use MEX routine
CALL MEX
RET
;
; SET PSW processor
;
STPSW: MVI C,SBLANK
CALL MEX
JC SETERR ;SET PSW should have had argument
LXI D,PSWTBL ;look for PSW match in table
CALL TSRCH
JC SETERR ;not there, so report error
CALL FIXPSW ;routine to set PARSV and WRDSV
CALL INITMOD1 ;now fix ACIA registers
;
PSWSHOW:
CALL ILPRT
DB 'PSW setting:',TAB,' ',0
LDA PSWSET
CPI P8N1
JNZ PSW1
CALL ILPRT
DB '8N1',0
RET
PSW1: CPI P7E1
JNZ PSW2
CALL ILPRT
DB '7E1',0
RET
PSW2: CPI P7O1
JNZ PSW3
CALL ILPRT
DB '7O1',0
RET
PSW3: CPI P7N1
JNZ PSW4
CALL ILPRT
DB '7N1',0
RET
PSW4: CALL ILPRT
DB '<< ERROR >>',0
RET
;
;
PSWSET: DB 010H ;storage and default (8N1)
PARSV: DB 0BH ;storage and default (no parity)
WRDSV: DB 010H ;storage and default (8 data, 1 stop bits)
;
FIXPSW: MOV A,L ;PSW byte from table
STA PSWSET ;save it
ANI 0F0H ;mask for word length bits
STA WRDSV ;put in storage
LDA PSWSET ;get back PSW byte
ANI 0FH ;mask for parity bits
RLC ;first shift into upper nibble..
RLC ;...away we go...
RLC ;.....and go...
RLC ;......and done
ORI 0BH ;mask needed for ACIA command register
STA PARSV ;put in storage
RET
;
PSWTBL: DB '8N','1'+80H
DW P8N1 ;filled in with equ's
DB '7E','1'+80H
DW P7E1 ; - ditto -
DB '7O','1'+80H
DW P7O1 ; - ditto -
DB '7N','1'+80H
DW P7N1 ; - ditto -
DB 0 ;<<==== table terminator
;
;.....
;
; These routines set TPULSE flag at 0105H to either 'T' or 'P' so that
; MODEM (specifically MXO-SM13.ASM) overlay will dial in TONE or PULSE
; mode. The settings are mutually exclusive.
;
STTONE: MVI A,'T' ;get T flag
STA TPULSE ;put into proper place
JMP TPSHOW ;display dial mode
;
STPULSE:
MVI A,'P' ;get P flag
STA TPULSE
;
TPSHOW: CALL ILPRT
DB 'Dial Mode:',TAB,' ',0
LDA TPULSE
CPI 'T'
JNZ TP1
CALL ILPRT
DB 'TONE',0
RET
TP1: CPI 'P'
JNZ TP2
CALL ILPRT
DB 'PULSE',0
RET
TP2: CALL ILPRT
DB '<< ERROR >>',0
RET
;
;......
;
; Compare next input-stream item in table @DE; CY=1 if not found,
; else HL = matched data item
;
TSRCH: MVI C,LOOKUP ;get function code
JMP MEX ;pass to MEX processor
;
; Print in-line message ... blows away C register
;
ILPRT: MVI C,ILP ;get function code
JMP MEX ;go do it
;
;
; >>>> End of MXH-APnn <<<<