[Coco] ML Disk I/O examples?

Arthur Flexser flexser at fiu.edu
Fri Apr 13 18:52:59 EDT 2007


Mark, a bit of a "cheat" that works pretty nicely is to put together in ML a
tokenized LOADM command for the file you want, (a LOAD token, an "M", a
quotation mark, a filename, and a zero terminator) and have the Basic
interpreter execute this pseudo-line of Basic.  (You might want to precede the
filename with the drive number also, as in LOADM"0:filename").

Art

PS Found my source code to MENU;  here's the relevant code:

LOAD	LBSR MOVBST  set up  "0:        .   "+zero byte filename buffer
	LDX $A6      set current byte for parser (the address of the initial
quote before the drive number has previously been stored in $A6)
        JSR $AEBB    backspace parse pointer 1 byte to "M" in loadm
	JSR $A5      parse "M" plus filename at $A6		
	JSR $C99A    RSDOS 1.0 "load this filename" entry point (different for
RSDOS 1.1)

If you want the file to not just load but execute, substitute $AE75 for $C99A.


This is a bit fragmentary, and not quite what I said above (the LOAD token is
not included;  the C99A entry point assumes it's already been read, and that
an "M" byte exists one byte before the initial quote of the filename buffer.)



On Fri, 13 Apr 2007, Mark McDougall wrote:

> Hi,
> 
> Can anyone please point me to some "nice" examples of assembler disk I/O?
> I simply need to open a series of (binary) files and read then into memory.
> Target is Coco 3.
> 
> The only examples I've seen are from the "Portal-9 Source Pack" and there's 
> scarcely a comment in the entire collection of listings! Pac-dude is using 
> DSKCON and it makes my head hurt.
> 
> Surely there's _commented_ examples around that use disk basic ROM routines 
> to open and read files??? Or is it really that painful on the Coco?
> 
> TIA
> Regards,
> 
> -- 
> |              Mark McDougall                | "Electrical Engineers do it
> |  <http://members.iinet.net.au/~msmcdoug>   |   with less resistance!"
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
> 




More information about the Coco mailing list