[Coco] Help with BASIC

Brett Gordon beretta42 at gmail.com
Thu Nov 20 12:23:47 EST 2014


Cool.  Then just follow it up with a "write mem,yadayadayada"
statement to the SDC!  awesome dude. Thanks!  I didn't know the asm
would be that easy to manipulate (or at least read ) basic files..



On Thu, Nov 20, 2014 at 11:12 AM, Darren A <mechacoco at gmail.com> wrote:
> On Thu, Nov 20, 2014 at 5:40 AM, Brett Gordon wrote:
>
>> Has anybody created a utility to flash their SDC ROM banks from a
>> BASIC disk file yet?  -or-  How would one accomplish loading a flat
>> file into memory from BASIC?
>>
>> 1. Change the flat ROM into a BIN, and use CLOAD
>>       a. is it possible to squeeze 16k of binary data into a BASIC
>> enviroment?
>>       b. yuck - this would require people to change their ROM's to BIN's
>> 2. I didn't see any BASIC statements designed to load binary data - is
>> there one?
>> 3. Rip data from the the lowlevel disk buffers (unlawfully touching BASIC )
>>
>
>
> If you want to load a raw file (no preamble) into memory you can OPEN it as
> a data file and use a small ML routine to read the bytes:
>
> 10 CLEAR 100,&H3FFF
> 20 OPEN "I",#1,"FILE.ROM"
> 30 EXEC code
> 40 CLOSE #1
>
> RawLd     ldx   #$4000     RAM storage address
>           lda   #1         select file #1
>           sta   $6F
> ldByte    jsr   $A176      read 1 byte from file
>           ldb   $70        test EOF flag
>           bne   ldDone     branch if EOF
>           sta   ,x+        store byte in RAM
>           bra   ldByte     loop
> ldDone    clr   $6F        restore console I/O
>           rts
>
> Darren
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco



-- 
Brett M. Gordon,
beretta42 at gmail.com


More information about the Coco mailing list