Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

detecting DOS 3.3 vs. ProDOS from Applesoft

3 views
Skip to first unread message

Ivan X

unread,
Dec 26, 2009, 2:35:40 PM12/26/09
to
I know this must be something well-known and obvious, and yet my searching
didn't turn up anything. Is there some simple PEEK or something which would
allow an Applesoft program to determine whether it's running under DOS 3.3
or ProDOS? (Or, to really get fancy, also detect something other than
those?)

Thanks for any insight.


--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

Oliver Schmidt

unread,
Dec 27, 2009, 7:42:12 AM12/27/09
to
Hi Ivan,

>I know this must be something well-known and obvious, and yet my searching
>didn't turn up anything. Is there some simple PEEK or something which would
>allow an Applesoft program to determine whether it's running under DOS 3.3
>or ProDOS? (Or, to really get fancy, also detect something other than
>those?)

I can't find the reference right now but the "official" way is to
check location $BF00 (start of MLI) for the value $4C (JMP
instruction).

Best, Oliver

John B. Matthews

unread,
Dec 27, 2009, 10:05:28 AM12/27/09
to
In article <hh7kmq$miv$1...@online.de>, ol...@web.de (Oliver Schmidt)
wrote:

If you determine that ProDOS is running, the "ProDOS 8 Technical
Reference Manual" mentions that the release number is the last byte
among the system globals:

BFFF:02 192 KVERSION DFB $2 ;VERSION NO. (RELEASE ID)

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Ivan X

unread,
Dec 28, 2009, 12:24:17 PM12/28/09
to
That's perfect, thanks. Even better, it's a $D3 in DOS 3.3 (as well as
Pronto-DOS and Diversi-DOS, but not David-DOS), and something else in DOS
3.2, so it is indeed a useful identifier. Would be curious if you ever
locate the reference, but it's nonessential since it works.

Ivan.


On 12/27/09 7:42 AM, in article hh7kmq$miv$1...@online.de, "Oliver Schmidt"
<ol...@web.de> wrote:

Oliver Schmidt

unread,
Dec 29, 2009, 4:03:07 AM12/29/09
to
Hi Ivan,

>That's perfect, thanks.

You're welcome :-)

>Would be curious if you ever
>locate the reference, but it's nonessential since it works.

If you really ;-) need to know: 'Beneath Apple ProDOS', page 6-63

Best, Oliver

Toinet

unread,
Dec 29, 2009, 10:40:00 AM12/29/09
to
Dear All,
as already written:

Beneath Apple ProDOS, page 6-63
Is ProDOS ACTIVE?
The following series of instructions should be used prior to
attempting to call the ProDOS MLI.
LDA $BF00
CMP #$4C
BNE NOPRODS

Beneath Apple DOS, page 6-17
IS DOS IN THE MACHINE?
The following series of instructions should be used prior to
attempting to call RWTS or the file manager to insure that DOS is
present on this machine.
LDA $3D0
CMP #$4C
BNE NODOS

Interesting code to determine the DOS version on page 6-16 of Beneath
Apple DOS
WHICH VERSION OF DOS IS ACTIVE?
In case the program has version dependent code, a check of the DOS
version may be required:
CLC
LDA #0
ADC #$BE
STA $0
LDA $3D2
ADC #$16
STA $1
LDY #0
LDA ($0),Y - GET DOS VERSION NUMBER (2 OR 3)

Antoine

Anton Treuenfels

unread,
Dec 30, 2009, 9:22:41 PM12/30/09
to

"Toinet" <antoine...@laposte.net> wrote in message
news:b41e2a66-06c1-4980...@m16g2000yqc.googlegroups.com...

> Interesting code to determine the DOS version on page 6-16 of Beneath
> Apple DOS
> WHICH VERSION OF DOS IS ACTIVE?
> In case the program has version dependent code, a check of the DOS
> version may be required:
> CLC
> LDA #0
> ADC #$BE
> STA $0
> LDA $3D2
> ADC #$16
> STA $1
> LDY #0
> LDA ($0),Y - GET DOS VERSION NUMBER (2 OR 3)

Is this correct? The first four instructions appear to do nothing other than
place the value '$BE' in memory location zero. Um, and they leave the carry
flag clear for the next addition. Wouldn't it be simpler just to do:

LDA #$BE
STA $0
CLC

or perhaps:

LDA #$00
STA $0
CLC
...
LDY #$BE

Two bytes and two cycles shorter either way. Or is there something else
going on here that's not immediately apparent?

- Anton Treuenfels

Toinet

unread,
Dec 30, 2009, 11:57:04 PM12/30/09
to
On 31 déc, 03:22, "Anton Treuenfels" <teamtemp...@yahoo.com> wrote:
> "Toinet" <antoine.vig...@laposte.net> wrote in message

You are both correct:
- the code from page 6-16 is correctly reprinted
- your code is better

I think the writer wanted to make a clean 16-bit addition with no real
interest. The interest resides in the use of $3D2 which holds the DOS
high byte load point.

antoine

0 new messages