home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / atari / 8bit / 4572 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  3.1 KB

  1. Path: sparky!uunet!portal!cup.portal.com!Rick_Michael_Cortese
  2. From: Rick_Michael_Cortese@cup.portal.com
  3. Newsgroups: comp.sys.atari.8bit
  4. Subject: Re: Connecting an RS232 modem to an Atari?
  5. Message-ID: <65471@cup.portal.com>
  6. Date: Tue,  8 Sep 92 11:30:22 PDT
  7. Organization: The Portal System (TM)
  8. References: <1992Sep7.231030.7510@constellation.ecn.uoknor.edu>
  9.   <65456@cup.portal.com>
  10. Lines: 137
  11.  
  12. 10 ;ASM ,,#D9:TC
  13. 20       .OPT NO LIST
  14. 30       *=  $0600
  15. 40 ;MAC/65 source for
  16. 50 ;RS232 ASCII serial transfer over
  17. 60 ;joystick port #1 by Rick Cortese
  18. 70 ;Some routines modified from
  19. 80 ;Eric Floegel "Forth on the Atari"
  20. 90 ;To be called from Basic with
  21. 0100 ;X=USR(1536)
  22. 0110 ;to initialize the joystick port
  23. 0120 ;then
  24. 0130 ;X=USR(1686, BYTE)
  25. 0140 ;where "BYTE"=data to be sent
  26. 0150 ;to change BAUD: poke 45000/BAUD
  27. 0160 ;POKE 1776, 45000/BAUD
  28. 0170 ;so you can use different values
  29. 0180 ;to test the maximum speed
  30. 0190 ;to build a cable you just need to
  31. 0200 ;get a DB25 female connector and
  32. 0210 ;hook the White lead from an Atari
  33. 0220 ;stick cable to pin #3 & the black
  34. 0230 ;lead to pin #7
  35. 0240 ;the other terminal (ST?) should
  36. 0250 ;have it's port set to 8,1,N
  37. 0260 ;& NOT! monitor XON CTS etc lines
  38. 0270 ;Uniterm lets you do this W/O any
  39. 0280 ;problem, I don't know about other
  40. 0290 ;telecommunication software.
  41. 0300 ;plug the DB25 into the ST cable
  42. 0310 ;use ASCII file transfer method
  43. 0320 ;For an RS232 cable, see DOC file
  44. 0330 ;or "CAPTURE" the data
  45. 0340 PTR =   $CB
  46. 0350 SIZE =  $CD
  47. 0360 VAR =   $CF
  48. 0370 PORTA = $D300
  49. 0380 PACTL = $D302
  50. 0390 NMIEN = $D40E
  51. 0400 DMACTL = $D400
  52. 0410 BAUD =  300
  53. 0420 INIT
  54. 0430     PLA
  55. 0440     LDA #$30
  56. 0450     STA PACTL
  57. 0460     LDA #$01
  58. 0470     STA PORTA
  59. 0480     LDA #$34
  60. 0490     STA PACTL
  61. 0500     LDA #$00
  62. 0510     STA PORTA
  63. 0520     RTS
  64. 0530 BASIC ;         USR() ENTRY
  65. 0540     PLA
  66. 0550     PLA
  67. 0560     STA PTR+1
  68. 0570     PLA
  69. 0580     STA PTR
  70. 0590     PLA
  71. 0600     PLA
  72. 0610     STA SIZE
  73. 0620     TAY
  74. 0630 CONVERT ;       TO INVERSE LOGIC
  75. 0640     LDA #$FF
  76. 0650     DEY
  77. 0660     BMI CONTINUE
  78. 0670     EOR (PTR),Y
  79. 0680     STA (PTR),Y
  80. 0690     JMP CONVERT
  81. 0700 CONTINUE
  82. 0710     SEI
  83. 0720     LDA #0
  84. 0730     STA NMIEN
  85. 0740     STA DMACTL
  86. 0750     STA VAR
  87. 0760 SEND1
  88. 0770     LDY VAR
  89. 0780     LDA (PTR),Y
  90. 0790     STA BUFF
  91. 0800     LDY #$08
  92. 0810     STY COUNT
  93. 0820 ;RS232 start bit
  94. 0830     LDA #$01
  95. 0840     STA PORTA
  96. 0850     NOP
  97. 0860     NOP
  98. 0870     NOP
  99. 0880     NOP
  100. 0890     NOP
  101. 0900     NOP
  102. 0910     NOP
  103. 0920     NOP
  104. 0930     JSR WAIT
  105. 0940 SEND2
  106. 0950     LDA BUFF
  107. 0960     STA PORTA
  108. 0970     ROR A
  109. 0980     STA BUFF
  110. 0990     JSR WAIT
  111. 1000     DEC COUNT
  112. 1010     BNE SEND2
  113. 1020 ;Stop bit
  114. 1030     LDA #$00
  115. 1040     STA PORTA
  116. 1050     JSR WAIT
  117. 1060     JSR WAIT
  118. 1070     INC VAR
  119. 1080     LDX VAR
  120. 1090     CPX SIZE
  121. 1100     BNE SEND1
  122. 1110 ;SCR on & return to BASIC
  123. 1120     LDA #$22
  124. 1130     STA DMACTL
  125. 1140     LDA #$FF
  126. 1150     STA NMIEN
  127. 1160     CLI
  128. 1170     RTS
  129. 1180 BUFF
  130. 1190     .BYTE 0
  131. 1200 COUNT
  132. 1210     .BYTE 0
  133. 1220 WAIT
  134. 1230     LDX DELAYX
  135. 1240 D1
  136. 1250     LDY DELAYY
  137. 1260 D2
  138. 1270     DEY
  139. 1280     BNE D2
  140. 1290     DEX
  141. 1300     BNE D1
  142. 1310     RTS
  143. 1320 DELAYX
  144. 1330     .BYTE 45000/BAUD
  145. 1340 DELAYY
  146. 1350     .BYTE $06
  147. 1360     .END
  148.    ASSIGN
  149.