home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / apple2 / programmerfaq / part1
Encoding:
Internet Message Format  |  2004-05-05  |  45.9 KB

  1. Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail
  2. Message-ID: <apple2/programmerfaq/part1_1083675484@rtfm.mit.edu>
  3. Supersedes: <apple2/programmerfaq/part1_1081078121@rtfm.mit.edu>
  4. Expires: 17 Jun 2004 12:58:04 GMT
  5. X-Last-Updated: 2004/04/28
  6. Organization: none
  7. From: rubywand@swbell.net
  8. Newsgroups: comp.sys.apple2.programmer,comp.answers,news.answers
  9. Subject: Apple II comp.sys.apple2.programmer FAQs, Part 1/1
  10. Followup-To: poster
  11. Approved: news-answers-request@MIT.EDU
  12. Summary: Comp.sys.apple2.programmer (Csa2P) is concerned with 
  13.          programming the Apple II series of computers. It is the
  14.          net's largest forum for Apple II programmers and
  15.          programming beginners to ask questions, discuss issues,
  16.          and share ideas.
  17. Originator: faqserv@penguin-lust.MIT.EDU
  18. Date: 04 May 2004 13:01:35 GMT
  19. Lines: 1035
  20. NNTP-Posting-Host: penguin-lust.mit.edu
  21. X-Trace: 1083675695 senator-bedfellow.mit.edu 569 18.181.0.29
  22. Xref: senator-bedfellow.mit.edu comp.sys.apple2.programmer:15429 comp.answers:57087 news.answers:270923
  23.  
  24. Archive-name: apple2/programmerfaq/part1
  25. Posting-Frequency: monthly
  26. Last-modified: 2004/5/1
  27. URL: http://home.swbell.net/rubywand/index.html
  28.  
  29. Apple II Programming
  30.  
  31. comp.sys.apple2.programmer Frequently Asked Questions v057 May 2004
  32.  
  33. Text- ftp://rtfm.mit.edu/pub/usenet/news.answers/apple2/programmerfaq/part1
  34. HTML- http://home.swbell.net/rubywand/csa2pfaq.html
  35.  
  36.  
  37.  
  38. 001- What programming languages are available for the Apple II? 
  39. 002- Where can I find out about Apple II programming? 
  40. 003- Where can I get Apple II languages and programming software? 
  41. 004- Where can I find PEEKs & POKEs and monitor routine info? 
  42. 005- How can I see and edit what's in a Text file? 
  43. 006- How do I save a BASIC program in ASCII text form? 
  44. 007- Where and how do I get System 6.0.1? 
  45. 008- Where can I get Applesoft shape table info and programs? 
  46. 009- What Operating System environments does the GS support? 
  47. 010- How do I write programs for the Apple Graphics Tablet? 
  48. 011- How do I read the joystick on a GS in native mode? 
  49. 012- How do I write programs which use the mouse? 
  50. 013- Where can I find manuals and other resources for the CP/M OS?
  51. 014- How can I view and enter code using the "monitor"? 
  52. 015- What memory areas should a user be careful about modifying? 
  53. 016- Can I do multi-tasking on a IIgs? or What is GNO/ME? 
  54.  
  55.   
  56.   
  57.   
  58.   
  59.  
  60. Csa2 Programmer FAQs 
  61.  
  62. Feel free to email comments, suggestions, and materials. 
  63.  
  64. Jeff Hurlburt 
  65. rubywand@swbell.net 
  66.   
  67.  
  68. __________________________ 
  69.   
  70.   
  71.  
  72. 001- What programming languages are available for the Apple II? 
  73.  
  74. 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. 
  75.  
  76. 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. 
  77.  
  78. 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. 
  79.  
  80. To the above you can add several assemblers including Merlin, Orca/M, an assembler from Ninja Force, and the MicroSparc Assembler. 
  81.  
  82. 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 . 
  83.  
  84. For Orca manuals and to order the Orca languages see Byte Works products at Syndicomm ( http://www.syndicomm.com/products/ ).
  85.  
  86. --Rubywand, Jeffrey Iverson, Andrew Roughan
  87.  
  88. __________________________ 
  89.   
  90.  
  91.  
  92. 002- Where can I find out about Apple II programming? 
  93.  
  94. 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. 
  95.  
  96. 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. 
  97.  
  98. Besides these built-in languages, many others can be loaded in and used (see previous Q&A). 
  99.   
  100.  
  101. There are several good places on the net to find out about programming: 
  102.  
  103. Apple II and BASIC programming books on-line
  104.  http://www.callapple.org/apple2/manuals/index.html
  105.  http://www.atariarchives.org/
  106.  
  107. Apple II comp.sys.apple2 newsgroup 
  108.  news:comp.sys.apple2 
  109.  Frequently Asked Questions (FAQs) distributed worldwide via USENET; 
  110.  available in pure Text, line-length formatted Text, and html: 
  111.  ftp://ground.ecn.uiowa.edu/apple2/Faqs/ 
  112.  ftp://ground.ecn.uiowa.edu/apple2/Faqs/Formatted/ 
  113.  http://home.swbell.net/rubywand/A2FAQs1START.html 
  114.  http://apple2.org.za/gswv/a2zine/faqs/
  115.  
  116. Apple II comp.sys.apple2.programmer newsgroup 
  117.  news:comp.sys.apple2.programmer
  118.  Frequently Asked Questions (FAQs)
  119.  http://home.swbell.net/rubywand/csa2pfaq.html
  120.  ftp://rtfm.mit.edu/pub/usenet/news.answers/apple2/programmerfaq/part1
  121.  
  122. Apple II DOS and ProDOS mini manual 
  123.  http://home.swbell.net/rubywand/Csa2DOSMM.html
  124.  ftp://ground.ecn.uiowa.edu/apple2/Faqs/Formatted/Csa2DOSMM.txt 
  125.  
  126. Apple II game authoring links 
  127.  http://home.swbell.net/rubywand/A2FAQs7GAMESITES.html#004 
  128.  
  129. Apple II Textfiles 
  130.  http://www.textfiles.com/apple/
  131.  
  132. Applesoft BASIC FAQs on 'Another Computer Museum 
  133.  http://www.xs4all.nl/~fjkraan/comp/apple2faq/app2asoftfaq.html
  134.  
  135. Asimov 
  136.  ftp://ftp.apple.asimov.net/pub/apple_II/documentation/ 
  137.  
  138. Ground 
  139.  ftp://ground.ecn.uiowa.edu/apple2/MiscInfo/Applesoft/ 
  140.  ftp://ground.ecn.uiowa.edu/apple2/MiscInfo/Programming/
  141.  ftp://ground.ecn.uiowa.edu/apple2/apple8/Beagle.Oldies/
  142.  ftp://ground.ecn.uiowa.edu/apple2/MiscInfo/ 
  143.  
  144. GS WorldView 
  145.  http://apple2.org.za/gswv/a2zine/Docs/ 
  146.  
  147. Home of the Apple II- Apple II manual reprints, new user programming info
  148.  http://www.educate.net.au/~apple2/
  149.  
  150. Magazine and on-line 'zine issues and back issues-- see Publishers at ...
  151.  http://home.swbell.net/rubywand/A2FAQs3VENDORS.html#021
  152.  
  153. Major Apple II Sites- many Apple II links 
  154.  http://home.swbell.net/rubywand/A2FAQs4MAJORSITES.html 
  155.  
  156. Niel Parker's Home Page- Apple IIgs progamming information 
  157.  http://axis.llx.com/~nparker/a2/ 
  158.  
  159. Paul Schlyter's Apple II Stuff- compilers, S-C assemblers, utilities,
  160.  Assembly Line disks, ...
  161.  http://www.stjarnhimlen.se/apple2/
  162.  
  163. Ron Kneusel's 6502 page- 6502 info, assem tutorials, and links
  164.  http://www.geocities.com/oneelkruns/65index.html
  165.  
  166. The Fridge- 6502 info, tutorials, assembly language routines
  167.  http://www.ffd2.com/fridge/
  168.  
  169. www.6502.org- 6502 info, tutorials, assembly language routines
  170.  http://www.6502.org/
  171.  
  172.  
  173.  
  174. 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. 
  175.   
  176.  
  177. Applesoft BASIC 
  178.  
  179. The #1 Applesoft information source is the Basic Programming Reference Manual from Apple. Here are some other good Applesoft materials to look for ... 
  180.  
  181. Apple II User's Guide by Poole, Martin, and Cook 
  182.   Note: Third Edition (Apple II User's Guide for APPLE II Plus and
  183.   APPLE IIe) is completely revised to include ProDOS coverage
  184. Apple II Reference Manual from Apple 
  185. Peeks, Pokes, and monitor routines info (see below) 
  186. DOS & ProDOS books (see below) 
  187.  
  188.  
  189. GSoft BASIC (New IIgs BASIC from Byte Works)
  190.  
  191. Learning to Program in GSoft BASIC by Mike Westerfield (Byte Works) 
  192.  
  193.  
  194. Assembly Language and Machine Language Coding 
  195.  
  196. 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). 
  197.  
  198. 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. 
  199.  
  200. Assembly Lines: The Book by Wagner 
  201. Programming Manual (for 6502 from Mos Technology, 1976)
  202. Beagle Bros "Peeks, Pokes, and Pointers" (poster) 
  203. What's Where in the Apple II? by William F. Luebbert 
  204. Programming the 65816 Including the 6502, 65C02, and 65802 
  205.  by David Eyes and Ron Lichty 
  206. 65816/65802 Assembly Language Programming by Fischer 
  207.  
  208.  
  209. Other Languages 
  210.  
  211. Apple Pascal: a hands-on approach by Luehrmann & Peckham 
  212. Learn to Program in C by Mike Westerfield (Byte Works) 
  213. Learn to Program in Pascal by Mike Westerfield (Byte Works) 
  214. Logo Plus manual from Terrapin 
  215. HyperCard IIGS Script Language Guide (Apple/ Addison-Wesley) 
  216.   
  217.  
  218. DOS, ProDOS, and GS/OS 
  219.  
  220. The DOS Manual from Apple 
  221. Beneath Apple DOS by Worth & Lechner 
  222. Beneath Apple ProDOS by Worth & Lechner 
  223. Supplement to Beneath Apple ProDOS For ProDOS8 (v1.2,1.3)  by Worth & Lechner
  224. ProDOS Inside and Out by Doms and Weishaar 
  225. ProDOS Technical Reference Manual (Apple/ Addison-Wesley) 
  226. Apple IIGS GS/OS Technical Reference (Apple/ Addison-Wesley) 
  227. Apple IIGS GS/OS Device Driver Reference (Apple/ Addison-Wesley) 
  228. Apple IIGS System 6 User's Reference (Apple/ Addison-Wesley) 
  229. The System 6 Book by Jerry Kindal (Quality Computers)
  230. Apple IIGS ProDOS 8 Reference (Apple/ Addison-Wesley) 
  231. Apple IIGS ProDOS 16 Reference (Apple/ Addison-Wesley) 
  232. Apple IIGS Toolbox Reference v. 1-3 (Apple/ Addison-Wesley) 
  233. Exploring Apple GS/OS and ProDOS 8 by Gary Little 
  234. Toolbox Programming in C by Mike Westerfield (Byte Works) 
  235. Toolbox Programming in Pascal by Mike Westerfield (Byte Works) 
  236.   
  237.  
  238. 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. 
  239.  
  240. 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. 
  241.   
  242.  
  243. --Rubywand, Terence J. Boldt, Tony Cianfaglione, Steve Sanders, Wayne Stewart, Charles T. Turley
  244.   
  245.  
  246. __________________________ 
  247.   
  248.  
  249.  
  250. 003- Where can I get Apple II languages and programming software? 
  251.  
  252. 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. 
  253.   
  254.  
  255. You can find very good collections of Apple II languages and related software on the net at ... 
  256.  
  257. Asimov- Apple II programming software and utilities
  258.  ftp://ftp.apple.asimov.net/pub/apple_II/images/utility/programming/
  259.  
  260. Ground- Apple II languages, programming software, and utilities
  261.  ftp://ground.ecn.uiowa.edu/apple2/apple8/Languages/
  262.  ftp://ground.ecn.uiowa.edu/apple2/apple8/Beagle.Oldies/
  263.  ftp://ground.ecn.uiowa.edu/apple2/apple16/Languages/
  264.  ftp://ground.ecn.uiowa.edu/apple2/Collections/SoWhat/
  265.  ftp://ground.ecn.uiowa.edu/apple2/Collections/Phoenyx/
  266.  
  267. GS WorldView- Apple II programming software and utilities
  268.  http://apple2.org.za/gswv/a2zine/Utils/ 
  269.  
  270. Ninja Force Downloads- Apple IIgs utilities
  271.  http://www.ninjaforce.com/html/products.html
  272.  
  273. Paul Schlyter's Apple II Stuff- Compilers, S-C assemblers, utilities
  274.  http://www.stjarnhimlen.se/apple2/dsk.html
  275.  
  276. So What Software- Apple IIgs programming software
  277.  http://www.sowhatsoftware.com/home.html
  278.  
  279. TFF Enterprises 
  280.  ftp://apple2.caltech.edu/pub/apple2/8bit/dev/ 
  281.  
  282. Apple II game authoring software links 
  283.  http://home.swbell.net/rubywand/A2FAQs7GAMESITES.html#004 
  284.  
  285. More software links 
  286.  http://home.swbell.net/rubywand/A2FAQs4MAJORSITES.html 
  287.  
  288. --Rubywand, Andrew Roughan
  289.  
  290. __________________________ 
  291.   
  292.  
  293.  
  294. 004- I'd like to do some 'serious' Apple II programming. Where can I
  295.      find a information about soft switches (i.e. "PEEKs & POKEs"), 
  296.      monitor routines, and standard names used for these? 
  297.  
  298. 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.
  299.  
  300. Not all switches are present on all Apple II models. In general, the later the model, the more features and soft switches are available.
  301.  
  302. 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.
  303.  
  304.  
  305. Soft Switches and Status Indicators
  306.  
  307. KEYBOARD = $C000 ;keyboard data (latched) (Read)
  308.                  ;Bit 7 is set to indicate a keypress
  309.                  ;is waiting, with the ASCII
  310.                  ;code in bits 6-0.
  311.  
  312. CLR80STORE=$C000 ;80STORE Off- disable 80-column memory mapping (Write)
  313. SET80STORE=$C001 ;80STORE On- enable 80-column memory mapping (WR-only)
  314.  
  315. CLRAUXRD = $C002 ;read from main 48K (WR-only)
  316. SETAUXRD = $C003 ;read from aux/alt 48K (WR-only)
  317.  
  318. CLRAUXWR = $C004 ;write to main 48K (WR-only)
  319. SETAUXWR = $C005 ;write to aux/alt 48K (WR-only)
  320.  
  321. CLRCXROM = $C006 ;use ROM on cards (WR-only)
  322. SETCXROM = $C007 ;use internal ROM (WR-only)
  323.  
  324. CLRAUXZP = $C008 ;use main zero page, stack, & LC (WR-only)
  325. SETAUXZP = $C009 ;use alt zero page, stack, & LC (WR-only)
  326.  
  327. CLRC3ROM = $C00A ;use internal Slot 3 ROM (WR-only)
  328. SETC3ROM = $C00B ;use external Slot 3 ROM (WR-only)
  329.  
  330. CLR80VID = $C00C ;disable 80-column display mode (WR-only)
  331. SET80VID = $C00D ;enable 80-column display mode (WR-only)
  332.  
  333. CLRALTCH = $C00E ;use main char set- norm LC, Flash UC (WR-only)
  334. SETALTCH = $C00F ;use alt char set- norm inverse, LC; no Flash (WR-only)
  335.  
  336.  
  337. STROBE =   $C010 ;clear bit 7 of keyboard data ($C000)
  338. If read, it also provides an "any key down" flag in bit 7, with
  339. the keycode in the remaining bits. (These features only apply to
  340. the IIe and later machines.)
  341.  
  342.  
  343. Bit seven of these Read Status locations is 1 if the condition is true
  344.  
  345. RDLCBNK2 = $C011 ;reading from LC bank $Dx 2
  346. RDLCRAM =  $C012 ;reading from LC RAM
  347. RDRAMRD =  $C013 ;reading from aux/alt 48K
  348. RDRAMWR =  $C014 ;writing to aux/alt 48K
  349. RDCXROM =  $C015 ;using internal Slot ROM
  350. RDAUXZP =  $C016 ;using Slot zero page, stack, & LC
  351. RDC3ROM =  $C017 ;using external (Slot) C3 ROM
  352. RD80COL =  $C018 ;80STORE is On- using 80-column memory mapping
  353. RDVBLBAR = $C019 ;not VBL (VBL signal low)
  354. RDTEXT =   $C01A ;using text mode
  355. RDMIXED =  $C01B ;using mixed mode
  356. RDPAGE2 =  $C01C ;using text/graphics page2
  357. RDHIRES =  $C01D ;using Hi-res graphics mode
  358. RDALTCH =  $C01E ;using alternate character set
  359. RD80VID =  $C01F ;using 80-column display mode
  360.  
  361. TAPEOUT =  $C020 ;toggle the cassette output.
  362.  
  363. SPEAKER =  $C030 ;toggle speaker diaphragm
  364.  
  365. STROBE =   $C040 ;generate .5 uS low pulse @ Game pin 5
  366. If read, you get one half-microsecond low pulse on the Game I/O
  367. STROBE pin; if write, you get two pulses. (IIe and ][+ only, not
  368. available on the IIgs).
  369.  
  370. CLRTEXT =  $C050 ;display graphics
  371. SETTEXT =  $C051 ;display text
  372.  
  373. CLRMIXED = $C052 ;clear mixed mode- enable full graphics
  374. SETMIXED = $C053 ;enable graphics/text mixed mode
  375.  
  376. PAGE1 =    $C054 ;select text/graphics page1
  377. PAGE2 =    $C055 ;select text/graphics page2
  378. See IIe, IIc, IIgs manual for details on how these switches
  379. affect 80-col bank selection.
  380.  
  381. CLRHIRES = $C056 ;select Lo-res
  382. SETHIRES = $C057 ;select Hi-res
  383.  
  384. SETAN0 =   $C058 ;Set annunciator-0 output to 0
  385. CLRAN0 =   $C059 ;Set annunciator-0 output to 1
  386. SETAN1 =   $C05A ;Set annunciator-1 output to 0
  387. CLRAN1 =   $C05B ;Set annunciator-1 output to 1
  388. SETAN2 =   $C05C ;Set annunciator-2 output to 0
  389. CLRAN2 =   $C05D ;Set annunciator-2 output to 1
  390. SETAN3 =   $C05E ;Set annunciator-3 output to 0
  391. SETDHIRES= $C05E ;if IOUDIS Set, turn on double-hires
  392. CLRAN3 =   $C05F ;Set annunciator-3 output to 1
  393. CLRDHIRES= $C05F ;if IOUDIS Set, turn off double-hires
  394. Note: "0" is near 0V, "1" is near 5V.
  395.  
  396.  
  397. TAPEIN =   $C060 ;bit 7 = data from cassette on Apple II,
  398. or PB3           ;II+, IIe. On IIgs bit 7 reflects the
  399.                  ;status of Game Port Pushbutton 3--
  400.                  ;closed= 1. (read)
  401.  
  402. OPNAPPLE = $C061 ;open apple (command) key data (read)
  403. CLSAPPLE = $C062 ;closed apple (option) key data (read)
  404. These are actually the first two game Pushbutton inputs (PB0
  405. and PB1) which are borrowed by the Open Apple and Closed Apple
  406. keys. Bit 7 is set (=1) in these locations if the game switch or
  407. corresponding key is pressed.
  408.  
  409. PB2 =      $C063 ;game Pushbutton 2 (read)
  410. This input has an option to be connected to the shift key on
  411. the keyboard. (See info on the 'shift key mod'.)
  412.  
  413. PADDLE0 =  $C064 ;bit 7 = status of pdl-0 timer (read)
  414. PADDLE1 =  $C065 ;bit 7 = status of pdl-1 timer (read)
  415. PADDLE2 =  $C066 ;bit 7 = status of pdl-2 timer (read)
  416. PADDLE3 =  $C067 ;bit 7 = status of pdl-3 timer (read)
  417. PDLTRIG =  $C070 ;trigger paddles
  418. Read this to start paddle countdown, then time the period until
  419. $C064-$C067 bit 7 becomes set to determine the paddle position.
  420. This takes up to three milliseconds if the paddle is at its maximum
  421. extreme (reading of 255 via the standard firmware routine).
  422.  
  423. SETIOUDIS= $C07E ;enable DHIRES & disable $C058-5F (W)
  424. CLRIOUDIS= $C07E ;disable DHIRES & enable $C058-5F (W)
  425.  
  426.  
  427. "Language Card" area Switches
  428. Bank 1 and Bank 2 here are the 4K banks at $D000-$DFFF. The
  429. remaining area from $E000-$FFFF is the same for both
  430. sets of switches.
  431.  
  432.            $C080 ;LC RAM bank2, Read and WR-protect RAM
  433. ROMIN =    $C081 ;LC RAM bank2, Read ROM instead of RAM,
  434.                  ;two or more successive reads WR-enables RAM
  435.            $C082 ;LC RAM bank2, Read ROM instead of RAM,
  436.                  ;WR-protect RAM
  437. LCBANK2 =  $C083 ;LC RAM bank2, Read RAM
  438.                  ;two or more successive reads WR-enables RAM
  439.            $C088 ;LC RAM bank1, Read and WR-protect RAM
  440.            $C089 ;LC RAM bank1, Read ROM instead of RAM,
  441.                  ;two or more successive reads WR-enables RAM
  442.            $C08A ;LC RAM bank1, Read ROM instead of RAM,
  443.                  ;WR-protect RAM
  444. LCBANK1 =  $C08B ;LC RAM bank1, Read RAM
  445.                  ;two or more successive reads WR-enables RAM
  446.            $C084-$C087 are echoes of $C080-$C083
  447.            $C08C-$C08F are echoes of $C088-$C08B
  448.  
  449.  
  450. CLRC8ROM = $CFFF ;disable Slot card C8 ROM
  451. Reading any location from $Cn00-$CnFF (where n is the Slot) will
  452. enable the $C800-$CFFF area for that card, if the card supports
  453. this feature. Reading $CFFF disables this area for all cards.
  454.  
  455.  
  456. Example: To enable double Hi-res graphics, the following code will
  457. accomplish this:
  458.  
  459. STA SETHIRES
  460. STA SETAN3
  461. STA CLRMIXED
  462. STA CLRTEXT
  463. JSR $C300
  464.  
  465.  
  466. --kburtch@pts.mot.com, David Empson, Rubywand
  467.  
  468. ----------------------------
  469.  
  470.  
  471. 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).
  472.  
  473. FP= "floating point"= Applesoft BASIC   INT= Integer BASIC
  474. Note: Text window and related settings refer to 40-column mode
  475.  
  476. Decimal | Hexadecimal |
  477. -----------------------------------------------------------------------------
  478. 32      | $20         | Text window left-edge (0-39)
  479. 33      | $21         | Text window width (1-40)
  480. 34      | $22         | Text window top-edge (0-23)
  481. 35      | $23         | Text window bottom (1-24)
  482. 36      | $24         | Horizontal cursor-position (0-39)
  483. 37      | $25         | Vertical cursor-position (0-23)
  484. 43      | $2B         | Boot slot * 16 (after boot only)
  485. 44      | $2C         | Lo-res line end-point
  486. 48      | $30         | Lo-res COLOR * 17
  487. 50      | $32         | Text output format [63=INVERSE 255=NORMAL 127=FLASH]
  488. 51      | $33         | Prompt-character (NOTE: POKE 51,0:GOTO LINE # will
  489.         |             | sometimes prevent a false NOT DIRECT COMMAND 
  490.         |             | obtained with GOTO # alone.)
  491. 74-75   | $4A-$4B     | LOMEM address (INT)
  492. 76-77   | $4C-$4D     | HIMEM address (INT)
  493. 78-79   | $4E-$4F     | Random-Number Field
  494. 103-104 | $67-$68     | Start of Applesoft program- normally set to $801
  495.         |             | (2049 decimal) and location $800 is set to $00. 
  496.         |             | NOTE: To load a program above hires page 1 (at
  497.         |             | $4001), POKE 103,1: POKE 104,64: POKE 16384,0  
  498.         |             | and LOAD the program.
  499. 105-106 | $69-$6A     | LOMEM Start of varible space & end of Applesoft prgm
  500. 107-108 | $6B-$6C     | Start of array space  (FP)
  501. 109-110 | $6D-$6E     | End of array space  (FP)
  502. 111-112 | $6F-$70     | Start of string-storage  (FP)
  503. 115-116 | $73-$74     | HIMEM- the highest available Applesoft address +1
  504. 117-118 | $75-$76     | Line# being executed.  (FP)
  505. 119-120 | $77-$78     | Line# where program stopped.  (FP)
  506. 121-122 | $79-$7A     | Address of line executing.  (FP)
  507. 123-124 | $7B-$7C     | Current DATA line#
  508. 125-126 | $7D-$7E     | Next DATA address
  509. 127-128 | $7F-$80     | INPUT or DATA address
  510. 129-130 | $81-$82     | Var.last used. VAR$=CHR$(PEEK(129))+CHR$(PEEK(130))
  511. 131-132 | $83-$84     | Last-Used-Varible Address  (FP)
  512. 175-176 | $AF-$B0     | End of Applesoft Program (Normally=LOMEM)
  513. 202-203 | $CA-$CB     | Start of Program Address (INT)
  514. 204-205 | $CC-CD      | End of Varible Storage (INT)
  515. 214     | $D6         | RUN Flag (POKE 214,255 sets Applesoft run-only.)
  516. 216     | $D8         | ONERR Flag (POKE 216,0 cancels ONERR; en norm errs)
  517. 218-219 | $DA-$DB     | Line# of ONERR Error
  518.  
  519. --Apple II Textfiles ( http://www.textfiles.com/apple/ ).
  520.  
  521. ----------------------------
  522.  
  523.  
  524. Useful CALLs
  525.  
  526. Example: from the BASIC prompt, CALL -151 enters the monitor.
  527.  
  528.  Hex   Dec
  529. $BEF8 48888  ProDOS- recovers from "NO BUFFERS AVAILABLE" error
  530. $D683 54915  Inits Applesoft stack- scraps false "OUT OF MEMORY" error.
  531. $F328 -3288  Repairs Applesoft stack after an ONERR GOTO handles an error.
  532. $F3D4 -3116  HGR2
  533. $F3DE -3106  HGR
  534. $F3F2 -3086  Clear HI-RES screen to Black
  535. $F3F6 -3082  Clear HI-RES screen to recent HCOLOR
  536. $F5CB -2613  Move HI-RES cursor coords to 224-226
  537. $F800 -2048  PLOT a LO-RES POINT (AC:Y-COORD  Y:X-COORD)
  538. $F819 -2023  DRAW a HORIZONTAL LO-RES LINE.
  539. $F828 -2008  DRAW a VERTICAL LO-RES LINE.
  540. $F832 -1998  CLEAR LO-RES SCREEN 1 and set GRAPHICS mode.
  541. $F836 -1994  CLEAR top 20 lines of LO-RES Graphics
  542. $F847 -1977  CALCULATE LO-RES Graphics base ADDRESS.
  543. $F85F -1953  Change LO-RES COLOR to COLOR + 3
  544. $F940 -1728  PRINT contents of X & Y (REG 9 as 4 HEX digits)
  545. $F94C -1716  PRINT X BLANKS (X REG contains # to PRINT)
  546. $FA86 -1402  IRQ HANDLER
  547. $FA92 -1390  BREAK HANDLER
  548. $FAA6 -1370  RE-BOOTS DISK SYSTEM
  549. $FAD7 -1321  to display USER REGISTERS
  550. $FB2F -1233  TEXT- screen init
  551. $FB39 -1223  set SCREEN to TEXT mode
  552. $FB40 -1216  GR- set GRAPHICS mode
  553. $FB4B -1205  set NORMAL WINDOW
  554. $FB60 -1184  Prints the 'Apple ][' at the top of your screen.
  555. $FBC1 -1087  CALCULATE TEXT BASE ADDRESS
  556. $FBE4 -1052  SOUND BELL
  557. $FBF4 -1036  to MOVE CURSOR RIGHT
  558. $FBFD -1027  OUTPUT A-REG as ASCII on TEXT SCREEN 1
  559. $FC10 -1008  to MOVE CURSOR LEFT
  560. $FC1A  -998  to MOVE CURSOR UP
  561. $FC22  -990  PERFORM a VERTICAL TAB to ROW in ACCUMULATOR
  562. $FC2C  -980  PREFORM ESCAPE FUNCTION
  563. $FC42  -958  CLEAR from CURSOR to END of PAGE (ESC -F)
  564. $FC58  -936  HOME & CLEAR SCREEN (Destroys ACCUMULATOR & Y-REG)
  565. $FC62  -926  PERFORM a CARRIAGE RETURN
  566. $FC66  -922  PERFORM a LINE FEED
  567. $FC70  -912  SCOLL UP 1 LINE (Destroys ACCUMULATOR & Y-REG)
  568. $FC95  -875  Clear entire Text line.
  569. $FC9C  -868  CLEAR from CURSOR to END of LINE (ESC-E)
  570. $FDOC  -756  GET KEY from KEYBOARD (Destroys A & Y-REG) WAIT for KEY PRESS.
  571. $FD5A  -678  Wait for RETURN
  572. $FD5C  -676  Sound Bell and wait for RETURN
  573. $FD67  -665  PREFORM CARRIAGE RETURN & GET LINE of TEXT.
  574. $FD6A  -662  GET LINE of TEXT from KEYBOARD (X RETND with # of CHARACTERS)
  575. $FD6F  -657  INPUT which accepts commas & colons. Here is an example:
  576.              PRINT "NAME (LAST, FIRST): ";: CALL-657: N$="": FOR X= 512 TO 719
  577.              : IF PEEK (X) < > 141 THEN N$= N$ + CHR$ (PEEK (X) -128): NEXT X
  578.  
  579. $FD8E  -626  PRINT CARRIAGE RETURN (Destroys ACCUMULATOR & Y-REG)
  580. $FDDA  -550  PRINT CONTENTS of ACCUMULATOR as 2 HEX DIGETS.
  581. $FDE3  -541  PRINT a HEX digit
  582. $FDED  -531  OUTPUT CHARACTER IN ACCUMULATOR. (Destroys A & Y-REG COUNT)
  583. $FDF0  -528  GET MONITOR CHARACTER OUTPUT
  584. $FE2C  -468  PERFORM MEMORY MOVE A1-A2 TO A4. Here is an example:
  585.              10 POKE 60,Source Start address Lo
  586.              20 POKE 61,Source Start address Hi
  587.              30 POKE 62,Source End address Lo
  588.              40 POKE 63,Source End address Hi
  589.              50 POKE 66,Destination address Lo
  590.              60 POKE 67,Destination address Hi
  591.              70 CALL -468
  592.  
  593. $FE80  -384  set INVERSE mode
  594. $FE84  -380  set NORMAL mode
  595. $FEBF  -321  DISPLAY A,S,Y,P,S REG. (CURRENT VALUES)
  596. $FF2D  -211  PRINT "ERR" & SOUNDS BELL (Destroys ACCUMULATOR & Y-REG)
  597. $FF3A  -198  PRINT BELL (Destroys ACCUMULATOR & Y-REG)
  598. $FF59  -167  ENTER MONITOR RESET, TEXT mode, "COLD START"
  599. $FF65  -155  ENTER MONITOR, ring BELL, "WARM START"
  600. $FF69  -151  Go to MONITOR
  601. $FF70  -144  SCAN INPUT BUFFER (ADDRESS $200...)
  602.  
  603. --The Enforcer (on Apple Textfiles at http://www.textfiles.com/apple/ ) and Rubywand
  604.  
  605. ---------------------------- 
  606.   
  607.  
  608. 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.. 
  609.  
  610. 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). 
  611.  
  612. On-line lists of PEEKs & POKEs + Monitor Routines are available at 
  613.  
  614. Apple II Textfiles 
  615. http://www.textfiles.com/apple/
  616.  
  617.  
  618. 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 
  619.   
  620.  
  621. __________________________ 
  622.   
  623.  
  624.  
  625. 005- How can I see and edit what's in a Text file? 
  626.  
  627. A handy utility for quickly viewing Text files under DOS 3.3 or ProDOS is Copy II Plus. 
  628.  
  629. 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. 
  630.  
  631. 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. 
  632.  
  633. 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 
  634.   
  635.  
  636. __________________________ 
  637.   
  638.  
  639.  
  640. 006- How do I save a BASIC program in ASCII text form? 
  641.  
  642. 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. 
  643.  
  644. 1 HOME:PRINT CHR$(4)"OPEN LISTFILE": PRINT CHR$(4)"WRITE LISTFILE": POKE 33,33: LIST 2,: PRINT CHR$(4)"CLOSE": END 
  645.  
  646. 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,. 
  647.  
  648. 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.
  649.  
  650. --David Cross 
  651.  
  652. __________________________ 
  653.   
  654.  
  655.  
  656. 007- Where and how do I get GS System 6.0.1? 
  657.  
  658.      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. 
  659.  
  660. For details with links, go to the main Apple II FAQs at ...
  661.  
  662. Text- ftp://ground.ecn.uiowa.edu/apple2/Faqs/Formatted/Csa21MAIN4.txt
  663. HTML- http://home.swbell.net/rubywand/Csa2APPLICS.html#018 .
  664.  
  665. --Rubywand
  666.  
  667. __________________________ 
  668.   
  669.  
  670.  
  671. 008- Where can I get Applesoft shape table info and programs? 
  672.  
  673.      Go to the Ground archive's Beagle Bros folder at ... 
  674.  
  675. ftp://ground.ecn.uiowa.edu/2/apple2/apple8/Beagle.Oldies/ 
  676.  
  677. and download SHAPE.MECH1.SHK and SHAPE.MECH2.SHK.
  678.  
  679.  
  680.      For information on using shapes in BASIC, go to Ground's Applesoft information folder at ...
  681.  
  682. ftp://ground.ecn.uiowa.edu/2/apple2/MiscInfo/Applesoft/ 
  683.  
  684. and see the file hires.routines .
  685.  
  686.  
  687. --Rubywand 
  688.  
  689. __________________________ 
  690.   
  691.  
  692.  
  693. 009- What Operating System environments does the GS support? 
  694.  
  695. The GS can support several. Some of the more popular OS environments include ... 
  696.  
  697. 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. 
  698.  
  699. 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. 
  700.  
  701. Apple Pascal- This is an early 1980's implementation of UCSD Pascal which can run on 40-column and 80-column Apple II's. 
  702.  
  703. 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
  704.  
  705. 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.
  706. --Rubywand and David Empson 
  707.  
  708. GNO- GNO is a UNIX-like multitasking environment for the Apple IIgs which runs on top of the native operating system, GS/OS. 
  709.  
  710. --Rubywand, David Empson, Devin Reade, Jeffrey Iverson
  711.   
  712.  
  713. __________________________ 
  714.   
  715.  
  716.  
  717. 010- How do I write programs for the Apple Graphics Tablet? 
  718.  
  719.      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.
  720.  
  721.      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:
  722.  
  723.      To detect the interface card, I looped over all slots to check in its firmware for
  724.  
  725. $B0 at location $Cx01 and
  726. $20 at location $Cx09
  727.  
  728. x being the slot number. I never found this 'signature' in any other firmware.
  729.  
  730.      To check for the pen position one has to poll the tablet (again x being the slot number):
  731.  
  732. LDA $CFFF ; switch off all extension ROMS
  733.  
  734. LDA $Cx00 ; switch on the extension ROM of the tablet
  735.  
  736. LDA #$Cx
  737.  
  738. STA $07F8 ; initialize some hidden text screen data area for the tablet firmware
  739.  
  740. JSR $CBB9 ; call well known location ;-) in tablet firmware
  741.  
  742.      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.
  743.  
  744.      After the routine has returned one can get the information:
  745.  
  746. $0280 contains the state of the pen (up or down), I don't recall which bit it is nor if one can distinguish between 'pen up' and 'pen out of reach but key pressed'
  747.  
  748. $0281, $0282 contains the absolute X position of the pen
  749.  
  750. $0283, $0284 contains the absolute Y position of the pen
  751.  
  752.      As far as I can remember the values have about 12 bit resolution (!). Usually I needed screen coordinates (280 x 192), so I dropped the 4 least significant bits and did some additional adjustment. Unfortunately, I don't recall what coordinates will be there in the 'out of reach but key pressed' case.
  753.  
  754. --Oliver Schmidt 
  755.  
  756. __________________________ 
  757.   
  758.  
  759.  
  760. 011- A while ago someone posted about how to read the joystick on 
  761.      a GS in native mode. They said that it was possible to read 
  762.      both paddles at once and therefore get much more accurate 
  763.      readings? 
  764.  
  765. Only the high bit of these locations is valid. When the high bit of either location becomes 0 then the corresponding analog input has timed out. 
  766.  
  767. You will actually get more accurate results by reading them one after the other with the accumulator set to 8 bits wide and the index registers used to hold the counts (16 bits wide). This allows for a much faster loop, giving better resolution. Assuming that this routine is called from full native mode, the following code will do the trick: 
  768.   
  769.  
  770. strobe equ $C070 ; analog input timing reset
  771. pdl0 equ $C064   ; analog input 0
  772. pdl1 equ $C065   ; analog input 1
  773.  
  774. start php        ; save processor status register
  775. phb              ; and data bank register
  776. sep #%100000     ; make accumulator 8 bits wide
  777. lda #0           ; make data bank = 0
  778. pha
  779. plb
  780. ldx #0           ; initialize the counters
  781. txy
  782. lda strobe       ; strobe the timing reset
  783. loop1 inx        ; increment pdl0 count
  784. lda pdl0         ; is high bit = 0?
  785. bmi loop1        ; no, keep checking
  786. lda strobe       ; yes, strobe the timing reset again
  787. loop2 iny        ; increment pdl1 counter
  788. lda pdl1         ; is high bit = 0?
  789. bmi loop2        ; no, keep checking
  790. plb              ; yes, restore data bank
  791. plp              ; and processor status register
  792. rts              ; return to caller (could be RTL)
  793.  
  794.  
  795. Notice that the actual counting loops are only 9 cycles long. This gives the best possible resolution. You will need your counters to be 16 bits wide as the results will easily overflow the capacity of an 8 bit counter. 
  796.  
  797. Using memory locations as counters will only serve to slow the counting loop down. If X and Y contain valid data before entry, you will need to save them off to the stack and pull them back in after interpreting the joystick results. I have used this exact method to read the analog inputs on my Science Toolkit box which connects to the joystick port. 
  798.  
  799. The results have been extremely accurate (much more than would be needed for a game which reads the joystick). --tgeer@pro-gumbo.cts.com (System Administrator) 
  800.  
  801. __________________________ 
  802.   
  803.  
  804.  
  805. 012- How do I write programs which use the mouse? 
  806.  
  807.      The assembly language interface to the mouse firmware is documented in the reference material that was supplied with the IIe AppleMouse card, the IIc Technical Reference Manual, and the IIgs Firmware Reference Manual.
  808.  
  809.      For a 'how to' discussion, see csa2 FAQs Resource file R034MOUSEPRG.TXT at ...
  810.  
  811. ftp://ground.ecn.uiowa.edu/apple2/Faqs/R034MOUSEPRG.TXT
  812. http://home.swbell.net/rubywand/R034MOUSEPRG.TXT . 
  813.  
  814. --David Empson 
  815.  
  816. __________________________ 
  817.  
  818.  
  819.  
  820. 013- Where can I find manuals and other resources for the CP/M
  821.      operating system?
  822.  
  823.      These sites are imho the BEST sites for CP/M related downloads:
  824.  
  825. Dr. Tom's large Apple II CP/M collection on Asimov
  826. See  A2.CPM. ...  stuff at ...
  827. ftp://ftp.apple.asimov.net/pub/apple_II/unsorted/
  828.  
  829. Also, see other CP/M materials on Asimov:
  830. ftp://ftp.apple.asimov.net/pub/apple_II/utility/
  831.  
  832. The CP/M ver 1.4 & 2.x Programmer's Reference Guide on Paul Schlyter's Apple II Stuff:
  833. http://home.tiscali.se/pausch/apple2/dsk.html
  834.  
  835. Other good sources:
  836. http://www.vectorbd.com/bfd/applecpm/
  837. http://www.iso.port.ac.uk/~mike/interests/chistory/documents/cpm-22-manual/
  838. http://www.retroarchive.org/cpm/ .
  839.  
  840.      I've asked Michael Haardt, author of cpmtools, to incorporate some code changes that would allow his package to work on apple II cpm images (both in dos and prodos order).  This package allows one to manipulate cpm disk images - extract, copy, delete, etc, etc from a unix command line. With version 1.6, cpmtools can now handle apple II cpm images.
  841.  
  842. The very latest cpmtools can be downloaded from
  843.  
  844. http://packages.debian.org/stable/otherosfs/cpmtools.html
  845.  
  846. With cpmtools, I've been able to create Apple II images with the generic software obtained from
  847.  
  848. http://www.retroarchive.org/cpm
  849.  
  850. These images I've been able to download to an Apple II via ADT without any problems.  I feel that they would be of use to Apple II CP/M users.
  851.  
  852.  
  853. --Bart, Celt, Raoul Golan, Paul Schlyter, Charles T. Turley
  854.  
  855. __________________________ 
  856.   
  857.  
  858.  
  859. 014- How can I view and enter code using the "monitor"? 
  860.  
  861. Every Apple II has a built in "System Monitor", which lets you play around with memory contents. 
  862.  
  863. To get into it, start in BASIC and type CALL-151. 
  864.  
  865. You then get an * prompt to indicate you are in the monitor. To get back to BASIC at a later point, press Control-C then return (on a line by itself). 
  866.  
  867. The monitor has a lot of commands and the syntax is rather cryptic. Everything is entered and displayed in hexadecimal (base 16). 
  868.  
  869. The simplest commands are a single letter. For example, the "I" command sets the display to inverse, and "N" sets it to normal. 
  870.  
  871. The next level up in complexity are commands which expect a single address parameter. The address must be entered first, followed by the command letter. In some cases, the monitor remembers the last address used, so you can continue where you left off by using the command letter by itself. 
  872.  
  873. An example of this is the "L" command (list) which disassembles 20 instructions. The normal usage is to enter the start address followed by an "L". After you've seen one screenful, type "L" by itself and you get another screenful continuing from the next address. 
  874.  
  875. e.g. 
  876.  
  877. E000L 
  878.  
  879. The first command will list the first page of code for the Applesoft BASIC interpreter, and the second command will list the second page. 
  880.  
  881. You can use multiple commands on the same line, as long as you know what you are doing. If you don't mind pausing and resuming the scrolling output (use Ctrl-S to pause, any key to resume), you can do something like: 
  882.  
  883. E000LLLLLLL 
  884.  
  885. to get several pages of disassembly at once. 
  886.   
  887.  
  888. Moving up another step are commands that accept a range of addresses. The address range is entered, with the start and end address separated by a period (fullstop), and the command letter (if any) goes on the end. 
  889.  
  890. The best example of this is a memory dump, which doesn't have a command letter. If you want to display a range of bytes as a hex dump, use something like this: 
  891.  
  892. E000.E07F 
  893.  
  894. The monitor displays eight bytes per line, with the address at the beginning of each line. If you don't start on a multiple of eight, then the first line will have less than eight bytes and subsequent lines will be aligned on eight byte boundaries. 
  895.  
  896. There are variations on the memory dump that can be used for special cases: 
  897.  
  898. 1. You can press return on a blank line to display the next eight bytes. 
  899. 2. If you enter an address and press return, one location is displayed. 
  900. 3. You can continue from the end of the previous dump to a specified address by entering a dot followed by the end address. 
  901.  
  902. You can also display scattered locations by entering them as separate commands. For example: 
  903.  
  904. E000 E003 E006 
  905.  
  906. will display the three specified locations, one per line. 
  907.   
  908. The third layer of command complexity are the commands which expect a destination address and a source address range. The destination address goes first, then a less-than sign, then the source range (with a dot in the middle), and finally the command letter. The main example of this is a memory move ("M"): 
  909.  
  910. 4000<6000.7FFFM 
  911.  
  912. This will move 8192 (2000 hex) bytes from locations 6000 through 7FFF down to 4000. 
  913.  
  914. If your source and destination ranges overlap, the move will work correctly if you are moving data to a lower memory location, but if moving to a higher location you will get a repeating pattern of the data from the start of the source range. 
  915.   
  916.  
  917. There is one major command that breaks the rules above: the "set memory" command. The general syntax for this is the start address followed by a colon, then a space-separated list of bytes to be entered into memory. If you enter more than two digits for the data bytes, only the low order two digits are used. 
  918.  
  919. If you are entering a lot of data, you can continue the command on subsequent lines by starting the command with a colon (no address). 
  920.  
  921. The rest of the command line after the colon is regarded as part of the data to be entered, unless the monitor encounters a single letter command first. 
  922.  
  923. For example, the following single line command will enter a short machine code program and disassemble it. The "N" command (normal) is used as a dummy command to force the data entry to terminate. 
  924.  
  925. 300:20 58 FC A9 C8 20 ED FD A9 E9 20 ED FD 20 8E FD 60 N 300L 
  926.  
  927.  
  928. Having got all that out of the way, here are the major monitor commands, each given in example form. 
  929.  
  930. <return>          Display next line of hex dump
  931. 1000              Hex dump one location
  932. 1000.101F         Hex dump a range of locations
  933. .102F             Continue hex dump to specified address
  934. 1000:1 2 3 50     Set memory
  935. :51 52 53         Continue set memory
  936. 300G              Go - call subroutine at specified location
  937. G                 Go again - call same address as last time
  938. I                 Inverse
  939. 300L              List - disassemble 20 lines
  940. L                 List again - continue disassembly
  941. 1000<2000.207FM   Move - copy range to destination address
  942. N                 Normal
  943. 1000<2000.207FV   Verify - compare range to destination address
  944.  
  945.  
  946. There are also several commands that use control characters: 
  947.  
  948. Ctrl-B Cold start BASIC (avoid this) 
  949. Ctrl-C Warm start BASIC 
  950. Ctrl-E Display the saved CPU registers 
  951. Ctrl-K Set input to specified slot (preceded by slot number) 
  952. Ctrl-P Set output to specified slot (preceded by slot number) 
  953. Ctrl-Y User command 
  954.  
  955. The Ctrl-E command also lets you set the saved CPU registers, which will be used on a subsequent G (go) command. Type Ctrl-E then a colon, followed by the data to place into the A, X and Y registers. 
  956.  
  957. The Ctrl-K and Ctrl-P commands should be avoided if you are running under DOS 3.3 or ProDOS, because they may cause DOS to be disconnected from the I/O. Use PR#n or IN#n instead. 
  958.  
  959. Ctrl-Y is an "escape hatch", which allows third-party code to hook into the monitor for this one command. 
  960.  
  961. On the Apple IIgs, IIc (with UniDisk ROM or later), and enhanced IIe there is also a mini-assembler which can be accessed from the monitor by typing an exclamation mark as a monitor command. While in the mini-assembler you enter lines of the form Address:Instruction, or to enter instructions in sequence, type a space then the instruction. (You must specify the address for the first instruction, or you could be writing anywhere.) Press <return> on a blank line to get back to the monitor. 
  962.  
  963. e.g. starting in the monitor, type in the following: 
  964.  
  965. 1000:JSR FC58 
  966. LDA #C8 
  967. JSR FDED 
  968. LDA #E9 
  969. JSR FDED 
  970. JSR FD8E 
  971. RTS 
  972. <return> 
  973. 1000L 
  974. 1000G 
  975.  
  976. This is the same program I gave above as an example of the set memory command, loaded at a different location. 
  977.  
  978. --David Empson 
  979.  
  980. __________________________ 
  981.   
  982.  
  983.  
  984. 015- What parts of Apple II memory should a user be careful about
  985.      modifying when using the monitor? 
  986.  
  987. It is important to keep in mind that you can do all sorts of nasty things to the computer if you play around in the monitor and don't know where things are located in memory. 
  988.  
  989. The safest bet if you want to have a play would be to start the computer with no disk in the drive, then get into the monitor. 
  990.  
  991. Don't play around with the following memory areas at all (unless you know exactly what you are doing): 
  992.  
  993. 0020-004F Zero page memory area used by the monitor 
  994. 0100-01FF Stack 
  995. 0200-02FF Input buffer 
  996. 03D0-03FF System vectors 
  997. C000-C0FF I/O space. Don't even read memory in this area 
  998.           unless you know what you are doing. 
  999. C100-C7FF I/O firmware (usually ROM on cards in slots, or 
  1000.           emultated slots). Some I/O cards may have I/O 
  1001.           ports in this area (but not for the IIc). 
  1002. C800-CFFF Bank-switched area used by I/O cards. It is safe 
  1003.           to read this area in the IIc, but it has to be 
  1004.           handled carefully in other machines. 
  1005.   
  1006.  
  1007. The following areas must be handled carefully to avoid problems: 
  1008.  
  1009. 0050-00FF Zero page memory area used by Applesoft BASIC 
  1010. 0400-07FF Text screen and "screen holes", which contain 
  1011.           system data 
  1012. D000-FFFF ROM and bank-switched RAM ("language card"). 
  1013.           Don't write anything into this area, especially 
  1014.           if you are running under ProDOS. 
  1015.   
  1016.  
  1017. Other memory areas that you may need to be aware of: 
  1018.  
  1019. 0800-???? Applesoft BASIC programs normally go here, 
  1020.           followed by variables 
  1021. 2000-3FFF Hires graphics buffer for page 1 
  1022. 4000-5FFF Hires graphics buffer for page 2 
  1023. 9600-BFFF Normally used by DOS 3.3 or ProDOS 
  1024. ????-95FF Normally used for strings in Applesoft BASIC 
  1025.  
  1026. The hires graphics buffers are only an issue if you need to use them. Under DOS 3.3 or ProDOS, the upper memory limit (9600) may change depending on the use of the MAXFILES command under DOS or the number of open files under ProDOS. 
  1027.   
  1028.  
  1029. This leaves you with the following areas that you can usually play with to your heart's content. There are _some_ exceptions, but I've covered enough for one article. 
  1030.  
  1031. 0000-001F This isn't entirely free, but is usually OK. 
  1032. 0300-03CF Often used for small machine code programs. 
  1033. 1000(ish)-7FFF(ish) 
  1034.  
  1035. The last area varies wildly depending on the size of any BASIC program and its variables. 
  1036.  
  1037. --David Empson 
  1038.   
  1039.  
  1040. __________________________ 
  1041.   
  1042.  
  1043.  
  1044. 016- Can I do multi-tasking on a IIgs? or What is GNO/ME? 
  1045.   
  1046. GNO/ME is a programming shell (a command line environment) for the Apple IIgs.  Designed as a replacement for the ORCA Shell, GNO/ME works in a manner similar to the Unix operating system, providing preemptive multitasking of multiple text programs, as well as many Unix commands and library functions. 
  1047.  
  1048. For more information about GNO/ME, see 
  1049.  
  1050. GNO/ME USENET newsgroup (comp.sys.apple2.gno) and FAQs at 
  1051. ftp://rtfm.mit.edu/pub/usenet/news.answers/apple2/GNO-faq 
  1052.  
  1053. Trenco archive 
  1054. http://trenco.myrias.com:80/%7Egno/ 
  1055.  
  1056. --Bryan Ogawa
  1057.