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
/
BEEHIVE
/
COMMS
/
IMP-ICE.ARC
/
I2AP.ASM
next >
Wrap
Assembly Source File
|
1990-09-20
|
12KB
|
427 lines
; I2AP-1A.ASM - Apple ][ overlay file for IMP - 07/27/85
;
; This overlay file adapts Apple // computers with PCPI Applicard character
; driver 2 connected to a serial device;
;
; You will want to look this file over carefully. There are a number of
; options that you can use to configure the program to suit your taste.
;
; Edit this file for your preferences then follow the "TO USE:" example
; shown below.
;
; Many terminals will clear the screen with a CTL-Z. If yours does, put
; a 1AH at CLEAR: (010AH). Many terminals use two characters, the first
; normally an ESC. For example, ESC *. In this case put '*' at CLEAR:
; (The ESC will automatically be typed with no CTL-character present.)
; If you don't know what your terminal uses, put a 0 at CLEAR: and IMP
; will scroll up 24 blank lines to clear the CRT for things like MENU,
; looking at the function key table, typing CTL-Z in command mode, etc.
;
; Use the "SET" command to change the baudrate when desired. The value
; at MSPEED controls the baudrate when the program is first called up.
;
; TO USE: First edit this file filling in answers for your own
; equipment. Then assemble with ASM.COM or equivalent
; assembler. Then use MLOAD to merge into the main file:
;
; MLOAD IMP.COM=IMP.COM,I2AP-x.HEX
;
; = = = = = = = = = = = = = = = = = = = = = = = =
;
; 04/24/87 - Applicard driver support rewrite - Ken Lau
; 07/17/85 - Written to work with IMP - Irv Hoff
;
; = = = = = = = = = = = = = = = = =
;
;
YES EQU 0FFH
NO EQU 0
;
;-----------------------------------------------------------------------
;
DEVNO EQU 2 ; Character driver device number (Applicard)
;
;-----------------------------------------------------------------------
;
ESC EQU '['-40H ; ^[ = Escape
BELL EQU 'G'-40H ; ^G = Bell character
LF EQU 'J'-40H ; ^J = Linefeed
NEXTRY EQU 'K'-40H ; ^K = Try next phone number, abort this try
CR EQU 'M'-40H ; ^M = Carriage return
CLEARSC EQU 'Z'-40H ; ^Z = Clear screen, command mode only
EOFCHAR EQU 'Z'-40H ; ^Z = End of file
;
;
;=======================================================================
;
;
ORG 0100H
;
;
DS 3 ; Skip the data area below
;
;
; These routines and equates are at the beginning of the program so
; they can be patched by a monitor or overlay file without re-assembling
; the program.
;
MSPEED: DB 1 ; 0=110 1=300 2=450 3=600 4=710 5=1200 103H
; 6=2400 7=4800 8=9600 9=19200 default
HS2400: DB NO ; Yes=2400 bps highest speed 104H
HS1200: DB NO ; Yes=1200 bps highest speed 105H
RACAL: DB NO ; Yes=Racal-Vadic 1200V or 2400V or 2400PA 106H
PROMODM: DB NO ; Yes=Prometheus ProModem 1200 bps 107H
RESVD1: DB NO ; Reserved for special modems 108H
RESVD2: DB NO ; Reserved for special modems 109H
;
;
CLEAR: DB '*' ; Clear screen character (ESC not needed) 10AH
;
;
CLOCK: DB 2 ; Clock speed in MHz, 25.5 MHz max. 10BH
; NOTE: DO NOT MULTIPLY BY 10 FOR APPLICARD
;
;
; 20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
BYTDLY: DB 9 ; 0=0 delay 1=10ms 5=50 ms - 9=90 ms 10CH
; default time to send character in ter-
; minal mode file transfer for slow BBS
CRDLY: DB 9 ; 0=0 delay 1=100 ms 5=500 ms - 9=900 ms 10DH
; default time for extra wait after CRLF
; in terminal mode file transfer
NOFCOL: DB 5 ; Number of directory columns shown 10EH
TCHPUL: DB 'T' ; T=tone, P=Pulse (Hayes 2400 modems) 10FH
;.....
;
;
ADDLFD: DB NO ; Yes=add LF after CR to send file in terminal 110H
; mode (normally added by remote echo)
CONVRUB: DB YES ; Yes=convert rub to backspace 111H
CRCDFLT: DB YES ; Yes=default to CRC checking 112H
IGNRCTL: DB NO ; Yes=CTL-chars above ^M not displayed 113H
;.....
;
;
EXTCHR: DB '['-40H ; ESC = preceeds local control character 114H
EXITCHR: DB 'E' ; Exit character 115H
FILESND: DB 'F' ; Send file when in terminal mode 116H
NOCONCT: DB 'N' ; Disconnect from phone line 117H
LOGCHR: DB 'L' ; Send logon 118H
LSTCHR: DB 'P' ; Toggle printer 119H
UNSAVCH: DB 'R' ; Close input text buffer 11AH
SAVECHR: DB 'Y' ; Open input text buffer 11BH
CLEARS: DB 'Z' ; Clears screen, terminal mode 11CH
SPARE1: DB 0 ; For future development 11DH
SPARE2: DB 0 ; For future development 11EH
;.....
;
;
; Handles in/out ports for data and status
;
I$MDCTL1: JMP RCVCTL1 ; In modem control port 11FH
DB 0,0,0,0,0,0,0 ; Spares if needed 122H
;
I$MDTXE: JMP RCVCTL1 ; 129H
DB 0,0,0,0,0,0,0 ; 12CH
;
I$MDDATP: JMP RCVDATP ;in modem data port 133H
DB 0,0,0,0,0,0,0 ; 146H
;
O$MDDATP: JMP SNDDATP ; Out modem data port 13DH
DB 0,0,0,0,0,0,0 ; Spares if needed 140H
;.....
;
;
A$MDRCV: ANI 2 ; 147H
RET ; 149H
;
C$MDRCV: CPI 2 ; 14AH
RET ; 14CH
;
A$MDSND: ANI 1 ; 14DH
RET ; 14FH
;
C$MDSND: CPI 1 ; 150H
RET ; 152H
;
A$MDTXE: ANI 1 ; 153H
RET ; 155H
;
C$MDTXE: CPI 1 ; 156H
RET ; 158H
;.....
;
;
; Special exit vector, used by some computers to reset interrupt vectors
;
J$EXITVEC:RET ; 159H
DB 0,0 ; 15AH
;.....
;
;
; Jump vectors needed by each overlay
;
J$GOODBYE:JMP GOODBYE ; Disconnects modem by dropping DTR 15CH
J$INITMOD:JMP INITMOD ; Initializes modem, autosets baudrate 15FH
J$STUPR: JMP STUPR ; SET routine to change baudrate 162H
J$SYSVR: JMP SYSVR ; Signon message 165H
;.....
;
;
; "AT" command strings, can be replaced in individual overlay if needed
;
J$STRNGA: DS 3 ; 1200 bps "AT" string 168H
J$STRNG1: DS 3 ; 2400 bps "AT" string 16B:IMP
;
;
; Next fourteen lines should not be changed by user overlay as these go
; to specific locations in the main program, not in the overlay.
;
;
J$CMDSPL: DS 3 ; Allows entry of baudrate on CMD line 16EH
J$CRLF: DS 3 ; Turns up one new line on display 171H
J$DIAL: DS 3 ; Start of dialing routine 174H
J$DSCONT: DS 3 ; Terminates modem use 177H
J$GOLST: DS 3 ; Printer routine, needed by Apple //e 17AH
J$ILPRT: DS 3 ; Prints an inline string, 0 to end 17DH
J$INBUF: DS 3 ; Stores a keybd string for comparison 180H
J$INLNCP: DS 3 ; Inline "compare strings" routine 183H
J$INMDM: DS 3 ; Max .1 sec wait for modem character 186H
J$RCVRSP: DS 3 ; For 3801 I/O use (TV-803) 189H
J$SNDCHR: DS 3 ; Sends a character to the modem 18CH
J$SNDSTR: DS 3 ; Sends a string to the modem, $ to end 18FH
J$TIMER: DS 3 ; .1 second timer (amount in 'B' reg.) 192H
J$NEW1: DB 0,0,0 ; For future needs 195H
J$NEW2: DB 0,0,0 ; For future needs 198H
;.....
;
;
; For 2400 bps auto-stepdown units
;
MANUAL: DB 0 ; For manual selection flag 19BH
J$300: JMP OK300 ; Sets baudrate to 300 baud 19CH
J$1200: JMP OK1200 ; Sets baudrate to 1200 bps 19FH
J$2400: JMP OK2400 ; Sets baudrate to 2400 bps 1A2H
;.....
;
;
LOGPTR: DW LOGON ; Pointer to display LOGON message 1A5H
;
SYSVR: CALL J$ILPRT ; Display the following line 1A7H
DB 'Apple // and ' ;
DB 'Applicard '
DB 'with device ', devno+30h,CR,LF
DB 0
RET
;
;-----------------------------------------------------------------------
;
; NOTE: You can change the SYSVER message to be longer or shorter. The
; end of your last routine should terminate by 0400H (601 bytes
; available after start of SYSVER).
;
;-----------------------------------------------------------------------
;
; You can put in a message at this location which can be called up with
; (special character-L). You can put in several lines. End with a 0.
;
LOGON: DB 'Hello there from an Apple computer user',CR,0
;
;-----------------------------------------------------------------------
;
; This routine sets DTR low for 1 second to disconnect the phone
;
GOODBYE EQU $
;
CALL INITMOD1
LXI H,GBSTR
CALL J$SNDSTR
RET
GBSTR DB 'ATH0',CR,'$'
;
;
;=========================== INITMOD ===================================
;
;
INITMOD JMP INITMOD2 ; Patched to INIMOD3 after the first time
INITMOD2 LHLD J$DIAL+1 ; Hook in NEWDIAL routine
SHLD NEWDIALJ+1
LXI H,NEWDIAL
SHLD J$DIAL+1
LXI H,INITMOD3 ; Patch INITMOD to not install hook again
SHLD INITMOD
INITMOD3 JMP OK300 ; 300 bps
INITMOD1 JMP INITSER ; Initialize driver (prepare to AT)
;
;
; Dial routine hook (to reset modem)
NEWDIAL CALL INITMOD1
NEWDIALJ JMP 0400H ; to be patched
;
;========================== APPLE I/O ==================================
;-------- SIO --------
;Games serial driver. Mar 87. Ken Lau.
;Boot disk must have GAMESER.DVR installed.
;Main routines: initser, sistat, sostat, serin, serout
;Input byte from Apple/Starcard port --> [A]
AINP IN 40h
RLC
JNC AINP
IN 20h
RET
;Output [A] --> Apple/Starcard port
AOUT PUSH PSW
AOUT1 IN 40h
RRC
JC AOUT1
POP PSW
OUT 0
RET
;Initialize serial port
initser push psw
mvi a,devno*4+0C0h
call aout
call ainp ;dummy
pop psw
ret
;Returns status of serial in port. NZ if data waiting. A corrupted
sistat mvi a,devno*4+0C3h
call aout
mvi a,1
call aout
call ainp
ora a
ret
;Returns status of serial out port. NZ if ready to send. A corrupted
sostat mvi a,devno*4+0C3h
call aout
mvi a,0
call aout
call ainp
ora a
ret
;Send [A]
serout push psw
serout1 mvi a,devno*4+0C2h
call aout
pop psw
jmp aout
;Receive byte --> [A]
serin mvi a,devno*4+0C1h
call aout
jmp ainp
;-------- END SIO --------
;
SNDDATP EQU SEROUT
;
RCVDATP EQU SERIN
;
RCVCTL1 PUSH B ;FORM 'CONTROL PORT BYTE'.
CALL SISTAT ;BIT 1 = 1 IF SERIN RECEIVED
MOV B,A ;BIT 0 = 1 IF SEROUT EMPTY
JZ RCVCTL2
MVI B,2
RCVCTL2 CALL SOSTAT
JZ RCVCTL3
MVI A,1
RCVCTL3 ORA B
POP B
RET
;
;
;-----------------------------------------------------------------------
;
;
; Use the 'SET' command to select a desired baud rate
;
STUPR CALL J$CMDSPL ; Gives up CMDBUF+6
JNC STUPR2
;
STUPR1: CALL J$ILPRT
DB 'Input Baud Rate (75, 300, 300 BELL, 1200, TURN LINE): ',0
LXI D,BAUDBUF ; Point to new input buffer
CALL J$INBUF
CALL J$CRLF
LXI D,BAUDBUF+2
;
STUPR2 CALL J$INLNCP ; Compare BAUDBUF+2 with chars below
DB '75',0
JNC OK75P
CALL J$INLNCP
DB '300 BELL',0
JNC OK300BE
CALL J$INLNCP
DB '300',0
JNC OK300 ; Go if match
CALL J$INLNCP
DB '1200',0
JNC OK1200P
CALL J$INLNCP
DB 'TURN LINE',0
JNC OKTURN
CALL J$ILPRT ; All matches failed, tell operator
DB '++ Incorrect entry ++',CR,LF,BELL,CR,LF,0
JMP STUPR1
;
OK75P CALL J$ILPRT
DB 'Transmit Modem speed is: 75 bps',CR,LF,'Receive ',0
OK75 LXI H,OK75AT
MVI A,5
JMP LOADBD
OK75AT DB 'AT*',81H,'2B',CR,'$' ;AutoIce command
OK300 LXI H,OK300AT
MVI A,1
JMP LOADBD
OK300AT DB 'AT*',81H,'6B',CR,'$' ;AutoIce command
OK300BE LXI H,OK300BA
MVI A,1
JMP LOADBD
OK300BA DB 'AT*',81H,'5B',CR,'$' ;AutoIce command
OK1200P CALL J$ILPRT
DB 'Receive Modem speed is: 75 bps',CR,LF,'Transmit ',0
OK1200 LXI H,OK1200A
MVI A,5
JMP LOADBD
OK1200A DB 'AT*',81H,'8B',CR,'$' ;AutoIce command
OKTURN LXI H,OKTURNA
MVI A,5
JMP LOADBD
OKTURNA DB 'AT*',81H,'0B',CR,'$' ;AutoIce command
OK2400
OK4800
OK9600 RET
LOADBD STA MSPEED ; Change time-to-send to match baudrate
PUSH H
CALL INITMOD1
POP H
CALL J$SNDSTR
RET
;
BAUDBUF DB 10,0,0,0,0,0
DB 0,0,0,0,0,0
;
;-----------------------------------------------------------------------
;
; NOTE: Must terminate prior to 0400H
;
END
;------------------------------------