Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Apple » Apple II » ProDOS Commands for Basic
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
ProDOS Commands for Basic [message #379839] Fri, 18 January 2019 16:07 Go to next message
Anonymous
Karma:
Originally posted by: Apple//e86

Hello,

I am refreshing my skills with Basic and ProDOS. Is there a way to load/save Basic program files from a disk drive 2? If so, what would the commands be? Thank you!
Re: ProDOS Commands for Basic [message #379840 is a reply to message #379839] Fri, 18 January 2019 16:10 Go to previous messageGo to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
On Fri, 18 Jan 2019, Apple//e86 wrote:

> Hello,
>
> I am refreshing my skills with Basic and ProDOS. Is there a way to load/save Basic program files from a disk drive 2? If so, what would the commands be? Thank you!
>
>

,D2

-uso.
Re: ProDOS Commands for Basic [message #379845 is a reply to message #379840] Fri, 18 January 2019 17:58 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Apple//e86

Thanks. Do I need to specify slot the drive card is in?
Re: ProDOS Commands for Basic [message #379853 is a reply to message #379845] Fri, 18 January 2019 19:08 Go to previous messageGo to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
On Fri, 18 Jan 2019, Apple//e86 wrote:

>
>
> Thanks. Do I need to specify slot the drive card is in?
>

Not if it's the current slot.

-uso.
Re: ProDOS Commands for Basic [message #379862 is a reply to message #379845] Fri, 18 January 2019 21:58 Go to previous messageGo to next message
gids.rs is currently offline  gids.rs
Messages: 1395
Registered: October 2012
Karma: 0
Senior Member
,D2 should not really be used without the Slot derivitive, as Prodos can handle not only floppy drives, but 3.5 floppies, hard drives and Ram Drives all connected at the same time. All can also have a 2nd drive of each kind.

With that many drives I feel it is best not to limit a basic program to just D1 and D2, and better off to use the Prefix command.

Remember also that Prodos can handle sub-directories and is limited to only 51 files in the root directory.

You would use the Prefix command with CHR$(4) like this

10 ? CHR$(4)"PREFIX,S6,D2": INPUT VOL$

It is a little more involved to read the subdirectories and fikes from basic, but to enter a subdirectory is very easy. Just enter the subdir name after the Prefix command.

Some more examples of the Prefix command

10 ? CHR$(4)"PREFIX /VOLNAME": requires forward slash
10 ? CHR$(4)"PREFIX SUBDIRECTORYNAME"
10 ? CHR$(4)"PREFIX": INPUT VOL$: gets current slots prefix

To read files from any directory is

20 ? CHR$(4)"READ"VOL$DIR$: CT=1
30 INPUT A$: INPUT A$: INPUT A$: discard the first 3 lines of a CATALOG
40 INPUT FI$(CT): CT=CT+1
50 IF FI$(CT) <> "" THEN 40
60 CT=CT-1: FOR I =1 TO CT: ? FI$(I): NEXT

That should be enough to get you started. You will have to first read the volune name and subdirectory name into VOL$ and DIR$
Re: ProDOS Commands for Basic [message #380396 is a reply to message #379862] Wed, 30 January 2019 17:30 Go to previous message
Anonymous
Karma:
Originally posted by: billchatfield1

On Friday, January 18, 2019 at 9:58:14 PM UTC-5, I am Rob wrote:
> ,D2 should not really be used without the Slot derivitive, as Prodos can handle not only floppy drives, but 3.5 floppies, hard drives and Ram Drives all connected at the same time. All can also have a 2nd drive of each kind.
>
> With that many drives I feel it is best not to limit a basic program to just D1 and D2, and better off to use the Prefix command.
>
> Remember also that Prodos can handle sub-directories and is limited to only 51 files in the root directory.
>
> You would use the Prefix command with CHR$(4) like this
>
> 10 ? CHR$(4)"PREFIX,S6,D2": INPUT VOL$
>
> It is a little more involved to read the subdirectories and fikes from basic, but to enter a subdirectory is very easy. Just enter the subdir name after the Prefix command.
>
> Some more examples of the Prefix command
>
> 10 ? CHR$(4)"PREFIX /VOLNAME": requires forward slash
> 10 ? CHR$(4)"PREFIX SUBDIRECTORYNAME"
> 10 ? CHR$(4)"PREFIX": INPUT VOL$: gets current slots prefix
>
> To read files from any directory is
>
> 20 ? CHR$(4)"READ"VOL$DIR$: CT=1
> 30 INPUT A$: INPUT A$: INPUT A$: discard the first 3 lines of a CATALOG
> 40 INPUT FI$(CT): CT=CT+1
> 50 IF FI$(CT) <> "" THEN 40
> 60 CT=CT-1: FOR I =1 TO CT: ? FI$(I): NEXT
>
> That should be enough to get you started. You will have to first read the volune name and subdirectory name into VOL$ and DIR$

A big part of this is knowing what the volume names are before you type in PREFIX /VOLNAME. ProDOS does not provide a straight-forward way to get the volume names. So, I wrote a program to do it: https://github.com/gungwald/online

There is an online.dsk download in the releases section.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Apple II Ext 80 column and RGB manual and disks
Next Topic: Two questions for II enthusiasts
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Apr 19 11:16:20 EDT 2024

Total time taken to generate the page: 0.00330 seconds