[comp.sys.atari.st] NOTE from WALDI

WALDI@DHDIHEP1.BITNET (05/12/87)

Date: 12 May 1987, 12:20:58 SET
From: Roland Waldi              phone (6221) 564334  WALDI    at DHDIHEP1
      D-6900 Heidelberg / F.R. Germany
To:   INFO-ATARI16
Topic: fixed addresses like _shell_p, $440...

Several people discussed on the net the use of the variable _shell_p
at location $4F6, e.g.:
> Using the location at $4F6 for different purposes will crash more than one
> program. If one needs to use anything, use some of the space at either the
> $500 range, or in the $300 range ( before the save area for the registers
> ....
> Jos Vermaseren
> t68@nikhefh.uucp
According to Simon Poole's reply it is used by GEM/AES.
Let me tell you my observations:
1. According to the documentations I could access, it is for use
   of the OS Shell. I assume, this is meant to be GEM usually, so
   it would be consistent with Simon's observations. A command line
   shell, which is supposed not to invoke GEM, might then also safely
   use this for any purpose, but not if it may call GEM-applications.
2. I looked into this variable with a debugger, while running
   a GEM program. I could not verify it's use by GEM/AES, since
   it was ALWAYS 00000000. So my question to Simon: When can one
   find a real address at this place? Actually, there were such
   "PATH='... data in memory, But I could not find a place with
   a pointer to them. (I have TOS in ROM).
3. To ATARI: Can anyone comment on the proper use of this storage
   location?

The suggestion to use locations at $500 is very dangerous. Though these
locations are not documented, they are nevertheless used by TOS!
There are several pointers to printer (Centronics) output routines,
and a pointer to the PUN used for harddisk access is close above $500!
So please no one use these for private programs, if you want to
avoid system crashes. Whether the place before the post-mortem-savearea
is save, I don't know.

Another location that was discussed is $440 / $A08, A0C to control
the floppy seek rate:
>   Apparently, there is a location (0x0A08) that contains the
>   current seek rate. This location is one WORD long. It
> .....
>   What about the documented, 0x0440 location? Well, I ran some
> .....
> John Ogawa
>
> NET: ...ucbvax!sdcsvax!sdcc13!ps136sag
Actually, I can confirm locations $A08 and $A0c for the floppy drives' seek
rate. SInce it is undocumented, it may --however-- not be ported to other
TOS versions (the adresses may change). A more save way is to use
the documented location $440. Then, after changing, you have to inform
the OS by calling a hdv_init (which does not initialize hard disk, but
rather floppy i/o). This can be called via its (documented) pointer
at $46A, e.g. try:
   move   #2,$440
   move.l $46A,A0
   jsr    (A0)
or something similar (not tested). Again, could anyone from Atari comment?

Roland Waldi,  WALDI@DHDIHEP1.BITNET