Thanks for any insight.
--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
>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
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.
On 12/27/09 7:42 AM, in article hh7kmq$miv$1...@online.de, "Oliver Schmidt"
<ol...@web.de> wrote:
>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
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
> 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
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