[Coco] OS9 directory from BASIC

Bob Devries devries.bob at gmail.com
Thu Aug 2 00:17:04 EDT 2007


Continuing on from my previous post:

If BASIC's string manipulation commands are to be used, something like this 
could be used to copy the sector buffer into two string variables as it 
would be if you used DSKI$ : (remember to CLEAR enough string space first)

20 A$=STRING$(128," "):B$=STRING$(128," ")
30 PA=VARPTR(A$)
40 PB=VARPTR(B$)
50 AD=PEEK(PA+2)*256+PEEK(PA+3)
60 BD=PEEK(PB+2)*256+PEEK(PB+3)
70 PRINT"$";HEX$(AD):REM prints the address in memory of string variable A$
80 PRINT"$";HEX$(BD):REM prints the address in memory of string variable B$
90 FOR X=0 TO 127:POKEAD+X,PEEK(X+&H0600):NEXT X:REM moves data from first 
half of sector buffer to A$
100 FOR X=0 TO 127:POKEBD+X,PEEK(X+&H0680):NEXT X:REM moves data from second 
half of sector buffer to B$

After this, you can use MID$ to your heart's content. :P

--
Regards, Bob Devries, Dalby, Queensland, Australia

Isaiah 50:4 The sovereign Lord has given me
the capacity to be his spokesman,
so that I know how to help the weary.

website: http://www.home.gil.com.au/~bdevasl
my blog: http://bdevries.invigorated.org/

----- Original Message ----- 
From: "theother_bob" <theother_bob at yahoo.com>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Thursday, August 02, 2007 12:07 PM
Subject: Re: [Coco] OS9 directory from BASIC


> I've been contemplating it... would be interested in any thoughts in that 
> regard.
> First you'd have to determine 40 or 80 track and (perhaps temporarily) 
> patch basic to read 80 tracks. Then I suppose it's just a matter of 
> parsing the directory structure...
> I don't know how safe it would be to use an 80 track patch while an 
> HDB-DOS hard drive is in use. Parhaps use a ramdisk to store the directory 
> data, then remove the patch.
> It would make a great module for ColorFOG.
>
> theother_bob
>
> ----- Original Message ----
> From: Bob Devries <devries.bob at gmail.com>
> To: coco at maltedmedia.com
> Sent: Wednesday, August 1, 2007 7:11:29 PM
> Subject: [Coco] OS9 directory from BASIC
>
>
> Hi people,
>
> Has anyone here ever tried to write a BASIC programme to read a directory
> from an OS9 disk?
>
> I'm thinking about all the times I've wanted to see what's on an os9 disk,
> but really didn't want to take the time to boot up into OS9.
>
> --
> Regards, Bob Devries, Dalby, Queensland, Australia
>
> Isaiah 50:4 The sovereign Lord has given me
> the capacity to be his spokesman,
> so that I know how to help the weary.
>
> website: http://www.home.gil.com.au/~bdevasl
> my blog: http://bdevries.invigorated.org/
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
>
> 
> ____________________________________________________________________________________
> Shape Yahoo! in your own image.  Join our Network Research Panel today! 
> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list