home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_07_1985_Transactor_Publishing.d64 / remote.pal (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  3KB  |  194 lines

  1. 0 rem the transactor volume 6 issue 02        page 42
  2. 100 sys700
  3. 110 .opt oo
  4. 120 *=$c000
  5. 130 jmp setup
  6. 140 ;
  7. 150 ;kernal entries:
  8. 160 chkin  =$ffc6
  9. 170 chkout =$ffc9
  10. 180 clall  =$ffe7
  11. 200 getin  =$ffe4
  12. 210 open   =$ffc0
  13. 220 setlfs =$ffba
  14. 230 setnam =$ffbd
  15. 240 vector =$ff8d
  16. 250 ;
  17. 260 scrnout =$e716 ;chrout for screen
  18. 270 normout =$f1ca ;chrout vector
  19. 280 ;
  20. 290 asave   =$fb   ;temp storage for a
  21. 300 bufptr  =$c6   ;# chrs in kbd buffr
  22. 320 outvec  =$0326 ;output vector
  23. 330 stopvec =$0328 ;check stop vector
  24. 340 loadvec =$0330 ;load vector
  25. 350 savevec =$0332 ;save vector
  26. 370 ioabort =$032c
  27. 380 filenum =100   ;rs232 file #
  28. 390 ;
  29. 400 fn .byte 6,16  ;rs232 ctrl/command
  30. 420 ;
  31. 430 setup =*
  32. 440 ;
  33. 450 ;save old vectors
  34. 460 ldx #<vecsave
  35. 470 ldy #>vecsave
  36. 480 sec
  37. 490 jsr vector
  38. 500 ;
  39. 510 jsr clall   ;close all files
  40. 550 jsr rsopen  ;open rs232 file
  41. 560 ;
  42. 580 sei
  43. 600 ;change stop vector
  44. 610 lda #<newstop
  45. 620 sta stopvec
  46. 630 lda #>newstop
  47. 640 sta stopvec+1
  48. 650 ;
  49. 660 ;change load vector
  50. 670 lda #<newload
  51. 680 sta loadvec
  52. 690 lda #>newload
  53. 700 sta loadvec+1
  54. 710 ;
  55. 720 ;change save vector
  56. 730 lda #<newsave
  57. 740 sta savevec
  58. 750 lda #>newsave
  59. 760 sta savevec+1
  60. 770 ;
  61. 780 ;change "abort i/o" vector
  62. 790 lda #<newio
  63. 800 sta ioabort
  64. 810 lda #>newio
  65. 820 sta ioabort+1
  66. 830 ;
  67. 831 aftersav =*
  68. 832 sei
  69. 840 ;change output vector
  70. 850 lda #<newout: sta outvec
  71. 860 lda #>newout: sta outvec+1
  72. 870 ;
  73. 880 ;change irq vector
  74. 890 lda #<intrtn: sta $0314
  75. 900 lda #>intrtn: sta $0315
  76. 920 cli
  77. 930 rts
  78. 940 ;
  79. 950 ;
  80. 960 newout =*
  81. 970 ;this is the new output routine
  82. 980 ;which sends to rs232 and screen
  83. 990 ;the vector at $0326 points here
  84. 1000 ;
  85. 1005 sei
  86. 1010 sta asave
  87. 1020 txa: pha: tya: pha ;save x & y!!
  88. 1030 lda asave
  89. 1040 jsr scrnout   ;screen
  90. 1050 ldx #filenum
  91. 1060 jsr chkout
  92. 1070 lda asave
  93. 1080 jsr normout   ;rs232
  94. 1090 pla: tay: pla: tax
  95. 1100 lda asave     ;restore a
  96. 1105 cli
  97. 1110 rts
  98. 1120 ;
  99. 1130 ;
  100. 1140 intrtn =*
  101. 1150 ;puts char from rs232 into
  102. 1160 ;keyboard buffer
  103. 1170 ;
  104. 1180 ldx #filenum
  105. 1190 jsr chkin   ;connect rs232 channel
  106. 1200 jsr getin   ;get character
  107. 1210 cmp #0      ;null
  108. 1220 beq out     ;ignore nulls
  109. 1230 cmp #3      ;ctrl-c (break)
  110. 1240 bne nobrk
  111. 1250 lda #$7f    ;indicate break
  112. 1260 sta brkflg  ;..to new stop rtn
  113. 1270 jmp out
  114. 1280 nobrk =*
  115. 1290 ldx #0      ;clear stop
  116. 1300 stx brkflg  ;..flag
  117. 1310 ldx bufptr  ;# chars in buffer
  118. 1320 sta $0277,x ;keyboard buffer
  119. 1330 inc bufptr  ;point to next char
  120. 1340 out =*
  121. 1350 ldx #0      ;switch back to
  122. 1360 jsr chkin   ;..keyboard
  123. 1370 jmp (vecsave) ;system irq routine
  124. 1380 ;
  125. 1390 ;
  126. 1400 rsopen =*
  127. 1410 ;open rs232 file
  128. 1420 ldx #<fn     ;point to
  129. 1430 ldy #>fn     ;...filename
  130. 1440 lda #2       ;filename length
  131. 1450 jsr setnam   ;set filename
  132. 1460 lda #filenum
  133. 1470 ldx #2
  134. 1480 ldy #2
  135. 1490 jsr setlfs
  136. 1500 jsr open    ;open file#,2,2,fn
  137. 1510 ldx #filenum
  138. 1520 jsr chkout  ;connect channel
  139. 1530 rts
  140. 1540 brkflg .byte 0
  141. 1550 ;
  142. 1560 newstop =*
  143. 1570 ;check stop key routine
  144. 1580 lda brkflg
  145. 1590 beq nostop
  146. 1600 sta $91
  147. 1610 lda #0
  148. 1620 sta brkflg
  149. 1630 nostop =*
  150. 1640 jmp (vecsave+20)
  151. 1650 ;
  152. 1660 ;
  153. 1670 newload =*
  154. 1680 ;load vector points here
  155. 1690 ;must disable stuff before load
  156. 1700 php: pha: txa: pha
  157. 1710 ldx #0 ;0=load
  158. 1730 jmp ld
  159. 1740 ;
  160. 1750 newsave =*
  161. 1760 php: pha: txa: pha
  162. 1770 ldx #2 ;2=save
  163. 1790 ;
  164. 1800 ld =*
  165. 1830 tya
  166. 1840 pha
  167. 1850 ;
  168. 1860 lda vecsave
  169. 1870 sta $0314  ;irq vector
  170. 1880 lda vecsave+1
  171. 1890 sta $0315
  172. 1900 ;
  173. 1910 lda vecsave+18
  174. 1920 sta outvec ;output vector
  175. 1930 lda vecsave+19
  176. 1940 sta outvec+1
  177. 1950 ;
  178. 1970 lda vecsave+28,x ;load/save adr lo
  179. 1980 sta ldsv+1
  180. 1990 lda vecsave+29,x ;load/save adr hi
  181. 2000 sta ldsv+2
  182. 2010 pla:tay:pla:tax:pla:plp
  183. 2020 ldsv jsr *-* ;load or save routine
  184. 2030 php:pha:txa:pha:tya:pha
  185. 2040 jsr aftersav
  186. 2050 pla:tay:pla:tax:pla:plp
  187. 2060 rts
  188. 2070 ;
  189. 2080 newio =*
  190. 2085 lda #1   ;always keep 1 file open
  191. 2090 jmp $f331
  192. 2100 ;
  193. 2110 vecsave *=*+26
  194.