Thread View: net.micro.atari8
2 messages
2 total messages
Started by Rick Genter
Tue, 22 Apr 1986 20:15
From which drive did I start (Atari-800)?
Author: Rick Genter
Date: Tue, 22 Apr 1986 20:15
Date: Tue, 22 Apr 1986 20:15
24 lines
1789 bytes
1789 bytes
I recently unpacked my Atari-800 which has been in storage for the past
two years and have been doing some extensive Basic hacking on it. I have a
question that I can't find the answer to in any of my documentation, though
I may have just missed it.
Is there some way, from Basic, to determine from which disk drive the
currently executing program was started? Obviously if the program was just
typed in this should return a <No such drive> indication. But if I typed:
RUN "D3:FOO.BAS
is there something that FOO.BAS can do to determine that it was executed from
D3: as opposed to D<anything else>:? As this is Basic, no hack, no matter
how gross or disgusting, will be frowned upon, as long as it works :-).
Please reply directly to me; I have asked to be on this mailing list, but
have not gotten it confirmed yet and don't want to miss any responses. I'll
summarize when appropriate.
--------
Rick Genter BBN Laboratories Inc.
(617) 497-3848 10 Moulton St. 6/506
rgenter@labs-b.bbn.COM (Internet new) Cambridge, MA 02238
rgenter@bbn-labs-b.ARPA (Internet old) ...!{decvax,linus}!bbncca!rgenter (UUCP)
Re: From which drive did I start (Atari-800)?
Author: Bruce D. Nelson
Date: Fri, 02 May 1986 12:40
Date: Fri, 02 May 1986 12:40
26 lines
1926 bytes
1926 bytes
In article <8604230049.AA04104@ucbvax.berkeley.edu> rgenter@BBN-LABS-B.ARPA (Rick Genter) writes:
> Is there some way, from Basic, to determine from which disk drive the
>currently executing program was started? Obviously if the program was just
>typed in this should return a <No such drive> indication. But if I typed:
>
> RUN "D3:FOO.BAS
>
>is there something that FOO.BAS can do to determine that it was executed from
>D3: as opposed to D<anything else>:? As this is Basic, no hack, no matter
>how gross or disgusting, will be frowned upon, as long as it works :-).
BASIC uses IOCB #7 to do all its internal I/O (LOAD, RUN, SAVE, LPRINT, etc.).
Therefore, if you do a PEEK(195) which is the ICDNO of IOCB #7 you will get
an integer which is the unit number of the device last accessed (although the
IOCB is closed by then). Make sure you do no other channel 7 I/O before you
do the PEEK(195).
If you do a PEEK(195) after an LPRINT, you get a 1, which is the unit number
of "P1:". If you do a PEEK(195) right after you did a LOAD "D6:FOO", you
will get a 6. Try it - it really works!
Bruce D. Nelson
{...}!rochester!kodak!ektools!bruce
C-Serve: 70175,672
Delphi: BRUCENELSON
BBS: (716)334-8232 SUNDAYS ONLY 9am-9pm EDT
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads