<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 09 Jan 1998 23:36:01 +0000
From   : Joel Rowbottom <joel@...>
Subject: Re: Basic ROM

At 10:32 09/01/98 +0000, you wrote:

>Well, I have no sideways RAM, so the *SR commands don't exist for me.
>Please can you explain how I would go about poking the currently selected
>ROM number into an address, in order to save the basic ROM.

The following BASIC program might work, but it's been a while...:

 10 REM Set rom% to the ROM number you want to save
 20 rom%=14
 30
 40 REM Set up the file to save the ROM to.
 50 file%=OPENOUT("RomImage")
 60
 70 FOR i%=&8000 TO &BFFF
 80
 90 REM This bit reads a byte out of ROM
100 REM Uses OSRDRM, nicer in assembler but I'm busy ;)
110 ?&F6=i% MOD 256
120 ?&F7=i% DIV 256
130 Y%=rom%
140 CALL &FFB9
150 
160 BPUT #file%, A%
170 
180 NEXT i%
190
200 REM Now close the file again
210 
220 CLOSE #file%
230
240 PRINT "Done"
250 END

That's it. Try it. I'm not sure it'll work properly, I can't remember
whether it's LSB-MSB or MSB-LSB so you might need to swap the MOD and DIV
around in lines 110 and 120.

HTH,



J.


--
Joel Rowbottom BSc (Hons) CNE -- All opinions are solely my own
<jMl New Media> - http://www.jml.net/
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>