[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Don't trust this list.
In article <594unb$dm@news.wco.com>,
Charles T. Turley <cturley@1wsw.org> wrote:
>I found this MEGA COLLECTION of Peeks, Pokes & Calls
That list suffers from exactly the same problems as the list from
before-- it's got a lot of problems. David Empson shot holes in that
one; his post is reprinted below. Just because you have a list doesn't
mean it's accurate at all-- listen to and remember what the
programmers say.
--- Quoting from www.dejanews.com
Subject: Re: Big PEEKs, POKEs, and CALLS list
From: dempson@actrix.gen.nz (David Empson)
Date: 1996/08/11
Message-Id: <dempson-1108961641090001@dempson.actrix.gen.nz>
References: <320A6E32.7C67@baldcom.net>
Organization: Empsoft
Newsgroups: comp.sys.apple2.programmer
In article <320A6E32.7C67@baldcom.net>, Edhel Iaur <drsmooth@baldcom.net> wrote:
>This stuff's probably been here before a lot, but it was said to me
>(sorta) that it may be useful.
There is not enough detail provided with mnany of these to actually make
use of them, unless you know what context they are defined in.
>MEMORY ADDRESSES
>
>$06-$09 = Free
>$18-$1F = Free
>$4E-$4F = Constantly randomly changing numbers
Only while waiting for input with KEYIN.
>$CE-$CF = Free
>$EB-$EF = Free
>$F9-$FF = Free
>$C9-$CD = Random numbers?
The above are mostly for Applesoft BASIC. Integer BASIC has a completely
different zero page layout, and the Applesoft zero page variables are not
relevant if you are writing a standalone SYS file.
In addition, $1F is allegedly used by the monitor (if you believe Apple's
memory usage charts).
>$100-$95FF = Free
$100-$1FF is the stack. It certainly isn't "free".
$200-$2FF is the input buffer, so must be used with extreme caution (under
ProDOS with a Thunderclock installed, parts of it get overwritten on every
ProDOS call).
$300-$3CF is free.
$3D0-$3EC is usually used by DOS 3.3 or BASIC.SYSTEM for entry point vectors.
$3ED-$3FF is used by the monitor for various hooks.
$400-$7FF is the text screen, including screen holes which must be preserved.
$800-$95FF is usually free under DOS 3.3 or BASIC.SYSTEM, but the upper
end may vary depending on MAXFILES (DOS 3.3) or the number of open files
(ProDOS). In addition, BASIC programs use part of this area, so you
cannot assume it is all available for a machine language subroutine being
called by a BASIC program.
A SYS program under ProDOS can also use $9600-$BEFF.
>$9600-$BFFF = DOS 3.3
Unless you've changed the number of buffers with MAXFILES.
>$9600-$BEFF = BASIC.SYSTEM
Unless there are any files open.
The following table of entry points ($9D5E through $AAB1) are only
relevant for DOS 3.3. (I haven't checked the addresses.)
>$9D5E = Routine called after RESTART is pressed
>$A963 = Two-byte value that is the max. value allowed w/the L parameter
>$AA57 = Current MAXFILES setting
>$AAB1 = Default MAXFILES setting
The following table of entry points ($BE43 through $BE6B) are only
relevant under BASIC.SYSTEM. (I haven't checked the addresses.)
>$BE43 EXEC file active (status)
>$BE44 Input file active (status)
>$BE45 Output file active (status)
>$BE46 Prefix active (status)
>$BE47 Directory file being accessed (status)
>$BE48 End of directory data reached (status)
>$BE49 Index to free string space (in K) (data)
>$BE4A Character count for WRITE's temporary buffer (data)
>$BE4B Current character count during keyboard entry (data)
>$BE4C ASCII code of last character sent to output (used in error detection)
>$BE4D Number of open files (doesn't include EXECs) (data)
>$BE4E EXEC file is being closed (status)
>$BE4F DIR file is being read (status)
>$BE58-59 The last used A parameter
>$BE5A-5C The last used B parameter
>$BE5D-5E The last used E parameter
>$BE5F-60 The last used L parameter
>$BE61 The last used S parameter
>$BE62 The last used D parameter
>$BE63-64 The last used F parameter
>$BE65-66 The last used R parameter
>$BE67 The last used V parameter
>$BE68-69 The last used @ parameter
>$BE6A The last used T parameter
>$BE6B The last used number after PR# or IN#
>$BF00-$BFFF = ProDOS's global page
Got that one right.
>$C000-$FFFF = ROM
$C000-$CFFF is not ROM. It is the I/O space, which may include ROM
provided by I/O cards. In the IIe, IIc and IIgs, the $C100-$CFFF can be
switched to access ROM areas.
$D000-$FFFF may also be switched to the language card (bank switched RAM),
with two alternate 4K banks appearing at $D000-$DFFF.
>$D000-$F7FF = Applesoft BASIC
>$E000-$F7FF = Integer BASIC
Actually, Integer BASIC finishes considerably earlier than $F7FF. The
remainder of the ROM is used by Sweet-16 and the Mini-Assembler.
>$F800-$FFFF = Hex. Language
Pardon? Try "Monitor firmware".
(And this is only true in the ][/][+. In the IIe and later machines,
parts of the monitor firmware are burrowed away in other ROM areas.)
>976 = Warmstart entry
Also known as $3D0, only relevant under DOS 3.3 or BASIC.SYSTEM.
>43140-43379 = DOS 3.3 commands
>43380-43581 = DOS 3.3 error messages
>45991-45994 = DOS 3.3 file-type codes
>46010-45999 = Disk volume header (backwards)
The above line is for DOS 3.3 only.
>48640 = Warmstart entry to BASIC.SYSTEM
>53456-54116 = Applesoft commands and error messages
>
>
>PEEKS, POKES, AND CALLS
>
>Poke 32,X Set left margin of text window
>Poke 33,X Set width of text window
>Poke 34,X Set top margin of text window
>Poke 35,X Set bottom margin of text window
>Peek (36) Horizontal cursor position
This is only valid in 40-column mode.
>Peek (37) Vertical cursor position
>POKE PEEK(40)+PEEK(41)*x+PEEK(36),32 Makes cursor either not flash or be
> invisible, depending on whether x is 156 or 256
This doesn't even make sense. PEEK(40) and PEEK(41) access the low order
and high order byte of BASL, which is the pointer set up by BASCALC to
point to the current screen line. To calculate the address of the current
line, you should use PEEK(40) + PEEK(41) * 256. PEEK(36) then gives you a
horizontal offset into the line (only in 40-column mode). A '32' is an
inverse space.
If you tried to use PEEK(40) + PEEK(41) * 156, you would be pointing
somewhere earlier in memory, and might overwrite something important with
a space character.
... and so it continues. It would probably take me an hour to check and
clarify the rest of these properly.
--
David Empson
dempson@actrix.gen.nz
Snail Mail: P.O. Box 27-103, Wellington, New Zealand
--- End quoting
Things this full of errors shouldn't be floating around.
Nathan Mates
--
<*> Nathan Mates http://www.visi.com/~nathan/ <*>
# What are the facts? Again and again and again-- what are the _facts_?
# Shun wishful thinking, avoid opinion, care not what the neighbors
# think-- what are the facts, and to how many decimal places? -R.A. Heinlein