Path: news.uiowa.edu!chi-news.cic.net!cs.utexas.edu!news.sprintlink.net!news-stk-200.sprintlink.net!news.lightlink.com!usenet
From: Edhel Iaur <drsmooth@baldcom.net>
Newsgroups: comp.sys.apple2.programmer
Subject: Big PEEKs, POKEs, and CALLS list
Date: Thu, 08 Aug 1996 18:46:10 -0400
Organization: ART MATRIX - LIGHTLINK
Lines: 468
Message-ID: <320A6E32.7C67@baldcom.net>
NNTP-Posting-Host: 205.232.46.111
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.02 (Win95; I)

This stuff's probably been here before a lot, but it was said to me (sorta) that it may be useful.  Some are 
for ProDOS, some are for DOS 3.3, and some are for Applesoft BASIC in general.  A lot of the DOS 3.3 stuff 
came from Bert Kersey's DOSTalk Scrapbook.  As usual, I claim no responsibility for any damage, etc. these may 
do.  Some of the info may be less than 100% accurate; I haven't updated this in a long while.  Without further 
ado, here's my really big PEEKs, POKEs, and CALLs and stuff list.

A little more ado:As always, feel free to email/post to me questions about this stuff.  I don't worry about 
too much email, as I won't have internet service after 2 weeks (approx.)

MEMORY ADDRESSES

$06-$09 = Free
$18-$1F = Free
$4E-$4F = Constantly randomly changing numbers
$CE-$CF = Free
$EB-$EF = Free
$F9-$FF = Free
$C9-$CD = Random numbers?
$100-$95FF = Free
$300-$3FF = Free
$9600-$BFFF = DOS 3.3
$9600-$BEFF = BASIC.SYSTEM
$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
$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
$C000-$FFFF = ROM
$D000-$F7FF = Applesoft BASIC
$E000-$F7FF = Integer BASIC
$F800-$FFFF = Hex. Language

976 = Warmstart entry
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)
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
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
Poke 50,63 INVERSE
Poke 50,127 FLASH
Poke 50,128 Listings and CATALOGs invisible
Poke 50,255 NORMAL
Poke 82,128 Cassette program will automatically RUN when loaded
Peek 103 & 104 - (Two-byte number) LOMEM value
POKE 109,PEEK(107):POKE 110,PEEK(108) Deletes all arrays.  Lets you
               reDIMention any or all arrays
Peek 115 & 116 - (Two-byte number) HIMEM value
POKE 214,128 or 255 Makes disk program RUN when any command is issued
X = PEEK (218) + PEEK (219) * 256 -- X equals line where error occured
Peek 232 & 233 Two-byte value of address of shape table
Peek (241) 256-SPEED
Call -380 NORMAL
Call -384 INVERSE
Call -875 Clears entire text line
Call -912 Scrolls up one line
Call -958 Clears the bottom of the text screen
X=PEEK(978) Determines where DOS is - if less than 157 then DOS is below
               normal location - computer has less than 48K memory; if 157
               then DOS is at its normal 48K location; if 190 then DOS is
               ProDOS, not DOS 3.3; if greater than 190 then DOS is in the
               language card.  Another source says this PEEK can show memory
               size if used as: PRINT (PEEK(978)+35)/4;"K"
POKE 1011,224 Makes RESET reboot
POKE 1010,102:POKE 1011,213:POKE 1012,112 Makes RESET RUN.  Also unhooks DOS.
               Use CALL 1002 at beginning of program to rehook it.
POKE 1013,76:POKE 1014,26:POKE 1015,252 Makes "&" move cursor up one line
Peek (2040)-192 Current active slot
POKE 40286,252:POKE 40287,164 Makes RESET RUN
Call 42340 Locks up disk to prevent writing on it.  CAUTION: BACK UP DISK
               BEFORE USING
Poke 44467,234:Poke 44468,234:Poke 44469,234 Causes DOS 3.3 to forget to show
               you the disk catalog header the next time you catalog a disk
