home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / apple2 / 34 < prev    next >
Encoding:
Internet Message Format  |  1990-12-02  |  18.8 KB

  1. Path: wuarchive!usc!cs.utexas.edu!rutgers!aramis.rutgers.edu!paul.rutgers.edu!yoko.rutgers.edu!jac
  2. From: jac@yoko.rutgers.edu (Jonathan A. Chandross)
  3. Newsgroups: comp.sources.apple2
  4. Subject: v001SRC009:  ProDOS Saturn 64/128K Ramdisk Driver
  5. Message-ID: <Dec.1.16.31.42.1990.24233@yoko.rutgers.edu>
  6. Date: 1 Dec 90 21:31:43 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 686
  9. Approved: jac@paul.rutgers.edu
  10.  
  11.  
  12. Submitted-by: NONE
  13. Posting-number: Volume 1, Source:9
  14. Archive-name: prodos/ramdisk/saturn
  15. Architecture: ANY_2
  16. Version-number: 1.00
  17.  
  18. This is a ProDOS ramdisk driver for Saturn 64/128K cards.
  19.  
  20. Enjoy. 
  21.  
  22.  
  23. =Manual
  24. -
  25. -
  26. -
  27. -
  28. -
  29. -
  30. -
  31. -
  32. -
  33. -         ProDOS driver for Saturn 64/128K ramcards
  34. -
  35. -                        Version 1.00
  36. -
  37. -
  38. -
  39. -
  40. -The following code is posted as freeware. I expect no
  41. -compensation other than due credit for the creation of this
  42. -source code. If you adapt and improve on this driver I'd
  43. -like to hear from you.
  44. -
  45. -
  46. -I created this driver several years ago when I purchased a
  47. -Saturn 128K card for my Apple ][+.  The driver has several
  48. -limitations, the biggest of which is that it only supports a
  49. -single card in a slot 0.  The other limitations are:
  50. -
  51. -     (1)  Currently the driver is a BRUN-able program that
  52. -          tests for the presense of 64K or 128K of Saturn
  53. -          compatible ram in slot 0.
  54. -
  55. -     (2)  Upon finding sufficient RAM the driver takes over
  56. -          the complete card except for the 16k that ProDOS
  57. -          uses in block 0.
  58. -
  59. -     (3)  The 16 bytes of the ProDOS global page used for
  60. -          Apple's copyright notice are also consumed.  Since
  61. -          a few other programs use this area as scratchpad
  62. -          RAM, conflicts are possible.  Unpredictable
  63. -          results will occur if these bytes are overwritten
  64. -          after the ramcard has been initialized.
  65. -
  66. -     (4)  The core of the ram disk driver resides from $D000
  67. -          through $D0FF in bank 2 of block 0. This is the
  68. -          section of unused memory right below the ProDOS
  69. -          quit code. As in note 3, overwriting this code
  70. -          will have unpredictable result.
  71. -
  72. -
  73. -
  74. -The operation of the driver is quite simple.
  75. -
  76. -     (A)  The user's application makes a call to the ProDOS
  77. -          MLI to access the ramdisk.
  78. -
  79. -     (A)  The ProDOS MLI does bank switching and passes the
  80. -          request to the ProDOS kernel.
  81. -
  82. -     (C)  The ProDOS kernel decides it needs a certain block
  83. -          from the ramdisk so it sets up some bytes in zero
  84. -
  85. -
  86. -
  87. -
  88. -
  89. -
  90. -
  91. -
  92. -
  93. -                           - 2 -
  94. -
  95. -
  96. -          page and calls the driver through the driver
  97. -          vectors in the ProDOS global page.
  98. -
  99. -     (D)  The ProDOS global page driver vectors pass control
  100. -          to a short routine installed in place of the Apple
  101. -          Copyright notice in the ProDOS global page.
  102. -
  103. -     (E)  The short routine installed in place of the Apple
  104. -          Copyright notice does bank switching to make the
  105. -          main core of the driver available for execution
  106. -          and then jumps to it.
  107. -
  108. -     (F)  The main core of the routine analyzes the
  109. -          parameters placed in zero page by the ProDOS
  110. -          kernel and sets up a few parameters of its own.
  111. -
  112. -     (G)  With everything in order, the ramdisk driver swaps
  113. -          a read/write routine with a section of zero page
  114. -          memory.
  115. -
  116. -     (H)  The swapped read/write routine does the requested
  117. -          action and returns to the ramdisk driver.
  118. -
  119. -     (I)  The ramdisk driver then re-swaps the read/write
  120. -          routine with the section of stored zero page
  121. -          memory.
  122. -
  123. -     (J)  The ramdisk driver cleans up shop and returns to
  124. -          the short routine installed in place of the Apple
  125. -          Copyright notice.  This routine then bank switches
  126. -          the ProDOS kernel back in.  Control then returns
  127. -          to the ProDOS kernel which then cleans up and
  128. -          exits.  This, in turn, returns to the ProDOS MLI,
  129. -          which then cleans up and then returns to the
  130. -          calling Application.
  131. -
  132. -This may seem like a lot of steps, but it is small and quite
  133. -fast.
  134. -
  135. -
  136. -Have fun with the code. If you improve on it, let me have a
  137. -copy back.  There are others who would gain from continued
  138. -work on this program.  I've helped you, now you have a
  139. -chance to help others.
  140. -
  141. -
  142. -
  143. -                    Matthew Lee Stier
  144. -                    Sun Microsystems
  145. -                    P.O. Box 13447
  146. -                    RTP, NC  27709-3447
  147. -                    (919) 469-8300
  148. -                    Internet: mstier@east.sun.com
  149. -                    UUCP: sun!sunpix!matthew or rti!sunpix!matthew
  150. -
  151. -
  152. -
  153. -
  154. -
  155. -
  156. -
  157. -
  158. -
  159. -                           - 3 -
  160. -
  161. -
  162. -
  163. -
  164. -
  165. -
  166. -
  167. -
  168. -
  169. -
  170. -
  171. -
  172. -
  173. -
  174. -
  175. -
  176. -
  177. -
  178. -
  179. -
  180. -
  181. -
  182. -
  183. -
  184. -
  185. -
  186. -
  187. -
  188. -
  189. -
  190. -
  191. -
  192. -
  193. -
  194. -
  195. -
  196. -
  197. -
  198. -
  199. -
  200. -
  201. -
  202. -
  203. -
  204. -
  205. -
  206. -
  207. -
  208. -
  209. -
  210. -
  211. -
  212. -
  213. -
  214. -
  215. -
  216. -
  217. -
  218. -
  219. -
  220. -
  221. -
  222. =Manual.tr
  223. -.\"
  224. -.\" Fake a paragraph so MS sets everthing.  (.BG done at first
  225. -.\" paragraph.)  Then reset the modes to what we want.  MS is
  226. -.\" braindamaged.
  227. -.\"
  228. -.\" Don't adjust margins (ragged right) and turn off hyphenation.
  229. -.\" No date.
  230. -.\"
  231. -.pl 11.0i
  232. -.LP
  233. -.na
  234. -.nr HY 0
  235. -.hy 0
  236. -.ND
  237. -.\"
  238. -.\" Title down 3 lines
  239. -.\"
  240. -.rs 
  241. -.sp 3
  242. -.ce
  243. -ProDOS driver for Saturn 64/128K ramcards
  244. -.sp
  245. -.ce
  246. -Version 1.00
  247. -.sp 3
  248. -.LP
  249. -The following code is posted as freeware. I expect no compensation other
  250. -than due credit for the creation of this source code. If you adapt and
  251. -improve on this driver I'd like to hear from you.
  252. -
  253. -.LP
  254. -I created this driver several years ago when I purchased a 
  255. -Saturn 128K card for my Apple ][+.
  256. -The driver has several limitations, the biggest of which is that
  257. -it only supports a single card in a slot 0.  The other limitations
  258. -are:
  259. -.RS
  260. -.IP (1)
  261. -Currently the driver is a BRUN-able program that tests for the presense
  262. -of 64K or 128K of Saturn compatible ram in slot 0.
  263. -.IP (2)
  264. -Upon finding sufficient RAM the driver takes over the complete card except 
  265. -for the 16k that ProDOS uses in block 0.
  266. -.IP (3)
  267. -The 16 bytes of the ProDOS global page used for Apple's
  268. -copyright notice are also consumed.
  269. -Since a few other programs use this area as scratchpad RAM, conflicts
  270. -are possible.
  271. -Unpredictable results will occur if these bytes are overwritten
  272. -after the ramcard has been initialized.
  273. -.IP (4)
  274. -The core of the ram disk driver resides from $D000 through $D0FF
  275. -in bank 2
  276. -of block 0. This is the section of unused memory right below the ProDOS
  277. -quit code. As in note 3, overwriting this code will have unpredictable
  278. -result.
  279. -.RE
  280. -.sp 2
  281. -.LP
  282. -The operation of the driver is quite simple. 
  283. -.RS
  284. -.IP (A)
  285. -The user's application makes a call to the ProDOS MLI to access the
  286. -ramdisk.
  287. -.IP (A)
  288. -The ProDOS MLI does bank switching and passes the request to the ProDOS
  289. -kernel.
  290. -.IP (C)
  291. -The ProDOS kernel decides it needs a certain block from the ramdisk
  292. -so it sets up some bytes in zero page and calls the driver through
  293. -the driver vectors in the ProDOS global page.
  294. -.IP (D)
  295. -The ProDOS global page driver vectors pass control to a short routine
  296. -installed in place of the Apple Copyright notice in the ProDOS global
  297. -page.
  298. -.IP (E)
  299. -The short routine installed in place of the Apple Copyright notice
  300. -does bank switching to make the main core of the driver available
  301. -for execution and then jumps to it.
  302. -.IP (F)
  303. -The main core of the routine analyzes the parameters placed in zero 
  304. -page by the ProDOS kernel and sets up a few parameters of its own.
  305. -.IP (G)
  306. -With everything in order, the ramdisk driver swaps a read/write routine
  307. -with a section of zero page memory.
  308. -.IP (H)
  309. -The swapped read/write routine does the requested action and returns 
  310. -to the ramdisk driver.
  311. -.IP (I)
  312. -The ramdisk driver then re-swaps the read/write routine with the
  313. -section of stored zero page memory.
  314. -.IP (J)
  315. -The ramdisk driver cleans up shop and returns to the short routine
  316. -installed in place of the Apple Copyright notice.  This routine then
  317. -bank switches the ProDOS kernel back in.  Control then returns to
  318. -the ProDOS kernel which then cleans up and exits.  This, in turn,
  319. -returns to the ProDOS MLI, which then cleans up and then returns to
  320. -the calling Application.
  321. -.RE
  322. -.LP
  323. -This may seem like a lot of steps, but it is small and quite fast.
  324. -.sp
  325. -.LP
  326. -Have fun with the code. If you improve on it, let me have a copy back.
  327. -There are others who would gain from continued work on this program.
  328. -I've helped you, now you have a chance to help others.
  329. -.sp 3
  330. -.in 2.0i
  331. -.nf
  332. -Matthew Lee Stier
  333. -Sun Microsystems
  334. -P.O. Box 13447
  335. -RTP, NC  27709-3447
  336. -(919) 469-8300
  337. -Internet: mstier@east.sun.com
  338. -UUCP: sun!sunpix!matthew or rti!sunpix!matthew
  339. -.fi
  340. -.in 0
  341. =Read.Me
  342. -
  343. -Manual        on-line readable version of manual
  344. -Manual.tr    troff/nroff source to Manual
  345. -driver        Saturn driver code
  346. -roff        Unix shell script to produce Manual given Manual.tr
  347. -
  348. =driver
  349. -
  350. -;
  351. -; ProDOS disk driver for
  352. -; 64k/128k Saturn ramcard
  353. -;
  354. -; Matthew Lee Stier
  355. -; Sun Microsystems
  356. -; P.O. Box 13447
  357. -; RTP, NC  27709-3447
  358. -; (919) 469-8300
  359. -; Internet: mstier@east.sun.com
  360. -; UUCP: sun!sunpix!matthew or rti!sunpix!matthew
  361. -;
  362. -; Copyright (c) 1986
  363. -;
  364. -JMP       EQU  $4C
  365. -LDA       EQU  $B1            ;INDIRECT,Y
  366. -STA       EQU  $91            ;INDIRECT,Y
  367. -FORMAT.C  EQU  $4
  368. -WR.BLK.C  EQU  $81
  369. -GET.TIME  EQU  $82
  370. -NO.EC     EQU  $00
  371. -IO.EC     EQU  $27
  372. -WP.EC     EQU  $28
  373. -ZPAGE     EQU  $0
  374. -CMD       EQU  $42
  375. -BUFFER    EQU  $44
  376. -BLK.NUM   EQU  $46
  377. -MLI       EQU  $BF00
  378. -DATETIME  EQU  $BF06
  379. -DEVADR31  EQU  $BF16
  380. -DEVCNT    EQU  $BF31
  381. -DEVLST    EQU  $BF32
  382. -COPYRITE  EQU  $BF40
  383. -DATE      EQU  $BF90
  384. -LC        EQU  $C080
  385. -ROMBNK2WE EQU  LC+$1
  386. -LCBNK2WE  EQU  LC+$3
  387. -LCBNK1WE  EQU  LC+$B
  388. -BLK0      EQU  LC+$4
  389. -ROMBNK1WE EQU  LC+$9
  390. -BLK7      EQU  LC+$F
  391. -;
  392. -          ORG  $2000
  393. -          LST  ON,NOA,NOV,GEN
  394. -;
  395. -          LDY  #7
  396. -NXTBLK16  LDX  LC.INDEX,Y     ;TEST FOR RAMCARD
  397. -          LDA  LC,X           ; SIZE
  398. -          BIT  LCBNK2WE       ;ENABLE BANK 2
  399. -          BIT  LCBNK2WE
  400. -          TYA
  401. -          STA  $D000
  402. -          DEY
  403. -          BPL  NXTBLK16
  404. -          BIT  BLK7
  405. -          LDY  $D000          ;GET RAMCARD SIZE
  406. -          BIT  BLK0           ;RESTORE BLOCK 0
  407. -          BIT  ROMBNK1WE      ; BANK 1
  408. -          BIT  ROMBNK1WE
  409. -          CPY  #8             ;ILLEGAL BANK SIZE?
  410. -          BCS  TESTRTN        ; YES...
  411. -          TYA
  412. -          ASL  
  413. -          TAY
  414. -          LDX  BLKSIZE+1,Y    ;GET RAMCARD SIZE
  415. -          LDA  BLKSIZE,Y      ; IN PRODOS BLOCKS
  416. -          BNE  INSTALL        ;IF NOT 0 THEN INSTALL
  417. -          SEC                 ;ELSE FLAG AN ERROR
  418. -TESTRTN   RTS                 ; AND QUIT
  419. -;
  420. -LC.INDEX  DB   $4,$5,$6,$7,$C,$D,$E,$F
  421. -BLKSIZE   DW   0,0,0,96,0,0,0,224
  422. -;
  423. -INSTALL   STX  MAX.BLK+1      ;SET I/O ROUTINE
  424. -          STA  MAX.BLK        ; MAX BLOCK
  425. -          STX  B2.D+1+$2A     ;SET DIRECTORY 
  426. -          STA  B2.D+1+$29     ; MAX BLOCK
  427. -          CPY  #3*2           ;IF 64K RAMCARD
  428. -          BNE  VBM128
  429. -          LDY  B1.96          ;USE 96 BLOCK VBM 
  430. -SET.VBM   LDA  B1.96,Y
  431. -          STA  B1.D,Y
  432. -          DEY
  433. -          BPL  SET.VBM
  434. -VBM128    JSR  MLI            ;GET CURRENT TIME
  435. -          DB   GET.TIME
  436. -          DW   0000
  437. -          LDY  #3
  438. -MOV.DATE  LDA  DATE,Y         ;MOVE IT TO DIRECTORY
  439. -          STA  B2.D+1+$1C,Y   ; HEADER
  440. -          DEY
  441. -          BPL  MOV.DATE
  442. -DO.MOVE1  BIT  ROMBNK2WE
  443. -          BIT  ROMBNK2WE
  444. -          LDY  #0
  445. -MOVE1     LDA  CHCK.CMD,Y     ;MOVE I/O ROUTINE
  446. -          STA  CHCK.CMD+OS,Y  ; TO BANK 2 @ $D000
  447. -          INY
  448. -          BNE  MOVE1
  449. -          LDY  #15
  450. -MOVE2     LDA  LC.ENTER,Y     ;MOVE LC.ENTER
  451. -          STA  COPYRITE,Y     ; TO PRODOS GLOBAL
  452. -          DEY                 ; PAGE
  453. -          BPL  MOVE2
  454. -          LDA  #<COPYRITE     ;INSTALL RAMCARD
  455. -          STA  DEVADR31+1     ; VECTOR IN DRIVE TABLE
  456. -          LDA  #>COPYRITE
  457. -          STA  DEVADR31
  458. -          INC  DEVCNT         ;INSTALL RAMCARD IN
  459. -          LDY  DEVCNT         ; LIST OF ATTACHED DRIVES
  460. -          LDA  #$3F           ;SLOT 3, DRIVE 2, TYPE-RAM
  461. -          STA  DEVLST,Y
  462. -          LDA  #2             ;FIRST DIRECTORY BLOCK
  463. -          LDX  #<B2.D
  464. -          LDY  #>B2.D
  465. -          JSR  WR.BLOCK
  466. -          LDA  #3             ;LAST DIRCETORY BLOCK
  467. -          LDX  #<B3.D
  468. -          LDY  #>B3.D
  469. -          JSR  WR.BLOCK
  470. -          LDA  #1             ;VOLUME BITMAP
  471. -          LDX  #<B1.D
  472. -          LDY  #>B1.D
  473. -          JSR  WR.BLOCK
  474. -          CLC
  475. -          RTS                 ;AND END
  476. -;
  477. -WR.BLOCK  STA  WR.BLK.P+4     ;SETUP BLK.NUM
  478. -          LDA  #00
  479. -          STA  WR.BLK.P+5
  480. -          STX  LENGTH+2       ;SETUP DATA POINTER
  481. -          STY  LENGTH+1
  482. -          STX  MOVDATA+2
  483. -          STY  MOVDATA+1
  484. -          LDY  #0               
  485. -          LDA  #0
  486. -ZBUFR     STA  BW.BUFR,Y      ;ZERO I/O BUFFER
  487. -          STA  BW.BUFR+256,Y
  488. -          INY
  489. -          BNE  ZBUFR
  490. -LENGTH    LDX  BW.BUFR        ;GET LENGTH OF INFO
  491. -MOVDATA   LDA  BW.BUFR,X
  492. -          STA  BW.BUFR-1,X    ;MOVE DATA TO I/O BUFFER
  493. -          DEX
  494. -          BNE  MOVDATA
  495. -          JSR  MLI            ;AND WRITE IT TO /RAM
  496. -          DB   WR.BLK.C
  497. -          DW   WR.BLK.P
  498. -          RTS
  499. -;
  500. -WR.BLK.P  DB   3              ;NUMBER OF PARAMETERS
  501. -          DB   $30            ;SLOT/DRIVE NUMBER
  502. -          DW   BW.BUFR        ;DATA BUFFER
  503. -          DW   0000           ;BLOCK NUMBER
  504. -;
  505. -B2.D      DB   B2.END-*-1
  506. -          DW   0              ;PREVIOUS.DIRECTORY.BLOCK
  507. -          DW   3              ;NEXT.DIRECTORY.BLOCK
  508. -VTYPE     DB   $F3            ;VTYPE/VN.LEN
  509. -VNAME     ASC  'RAM'          ;VNAME
  510. -          DS   VNAME+15-*,0
  511. -          DS   8,0            ;RESERVED
  512. -          DW   0              ;CREATION.DATE
  513. -          DW   0              ;CREATION.TIME
  514. -          DB   1              ;CREATION.VERSION
  515. -          DB   0              ;MINIMUM.VERSION
  516. -          DB   %01000011      ;ACCESS BITS
  517. -          DB   39             ;SIZE DIR ENTRIES
  518. -          DB   13             ;ENTRIES PER BLOCK
  519. -          DW   0              ;ACTIVE FILES
  520. -          DW   1              ;VBM
  521. -          DW   0              ;# OF BLOCKS
  522. -B2.END    EQU  *
  523. -;
  524. -B3.D      DB   B3.END-*-1
  525. -          DW   2              ;PREVIOUS.DIRECTORY.BLOCK
  526. -          DW   0              ;NEXT.DIRECTORY.BLOCK
  527. -B3.END    EQU  *
  528. -;
  529. -B1.D      DB   B1.END-*-1
  530. -          DB   %00001111      ;BLOCKS 0,1,2,3 ARE USED
  531. -          DS   27,$FF         ;ALL THE REST ARE FREE
  532. -B1.END    EQU  *
  533. -;
  534. -B1.96     DB   B1.96END-*-1
  535. -          DB   $0F            ;BLOCKS 0,1,2,3 ARE USED
  536. -          DS   11,$FF         ;ALL THE REST ARE FREE
  537. -B1.96END  EQU  *
  538. -;
  539. -LC.ENTER  CLD                 ;ALL ROUTINE BEGIN WITH
  540. -          BIT  LCBNK2WE       ;ENABLE BANK 2
  541. -          JSR  CHCK.CMD+OS    ; AND GOTO IT
  542. -LC.EXIT   PHP                 ;SAVE THE STATUS REGISTER
  543. -          BIT  LCBNK1WE       ;ENABLE BANK 1
  544. -          BIT  LCBNK1WE
  545. -          PLP                 ;RESTORE THE STATUS REG.
  546. -          RTS                 ;AND RETURN
  547. -;
  548. -          DS   >0-*,0
  549. -OS        EQU  $D000-*        ;OFFSET TO LANGUAGE CARD
  550. -;
  551. -CHCK.CMD  BIT  LCBNK2WE       ;ENSURE BANK 2 IS SELECTED
  552. -          LDA  CMD            ;GET THE COMMAND
  553. -          BEQ  STATUS         ; IS IT 'STATUS'...
  554. -          CMP  #FORMAT.C      ; IS IT 'FORMAT'
  555. -          BCC  RD.WR          ; NO, READ OR WRITE...
  556. -          BNE  IO.EXIT        , NO, I/O ERROR
  557. -          LDA  #WP.EC         ;ITS FORMAT
  558. -          SEC                 ; MARK DRIVE AS
  559. -          RTS                 ; WRITE PROTECTED
  560. -;
  561. -IO.EXIT   LDA  #IO.EC         ;ITS AN I/O ERROR
  562. -          SEC
  563. -          RTS
  564. -;
  565. -STATUS    LDY  MAX.BLK+OS+1   ;GET VOLUME SIZE
  566. -          LDX  MAX.BLK+OS
  567. -STATUS2   LDA  #NO.EC         ;AND RETURN
  568. -          CLC
  569. -          RTS
  570. -;
  571. -MAX.BLK   DW   0              ;NUMBER OF BLOCKS
  572. -;
  573. -RD.WR     LDA  BLK.NUM+1      ;CHECK VALID BLOCK NUM
  574. -          CMP  MAX.BLK+OS+1
  575. -          BNE  RD.WR2
  576. -          LDA  BLK.NUM
  577. -          CMP  MAX.BLK+OS     ;IF GREATER THAN
  578. -RD.WR2    BCS  IO.EXIT        ; MARK AS I/O ERROR...
  579. -          PHA
  580. -          LSR  A              ;GET RAMCARD
  581. -          LSR  A              ; BLOCK NUMBER
  582. -          LSR  A
  583. -          LSR  A
  584. -          LSR  A
  585. -          TAY
  586. -          LDA  B16TBL+OS,Y    ;CONVERT TO I/O ADDRESS
  587. -          STA  RC.BLK+OS+1
  588. -          PLA
  589. -          AND  #%00011111     ;GET BLOCK NUMBER
  590. -          CMP  #8
  591. -          BCS  NO.FIX         ;SET CORRECT BANK
  592. -          ADC  #8
  593. -NO.FIX    PHA
  594. -          LDA  #LCBNK2WE
  595. -          BCC  NO.FIX2
  596. -          LDA  #LCBNK1WE
  597. -NO.FIX2   STA  RC.BNK+OS+1
  598. -          PLA
  599. -          ASL  A
  600. -          ADC  #$C0           ;AND RAMCARD ADDRESS
  601. -          TAX
  602. -          LDA  CMD
  603. -          AND  #%00000010     ;SETUP RAMCARD POINTERS
  604. -          TAY
  605. -          LDA  #00
  606. -          STA  S1+OS,Y
  607. -          STA  S2+OS,Y
  608. -          TXA
  609. -          STA  S1+OS+1,Y
  610. -          INX
  611. -          TXA
  612. -          STA  S2+OS+1,Y
  613. -          TYA
  614. -          ASL
  615. -          ASL
  616. -          ASL
  617. -          TAY
  618. -RC.BLK    LDA  #00
  619. -          STA  MOVLOOP+OS+1,Y
  620. -RC.BNK    LDA  #00
  621. -          STA  MOVLOOP+OS+4,Y
  622. -          LDA  CMD
  623. -          EOR  #%00000011     ;SETUP MAIN MEM. POINTERS
  624. -          AND  #%00000010
  625. -          TAY
  626. -          LDX  BUFFER+1
  627. -          LDA  BUFFER
  628. -          STA  S1+OS,Y
  629. -          STA  S2+OS,Y
  630. -          TXA
  631. -          STA  S1+OS+1,Y
  632. -          INX
  633. -          TXA
  634. -          STA  S2+OS+1,Y
  635. -          TYA
  636. -          ASL
  637. -          ASL
  638. -          ASL
  639. -          TAY
  640. -          LDA  #LCBNK1WE
  641. -          STA  MOVLOOP+OS+1,Y
  642. -          LDA  #BLK0
  643. -          STA  MOVLOOP+OS+4,Y
  644. -          PHP
  645. -          SEI                 ;DISABLE INTERUPTS
  646. -          JSR  SWAP+OS        ;PUT R/W IN ZPAGE
  647. -          JSR  ZPAGE          ; DO READ/WRITE
  648. -          JSR  SWAP+OS        ;PUT ZPAGE BACK
  649. -          PLP                 ;RESTORE INTERUPT FLAG
  650. -          JMP  STATUS2+OS     ;AND EXIT
  651. -;
  652. -B16TBL    DB   $85,$86,$87,$8C,$8D,$8E,$8F
  653. -;
  654. -SWAP      LDY  #RWR.END-RWR   ;GET LENGTH OF RWR
  655. -SWAP2     LDX  RWR+OS,Y       ;AND SWAP ZPAGE
  656. -          LDA  ZPAGE,Y        ; WITH RWR
  657. -          STA  RWR+OS,Y
  658. -          STX  ZPAGE,Y
  659. -          DEY
  660. -          BPL  SWAP2
  661. -          RTS
  662. -;
  663. -RWR       LDY  #00            ;INIT INDEX POINTER
  664. -MOVLOOP   BIT  LC             ;ENABLE SOURCE
  665. -          BIT  LC
  666. -          DB   LDA,S1-RWR     ;GET THE DATA
  667. -          STA  T1-RWR
  668. -          DB   LDA,S2-RWR
  669. -          STA  T2-RWR
  670. -          BIT  LC             ;ENABLE DESTINATION
  671. -          BIT  LC
  672. -          LDA  T1-RWR         ;SAVE THE DATA
  673. -          DB   STA,D1-RWR
  674. -          LDA  T2-RWR
  675. -          DB   STA,D2-RWR
  676. -          INY                 ;DONE?
  677. -          BNE  MOVLOOP        ;NO...
  678. -          BIT  BLK0           ;RESET TO RAMCARD
  679. -          BIT  LCBNK2WE       ; BLOCK 0, BANK 2
  680. -          RTS                 ; AND RETURN
  681. -;
  682. -S1        DW   0              ;SOURCE 1
  683. -D1        DW   0              ;DESTINATION 1
  684. -S2        DW   0              ;SOURCE 2
  685. -D2        DW   0              ;DESTINATION 2
  686. -T1        DB   0              ;DATA 1
  687. -T2        DB   0              ;DATA 2
  688. -RWR.END   EQU  *
  689. -;
  690. -          DS   >0-*,0
  691. -BW.BUFR   EQU  *              ;I/O BUFFER
  692. -*
  693. -
  694. =roff
  695. -nroff -ms Manual.tr > Manual
  696. + END OF ARCHIVE
  697.