home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!cup.portal.com!Rick_Michael_Cortese
- From: Rick_Michael_Cortese@cup.portal.com
- Newsgroups: comp.sys.atari.8bit
- Subject: Re: Connecting an RS232 modem to an Atari?
- Message-ID: <65471@cup.portal.com>
- Date: Tue, 8 Sep 92 11:30:22 PDT
- Organization: The Portal System (TM)
- References: <1992Sep7.231030.7510@constellation.ecn.uoknor.edu>
- <65456@cup.portal.com>
- Lines: 137
-
- 10 ;ASM ,,#D9:TC
- 20 .OPT NO LIST
- 30 *= $0600
- 40 ;MAC/65 source for
- 50 ;RS232 ASCII serial transfer over
- 60 ;joystick port #1 by Rick Cortese
- 70 ;Some routines modified from
- 80 ;Eric Floegel "Forth on the Atari"
- 90 ;To be called from Basic with
- 0100 ;X=USR(1536)
- 0110 ;to initialize the joystick port
- 0120 ;then
- 0130 ;X=USR(1686, BYTE)
- 0140 ;where "BYTE"=data to be sent
- 0150 ;to change BAUD: poke 45000/BAUD
- 0160 ;POKE 1776, 45000/BAUD
- 0170 ;so you can use different values
- 0180 ;to test the maximum speed
- 0190 ;to build a cable you just need to
- 0200 ;get a DB25 female connector and
- 0210 ;hook the White lead from an Atari
- 0220 ;stick cable to pin #3 & the black
- 0230 ;lead to pin #7
- 0240 ;the other terminal (ST?) should
- 0250 ;have it's port set to 8,1,N
- 0260 ;& NOT! monitor XON CTS etc lines
- 0270 ;Uniterm lets you do this W/O any
- 0280 ;problem, I don't know about other
- 0290 ;telecommunication software.
- 0300 ;plug the DB25 into the ST cable
- 0310 ;use ASCII file transfer method
- 0320 ;For an RS232 cable, see DOC file
- 0330 ;or "CAPTURE" the data
- 0340 PTR = $CB
- 0350 SIZE = $CD
- 0360 VAR = $CF
- 0370 PORTA = $D300
- 0380 PACTL = $D302
- 0390 NMIEN = $D40E
- 0400 DMACTL = $D400
- 0410 BAUD = 300
- 0420 INIT
- 0430 PLA
- 0440 LDA #$30
- 0450 STA PACTL
- 0460 LDA #$01
- 0470 STA PORTA
- 0480 LDA #$34
- 0490 STA PACTL
- 0500 LDA #$00
- 0510 STA PORTA
- 0520 RTS
- 0530 BASIC ; USR() ENTRY
- 0540 PLA
- 0550 PLA
- 0560 STA PTR+1
- 0570 PLA
- 0580 STA PTR
- 0590 PLA
- 0600 PLA
- 0610 STA SIZE
- 0620 TAY
- 0630 CONVERT ; TO INVERSE LOGIC
- 0640 LDA #$FF
- 0650 DEY
- 0660 BMI CONTINUE
- 0670 EOR (PTR),Y
- 0680 STA (PTR),Y
- 0690 JMP CONVERT
- 0700 CONTINUE
- 0710 SEI
- 0720 LDA #0
- 0730 STA NMIEN
- 0740 STA DMACTL
- 0750 STA VAR
- 0760 SEND1
- 0770 LDY VAR
- 0780 LDA (PTR),Y
- 0790 STA BUFF
- 0800 LDY #$08
- 0810 STY COUNT
- 0820 ;RS232 start bit
- 0830 LDA #$01
- 0840 STA PORTA
- 0850 NOP
- 0860 NOP
- 0870 NOP
- 0880 NOP
- 0890 NOP
- 0900 NOP
- 0910 NOP
- 0920 NOP
- 0930 JSR WAIT
- 0940 SEND2
- 0950 LDA BUFF
- 0960 STA PORTA
- 0970 ROR A
- 0980 STA BUFF
- 0990 JSR WAIT
- 1000 DEC COUNT
- 1010 BNE SEND2
- 1020 ;Stop bit
- 1030 LDA #$00
- 1040 STA PORTA
- 1050 JSR WAIT
- 1060 JSR WAIT
- 1070 INC VAR
- 1080 LDX VAR
- 1090 CPX SIZE
- 1100 BNE SEND1
- 1110 ;SCR on & return to BASIC
- 1120 LDA #$22
- 1130 STA DMACTL
- 1140 LDA #$FF
- 1150 STA NMIEN
- 1160 CLI
- 1170 RTS
- 1180 BUFF
- 1190 .BYTE 0
- 1200 COUNT
- 1210 .BYTE 0
- 1220 WAIT
- 1230 LDX DELAYX
- 1240 D1
- 1250 LDY DELAYY
- 1260 D2
- 1270 DEY
- 1280 BNE D2
- 1290 DEX
- 1300 BNE D1
- 1310 RTS
- 1320 DELAYX
- 1330 .BYTE 45000/BAUD
- 1340 DELAYY
- 1350 .BYTE $06
- 1360 .END
- ASSIGN
-