Home » Archimedes archive » Acorn User » AU 1998-12.adf » Regulars » Rambles/ROMSbas
Rambles/ROMSbas
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1998-12.adf » Regulars |
Filename: | Rambles/ROMSbas |
Read OK: | ✔ |
File size: | 02A4 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM TO READ IN SIDEWAYS ROMs on an 8 bit machine 20MODE 7 30DIM code% 64 40FOR pass%=0 TO 2 STEP 2 50P%=code% 60[OPT pass% 70LDA &FE30 80PHA 90AND #&F0 100ORA &70 110STA &FE30 120LDY #0 130.loop 140LDA (&72),Y 150STA (&74),Y 160INC &72 170BNE P%+4 180INC &73 190INC &74 200BNE P%+4 210INC &75 220LDA &72 230CMP &76 240BNE loop 250LDA &73 260CMP &77 270BNE loop 280PLA 290STA &FE30 300RTS 310] 320NEXT 330DIM buffer% 16384 340INPUT "ROM to save: "rom% 350INPUT "Filename: "file$ 360?&70=rom% 370PROCdouble(&72,&8000) 380PROCdouble(&74,buffer%) 390PROCdouble(&76,&C000) 400CALL code% 410OSCLI"SAVE "+file$+" "+STR$~(buffer%)+" "+STR$~(buffer%+16384) 420END 430DEF PROCdouble(a%,n%) 440?a%=n% MOD 256 450a%?1=n% DIV 256 460ENDPROC
2� TO READ IN SIDEWAYS ROMs on an 8 bit machine � 7 � code% 64 (� pass%=0 � 2 � 2 2P%=code% <[OPT pass% F LDA &FE30 PPHA Z � #&F0 d �A &70 n STA &FE30 x LDY #0 � .loop �LDA (&72),Y �STA (&74),Y �INC &72 �BNE P%+4 �INC &73 �INC &74 �BNE P%+4 �INC &75 �LDA &72 �CMP &76 �BNE loop �LDA &73 CMP &77 BNE loop PLA " STA &FE30 ,RTS 6] @� J� buffer% 16384 T� "ROM to save: "rom% ^� "Filename: "file$ h ?&70=rom% r�double(&72,&8000) |�double(&74,buffer%) ��double(&76,&C000) �� code% �8�"SAVE "+file$+" "+�~(buffer%)+" "+�~(buffer%+16384) �� �� �double(a%,n%) �?a%=n% � 256 �a%?1=n% � 256 �� �
00000000 0d 00 0a 32 f4 20 54 4f 20 52 45 41 44 20 49 4e |...2. TO READ IN| 00000010 20 53 49 44 45 57 41 59 53 20 52 4f 4d 73 20 6f | SIDEWAYS ROMs o| 00000020 6e 20 61 6e 20 38 20 62 69 74 20 6d 61 63 68 69 |n an 8 bit machi| 00000030 6e 65 0d 00 14 07 eb 20 37 0d 00 1e 0e de 20 63 |ne..... 7..... c| 00000040 6f 64 65 25 20 36 34 0d 00 28 15 e3 20 70 61 73 |ode% 64..(.. pas| 00000050 73 25 3d 30 20 b8 20 32 20 88 20 32 0d 00 32 0c |s%=0 . 2 . 2..2.| 00000060 50 25 3d 63 6f 64 65 25 0d 00 3c 0e 5b 4f 50 54 |P%=code%..<.[OPT| 00000070 20 70 61 73 73 25 0d 00 46 0d 4c 44 41 20 26 46 | pass%..F.LDA &F| 00000080 45 33 30 0d 00 50 07 50 48 41 0d 00 5a 0a 80 20 |E30..P.PHA..Z.. | 00000090 23 26 46 30 0d 00 64 0a 84 41 20 26 37 30 0d 00 |#&F0..d..A &70..| 000000a0 6e 0d 53 54 41 20 26 46 45 33 30 0d 00 78 0a 4c |n.STA &FE30..x.L| 000000b0 44 59 20 23 30 0d 00 82 09 2e 6c 6f 6f 70 0d 00 |DY #0.....loop..| 000000c0 8c 0f 4c 44 41 20 28 26 37 32 29 2c 59 0d 00 96 |..LDA (&72),Y...| 000000d0 0f 53 54 41 20 28 26 37 34 29 2c 59 0d 00 a0 0b |.STA (&74),Y....| 000000e0 49 4e 43 20 26 37 32 0d 00 aa 0c 42 4e 45 20 50 |INC &72....BNE P| 000000f0 25 2b 34 0d 00 b4 0b 49 4e 43 20 26 37 33 0d 00 |%+4....INC &73..| 00000100 be 0b 49 4e 43 20 26 37 34 0d 00 c8 0c 42 4e 45 |..INC &74....BNE| 00000110 20 50 25 2b 34 0d 00 d2 0b 49 4e 43 20 26 37 35 | P%+4....INC &75| 00000120 0d 00 dc 0b 4c 44 41 20 26 37 32 0d 00 e6 0b 43 |....LDA &72....C| 00000130 4d 50 20 26 37 36 0d 00 f0 0c 42 4e 45 20 6c 6f |MP &76....BNE lo| 00000140 6f 70 0d 00 fa 0b 4c 44 41 20 26 37 33 0d 01 04 |op....LDA &73...| 00000150 0b 43 4d 50 20 26 37 37 0d 01 0e 0c 42 4e 45 20 |.CMP &77....BNE | 00000160 6c 6f 6f 70 0d 01 18 07 50 4c 41 0d 01 22 0d 53 |loop....PLA..".S| 00000170 54 41 20 26 46 45 33 30 0d 01 2c 07 52 54 53 0d |TA &FE30..,.RTS.| 00000180 01 36 05 5d 0d 01 40 05 ed 0d 01 4a 13 de 20 62 |.6.]..@....J.. b| 00000190 75 66 66 65 72 25 20 31 36 33 38 34 0d 01 54 19 |uffer% 16384..T.| 000001a0 e8 20 22 52 4f 4d 20 74 6f 20 73 61 76 65 3a 20 |. "ROM to save: | 000001b0 22 72 6f 6d 25 0d 01 5e 1a e8 20 22 46 69 6c 65 |"rom%..^.. "File| 000001c0 6e 61 6d 65 3a 20 20 20 20 22 66 69 6c 65 24 0d |name: "file$.| 000001d0 01 68 0d 3f 26 37 30 3d 72 6f 6d 25 0d 01 72 16 |.h.?&70=rom%..r.| 000001e0 f2 64 6f 75 62 6c 65 28 26 37 32 2c 26 38 30 30 |.double(&72,&800| 000001f0 30 29 0d 01 7c 18 f2 64 6f 75 62 6c 65 28 26 37 |0)..|..double(&7| 00000200 34 2c 62 75 66 66 65 72 25 29 0d 01 86 16 f2 64 |4,buffer%).....d| 00000210 6f 75 62 6c 65 28 26 37 36 2c 26 43 30 30 30 29 |ouble(&76,&C000)| 00000220 0d 01 90 0b d6 20 63 6f 64 65 25 0d 01 9a 38 ff |..... code%...8.| 00000230 22 53 41 56 45 20 22 2b 66 69 6c 65 24 2b 22 20 |"SAVE "+file$+" | 00000240 22 2b c3 7e 28 62 75 66 66 65 72 25 29 2b 22 20 |"+.~(buffer%)+" | 00000250 22 2b c3 7e 28 62 75 66 66 65 72 25 2b 31 36 33 |"+.~(buffer%+163| 00000260 38 34 29 0d 01 a4 05 e0 0d 01 ae 14 dd 20 f2 64 |84).......... .d| 00000270 6f 75 62 6c 65 28 61 25 2c 6e 25 29 0d 01 b8 10 |ouble(a%,n%)....| 00000280 3f 61 25 3d 6e 25 20 83 20 32 35 36 0d 01 c2 11 |?a%=n% . 256....| 00000290 61 25 3f 31 3d 6e 25 20 81 20 32 35 36 0d 01 cc |a%?1=n% . 256...| 000002a0 05 e1 0d ff |....| 000002a4