ÓDIALER00010 ;DIALER - Dave McGlumphy 4429 Paula Ln
00020 ;Chattanooga, Tennessee 37415   03/26/84
00030 ;MCI# 181-7759
00040 ;This program has model III defaults but also runs on a
00050 ;model 1 without changes.  I don't know about model IV
00060 ;It controls the "REMOTE" plug of the cassette cable
00070 ;Use that plug to control a normally-closed relay which
00080 ;is in series with the red or green wire of the phone
00090 ;line to achieve pulse dialing.  If it dials too fast
00100 ;for your phone system, increase the pause duration
00110 ;at the two places in the code that say "WITHIN DIGIT"
00120 	ORG	7000H
00130 BRKROW	EQU	3840H		;KEYBOARD ROW WITH BREAK
00140 BYTOUT	EQU	33AH		;DISPLAY SINGLE BYTE
00150 CKKEY	EQU	2BH		;CHECK FOR KEY-PRESS
00160 CLS	EQU	1C9H		;CLEAR SCREEN
00170 CURSOR	EQU	4020H		;CURSOR POSITION LSB
00180 DODOS	EQU	4405H		;EXIT & DO DOS COMMAND
00190 DOS	EQU	402DH		;DOS EXIT
00200 DSPLY	EQU	4467H		;DISPLAY MSG ON SCREEN
00210 LBUFPT	EQU	40A7H		;LINE INPUT BUFFER PTR
00220 LIPT	EQU	361H		;BASIC LINE INPUT RTN
00230 PAUSE	EQU	60H		;(BC) DETERMINES DURATION
00240 PORTF1	EQU	403DH		;MODEL 1 CASS PORT FLAG
00250 PORTF3	EQU	4210H		;MODEL III CASS PORT FLAG
00260 START	EQU	$
00270 	LD	HL,41A6H	;PLUG THE DISK BASIC
00280 	LD	B,15H		; LINKS FROM 41A6H
00290 BASLP	LD	(HL),0C9H	; TO 41E2H
00300 	INC	HL
00310 	INC	HL
00320 	INC	HL
00330 	DJNZ	BASLP		; WITH RETURNS
00340 	LD	A,(54H)		;CHECK MODEL 1/III
00350 	DEC	A		;Z IF MODEL 1
00360 	CALL	Z,MODEL1	;INITIALIZE FOR MODEL 1
00370 	LD	HL,LBUFPT	;SET UP THE
00380 	LD	(HL),0CAH	; LINE
00390 	INC	HL		; INPUT
00400 	LD	(HL),64H	; BUFFER
00410 MENU	EQU	$		;DISPLAY THE OPTIONS
00420 	LD	HL,SCREEN	;PT AT MENU SCREEN
00430 	CALL	DSPLY		;PRINT IT
00440 MENGET	EQU	$		;WHAT FUNCTION?
00450 	CALL	GETKEY		;GET UPPERCASE REQUEST
00460 	CP	'A'
00470 	JR	Z,ATC		;YES. PLAY AIR TRAFFIC
00480 	CP	'B'		;B?
00490 	JR	Z,BASIC		;BRING UP BASIC
00500 	CP	'C'		;C?
00510 	JR	Z,MODM80	;BRING UP MODEM80/CMD
00520 	CP	'D'		;D?
00530 	JR	Z,DIL68M	;YES. CALL 6800 BOARD
00540 	CP	'E'		;E?
00550 	JR	Z,GETPHN	;YES. GET KEYED PHONE#
00560 	CP	'F'		;F?
00570 	JR	Z,DILCRB	;YES. CALL CRABAPPLE
00580 	CP	'G'		;G?
00590 	JR	Z,DILMCI	;YES. CALL MCI
00600 	CP	'H'		;H?
00610 	JR	Z,DILDCS	;YES. CALL CHRIS SMITH
00620 	CP	'I'
00630 	JR	Z,DILWSM	;CALL BUTCH
00640 	CP	'J'
00650 	JR	Z,DILPET	;CALL PETE
00660 	CP	'K'
00670 	JR	Z,BOOT		;A HALT INSTRUCTION
00680 	CP	'L'
00690 	JR	Z,DILWOM	;DIAL WOMACK'S BBS
00700 	CP	'M'
00710 	JR	Z,HNG		;HANG UP
00720 	CP	'N'
00730 	JR	Z,PIC		;PICK UP THE PHONE
00740 MENUXT	EQU	$		;EXIT FROM MENU FUNCTION
00750 	JR	MENGET		;GO TO GET NEXT FUNCTION
00760 ATC	LD	HL,ATCPGM	;POINT AT ATC COMMAND
00770 	JP	DODOS		;GO DO IT
00780 BASIC	LD	HL,BASPGM
00790 	JP	DODOS		;GO INTO BASIC
00800 MODM80	LD	HL,MODPGM
00810 	JP	DODOS		;EXECUTE MODEM80/CMD
00820 DIL68M	LD	HL,M68PHN
00830 	CALL	DIAL		;DIAL 68MICRO JOURNAL
00840 	JR	MENUXT		;START OVER
00850 GETPHN	EQU	$		;GET PHONE# FROM KEYBOARD
00860 	LD	HL,NBRMSG	;POINT TO NUMBER? MSG
00870 	CALL	DSPLY		;PRINT IT
00880 	LD	HL,(LBUFPT)	;POINT TO INPUT BUFFER
00890 	PUSH	HL		;SAVE IT
00900 	CALL	LIPT		;GET THE NUMBER
00910 	POP	HL		;POINT AT PHONE #
00920 	CALL	DIAL		;DIAL IT
00930 	CALL	GETKEY		;PAUSE FOR A KEYPRESS
00940 	JR	MENUXT		;START OVER
00950 DILCRB	LD	HL,CRBPHN	;POINT TO CRABAPPLE PHONE
00960 	CALL	DIAL		;DIAL IT
00970 	JR	MENUXT		;START OVER
00980 DILMCI	LD	HL,MCIPHN	;POINT TO MCI PHONE#
00990 	CALL	DIAL		;DIAL IT
01000 	JR	MENUXT		;START OVER
01010 DILDCS	LD	HL,DCSPHN	;POINT AT CHRIS' PHONE#
01020 	CALL	DIAL		;DIAL IT
01030 	JR	MENUXT		;START OVER
01040 DILWSM	LD	HL,WSMPHN	;POINT AT BUTCH'S PHONE
01050 	CALL	DIAL		;DIAL IT
01060 	JR	MENUXT		;START OVER
01070 DILPET	LD	HL,PETPHN	;POINT AT PETE'S PHONE#
01080 	CALL	DIAL		;DIAL IT
01090 	JR	MENUXT		;START OVER
01100 BOOT	HALT			;CAUSES BOOT
01110 DILWOM	LD	HL,WOMPHN	;POINT AT WOMACK'S PHN
01120 	CALL	DIAL		;DIAL IT
01130 	JR	MENUXT		;START OVER
01140 HNG	CALL	HANGUP		;HANG UP THE PHONE
01150 	JR	MENUXT		;START OVER
01160 PIC	CALL	PICKUP		;PICK UP THE PHONE
01170 	JR	MENUXT		;START OVER
01180 DIAL	EQU	$		;HL POINTS TO PHONE#
01190 	PUSH	HL		;SAVE IT
01200 	CALL	HANGUP		;HANGUP THE PHONE
01210 	LD	BC,0		;DO A LONG
01220 	CALL	PAUSE		; PAUSE
01230 	CALL	PICKUP		;PICK IT UP. (DIALTONE)
01240 	LD	BC,0		;DO A LONG
01250 	CALL	PAUSE		; PAUSE
01260 	POP	HL		;RESTORE PTR TO PHONE#
01270 	DEC	HL		;POINT TO BYTE BEFORE
01280 	PUSH	HL		; PHONE# & SAVE IT
01290 GETDIG	EQU	$		;GET PHONE DIGIT
01300 	CALL	CKBRK		;BREAK EXITS TO DOS
01310 	POP	HL		;RESTORE PHONE# PTR
01320 	INC	HL		;POINT TO NEXT DIGIT
01330 	PUSH	HL		;SAVE PHN# PTR
01340 	LD	A,(HL)		;PUT IN A
01350 	CP	0		;END?
01360 	JR	Z,EXIT		;YES
01370 	CP	13		;C/R?
01380 	JR	Z,EXIT		;YES
01390 	CP	30H		;< 0 ?
01400 	JP	M,GETDIG	;YES
01410 	CP	39H+1		;> 9 ?
01420 	JP	P,GETDIG	;YES
01430 	PUSH	AF		;SAVE A
01440 	CALL	BYTOUT		;PRINT IT
01450 	POP	AF		;RESTORE IT
01460 	SUB	30H		;CHG ASCII# TO HEX#
01470 	CP	0		;ZERO?
01480 	JR	NZ,HAVDIG	;NO
01490 	ADD	A,10
01500 HAVDIG	EQU	$		;HAVE DIGIT TO DIAL
01510 	LD	(PULSCT),A	;SAVE IT
01520 	CALL	DIGIT		;DIAL THE DIGIT
01530 	LD	BC,25000	;PAUSE BETWEEN
01540 	CALL	PAUSE		; DIGITS
01550 	JR	GETDIG		;DO NEXT DIGIT
01560 DIGIT	EQU	$
01570 	LD	A,(PULSCT)	;# PULSES LEFT
01580 	CP	0		;DONE YET?
01590 	RET	Z		;YES. GOTO NEXT DIGIT
01600 	DEC	A		;SUBTRACT 1 &
01610 	LD	(PULSCT),A	; SAVE IT
01620 	LD	A,(PORT)	;PUT CASSETTE PORT #
01630 	LD	C,A		; IN C
01640 	LD	A,(MODEL)	;MODEL 1/III?
01650 	CP	1		;1?
01660 	JR	Z,DIGM1		;YES
01670 	LD	A,(PORTF3)	;GET PORT SETTINGS
01680 	JR	DIGXOR		;TURN OFF CASSETTE
01690 DIGM1	LD	A,(PORTF1)
01700 DIGXOR	EQU	$		;RESET PROPER MODEL
01710 	LD	HL,CASBIT	; CASSETTE BIT
01720 	XOR	(HL)		;TURN OFF
01730 	OUT	(C),A		; CASSETTE MOTOR
01740 	LD	BC,2200		;PUT DURATION IN BC
01750 	CALL	PAUSE		;WITHIN DIGIT
01760 	LD	A,(PORT)	;WHICH PORT TO CHANGE
01770 	LD	C,A		;PUT IT IN C
01780 	LD	A,(MODEL)	;MODEL 1/III?
01790 	CP	1		;1
01800 	JR	Z,DIGM1A
01810 	LD	A,(PORTF3)	;MODEL III PORT FLAGS
01820 	JR	DIGAND		;TO TURN ON CASSETTE
01830 DIGM1A	LD	A,(PORTF1)	;MODEL 1 CASSETTE FLAGS
01840 DIGAND	LD	HL,CASBIT	;MODEL CASS MTR BIT
01850 	AND	(HL)		; TO TURN IT ON
01860 	OUT	(C),A
01870 	LD	BC,2200		;PUT DURATION IN BC
01880 	CALL	PAUSE		;WITHIN DIGIT
01890 	JR	DIGIT
01900 EXIT	EQU	$		;HOUSEKEEP & EXIT
01910 	POP	HL
01920 	RET
01930 MODEL1	LD	A,0FFH		;LOAD PORT WITH
01940 	LD	(PORT),A	;MODEL 1 ADDRESS
01950 	LD	HL,MODEL	;PT TO MODEL BYTE
01960 	LD	(HL),1		;INDICATE MODEL1
01970 	LD	HL,CASBIT	;PT TO CASBIT
01980 	LD	(HL),4		;PUT 4 IN IT
01990 	LD	HL,14308	;SELECT CASSETTE
02000 	LD	(HL),1		; #2
02010 	RET
02020 HANGUP	EQU	$		;HANG UP THE PHONE
02030 	LD	A,(PORT)	;PUT CASSETTE PORT#
02040 	LD	C,A		;INTO C
02050 	LD	A,(MODEL)	;WHICH 'PUTER?
02060 	CP	1		;MODEL 1?
02070 	JR	Z,HANG1		;YES
02080 	LD	A,(PORTF3)	;GET CASS PORT FLAGS
02090 	JR	HANXOR		;GO TURN OFF
02100 HANG1	LD	A,(PORTF1)	;GET MOD1 CASS PORT FLAGS
02110 HANXOR	LD	HL,CASBIT	;MODEL CASS MTR BIT
02120 	XOR	(HL)		; TO TURN OFF
02130 	OUT	(C),A		;TURN OFF MOTOR
02140 	RET			;FROM HANG-UP
02150 PICKUP	EQU	$		;PICK UP THE PHONE
02160 	LD	A,(PORT)	;PUT CASSETTE PORT#
02170 	LD	C,A		;INTO C
02180 	LD	A,(MODEL)	;WHICH 'PUTER?
02190 	CP	1		;MODEL 1?
02200 	JR	Z,PICK1		;YES
02210 	LD	A,(PORTF3)	;GET CASS PORT FLAGS
02220 	JR	PICAND		;GO TURN ON
02230 PICK1	LD	A,(PORTF1)	;GET MOD1 CASS PORT FLAGS
02240 PICAND	LD	HL,CASBIT	;MODEL CASS MTR BIT
02250 	AND	(HL)		; TO TURN ON
02260 	OUT	(C),A		;TURN ON MOTOR
02270 	RET			;FROM PICKUP
02280 GETKEY	CALL	CKBRK		;<BREAK> EXITS TO DOS
02290 	LD	A,0		;CLEAR KEY BUFFER
02300 	CALL	CKKEY		;KEY PRESSED?
02310 	OR	A		;CONDITION THE FLAGS
02320 	JR	Z,GETKEY	;NO KEY PRESSED
02330 	PUSH	AF		;SAVE A
02340 	LD	IX,CURSOR	;SET UP PRINT@ POSITION
02350 	LD	A,58H		; AT
02360 	LD	(IX),A		; END
02370 	LD	A,3FH		; OF
02380 	LD	(IX+1),A	; MENU
02390 	LD	A,31		;ERASE EOF
02400 	CALL	BYTOUT		;DO IT
02410 	LD	A,14		;TURN CURSOR
02420 	CALL	BYTOUT		; ON
02430 	POP	AF		;GET A AGAIN
02440 	PUSH	AF		;SAVE IT AGAIN
02450 	CALL	BYTOUT		;PRINT IT
02460 	POP	AF		;RESTORE A
02470 	CP	'Z'+1		;LOWERCASE?
02480 	RET	M		;NO
02490 	SUB	20H		;MAKE IT UPPERCASE
02500 	RET			;WITH KEY IN A
02510 CKBRK	PUSH	AF		;SAVE A
02520 	LD	A,(BRKROW)	;BREAK KEY
02530 	AND	4		; PRESSED?
02540 	JP	NZ,DOS		;YES
02550 	POP	AF		;RESTORE A
02560 	RET			;NO
02570 NBRMSG	DEFB	8		;BACKSPACE CHARACTER
02580 	DEFM	'NUMBER?	'
02590 	DEFB	3		;END LINE WITH NO C/R
02600 SCREEN	DEFB	1CH		;HOME CURSOR
02610 	DEFB	1FH		;EREOF (CLEAR SCREEN)
02620 	DEFM	'A.	ATC				(<BREAK>	EXITS	'
02630 	DEFM	'TO	DOS.)
02640 	DEFB	10
02650 	DEFM	'B.	BASIC'
02660 	DEFB	10
02670 	DEFM	'C.	MODEM80'
02680 	DEFB	10
02690 	DEFM	'D.	68MICRO	JOURNAL....	'
02700 M68PHN	DEFM	'842-6809'
02710 	DEFB	0
02720 	DEFB	10
02730 	DEFM	'E.	ENTER	A	NUMBER	TO	DIAL'
02740 	DEFB	10
02750 	DEFM	'F.	CRABAPPLE..........	'
02760 CRBPHN	DEFM	'875-6035'
02770 	DEFB	0
02780 	DEFB	10
02790 	DEFM	'G.	MCI................	'
02800 MCIPHN	DEFM	'1-800-323-7751'
02810 	DEFB	0
02820 	DEFB	10
02830 	DEFM	'H.	CHRIS	SMITH........	'
02840 DCSPHN	DEFM	'899-5377'
02850 	DEFB	0
02860 	DEFB	10
02870 	DEFM	'I.	BUTCH..............	'
02880 WSMPHN	DEFM	'1-614-695-3056'
02890 	DEFB	0
02900 	DEFB	10
02910 	DEFM	'J.	PETE...............	'
02920 PETPHN	DEFM	'870-1324'
02930 	DEFB	0
02940 	DEFB	10
02950 	DEFM	'K.	BOOT	THE	SYSTEM'
02960 	DEFB	10
02970 	DEFM	'L.	WOMACK	BBS.........	'
02980 WOMPHN	DEFM	'891-0136'
02990 	DEFB	0
03000 	DEFB	10
03010 	DEFM	'M.	HANG	UP	THE	PHONE'
03020 	DEFB	10
03030 	DEFM	'N.	PICK	UP	THE	PHONE		'
03040 	DEFB	03
03050 ATCPGM	DEFM	'ATC'
03060 	DEFB	13
03070 BASPGM	DEFM	'BASIC'
03080 	DEFB	13
03090 MODPGM	DEFM	'MODEM80'
03100 	DEFB	13
03110 CASBIT	DEFB	2		;MIII CASSETTE MTR BIT
03120 MODEL	DEFB	3		;MIII (1=MODEL 1)
03130 PORT1	DEFB	0FFH		;M1 CASSETTE PORT
03140 PORT	DEFB	03CH		;MIII CASSETTE PORT
03150 PULSCT	DEFB	0		;PULSE COUNT
03160 	END	START
0 MODPGM	DEFM	'MODEM80'
03100 	DEFB	13
03110 CASBIT	DEFB	2		;MII