Poke 44480,234:Poke 44481,234:Poke 44482,234 Causes DOS 3.3 to forget to show
               you the disk volume number the next time you catalog a disk
POKE 44452,22:POKE 44605,21 Controls number of files displayed in CATALOG;
               The first POKE is always 1 greater than the second one
POKE 44505,234:POKE 44506,234 Reveals DELETEd files in your CATALOG
POKE 44509,76:POKE 44510,19:POKE 44511,174 Omits file type and file length in
               CATALOG
POKE 44545,169:POKE 44546,x:POKE 44547,234 Shows all files in CATALOG to be x
               sectors long
POKE 45620,234:POKE 45621,234 Keeps repeating first file in CATALOG
Poke 49237,0 View hi-res page 2
Poke 49236,0 View hi-res page 1
Poke 43602,0 Sets a flag so that you can then, immediately following this
               POKE, send a DOS command without going to the next line
Poke 44725,144:Poke 48894,36:Poke 46063,36 The next time you format a DOS 3.3
               disk, it may have 36 (not 35) tracks
Peek(43702) What language DOS thinks is running; if it equals 0 then it's
               Integer BASIC; if it's 64, then it's Applesoft; if it's 128,
               then it's cassette Applesoft
Poke 43698,ASC(A$)+128 Changes the CONTROL-D DOS activator to the character
               in A$
Poke 45994,ASC(A$)+128 Makes the B-type files show up as the one character
               type of file in A$
Poke 45993,ASC(A$)+128 Makes the A-type files show up as the one character
               type of file in A$
Poke 45992,ASC(A$)+128 Makes the I-type files show up as the one character
               type of file in A$
Poke 45991,ASC(A$)+128 Makes the T-type files show up as the one character
               type of file in A$
Poke 44508,ASC(A$)+128 Changes the unlocked character (no *) to the one

     character in A$
Poke 44515,ASC(A$)+128 Changes the locked character (*) to the one

     character in A$
Poke 45994,ASC(A$)+128 Makes the B-type files show up as the one character
               type of file in A$
Poke 42344,76 Causes DOS 3.3 to forget to save a hello program when
                formatting a disk
Poke 44793,11 Makes DOS 3.3 forget to replicate itself when formatting a disk
Poke 44723,4 Makes DOS 3.3 mark tracks 1 and 2 as free when formatting a disk
Poke 44578,234:Poke 44579,234:Poke 44580,234:Poke 44567,12 Makes next catalog
               appear in 2 columns
Poke 43364,255 Allows you to save a binary file 65535 bytes long
Poke 43273,65 Changes DOS 3.3's INIT syntax so that no filename is required
               after the INIT command
X=PEEK(46725) Determines DOS version - if X=165 then DOS 3.3.0; if 186 then
               DOS 3.3e; if 182 then DOS 3.3f; if 206 then ProntoDOS
Poke 43139,0 Locks up the computer; RESET has little effect
Poke 40514,X   If X=6, then DOS 3.3 will RUN the HELLO file; if X=52 then DOS
               3.3 will BRUN it; if X=20 then DOS 3.3 will EXEC it
IF PEEK (48705)=0 then TRACE is off
IF PEEK (48706)=0 then no program is running
IF PEEK(-1101)=6 then the computer in use is a //c or //e
Peek 47095 = Last slot used
Peek 47096 = Last drive used
IF PEEK (49249) AND PEEK (49250) > 127 THEN PRINT "NO PADDLES IN"
IF PEEK(-16384)>127 then a key has been pressed (POKE -16368,0 resets this)
X = PEEK (-16336) Clicks the speaker
IF PEEK (-16284) > 127 then joystick button 3 has been pressed
IF PEEK (-16285) > 127 then joystick button 2 has been pressed
IF PEEK (-16286) > 127 then joystick button 1 has been pressed
IF PEEK (-16287) > 127 then joystick button 0 has been pressed
Poke -16289,1 Puts .3 volts (1.6 MA) out pin 12 of internal joystick socket
               (Output 3 on at 0.3 volts)
