griff3125 Posted April 1, 2020 Share Posted April 1, 2020 Running the standard Atari Basic cartridge, is there a simple command for getting a disk directory from the disk drive? I have no issues loading or saving, but a listing of D1: would sure be convenient from the command level. I can't believe I don't remember it and the myriad of books I have give no reference. My gut feeling tells me Atari Basic omitted it? Thanks for any input. Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted April 1, 2020 Share Posted April 1, 2020 (edited) You can input a number of basic commands to get a directory (a mini program if you will), or you can type DOS and get the directory from there. there are a number of add ons utilities and languages that add it as a straight up command as well. So there isn't a direct Atari BASIC A,B, or C command. Edited April 1, 2020 by _The Doctor__ 1 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted April 1, 2020 Share Posted April 1, 2020 20 minutes ago, griff3125 said: My gut feeling tells me Atari Basic omitted it? You are correct. There are a few utilities (whose names I cannot possibly recall after all these years) which patch extra commands into BASIC by intercepting the OS line editor, but the best long-term solution is to use Altirra BASIC or another interpreter which offers DIR and other useful immediate mode commands. 4 Quote Link to comment Share on other sites More sharing options...
+skr Posted April 1, 2020 Share Posted April 1, 2020 One BASIC program listing you the current directory would be this: 10 DIM A$(40) 20 TRAP 30:OPEN #1,6,0,"D1:*.*": GOTO 40 30 ? "ERROR ";PEEK(195):END 40 TRAP 70 50 INPUT #1,A$ 60 ? A$:GOTO 50 70 END Find the complete description there: https://www.atarimagazines.com/v8n6/QuickDirectory.html 5 2 Quote Link to comment Share on other sites More sharing options...
griff3125 Posted April 1, 2020 Author Share Posted April 1, 2020 Thanks so much for the replies, saved me going nuts! Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted April 1, 2020 Share Posted April 1, 2020 1 hour ago, griff3125 said: Running the standard Atari Basic cartridge, is there a simple command for getting a disk directory from the disk drive? Nope. I used to place a small program on every disk that printed the directory. It is even possible to place there a couple of commands in a text file, e.g. "D:DIR", and then list the directory by ENTER "D:DIR". The following text file may do: CLR:DIMD$(20):CL.#1:O.#1,6,0,"D:*.*":FORI=0TO1STEP0:INPUT#1,D$:?D$:IF D$(2,2)=" " THEN NEXTI Print this line to the file "D:DIR", and everytime you need the directory, "ENTER "D:DIR"" does the job, without erasing the current program. 11 1 Quote Link to comment Share on other sites More sharing options...
Gavin1968 Posted April 1, 2020 Share Posted April 1, 2020 No, that is what DOS is for. Unless you are using SpartaDOS then you can just type DIR. Remember this was way before programs were loaded into memory for basic functions like today. Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 1, 2020 Share Posted April 1, 2020 (edited) Typing in a program can be an annoyance since it's interfering with what you're doing. A quick/dirty immediate mode method I used. If you've already used it recently then type END or CLOSE #1 first: O. #1,6,6,"D:*.*" : F. A=1 TO 9999 : GET #1,D : PUT #16,D : N. A It'll output the dir until error 136 occurs for EOF. Edited April 1, 2020 by Rybags 3 1 Quote Link to comment Share on other sites More sharing options...
drac030 Posted April 1, 2020 Share Posted April 1, 2020 7 minutes ago, Rybags said: O. #1,6,6,0,"D:*.*" About a half of the "6"s here may safely be saved 2 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 1, 2020 Share Posted April 1, 2020 Fixed... the second 6 is only as it's ignored and easier to just repeat than do a 0. 1 Quote Link to comment Share on other sites More sharing options...
drac030 Posted April 1, 2020 Share Posted April 1, 2020 Not safe approach, there can easily be a DOS which uses the aux2, whereas a 0 is always backwards compatible. And surely such DOS exists: When aux1 is equal to 6, the bits in aux2 enable these functions: (...) 4 1 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted April 2, 2020 Share Posted April 2, 2020 I think one of the reasons why people liked AtariBasic-compatible and faster Turbo-Basic XL was the command DIR. 2 Quote Link to comment Share on other sites More sharing options...
invisible kid Posted April 2, 2020 Share Posted April 2, 2020 As others already stated it is not built in basic. When I would have a work disk I would put a directory program on there, like ones included with magazine disks. Either that or go to dos by "DOS", list the directory, then "B" back to basic, then forget again, and keep repeating the process. : D Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted April 2, 2020 Share Posted April 2, 2020 @thorfdbg's solution is simple and elegant, and I recall seeing the same method advocated by some type-in listing in one of the old Atari magazines in the late 80s. For a short while, I had a library of SDX-related commands (CHDIR, MKDIR and such) which I would ENTER as required. Quote Link to comment Share on other sites More sharing options...
+Spancho Posted April 2, 2020 Share Posted April 2, 2020 If you use XDOS instead of Atari DOS you can call almost every DUP command from BASIC with a XIO command. For DIR that would be XIO 39,#1,0,0”D1:DIR”. According to the info on that side https://atariwiki.org/wiki/Wiki.jsp?page=XIO Command Codes DOS Handler 3 Quote Link to comment Share on other sites More sharing options...
Gibstov Posted April 2, 2020 Share Posted April 2, 2020 16 hours ago, Rybags said: Typing in a program can be an annoyance since it's interfering with what you're doing. A quick/dirty immediate mode method I used. If you've already used it recently then type END or CLOSE #1 first: O. #1,6,6,"D:*.*" : F. A=1 TO 9999 : GET #1,D : PUT #16,D : N. A It'll output the dir until error 136 occurs for EOF. Good idea. You could make this into a little program that you can ENTER. This will create the program called "DIR.LST". Which you can then use by: ENTER "D:DIR.LST" Anyway here it is: 10 OPEN #1,8,0,"D:DIR.LST" 20 ? #1;"CLOSE #1:O.#1,6,6,";CHR$(34); "D:*.*";CHR$(34) 30 ? #1;"FOR A=1 TO 9999:GET #1,D:PUT #16,D:NEXT A" 50 CLOSE #1 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted April 2, 2020 Share Posted April 2, 2020 This is exactly what was suggested in post #6 by thorfdbg, but without the line numbers (which are unnecessary). Quote Link to comment Share on other sites More sharing options...
Gibstov Posted April 2, 2020 Share Posted April 2, 2020 (edited) 10 minutes ago, flashjazzcat said: This is exactly what was suggested in post #6 by thorfdbg, but without the line numbers (which are unnecessary). Whoops I guess I missed that post. The program I wrote just creates the "DIR.LST" program. I guess I should have been more clear. Edited April 2, 2020 by Gibstov typos Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted April 2, 2020 Share Posted April 2, 2020 19 hours ago, Gavin1968 said: No, that is what DOS is for. Well, actually, this is what *DUP* is good for. With the Atari DUP, it is just an annoyance that DUP needs to be loaded every time, and then if you have a program in memory, the FMS needs to create a MEM.SAV file... so it is not very practical with the original Atari Dos/Dup. There were a couple of Basic extensions, like DiskIO (a version of which you find on the Atari++ page) where you could type "DIR" and you would get an (even sorted) output of the directory on the screen. And then, again we have many basic dialects that have DIR. Turbo Basic, or Basic++ have it. Quote Link to comment Share on other sites More sharing options...
+Philsan Posted April 2, 2020 Share Posted April 2, 2020 On 4/1/2020 at 8:33 PM, thorfdbg said: CLR:DIMD$(20):CL.#1:O.#1,6,0,"D:*.*":FORI=0TO1STEP0:INPUT#1,D$:?D$:IF D$(2,2)=" " THEN NEXTI Print this line to the file "D:DIR", and everytime you need the directory, "ENTER "D:DIR"" does the job, without erasing the current program. Could you please write the code to do it, I think OPEN and PRINT # something... 1 Quote Link to comment Share on other sites More sharing options...
jefffulton Posted April 2, 2020 Share Posted April 2, 2020 On 4/1/2020 at 10:19 AM, skr said: One BASIC program listing you the current directory would be this: 10 DIM A$(40) 20 TRAP 30:OPEN #1,6,0,"D1:*.*": GOTO 40 30 ? "ERROR ";PEEK(195):END 40 TRAP 70 50 INPUT #1,A$ 60 ? A$:GOTO 50 70 END Find the complete description there: https://www.atarimagazines.com/v8n6/QuickDirectory.html I think we wrote a program just like this and called it "catalog.bas", mimicking the Apple IIe CATALOG command. We would copy it to every basic disk we had. Good times. Quote Link to comment Share on other sites More sharing options...
+skr Posted April 2, 2020 Share Posted April 2, 2020 On the very day Turbo Basic was released in the German magazine "Happy Computer" as type in listing I started typing it in within a few hours and then barely used Atari Basic anymore. So I was very used to the DIR command of TB. Before that I always typed DOS to get a directory, losing lots of listings, as I forgot to save them before jumping to DOS... 4 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted April 2, 2020 Share Posted April 2, 2020 lol, I was so happy to keep all that stuff in ram disk, and have mem.sav/car.sav. instant dos menu... but then the programs wanted that memory as well soon enough.... fun times. Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 2, 2020 Share Posted April 2, 2020 The problem using DIR.LST is you then need to put it on every disk you're likely to use. An alternate could be to just embed it in your current Basic program. Probably best to put it right near the end, and have it such that you can GOTO it in immediate mode and have it create minimal disturbance. So it might be something like: 32000 CLOSE #5 : OPEN #5,6,0,"D:*.*" : TRAP 32100 32010 GET #5,ZZ : PUT #16,ZZ : GOTO 32020 32100 CLOSE #5 : STOP STOP instead of END so that other IOCBs aren't closed and you can use GOTO to resume your program if you've hit Break somewhere. 1 Quote Link to comment Share on other sites More sharing options...
+slx Posted April 3, 2020 Share Posted April 3, 2020 12 hours ago, skr said: So I was very used to the DIR command of TB. Before that I always typed DOS to get a directory, losing lots of listings, as I forgot to save them before jumping to DOS... 12 hours ago, skr said: So I was very used to the DIR command of TB. Before that I always typed DOS to get a directory, losing lots of listings, as I forgot to save them before jumping to DOS... I used DOS XL as I liked the command line better and it would also allow returning to BASIC without losing stuff. On 4/1/2020 at 8:33 PM, thorfdbg said: CLR:DIMD$(20):CL.#1:O.#1,6,0,"D:*.*":FORI=0TO1STEP0:INPUT#1,D$:?D$:IF D$(2,2)=" " THEN NEXTI Print this line to the file "D:DIR", and everytime you need the directory, "ENTER "D:DIR"" does the job, without erasing the current program. That's truly a very elegant solution, @thorfdbg! I admire both your idea and Atari BASIC's design that allows it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.