![]() |
| Home > Computers and Hardware > apple2 > programmerfaq > |
Apple II comp.sys.apple2.programmer FAQs, Part 1/1 |
Section 1 of 2 - Prev - Next
Archive-name: apple2/programmerfaq/part1
Posting-Frequency: monthly
Last-modified: 2004/5/1
URL: http://home.swbell.net/rubywand/index.html
Apple II Programming
comp.sys.apple2.programmer Frequently Asked Questions v057 May 2004
Text- ftp://rtfm.mit.edu/pub/usenet/news.answers/apple2/programmerfaq/part1
HTML- http://home.swbell.net/rubywand/csa2pfaq.html
001- What programming languages are available for the Apple II?
002- Where can I find out about Apple II programming?
003- Where can I get Apple II languages and programming software?
004- Where can I find PEEKs & POKEs and monitor routine info?
005- How can I see and edit what's in a Text file?
006- How do I save a BASIC program in ASCII text form?
007- Where and how do I get System 6.0.1?
008- Where can I get Applesoft shape table info and programs?
009- What Operating System environments does the GS support?
010- How do I write programs for the Apple Graphics Tablet?
011- How do I read the joystick on a GS in native mode?
012- How do I write programs which use the mouse?
013- Where can I find manuals and other resources for the CP/M OS?
014- How can I view and enter code using the "monitor"?
015- What memory areas should a user be careful about modifying?
016- Can I do multi-tasking on a IIgs? or What is GNO/ME?
Csa2 Programmer FAQs
Feel free to email comments, suggestions, and materials.
Jeff Hurlburt
rubywand@swbell.net
__________________________
001- What programming languages are available for the Apple II?
Quite a few. Apple Integer BASIC (in-ROM on the first Apple II's), can be loaded into II+ and later models. Applesoft, a floating point BASIC, is in-ROM on all models starting with the II+. Older Apple II's can load-in Applesoft or, via a plug-in board, access it from ROM.
Then, there is MD BASIC, the BASIC-like MacroSoft from MicroSparc, a beta version of Apple's GS BASIC, and the new (1998) Byte Works GS BASIC! Users who want to speed up their AppleSoft programs can use a BASIC compiler such as TASC or Einstein.
Other Apple II languages are Apple Fortran, UCSD Pascal, Orca (ByteWorks) Pascal, Kyan Pascal, Terrapin Logo, Apple Logo, two Logos from ByteWorks, Isys Forth, Master Forth, (and many other Forths), Modula2, Aztec C, Orca/C, ... . Hyperstudio and HyperCard let you create stacks.
To the above you can add several assemblers including Merlin, Orca/M, an assembler from Ninja Force, and the MicroSparc Assembler.
You can find a comprehensive listing in Larry Virden's "Apple II Programmer's Catalog of Languages and Toolkits" at http://www.purl.org/net/lvirden/Misc/apple2-languages.txt .
For Orca manuals and to order the Orca languages see Byte Works products at Syndicomm ( http://www.syndicomm.com/products/ ).
--Rubywand, Jeffrey Iverson, Andrew Roughan
__________________________
002- Where can I find out about Apple II programming?
All Apple II's come with some version of BASIC installed in-ROM on the motherboard. The original Apple II's have Integer BASIC. Starting with the II+ model, all Apple II's have floating-point Applesoft in-ROM. Owners of early Apple II's can load in Applesoft or plug in a card with Applesoft ROMs.
All Apple II's include a "monitor" program in ROM. Entering CALL-151 from the BASIC prompt puts you 'in' the monitor. Here you can view and change values in key memory locations and enter machine language routines.
Besides these built-in languages, many others can be loaded in and used (see previous Q&A).
There are several good places on the net to find out about programming:
Apple II and BASIC programming books on-line
http://www.callapple.org/apple2/manuals/index.html
http://www.atariarchives.org/
Apple II comp.sys.apple2 newsgroup
news:comp.sys.apple2
Frequently Asked Questions (FAQs) distributed worldwide via USENET;
available in pure Text, line-length formatted Text, and html:
ftp://ground.ecn.uiowa.edu/apple2/Faqs/
ftp://ground.ecn.uiowa.edu/apple2/Faqs/Formatted/
http://home.swbell.net/rubywand/A2FAQs1START.html
http://apple2.org.za/gswv/a2zine/faqs/
Apple II comp.sys.apple2.programmer newsgroup
news:comp.sys.apple2.programmer
Frequently Asked Questions (FAQs)
http://home.swbell.net/rubywand/csa2pfaq.html
ftp://rtfm.mit.edu/pub/usenet/news.answers/apple2/programmerfaq/part1
Apple II DOS and ProDOS mini manual
http://home.swbell.net/rubywand/Csa2DOSMM.html
ftp://ground.ecn.uiowa.edu/apple2/Faqs/Formatted/Csa2DOSMM.txt
Apple II game authoring links
http://home.swbell.net/rubywand/A2FAQs7GAMESITES.html#004
Apple II Textfiles
http://www.textfiles.com/apple/
Applesoft BASIC FAQs on 'Another Computer Museum
http://www.xs4all.nl/~fjkraan/comp/apple2faq/app2asoftfaq.html
Asimov
ftp://ftp.apple.asimov.net/pub/apple_II/documentation/
Ground
ftp://ground.ecn.uiowa.edu/apple2/MiscInfo/Applesoft/
ftp://ground.ecn.uiowa.edu/apple2/MiscInfo/Programming/
ftp://ground.ecn.uiowa.edu/apple2/apple8/Beagle.Oldies/
ftp://ground.ecn.uiowa.edu/apple2/MiscInfo/
GS WorldView
http://apple2.org.za/gswv/a2zine/Docs/
Home of the Apple II- Apple II manual reprints, new user programming info
http://www.educate.net.au/~apple2/
Magazine and on-line 'zine issues and back issues-- see Publishers at ...
http://home.swbell.net/rubywand/A2FAQs3VENDORS.html#021
Major Apple II Sites- many Apple II links
http://home.swbell.net/rubywand/A2FAQs4MAJORSITES.html
Niel Parker's Home Page- Apple IIgs progamming information
http://axis.llx.com/~nparker/a2/
Paul Schlyter's Apple II Stuff- compilers, S-C assemblers, utilities,
Assembly Line disks, ...
http://www.stjarnhimlen.se/apple2/
Ron Kneusel's 6502 page- 6502 info, assem tutorials, and links
http://www.geocities.com/oneelkruns/65index.html
The Fridge- 6502 info, tutorials, assembly language routines
http://www.ffd2.com/fridge/
www.6502.org- 6502 info, tutorials, assembly language routines
http://www.6502.org/
Be sure to keep a look out for Apple II books, charts, software packages, etc. when you visit used book stores, swap meets, school sales, ..., or peruse comp.sys.apple2 marketplace.
Applesoft BASIC
The #1 Applesoft information source is the Basic Programming Reference Manual from Apple. Here are some other good Applesoft materials to look for ...
Apple II User's Guide by Poole, Martin, and Cook
Note: Third Edition (Apple II User's Guide for APPLE II Plus and
APPLE IIe) is completely revised to include ProDOS coverage
Apple II Reference Manual from Apple
Peeks, Pokes, and monitor routines info (see below)
DOS & ProDOS books (see below)
GSoft BASIC (New IIgs BASIC from Byte Works)
Learning to Program in GSoft BASIC by Mike Westerfield (Byte Works)
Assembly Language and Machine Language Coding
Machine coding is when you enter 6502 (65816, ...) instructions directly-- as in going to the Apple II monitor (CALL-151) and typing in hexadecimal codes at specific addresses, like 300:A9 7F (instruction to load Accumulator with the value $7F entered at address $300).
Assembly coding substitutes easy-to-remember text for the numeric codes-- as in LDA#7F to load the Accumulator with the value $7F. Assembly coding is done using assembler software (like Merlin or Orca/M). A major advantage of assembly coding is that routines and other places in your program can be tagged with text labels and referenced this way in your program. The assembler software figures out things like Jump addresses.
Assembly Lines: The Book by Wagner
Programming Manual (for 6502 from Mos Technology, 1976)
Beagle Bros "Peeks, Pokes, and Pointers" (poster)
What's Where in the Apple II? by William F. Luebbert
Programming the 65816 Including the 6502, 65C02, and 65802
by David Eyes and Ron Lichty
65816/65802 Assembly Language Programming by Fischer
Other Languages
Apple Pascal: a hands-on approach by Luehrmann & Peckham
Learn to Program in C by Mike Westerfield (Byte Works)
Learn to Program in Pascal by Mike Westerfield (Byte Works)
Logo Plus manual from Terrapin
HyperCard IIGS Script Language Guide (Apple/ Addison-Wesley)
DOS, ProDOS, and GS/OS
The DOS Manual from Apple
Beneath Apple DOS by Worth & Lechner
Beneath Apple ProDOS by Worth & Lechner
Supplement to Beneath Apple ProDOS For ProDOS8 (v1.2,1.3) by Worth & Lechner
ProDOS Inside and Out by Doms and Weishaar
ProDOS Technical Reference Manual (Apple/ Addison-Wesley)
Apple IIGS GS/OS Technical Reference (Apple/ Addison-Wesley)
Apple IIGS GS/OS Device Driver Reference (Apple/ Addison-Wesley)
Apple IIGS System 6 User's Reference (Apple/ Addison-Wesley)
The System 6 Book by Jerry Kindal (Quality Computers)
Apple IIGS ProDOS 8 Reference (Apple/ Addison-Wesley)
Apple IIGS ProDOS 16 Reference (Apple/ Addison-Wesley)
Apple IIGS Toolbox Reference v. 1-3 (Apple/ Addison-Wesley)
Exploring Apple GS/OS and ProDOS 8 by Gary Little
Toolbox Programming in C by Mike Westerfield (Byte Works)
Toolbox Programming in Pascal by Mike Westerfield (Byte Works)
One of the best ways to learn programming is to find some old game you like and experiment with customizing it. This works especially well for learning Applesoft BASIC and machine language coding.
If your Apple II is an enhanced //e or later machine, be sure to get Program Writer. It's a vintage Applesoft program editing utility from Beagle which makes writing and debugging BASIC programs much easier.
--Rubywand, Terence J. Boldt, Tony Cianfaglione, Steve Sanders, Wayne Stewart, Charles T. Turley
__________________________
003- Where can I get Apple II languages and programming software?
Byte Works ( http://www.byteworks.org ) develops the Orca series of Apple II and IIgs languages including Pascal, C, Assembler, and the new IIgs BASIC as well as manuals, learning packages, and other language materials.
You can find very good collections of Apple II languages and related software on the net at ...
Asimov- Apple II programming software and utilities
ftp://ftp.apple.asimov.net/pub/apple_II/images/utility/programming/
Ground- Apple II languages, programming software, and utilities
ftp://ground.ecn.uiowa.edu/apple2/apple8/Languages/
ftp://ground.ecn.uiowa.edu/apple2/apple8/Beagle.Oldies/
ftp://ground.ecn.uiowa.edu/apple2/apple16/Languages/
ftp://ground.ecn.uiowa.edu/apple2/Collections/SoWhat/
ftp://ground.ecn.uiowa.edu/apple2/Collections/Phoenyx/
GS WorldView- Apple II programming software and utilities
http://apple2.org.za/gswv/a2zine/Utils/
Ninja Force Downloads- Apple IIgs utilities
http://www.ninjaforce.com/html/products.html
Paul Schlyter's Apple II Stuff- Compilers, S-C assemblers, utilities
http://www.stjarnhimlen.se/apple2/dsk.html
So What Software- Apple IIgs programming software
http://www.sowhatsoftware.com/home.html
TFF Enterprises
ftp://apple2.caltech.edu/pub/apple2/8bit/dev/
Apple II game authoring software links
http://home.swbell.net/rubywand/A2FAQs7GAMESITES.html#004
More software links
http://home.swbell.net/rubywand/A2FAQs4MAJORSITES.html
--Rubywand, Andrew Roughan
__________________________
004- I'd like to do some 'serious' Apple II programming. Where can I
find a information about soft switches (i.e. "PEEKs & POKEs"),
monitor routines, and standard names used for these?
Names shown are assembler "equate" names/labels. In a few cases, more than one label and function is associated with an address. A few soft switches have no established label.
Not all switches are present on all Apple II models. In general, the later the model, the more features and soft switches are available.
Many soft switches can be toggled via a Read or a Write. If only a Read or a Write is indicated, access the switch or indicator using the indicated method.
Soft Switches and Status Indicators
KEYBOARD = $C000 ;keyboard data (latched) (Read)
;Bit 7 is set to indicate a keypress
;is waiting, with the ASCII
;code in bits 6-0.
CLR80STORE=$C000 ;80STORE Off- disable 80-column memory mapping (Write)
SET80STORE=$C001 ;80STORE On- enable 80-column memory mapping (WR-only)
CLRAUXRD = $C002 ;read from main 48K (WR-only)
SETAUXRD = $C003 ;read from aux/alt 48K (WR-only)
CLRAUXWR = $C004 ;write to main 48K (WR-only)
SETAUXWR = $C005 ;write to aux/alt 48K (WR-only)
CLRCXROM = $C006 ;use ROM on cards (WR-only)
SETCXROM = $C007 ;use internal ROM (WR-only)
CLRAUXZP = $C008 ;use main zero page, stack, & LC (WR-only)
SETAUXZP = $C009 ;use alt zero page, stack, & LC (WR-only)
CLRC3ROM = $C00A ;use internal Slot 3 ROM (WR-only)
SETC3ROM = $C00B ;use external Slot 3 ROM (WR-only)
CLR80VID = $C00C ;disable 80-column display mode (WR-only)
SET80VID = $C00D ;enable 80-column display mode (WR-only)
CLRALTCH = $C00E ;use main char set- norm LC, Flash UC (WR-only)
SETALTCH = $C00F ;use alt char set- norm inverse, LC; no Flash (WR-only)
STROBE = $C010 ;clear bit 7 of keyboard data ($C000)
If read, it also provides an "any key down" flag in bit 7, with
the keycode in the remaining bits. (These features only apply to
the IIe and later machines.)
Bit seven of these Read Status locations is 1 if the condition is true
RDLCBNK2 = $C011 ;reading from LC bank $Dx 2
RDLCRAM = $C012 ;reading from LC RAM
RDRAMRD = $C013 ;reading from aux/alt 48K
RDRAMWR = $C014 ;writing to aux/alt 48K
RDCXROM = $C015 ;using internal Slot ROM
RDAUXZP = $C016 ;using Slot zero page, stack, & LC
RDC3ROM = $C017 ;using external (Slot) C3 ROM
RD80COL = $C018 ;80STORE is On- using 80-column memory mapping
RDVBLBAR = $C019 ;not VBL (VBL signal low)
RDTEXT = $C01A ;using text mode
RDMIXED = $C01B ;using mixed mode
RDPAGE2 = $C01C ;using text/graphics page2
RDHIRES = $C01D ;using Hi-res graphics mode
RDALTCH = $C01E ;using alternate character set
RD80VID = $C01F ;using 80-column display mode
TAPEOUT = $C020 ;toggle the cassette output.
SPEAKER = $C030 ;toggle speaker diaphragm
STROBE = $C040 ;generate .5 uS low pulse @ Game pin 5
If read, you get one half-microsecond low pulse on the Game I/O
STROBE pin; if write, you get two pulses. (IIe and ][+ only, not
available on the IIgs).
CLRTEXT = $C050 ;display graphics
SETTEXT = $C051 ;display text
CLRMIXED = $C052 ;clear mixed mode- enable full graphics
SETMIXED = $C053 ;enable graphics/text mixed mode
PAGE1 = $C054 ;select text/graphics page1
PAGE2 = $C055 ;select text/graphics page2
See IIe, IIc, IIgs manual for details on how these switches
affect 80-col bank selection.
CLRHIRES = $C056 ;select Lo-res
SETHIRES = $C057 ;select Hi-res
SETAN0 = $C058 ;Set annunciator-0 output to 0
CLRAN0 = $C059 ;Set annunciator-0 output to 1
SETAN1 = $C05A ;Set annunciator-1 output to 0
CLRAN1 = $C05B ;Set annunciator-1 output to 1
SETAN2 = $C05C ;Set annunciator-2 output to 0
CLRAN2 = $C05D ;Set annunciator-2 output to 1
SETAN3 = $C05E ;Set annunciator-3 output to 0
SETDHIRES= $C05E ;if IOUDIS Set, turn on double-hires
CLRAN3 = $C05F ;Set annunciator-3 output to 1
CLRDHIRES= $C05F ;if IOUDIS Set, turn off double-hires
Note: "0" is near 0V, "1" is near 5V.
TAPEIN = $C060 ;bit 7 = data from cassette on Apple II,
or PB3 ;II+, IIe. On IIgs bit 7 reflects the
;status of Game Port Pushbutton 3--
;closed= 1. (read)
OPNAPPLE = $C061 ;open apple (command) key data (read)
CLSAPPLE = $C062 ;closed apple (option) key data (read)
These are actually the first two game Pushbutton inputs (PB0
and PB1) which are borrowed by the Open Apple and Closed Apple
keys. Bit 7 is set (=1) in these locations if the game switch or
corresponding key is pressed.
PB2 = $C063 ;game Pushbutton 2 (read)
This input has an option to be connected to the shift key on
the keyboard. (See info on the 'shift key mod'.)
PADDLE0 = $C064 ;bit 7 = status of pdl-0 timer (read)
PADDLE1 = $C065 ;bit 7 = status of pdl-1 timer (read)
PADDLE2 = $C066 ;bit 7 = status of pdl-2 timer (read)
PADDLE3 = $C067 ;bit 7 = status of pdl-3 timer (read)
PDLTRIG = $C070 ;trigger paddles
Read this to start paddle countdown, then time the period until
$C064-$C067 bit 7 becomes set to determine the paddle position.
This takes up to three milliseconds if the paddle is at its maximum
extreme (reading of 255 via the standard firmware routine).
SETIOUDIS= $C07E ;enable DHIRES & disable $C058-5F (W)
CLRIOUDIS= $C07E ;disable DHIRES & enable $C058-5F (W)
"Language Card" area Switches
Bank 1 and Bank 2 here are the 4K banks at $D000-$DFFF. The
remaining area from $E000-$FFFF is the same for both
sets of switches.
$C080 ;LC RAM bank2, Read and WR-protect RAM
ROMIN = $C081 ;LC RAM bank2, Read ROM instead of RAM,
;two or more successive reads WR-enables RAM
$C082 ;LC RAM bank2, Read ROM instead of RAM,
;WR-protect RAM
LCBANK2 = $C083 ;LC RAM bank2, Read RAM
;two or more successive reads WR-enables RAM
$C088 ;LC RAM bank1, Read and WR-protect RAM
$C089 ;LC RAM bank1, Read ROM instead of RAM,
;two or more successive reads WR-enables RAM
$C08A ;LC RAM bank1, Read ROM instead of RAM,
;WR-protect RAM
LCBANK1 = $C08B ;LC RAM bank1, Read RAM
;two or more successive reads WR-enables RAM
$C084-$C087 are echoes of $C080-$C083
$C08C-$C08F are echoes of $C088-$C08B
CLRC8ROM = $CFFF ;disable Slot card C8 ROM
Reading any location from $Cn00-$CnFF (where n is the Slot) will
enable the $C800-$CFFF area for that card, if the card supports
this feature. Reading $CFFF disables this area for all cards.
Example: To enable double Hi-res graphics, the following code will
accomplish this:
STA SETHIRES
STA SETAN3
STA CLRMIXED
STA CLRTEXT
JSR $C300
--kburtch@pts.mot.com, David Empson, Rubywand
----------------------------
The following is a list of PEEKs, POKEs and Pointers in the zero page area. Most of the information comes from the Beagle Bros chart (1982).
FP= "floating point"= Applesoft BASIC INT= Integer BASIC
Note: Text window and related settings refer to 40-column mode
Decimal | Hexadecimal |
-----------------------------------------------------------------------------
32 | $20 | Text window left-edge (0-39)
33 | $21 | Text window width (1-40)
34 | $22 | Text window top-edge (0-23)
35 | $23 | Text window bottom (1-24)
36 | $24 | Horizontal cursor-position (0-39)
37 | $25 | Vertical cursor-position (0-23)
43 | $2B | Boot slot * 16 (after boot only)
44 | $2C | Lo-res line end-point
48 | $30 | Lo-res COLOR * 17
50 | $32 | Text output format [63=INVERSE 255=NORMAL 127=FLASH]
51 | $33 | Prompt-character (NOTE: POKE 51,0:GOTO LINE # will
| | sometimes prevent a false NOT DIRECT COMMAND
| | obtained with GOTO # alone.)
74-75 | $4A-$4B | LOMEM address (INT)
76-77 | $4C-$4D | HIMEM address (INT)
78-79 | $4E-$4F | Random-Number Field
103-104 | $67-$68 | Start of Applesoft program- normally set to $801
| | (2049 decimal) and location $800 is set to $00.
| | NOTE: To load a program above hires page 1 (at
| | $4001), POKE 103,1: POKE 104,64: POKE 16384,0
| | and LOAD the program.
105-106 | $69-$6A | LOMEM Start of varible space & end of Applesoft prgm
107-108 | $6B-$6C | Start of array space (FP)
109-110 | $6D-$6E | End of array space (FP)
111-112 | $6F-$70 | Start of string-storage (FP)
115-116 | $73-$74 | HIMEM- the highest available Applesoft address +1
117-118 | $75-$76 | Line# being executed. (FP)
119-120 | $77-$78 | Line# where program stopped. (FP)
121-122 | $79-$7A | Address of line executing. (FP)
123-124 | $7B-$7C | Current DATA line#
125-126 | $7D-$7E | Next DATA address
127-128 | $7F-$80 | INPUT or DATA address
129-130 | $81-$82 | Var.last used. VAR$=CHR$(PEEK(129))+CHR$(PEEK(130))
131-132 | $83-$84 | Last-Used-Varible Address (FP)
175-176 | $AF-$B0 | End of Applesoft Program (Normally=LOMEM)
202-203 | $CA-$CB | Start of Program Address (INT)
204-205 | $CC-CD | End of Varible Storage (INT)
214 | $D6 | RUN Flag (POKE 214,255 sets Applesoft run-only.)
216 | $D8 | ONERR Flag (POKE 216,0 cancels ONERR; en norm errs)
218-219 | $DA-$DB | Line# of ONERR Error
--Apple II Textfiles ( http://www.textfiles.com/apple/ ).
----------------------------
Useful CALLs
Example: from the BASIC prompt, CALL -151 enters the monitor.
Hex Dec
$BEF8 48888 ProDOS- recovers from "NO BUFFERS AVAILABLE" error
$D683 54915 Inits Applesoft stack- scraps false "OUT OF MEMORY" error.
$F328 -3288 Repairs Applesoft stack after an ONERR GOTO handles an error.
$F3D4 -3116 HGR2
$F3DE -3106 HGR
$F3F2 -3086 Clear HI-RES screen to Black
$F3F6 -3082 Clear HI-RES screen to recent HCOLOR
$F5CB -2613 Move HI-RES cursor coords to 224-226
$F800 -2048 PLOT a LO-RES POINT (AC:Y-COORD Y:X-COORD)
$F819 -2023 DRAW a HORIZONTAL LO-RES LINE.
$F828 -2008 DRAW a VERTICAL LO-RES LINE.
$F832 -1998 CLEAR LO-RES SCREEN 1 and set GRAPHICS mode.
$F836 -1994 CLEAR top 20 lines of LO-RES Graphics
$F847 -1977 CALCULATE LO-RES Graphics base ADDRESS.
$F85F -1953 Change LO-RES COLOR to COLOR + 3
$F940 -1728 PRINT contents of X & Y (REG 9 as 4 HEX digits)
$F94C -1716 PRINT X BLANKS (X REG contains # to PRINT)
$FA86 -1402 IRQ HANDLER
$FA92 -1390 BREAK HANDLER
$FAA6 -1370 RE-BOOTS DISK SYSTEM
$FAD7 -1321 to display USER REGISTERS
$FB2F -1233 TEXT- screen init
$FB39 -1223 set SCREEN to TEXT mode
$FB40 -1216 GR- set GRAPHICS mode
$FB4B -1205 set NORMAL WINDOW
$FB60 -1184 Prints the 'Apple ][' at the top of your screen.
$FBC1 -1087 CALCULATE TEXT BASE ADDRESS
$FBE4 -1052 SOUND BELL
$FBF4 -1036 to MOVE CURSOR RIGHT
$FBFD -1027 OUTPUT A-REG as ASCII on TEXT SCREEN 1
$FC10 -1008 to MOVE CURSOR LEFT
$FC1A -998 to MOVE CURSOR UP
$FC22 -990 PERFORM a VERTICAL TAB to ROW in ACCUMULATOR
$FC2C -980 PREFORM ESCAPE FUNCTION
$FC42 -958 CLEAR from CURSOR to END of PAGE (ESC -F)
$FC58 -936 HOME & CLEAR SCREEN (Destroys ACCUMULATOR & Y-REG)
$FC62 -926 PERFORM a CARRIAGE RETURN
$FC66 -922 PERFORM a LINE FEED
$FC70 -912 SCOLL UP 1 LINE (Destroys ACCUMULATOR & Y-REG)
$FC95 -875 Clear entire Text line.
$FC9C -868 CLEAR from CURSOR to END of LINE (ESC-E)
$FDOC -756 GET KEY from KEYBOARD (Destroys A & Y-REG) WAIT for KEY PRESS.
$FD5A -678 Wait for RETURN
$FD5C -676 Sound Bell and wait for RETURN
$FD67 -665 PREFORM CARRIAGE RETURN & GET LINE of TEXT.
$FD6A -662 GET LINE of TEXT from KEYBOARD (X RETND with # of CHARACTERS)
$FD6F -657 INPUT which accepts commas & colons. Here is an example:
PRINT "NAME (LAST, FIRST): ";: CALL-657: N$="": FOR X= 512 TO 719
: IF PEEK (X) < > 141 THEN N$= N$ + CHR$ (PEEK (X) -128): NEXT X
$FD8E -626 PRINT CARRIAGE RETURN (Destroys ACCUMULATOR & Y-REG)
$FDDA -550 PRINT CONTENTS of ACCUMULATOR as 2 HEX DIGETS.
$FDE3 -541 PRINT a HEX digit
$FDED -531 OUTPUT CHARACTER IN ACCUMULATOR. (Destroys A & Y-REG COUNT)
$FDF0 -528 GET MONITOR CHARACTER OUTPUT
$FE2C -468 PERFORM MEMORY MOVE A1-A2 TO A4. Here is an example:
10 POKE 60,Source Start address Lo
20 POKE 61,Source Start address Hi
30 POKE 62,Source End address Lo
40 POKE 63,Source End address Hi
50 POKE 66,Destination address Lo
60 POKE 67,Destination address Hi
70 CALL -468
$FE80 -384 set INVERSE mode
$FE84 -380 set NORMAL mode
$FEBF -321 DISPLAY A,S,Y,P,S REG. (CURRENT VALUES)
$FF2D -211 PRINT "ERR" & SOUNDS BELL (Destroys ACCUMULATOR & Y-REG)
$FF3A -198 PRINT BELL (Destroys ACCUMULATOR & Y-REG)
$FF59 -167 ENTER MONITOR RESET, TEXT mode, "COLD START"
$FF65 -155 ENTER MONITOR, ring BELL, "WARM START"
$FF69 -151 Go to MONITOR
$FF70 -144 SCAN INPUT BUFFER (ADDRESS $200...)
--The Enforcer (on Apple Textfiles at http://www.textfiles.com/apple/ ) and Rubywand
----------------------------
You can find listings of Apple II soft switches and popular monitor routines in a manual for your computer-- e.g. the Apple II Reference Manual (for II and II+), the IIe Technical Reference Manual, the Apple IIgs Firmware Reference Manual, etc..
An excellent guide to many PEEKs & POKEs and monitor routines is the famous "Peeks, Pokes, and Pointers" poster from Beagle Bros (early 1980's). A fairly exhaustive guide to important memory locations in the Apple II is What's Where in the Apple II: An Atlas to the Apple Computer by William Luebbert (1981).
On-line lists of PEEKs & POKEs + Monitor Routines are available at
Apple II Textfiles
http://www.textfiles.com/apple/
With very few exceptions, soft switches, monitor routines, and important vectors have remained stable since early Apple II models. So, although an old chart or listing may be missing some which are available on a newer Apple II, the ones shown will almost always work. --Rubywand and Mookie
__________________________
005- How can I see and edit what's in a Text file?
A handy utility for quickly viewing Text files under DOS 3.3 or ProDOS is Copy II Plus.
On the IIgs under the system Finder (the usual "desktop" display showing drives, folders, etc.) you can, probably, double-click on a text file to start up an application (program) which will display the Text and let you make changes.
Note: If you get an error message about not being able to find an application, you will want to think about setting up a link between Text type files and some Text editor program such as Teach. Some Text editor New Desk Accessories (like Shadowrite) will automatically establish a linkage.
Another way to view and edit Text files is to run a Text editor or word processor program and load in the file. On 8-bit Apple II's, some choices include Screenwriter II, AppleWriter, and, depending upon machine, some versions of Appleworks. On the IIgs you have many choices including Teach, Shadowrite NDA, CoolWriter, and Appleworks. --Rubywand
__________________________
006- How do I save a BASIC program in ASCII text form?
The following line added to the front of your Applesoft BASIC program will save it in a Text file named "LISTFILE". It works in DOS 3.3 or ProDOS.
1 HOME:PRINT CHR$(4)"OPEN LISTFILE": PRINT CHR$(4)"WRITE LISTFILE": POKE 33,33: LIST 2,: PRINT CHR$(4)"CLOSE": END
If you have a line 1 which you'd like to leave alone, you can enter the above at Line 0 and change LIST 2, to LIST 1,.
POKE 33,33 causes the text display routine to not insert any unneccessary spacing into your BASIC program listing, which cleans up the text file output nicely.
--David Cross
__________________________
007- Where and how do I get GS System 6.0.1?
You can download System 6.0.1 from several places on the net. You can also buy the set of System 6.0.1 diskettes or buy a hard disk with System 6.0.1 installed.
For details with links, go to the main Apple II FAQs at ...
Text- ftp://ground.ecn.uiowa.edu/apple2/Faqs/Formatted/Csa21MAIN4.txt
HTML- http://home.swbell.net/rubywand/Csa2APPLICS.html#018 .
--Rubywand
__________________________
008- Where can I get Applesoft shape table info and programs?
Go to the Ground archive's Beagle Bros folder at ...
ftp://ground.ecn.uiowa.edu/2/apple2/apple8/Beagle.Oldies/
and download SHAPE.MECH1.SHK and SHAPE.MECH2.SHK.
For information on using shapes in BASIC, go to Ground's Applesoft information folder at ...
ftp://ground.ecn.uiowa.edu/2/apple2/MiscInfo/Applesoft/
and see the file hires.routines .
--Rubywand
__________________________
009- What Operating System environments does the GS support?
The GS can support several. Some of the more popular OS environments include ...
DOS 3.3- usually Beagle's Prontodos or some other speeded version of the original DOS 3.3. This is the 5.25" diskette-based disk operating system used for years on earlier Apple II's. It's commands are designed for use from BASIC programs or from the keyboard. Many old Apple II games and other wares are on 5.25" diskettes which boot DOS 3.3.
ProDOS 8- e.g. ProDOS v2.0.3. This is a disk operating system which supports a variety of devices (e.g. 3.5" drives, hard drives, etc.) and allows sub-directories. Commands are very similar to DOS 3.3 and are designed for use in BASIC programs or from the keyboard. BASIC and 'system' programs can also utilize direct CALLs to well-defined ProDOS Machine Language Interface routines.
Apple Pascal- This is an early 1980's implementation of UCSD Pascal which can run on 40-column and 80-column Apple II's.
System- Originally called "ProDOS 16" and later "GS/OS", the collection of 'system stuff' (which includes GS/OS) is today called "System". The System Finder utilizes Toolbox routines to supply a super-res desktop, Windows-like environment. Both ProDOS 8 programs and 'GS Applications' (i.e. wares that need GS/OS to run) can be started from the desktop. Depending upon factors such as installed RAM and presence of a hard disk, System will usually be System 5.0.4 or System 6.0.1. System 5.0.4 is appropriate fo
r 1.25MB or smaller non-hard disk GS's. System 6.0.1 is recommended for larger memory GS's with a hard disk.
--Rubywand and David Empson
GNO- GNO is a UNIX-like multitasking environment for the Apple IIgs which runs on top of the native operating system, GS/OS.
--Rubywand, David Empson, Devin Reade, Jeffrey Iverson
__________________________
010- How do I write programs for the Apple Graphics Tablet?
The Apple Graphics Tablet I know of is rather large and heavy; its pen is attached to it with a (too short) cable; it makes funny sounds that change when the pen is moved in/out the reach of of the tablet.
A long time ago I patched a few programs to make use of this tablet. To make it clear in the first place - I don't have these patched versions available anymore :-(. But I found a listing from which I can tell you this:
To detect the interface card, I looped over all slots to check in its firmware for
$B0 at location $Cx01 and
$20 at location $Cx09
x being the slot number. I never found this 'signature' in any other firmware.
To check for the pen position one has to poll the tablet (again x being the slot number):
LDA $CFFF ; switch off all extension ROMS
LDA $Cx00 ; switch on the extension ROM of the tablet
LDA #$Cx
STA $07F8 ; initialize some hidden text screen data area for the tablet firmware
JSR $CBB9 ; call well known location ;-) in tablet firmware
When the pen is in reach of the tablet (up or down) this routine will return immediately. Else it will block - fortunately, the routine checks the keyboard strobe ($C010) too and will also return if a key is pressed, even if the pen remains out of tablet's reach.
Section 1 of 2 - Prev - Next
| Back to category programmerfaq - Use Smart Search |
| Home - Smart Search - About the project - Feedback |
© allanswers.org | Terms of use