Poke -16290,1 Puts 3.5 volts out pin 12 of internal joystick socket
               (Output 3 on at 3.5 volts)
Poke -16291,1 Puts .3 volts (1.6 MA) out pin 13 of internal joystick socket
               (Output 2 on at 0.3 volts)
Poke -16292,1 Puts 3.5 volts out pin 13 of internal joystick socket
               (Output 2 on at 3.5 volts)
Poke -16293,1 Puts .3 volts (1.6 MA) out pin 14 of internal joystick socket
               (Output 1 on at 0.3 volts)
Poke -16294,1 Puts 3.5 volts out pin 14 of internal joystick socket
               (Output 1 on at 3.5 volts)
Poke -16295,0 Puts .3 volts (1.6 MA) out pin 15 of internal joystick socket
               (Output 0 on at 0.3 volts)
Poke -16296,1 Puts 3.5 volts out pin 15 of internal joystick socket
               (Output 0 on at 3.5 volts)
Poke -16297,0 Hi-res
Poke -16298,0 Lo-res
Poke -16299,0 Switch from high-res page 1 to page 2
Poke -16300,0 Switch from high-res page 2 to page 1
Poke -16301,0 Allows graphics and 4 lines of text
Poke -16302,0 Full screen graphics - no text
Poke -16303,0 Shows text screen
Poke -16304,0 Shows graphics screen
X=PEEK (-16352) Toggles cassette output once - creates a "click" on a
               cassette tape
Poke -16427,234:Poke -16428,234:Poke -16429,234 If a disk is initalized after
               theses POKEs have been POKEd, it won't erase the language card
Call 62454 Turns hi-res screen to last color HPLOTted
FC58 Clear screen
FB40 Lo-res graphics mode
F800 PLOT (Accumulator,Y register)
F819 HLIN (Y register,contents of $2C) AT (Y register)
F828 VLIN (Accumulator,contents of $2D) AT (Y register)
FB2F Clears Hi-res screen, Lo-res screen, and accumulator
FD35 Wait for keypress
FDED Return contents of accumulator as 1 character


CONTROL CHARACTERS & SCHTICK

ESC @ = HOME
ESC F Clears stuff from under cursor
CTRL-S Pauses & unpauses program that is listing
ESC A = Move cursor right one column
ESC B = Move cursor left one column
ESC C = Move cursor down one line
ESC D = Move cursor up one line
CTRL-E RETURN = While in hex mode, shows contents of all registers


SPEED TIPS

-Frequently GOTOed & GOSUBed lines should be early in program
-Use NEXT instead of NEXT X
-Use variables instead of actual numbers


MISCELLANEOUS

PR#{8-255}=???
?=PRINT--Lists as PRINT
Joystick=150K Ohms
If PRINT PDL(N) When N=236-239, =POKE -16540+N,0
& = Jump to $3F5
X=FRE(0) = Clean string memory
Reserved words take up one byte
In hex, 0G = CALL 0
60 in hex (96 In decimal)= return to Applesoft
X=FRE(0) = X=Number of BASIC bytes free (If negitive, add 65536)
Syntax for DEF FN:
     10 DEF FN A(W)=2*W+W
     20 PRINT FN A(23)
     RUN
     Computer will return:
     69
If 43+ errors are going to be handled by ONERR GOSUB or ONERR GOTO, use this
subroutine in your program:
     10 POKE 768,104:POKE 769,168:POKE 770,104:POKE 771,166:POKE 772,223
     20 POKE 773,154:POKE 774,72:POKE 775,152:POKE 776,72:POKE 777,96
     30 CALL 768
If your shape table starts at 1DFC, enter (in hex):
     E8:FC 1D
