Rybags Posted April 3, 2020 Share Posted April 3, 2020 Have to wonder - how compact could an assembly version be made, like to sit near the bottom of Page 1. So then you could have something like ? USR(270) Or theoretically a stub could live in some free RAM down low with the directory program under the OS - done as an AUTORUN.SYS Quote Link to comment Share on other sites More sharing options...
+Philsan Posted April 3, 2020 Share Posted April 3, 2020 12 hours ago, Rybags said: 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. After RUN or GOTO 32000 I get STOPPED AT LINE 32100 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted April 3, 2020 Share Posted April 3, 2020 (edited) um perhaps GOTO 32010 instead.... Edited April 3, 2020 by _The Doctor__ Quote Link to comment Share on other sites More sharing options...
+Philsan Posted April 3, 2020 Share Posted April 3, 2020 6 minutes ago, _The Doctor__ said: um perhaps GOTO 32010 instead.... ERROR 131 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted April 3, 2020 Share Posted April 3, 2020 (edited) as in change 32010 GET #5,ZZ : PUT #16,ZZ : GOTO 32020 to 32010 GET #5,ZZ : PUT #16,ZZ : GOTO 32010 the error was Error-131 IOCB write only. Before you can do anything with a peripheral, you must first OPEN a channel (IOCB) to it. The OPEN command will specify whether data is to be read from or sent to the device. (This is of course done automatically with certain BASIC commands such as SAVE, LOAD, LPRINT etc.) If you OPEN a device to send data to it and then try to read data from it, this error results. You will then have to CLOSE the channel, and reOPEN it for read or read write (update). you have to RUN fresh or GOTO 32000 to OPEN the device and of course you see the fix up in the line # so it keeps pulling Dir data until no more info. http://www.page6.org/archive/issue_22/page_10.htm more error codes at http://www.page6.org/archive/issue_21/page_24.htm Edited April 3, 2020 by _The Doctor__ 1 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted April 3, 2020 Share Posted April 3, 2020 It works with RUN and GOTO 32000, thanks @_The Doctor__! 32000 CLOSE #5:OPEN #5,6,0,"D:*.*":TRAP 32100 32010 GET #5,ZZ:PUT #16,ZZ:GOTO 32010 32100 CLOSE #5:STOP 1 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted April 3, 2020 Share Posted April 3, 2020 On 4/1/2020 at 8:33 PM, thorfdbg said: 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. 18 hours ago, Philsan said: Could you please write the code to do it, I think OPEN and PRINT # something... Done! Place this file on disk and just type "ENTER D:DIR". DIR Why didn't you explain me that solution 36 years ago? ? 1 Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted April 3, 2020 Share Posted April 3, 2020 21 hours ago, Philsan said: Could you please write the code to do it, I think OPEN and PRINT # something... Sure, here you go: 10 OPEN #1,8,0,"D:DIR" 20 DIM Q$(1):Q$=CHR$(34) 30 PRINT #1;"CLR:DIM D$(32):CL.#1:"; 40 PRINT #1;"O.#1,6,0,";Q$;"D:*.*";Q$; 50 PRINT #1;":FORI=0TO0STEP0:"; 60 PRINT #1;"I.#1,D$:?D$:"; 70 PRINT #1;"I=I+(D$(2,2)<>";Q$;" ";Q$;")"; 80 PRINT #1;":NEXTI:CL.#1:CLR" 90 CLOSE #1 It actually also fixes the issue of #1 not being closed properly at the end. Enter this, save as "D:DIR.BAS", run it, and it creates "D:DIR". ENTER "D:DIR" does the job. 1 Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted April 4, 2020 Share Posted April 4, 2020 13 hours ago, Philsan said: Done! Place this file on disk and just type "ENTER D:DIR". DIR 93 B · 3 downloads Why didn't you explain me that solution 36 years ago? ? Well, this DIR command was available as a type-in listing in various german magazines in the 80s. You should have read more german Atari magazines back then... e.g.: - HC - Mein HomeComputer (Vogel Verlag), 02/1984 by Thomas Tausend, maybe it was also part of "Die Hexenkueche" (a Basic utility collection) by Thomas Tausend - or Computronic, 4/1986 "Directory in Basic" by Oliver Cyranka The attached HC ATR image contains the listing, use RUN"D:DIRECTOR.BAS" to load the file, it will generate a file on diskette, use ENTER"D:DIR" to enter that file and therefore execute a directory command; the attached CT ATR image also contains a basic listing, use RUN"D:DIR.BAS" to generate the file... HC_Mein_Home-Computer_1984_side_a.zip Computronic_1986_(side_b).zip 1 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted April 4, 2020 Share Posted April 4, 2020 So, here are the three programs that create the file that can be used with ENTER"D:DIR" to show directory. The results are the same, apart the fact the third program displays name-size bar. Which is better and what are the differences from a programmer's points of view? THORFDBG 10 OPEN #1,8,0,"D:DIR" 20 DIM Q$(1):Q$=CHR$(34) 30 PRINT #1;"CLR:DIM D$(32):CL.#1:"; 40 PRINT #1;"O.#1,6,0,";Q$;"D:*.*";Q$; 50 PRINT #1;":FORI=0TO0STEP0:"; 60 PRINT #1;"I.#1,D$:?D$:"; 70 PRINT #1;"I=I+(D$(2,2)<>";Q$;" ";Q$;")"; 80 PRINT #1;":NEXTI:CL.#1:CLR" 90 CLOSE #1 HC MEIN COMPUTER 02/1984 1 DIM M$(120) 2 M$="CLR:DIMQ$(20):CL.#1:O.#1,6,0,'D:*.*':FOR N=1TO25STEP0:I.#1;Q$:?Q$:IFLEN(Q$)>10 AND Q$(5,8)<>'FREE' THEN N.N" 3 OPEN #1,8,0,"D:DIR" 4 FOR N=1 TO LEN(M$) 5 Z=ASC(M$(N,N)) 6 IF Z=39 THEN Z=34 7 PUT #1,Z 8 NEXT N 9 PUT #1,155:END COMPUTRONIC 1986 30 DIM M$(200) 40 M$="CLR:DIM A$(20):? '{CLR} NAME SIZE':? :CLOSE #1:OPEN #1,6,0,'D:*.*':FOR A=1 TO 70:INPUT #1,A$:? A$:"50 M$(103)="IF A$ (1,1)=' ' OR A$(1,1)='*' THEN NEXT A" 60 OPEN #1,8,0,"D:DIR.LST":FOR N=1 TO LEN(M$):C=ASC(M$(N,N)):IF C=39 THEN C=34 70 PUT #1,C:NEXT N:PUT #1,155 80 CLOSE #1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 4, 2020 Share Posted April 4, 2020 The best option IMO is something that causes minimal disturbance to what you're doing which would likely be typing in or modifying a Basic program. So, if it's creating new variables or inadvertantly trashing existing ones, not really good. The ones I did earlier - not the most speedy things and the immediate mode one gives the error 136. But minimalistic insofar as not using lots of variables and IOCBs. 3 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted April 4, 2020 Share Posted April 4, 2020 spot on, you don't want it disturbing your program or much of anything else. The best one for our purposes is bare bones. Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted April 4, 2020 Share Posted April 4, 2020 You have to do a small change to the Computronic program, so you can ENTER"D:DIR". Change line 60 into Open #1,8,0,"DIR"... instead of DIR.LST, that's all... 1 Quote Link to comment Share on other sites More sharing options...
tabar Posted April 5, 2020 Share Posted April 5, 2020 is there a way to produce a 2 column output for disks or hard drive directories that are grater than 20 files or a pause? I know about control-1. Quote Link to comment Share on other sites More sharing options...
Preppie Posted April 5, 2020 Share Posted April 5, 2020 I used to use the one line dir shown here, but I remembered something a little more impressive so did a quick search: https://archive.org/stream/1982-11-compute-magazine/Compute_Issue_030_1982_Nov#page/n209/mode/2up Haven't read it completely, but looks like it gives you some extra commands in Atari BASIC. 2 Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted April 5, 2020 Share Posted April 5, 2020 DIR3N.BAS A 3 filename per line listing. 1 2 Quote Link to comment Share on other sites More sharing options...
BillC Posted April 6, 2020 Share Posted April 6, 2020 11 hours ago, Roydea6 said: DIR3N.BAS 722 B · 5 downloads A 3 filename per line listing. I haven't looked at it yet, but that layout is similar to that people often used for printing a floppies contents on the label BITD. Quote Link to comment Share on other sites More sharing options...
Dopeyman06 Posted April 26, 2022 Share Posted April 26, 2022 Re-visiting an old thread..... (Sorry......) How about something like this? Something where you can write a "header" and then the DIR of the disk? 1 Quote Link to comment Share on other sites More sharing options...
Jetboot Jack Posted April 28, 2022 Share Posted April 28, 2022 (edited) Like Preppie mentioned, my favorite way around the problem back in the day was the Compute Wedge, a really excellent little tool - http://archive.org/details/1982-11-compute-magazine/page/n209/mode/2up?view=theater sTeVE Edited April 28, 2022 by Jetboot Jack 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.