Max. line #=63999
Each line can have 239 characters
136=token for GR
186=token for PRINT
A input routine that accepts commas and colons:
     10 PRINT "-YOUR QUESTION HERE-";
     20 CALL-657:A$="":FOR X=512 TO 767:P=PEEK(X):IF P<>141 THEN
     A$=A$+CHR$(P):NEXT X
   (A$ now equals the response)
Move hi-res page 2 to 1:
     10 REM S.H. LAM TECHNIQUE
     20 C$="2000<4000.6000M":GOSUB 100:END
     100 C$=C$+" N D9C6G":REM SPACE BEFORE AND AFTER N
     110 FOR I=1 TO LEN(C$):POKE 511+I,ASC(MID$(C$,I,1))+128:NEXT
     120 POKE 72,0:CALL-144:RETURN
The proper syntax for reading a 2-byte number:
     Q=PEEK(B)+PEEK(B+1)*256
   Q now equals the new value and B should have been previously set to the
   starting address of the 2-byte number
The proper syntax for storing a 2-byte number:
     POKE B+1,Q/256:POKE B,Q-(PEEK(B+1)*256)
   Q should have been previously set to the value to be POKEd in and B should
   have been previously set to the starting address of where the value is to
   be stored
FOR A=46010 TO 45999 STEP -1:PRINT CHR$(PEEK(A));:NEXT
     Shows you the current DOS 3.3 disk catalog header
To stop a DOS 3.3 catalog after it waits for your keypress, enter (in hex):
     BCDF:20 0C FD C9 83 D0 03 4C 7F B3 60
PRINT PEEK(54)+256*PEEK(55) Returns the address of the current output routine
PRINT PEEK(56)+256*PEEK(57) Returns the address of the current output routine
     if DOS is active, then you use:
PRINT PEEK(43603)+256*PEEK(43604) Returns the address of the current output
               routine
PRINT PEEK(43605)+256*PEEK(43606) Returns the address of the current output
               routine
To determine what to POKE into 40192 to move the DOS buffers to put your
     machine language routine there, use the following formula:
     DB=40192-(L+38)
     You would then POKE 40192,DB and CALL 42964 to make DOS rebuild the DOS
     buffers, and then load your machine language routine into DB+38.

DOS 3.3 buffer table:

                  DOS Buffer #| Data Buffer  | Filename Field
                  ------------+--------------+----------------
                        3      |38400-38655   |  38957-38986
                        2      |38995-39250   |  39552-39581
                        1      |39590-39845   |  40147-40176



Pitch values to be POKEd into music routine:

Note      Value '   Value '''
     Value     Value ''  Value ''''

G    255  128  64   31   15
Ab   243  121  60   29   14
A    231  114  56   28   13
Bb   217  108  53   26   12
B    203  102  50   25
C    192  96   47   23
C#   182  90   45   22
D    172  85   42   21
Eb   162  80   40   20
E    154  76   37   18   11
F    146  72   35   17   10
F#   137  67   33   16   9


The duration to be POKEd into the music routine is 240 for a whole note.


A FOR/NEXT loop being used for a rest should be:
FOR R=1 TO RV:NEXT R with RV being equal to 500 for a whole rest.

10 D$=CHR$(4)
20 PRINT D$;"PREFIX"
30 INPUT PF$
40 PRINT "THE CURRENT PREFIX IS: ";PF$

To redirect information from slot 1 to a ML routine at $300, type PR#1,A$300

To redirect information from slot 1 to slot 4, type PR#1,A$C400

To stop writing to a text file after an OPEN and a WRITE or READ command have
been sent, print CHR$(4)


$Cs0C contains the card signature for the card in slot "s".
The x shows brand.

0x   not assigned
1x   printer
2x   X-Y input device
3x   serial/parallel input/output card
4x   modem
5x   sound/speech card
6x   clock
7x   mass storage device
8x   80 column display card
9x   network/bus interface
Ax   special purpose
Bx   reserved


_The error numbers_

0    NEXT without FOR
1    Language not available
2    Range error
3    No device connected
4    Volume write-protected
5    End of data
6    Path/file not found
7    Incorrect volume number
8    I/O error
9    Disk full
10   File locked
11   DOS-related syntax error
12   No buffers available
13   File type mismatch
14   Program too large
15   Illegal direct command
16   Applesoft syntax error
17   Directory full
18   File not open
19   Duplicate file name
20   File busy
21   File(s) still open
22   RETURN without GOSUB
42   Out of Data error
53   Illegal quantity error
56   RESET was pressed
69   Overflow error
77   Out of memory
90   Undefined statement error
107  Bad subscript error
120  Redimensioned array
133  Divide by zero
163  Type mismatch error
176  String too long error
191  Formula too complex
224  Undefined function error
254  Extra ignored
255  =Break=


_The file types_

1    BAD  Locked out bad blocks
2    PCD
3    PTX
4    TXT  Text
5    PDA
6    BIN  Binary file
7    FNT  IIgs font?
8    FOT  Pascal FOTO?
9    BA3
10   DA3
11   WPF  Word Perfect file?
12   SOS
15   DIR  Subdirectory
16   RPD
17   RPI
25   ADB  Appleworks database
26   AWP  Appleworks word processor
27   ASP  Appleworks spreadsheet
171  GSB
172  TDF
176  SRC  Source?
177  OBJ  Object?
178  LIB  Library?
179  S16
180  RTL
181  EXE
182  STR
183  TSF
184  NDA  New desk accessory?
185  CDA  Classic desk accessory?
186  TOL
187  DRV  Driver?
191  DOC  Document?
192  PNT  Paintworks file?
193  PIC  Super HiRes picture?
200  FON  Font?
201  FND
202  ICN  Icon?
226  DTS
239  PAS  Pascal file?
240  CMD  Extra command
245  MUS  Compose file
249  P16  ProDOS 16 file?
250  INT  Integer BASIC program
251  IVR  Stored Integer BASIC variables
252  BAS  Applesoft BASIC program
253  VAR  Stored Applesoft BASIC variables
254  REL  Relocatable machine language program
255  SYS  System program
-- 
=======================================================================

-=37th Wisest Wizard Edhel Iaur=-                  -=APPLE // FOREVER=-
Geek Code(C)v2.1: GCS/AT -d+@ H s-: g+ p0 !au(-) a-- w@ v@ C++(+++) L 3
                  E? N K W+(++) M+(++) !V po@ Y@ t+ !5 j R+(++) G+ D- e
                  tv@ b++ B-- u@ h!(++) f !r n+ !y+
*For info on the Geek Code(C) v2.1 standards, Netscape yourself over to
http://www.cs.swarthmore.edu/~binde/teatime/Miscellaneous/geek_code.txt

 -OR DO A NET SEARCH! (I use www.lycos.com & www.altavista.digital.com)
"My dependable Dell computer never cras
=======================================================================
Path: news.uiowa.edu!chi-news.cic.net!ddsw1!news.mcs.net!nntp04.primenet.com!news.shkoo.com!nntp.primenet.com!news.cais.net!news.mathworks.com!news-res.gsl.net!news.gsl.net!portc01.blue.aol.com!newsxfer2.itd.umich.edu!howland.erols.net!spool.mu.edu!munnari.OZ.AU!comp.vuw.ac.nz!waikato!news.express.co.nz!actrix.gen.nz!dempson.actrix.gen.nz!user
From: dempson@actrix.gen.nz (David Empson)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Big PEEKs, POKEs, and CALLS list
Date: Sun, 11 Aug 1996 16:41:09 +1200
Organization: Empsoft
Lines: 174
Message-ID: <dempson-1108961641090001@dempson.actrix.gen.nz>
References: <320A6E32.7C67@baldcom.net>
NNTP-Posting-Host: dempson.actrix.gen.nz

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
Path: news.uiowa.edu!news.physics.uiowa.edu!math.ohio-state.edu!cs.utexas.edu!howland.erols.net!vixen.cso.uiuc.edu!newsfeed.internetmci.com!hunter.premier.net!news.lightlink.com!usenet
From: Edhel Iaur <drsmooth@baldcom.net>
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Big PEEKs, POKEs, and CALLS list
Date: Sun, 11 Aug 1996 17:33:29 -0400
Organization: ART MATRIX - LIGHTLINK
Lines: 59
Message-ID: <320E51A9.3F3@baldcom.net>
References: <320A6E32.7C67@baldcom.net> <dempson-1108961641090001@dempson.actrix.gen.nz>
NNTP-Posting-Host: 205.232.46.104
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.02 (Win95; I)

My sincerest apologies for the crap/good stuff ratio of the Big PEEKs, 
POKEs, and CALLS list I posted a while ago.  It has been brought to my 
attention that certain parts are just plain WRONG. (Such as the bit 
about making the cursor be invisible or not flash.)

If you want help with any of the info on The Chart, you can either post 
it or mail me before 8/16/96, and I'll see what I can do to help.  Some 
of the stuff on The Chart refers to machine languge programming (Yes, I 
know that bit about $60 returning you to BASIC is inaccurate), and I 
can't teach everybody how to program in machine language with the time 
left before my account dies.  Maybe later :)

I know that many parts are vague (i.e., whether something's a ProDOS 
PEEK, or a DOS 3.3 PEEK). (This is because its original purpose was 
mostly to jog my memory of what the actual numbers were, and I'd mostly 
memorized which are for ProDOS and which are for DOS 3.3, since *I* 
typed this thing up.)  Many of the DOS 3.3 things in especial, have not 
been tested by me.  I have also forgotten totally how to use that 
routine that supposedly helps you if your Applesoft BASIC program 
encounters "43+ errors" (I got that from an old white & green 
spiral-bound book called something like _Applesoft ][ Programming 
Manual_)

I would do an update, but my internet account dies in about 1 week, so I 
probably won't have time.  Right now, I am working on arranging and 
commenting a pair of disk images of my earlier works.  The section in 
The Chart about pokes for the music routine should become more clear 
once you have these images.  I'll also try to make a couple of .SHKs, 
and upload them somewhere (suggestions as to where would be VERY 
welcome).  Suggestions to NOT upload these images at all is only 
semi-welcome ;)

Since I only have 1 week to comment all of my uncommented code (I think 
there's around 90 programs (they're small; I didn't have much attention 
span back then)), it will probably still be something less than totally 
self-explanitory.  As most of the programs will be small, the images' 
main purpose is educational (learn by example), but there will be a few 
programs that I would consider actually (somewhat) useful.

It may be about a year before I get net access again.  When I do, the 
first places to look for me would be the Apple // newsgroups. :)  I 
subscribe to almost all of them, and you will be able to get my new 
email address there.  Until then, you'll have to settle for talking 
about me behind my back.  (Go ahead, I guess I inadvertantly created 
more questions/problems than I answered with The [stupid] Chart!)

I guess that about covers it for now...
-- 
=======================================================================
-=37th Wisest Wizard Edhel Iaur=-                  -=APPLE // FOREVER=-
Geek Code(C)v2.1: GCS/AT -d+@ H s-: g+ p0 !au(-) a-- w@ v@ C++(+++) L 3
                  E? N K W+(++) M+(++) !V po@ Y@ t+ !5 j R+(++) G+ D- e
                  tv@ b++ B-- u@ h!(++) f !r n+ !y+
*For info on the Geek Code(C) v2.1 standards, Netscape yourself over to
http://www.cs.swarthmore.edu/~binde/teatime/Miscellaneous/geek_code.txt
 -OR DO A NET SEARCH! (I use www.lycos.com & www.altavista.digital.com)
"My dependable Dell computer never cras
=======================================================================
That's why it says "37th Wisest Wizard, not 1st Wisest :)
