@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@P!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `1  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D1:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D1:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu  } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED736 FREE SECTORS COPYING---D1:DIRECK.COMl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 138ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uDISPLAY LIST EXAMPLESWhen CIO opens a channel to the screen, it sets up the proper display list for the ANTIC chip. The foT}llowing are the things CIO must handle when setting up the display list.Display list duties as used by CIO 11display a U}certain number of blank lines at the top of the screen.Load the memory scan counter with the address of the display data buV}ffer.Display the required number of lines in the required ANTIC mode.Set up a jump instruction if the display list crosseW}s a 1K memory boundary.Set up a reload-memory-scan-counter instruction if the display data buffer crosses a 4K memory boundX}ary. 10CIO assumes that the display data buffer will butt against an 8K memory boundary. If a program causes the display bY}uffer to cross a 4K boundary (by changing RAMTOP [$006A (106)] to point to an address which is not at an 8K boundary) the scrZ}een will be scrambled. This is not usually a problem if the graphics mode doesn't require a large block of memory.SAMPLE D[}ISPLAY LISTBelow is an example of a Graphics 0 display list as CIO would set it up.Display list for Graphics 0assumi\}ng BASIC starts at $A000address instruction explanation Dec. Hex.$9C20 112 $70 \ 112 ]}$70 >---- 24 blank lines (8 each command) 112 $70 / 66 $42 ----- load memory scan counter with $9C^}24 64 $40 \__ next two bytes and display one line 156 $9C / \ of ANTIC 2 characters 2 $0_}2 -\ | 2 $02 | \- address of display data buffer 2 $02 | 2 $02 \--- 2nd ANTIC 2 `}instruction - --- 2 $02 ----- 24th ANTIC 2 instruction 65 $41 \ a} 32 $20 >---- jump back to start of list 156 $9C /$9C40 ??? ?? first byte of display data bufb}fer --- --$9FFF ??? ?? last byte of buffer$A000 start of ROMA display lic}st for a higher resolution graphics mode would require more instructions and might cross a 1K boundary. It would then includd}e a jump instruction to cross the boundary.MULTIPLE DISPLAYSIt is possible to set up multiple displays and use one at a te}ime. The technique of changing from one display to another is called page flipping. Below is the simplest way to set up twof} displays.setting up two displays 11Call a graphics mode through CIO or by using a BASIC GRAPHICS command.Store the dg}isplay list pointers, SDLSTL and SDLSTH, and the CIO screen pointer, SAVMSC [$0058,2 (88)].Move the start-of-ROM pointer, Rh}AMTOP [$006A (106)] to below the current display list. RAMTOP is a one byte pointer so it changes in increments of one page i}(256 bytes).make another graphics call as in the first step.store the new display list pointer and CIO screen pointer. 1j}0This will set up two displays, each with it's own display list. If the displays are in the same graphics mode, or you willk} not make any changes in the displays with CIO commands, (PLOT, PRINT, etc.) you can flip between the two simply by changing l}the display list pointer.If the screens are in the same graphics mode and you want to change which one to do CIO commands tm}o, Change the CIO screen pointer, SAVMSC [$0058,2 (88)]. This way, you can display one screen while drawing on the other.In}f you want to do CIO commands to screens of different graphics modes, you will have the move RAMTOP and do a graphics call too} change screens.If your manipulation of RAMTOP causes the display data buffer to cross a 4K boundary, the screen may be scrp}ambled.DISPLAY LIST INTERRUPTSDLIs are not used by the operating system. However, other programs can initiate and use thq}em. Use the following steps to set up display list interrupts.Setting up DLIs 11Set bit 7 of the display list instructr}ion for the line before you want the interrupt to occur. (The interrupt routine should set WSYNC and wait for the next line s}to execute.)Set bit 7 of NMIEN [$D40E (54286)] to enable DLIs.Set the DLI routine vector, VDSLST [$0200,2 (512)] to pointt} to your machine language DLI routine. 10Your DLI routine should set WSYNC [$D40A (54282)]. STA WSYNC will do. THis will u}cause the 6502 to wait for the next horizontal sync. This will keep the DLI routine from changing something in the middle ofv} a T.V. line.The DLI routine must end with an RTI instruction.SCROLLINGScrolling is controlled by a combination of scrow}ll position registers, and changing the memory scan counter. Basically, course scrolling is done by reloading the memory scax}n counter and fine scrolling is done by changing the scroll registers.VERTICAL SCROLLINGVertical scrolling is very simpley}. Follow the steps below to set up vertical scrolling of graphics.Steps to use vertical scrolling 11Set bit 4 of the fz}irst byte of the display list instruction for each line to be scrolled.Put the number of T.V. lines to offset the graphics {}vertically in the vertical scroll register, VSCROL [$D405 (54277)] 10The vertical scroll register can offset the graphics u|}pward by 0 - 7 T.V. lines in the 24 line graphics modes (ANTIC modes 2 and 4). In 12 line graphics modes (ANTIC modes 5 and }}7) it can vertically offset the graphics by 0 - 15 T.V. lines. To offset the graphics an 8th (or 16th) line, the scroll regi~}ster is reset to 0 and the memory scan counter is reloaded with the address of the next line of graphics in the display data }buffer. If the entire screen is being scrolled, the load-memory-scan-counter command (near the beginning of the display list}) is changed to point to the address of the second line of graphics.HORIZONTAL SCROLLINGHorizontal scrolling works much l}ike vertical scrolling. It is enabled by setting bit 5 of the instruction for each line to be scrolled. The horizontal scro}ll register, HSCROL [$D404 (54276)], sets the offset. The small difference is that graphics are moved twice as far per chang}e (two graphics 8 pixels instead of one). Also, when HSCROL = 0 the graphics are offset beyond the left edge of the screen b}y 16 color clocks (32 Graphics 8 pixels). When HSCROL = 15, the graphics line is shifted one color clock (2 Graphics 8 pixel}s) to the left of the screen.The big difference is that the memory scan counter gets messed up. This means that you must u}se a reload-memory-scan-counter command for each line of graphics. This is a major modification of the display list. It wil}l require you to move and build the list yourself.The advantage of this is that you can have a scrolling window in a large }graphics map. The technique is to move the window by reloading the memory scan counter, then fine scrolling to the invisible} bytes beyond the edges of the screen. 575useful data base variables and OS equatesSAVMSC $0058,2 (88): pointer} to current screen for CIO commandsRAMTOP $006A (106): start-of-ROM pointer (MSB only)VDSLST $0200,2 (512): DLI} vectorRAMSIZ $02E4 (740): permanent start-of-ROM pointer (MSB only)DLISTL $D402 (54274}): display list pointer low byteDLISTH $D403 (54275): " high byteHSCROL $D404 (54276): horizontal scroll r}egisterVSCROL $D405 (54277): vertical scroll registerNMIEN $D40E (54286): NMI enable (DLIs)Shadow registers}SDLSTL $0230 (560): DLISTLSDLSTH $0231 (561): DLISTH0E (54286): NMI enable (DLIs)Shadow registersF12 4 1 5 0 10 70 2 12 13227E27H16-@CHAPTER 16PLAYER AND MISSILE (PM) GRAPHICSPlayers and missiles (c }alled sprites on some computers) are movable objects which are independent of the normal graphics.Player and missile graphi }cs are fairly straight forward. Once the computer is set-up for PM graphics, five 8-pixel-wide columns can be displayed on t }he screen. The horizontal resolution (width of each pixel) and the vertical resolution (number of scan lines per pixel) are }variable. The horizontal position of each column is determined by it's horizontal position register. Each column is simply }a representation of a bit map in a certain block of memory. If you want to draw an object on the screen, you simply put a bi }t map representing it in the proper memory block. The vertical position of an object is determined by the location of it's b }it map in memory. For example, if you want to draw a happy face in the middle of the screen, you put a happy face bit map in } the middle of one of the memory blocks controlling one of the columns.One column (player) displayed on the screen } ---------- first byte of a block | | | | ------------------------------ | | } | | | | | | | | | | | | | } | | | | | | | | | | | ++++ | visible | | }| + + | | | |+ + + +| | | |+ +| area | | |++ ++| } | | |+ ++++ +|--object | | | + + | bit map | | | ++++ | | | } | | | | | | | | | | | ------------------- }----------- | | | | ---------- last byte of a block Horizontal positions }$00 $30 $CE $FF(0) (48) (206) (255) | | | } | | Left edge right edge | | | Far left } far rightTo move the happy face vertically you would move the entire bit map in memory. To move the happy face horizonta }lly you change the number in the horizontal position register for the proper player.One of the players can be (and often is }) split into four columns of two pixels wide each. These columns are then called missiles. In this case, each missile has i }t's own horizontal position register.SETTING UP PM GRAPHICSPM graphics are enabled by the direct memory access control r }egister, DMACTL [$D400 (54272)]. The program using PM graphics will usually use the shadow register, SDMCTL [$022F (559)]. }DMACTL (SDMCTL) 7 6 5 4 3 2 1 0 ----------------- |0|0| control | ----------------- bits 5 1 }= enable display list reading 4 0 = one line player resolution 1 = two line player resolution 3 1 = } enable four players 2 1 = enable fifth player or missiles 1 & 0 00 = no background 01 = narrow backgroun }d (128 color clocks, 1 color clock equals 2 GRAPHICS 8 pixels) 10 = normal background (160 color clock }s) 11 = wide background (192 color clocks)Normally, bits 5 and 1 are set to 1. Bits 4, 3 and 2 are used to enable } players and/or missiles accordingly.Once DMACTL is set up for the type of PM graphics to enable, the graphics control regi }ster, GRACTL [$D01D (53277)], is used to actually enable the PM graphics.GRACTL 7 6 5 4 3 2 1 0 ---------------- }- |not used | | | | ----------------- Bits 2 1 = latch paddle triggers 1 1 = enable four players } 0 1 = enable fifth player or missilesIf only DMACTL is set up, the ANTIC chip will access memory for PM graphics b }ut will not display them.Next, the memory area used for the PM bit maps must be set. This block must start on a 2K (8 page }) boundary if single line resolution is used and a 1K (4 page) boundary for two line resolution.The page number where the b }it map starts is stored in the PM base register, PMBASE [$D407 (54279)]. For one line resolution this number will be a multi }ple of 8. For two line resolution it will be a multiple of 4. PMBASE holds the MSB of the address of the PM bit map. The L }SB will always be 0 so it need not be specified.The PM bit maps 2 line resolution 128 bytes (1/2 page) per } player ----------------- start + 0 | |\ +---------------+ 1-1/2 page | | }(384 bytes) +===============+ unused | |/ +---------------+ +$180 (384) |M3 |M2 |M1 |M0 | }fifth player or missiles +===============+ +$200 (512) | player 0 map | +---------------+ +$280 (640) }| player 1 map | +===============+ +$300 (768) | player 2 map | +---------------+ +$380 (896) | playe }r 3 map | +===============+ +$400 (1024) 1 line resolution 256 bytes (1 page) per player ------ }----------- start + 0 | |\ + + | | +===============+ | } | 768 bytes + + | | (3 pages) +===============| | } | unused + + | |/ +===============+ +$300 (768) | | | | | fifth p }layer +M3 |M2 |M1 |M0 | or missiles | | | | | +===============+ +$400 (1024) | | } + player 0 map + | | +===============+ +$500 (1280) | | + player 1 map } + | | +===============+ +$600 (1536) | | + player 2 map + | } | +===============+ +$700 (1792) | | + player 3 map + | | +====== }=========+ +$800 (2048)D:CHAP16.1792) | | + player 3 map + | | +====== 'Example of using P/M graphics in BASIC 110 REM ---LABEL REGISTERS ETC10 LINES=220 VERT=12022 IF LINES=2 THEN VERT=VERT/}230 PM0=102432 IF LINES=2 THEN PM0=PM0/240 HORIZ=12050 PCOLR0=70460 SDMCTL=55970 SIZEP0=5325680 HPOSP0=5324890 SDMCTL}=559100 PMRAM=PEEK(106)-16110 PMBASE=54279120 GRACTL=53277130 PMSTART=PMRAM*256+PM0200 REM ---SET REGISTERS210 POKE SDM}CTL,62212 IF LINES=2 THEN POKE SDMCTL,46220 POKE SIZEP0,1230 POKE HPOSP0,HORIZ240 POKE PCOLR0,88250 POKE PMBASE,PMRAM26}0 POKE GRACTL,3300 REM ---DRAW PLAYER310 POKE PMSTART+VERT,60320 POKE PMSTART+VERT+1,66330 POKE PMSTART+VERT+2,165340 PO}KE PMSTART+VERT+3,129350 POKE PMSTART+VERT+4,195360 POKE PMSTART+VERT+5,189370 POKE PMSTART+VERT+6,66380 POKE PMSTART+VER}T+7,60 10The above program will draw a happy face in about the middle of the screen using player 0. To move the player hor}izontally, poke a different number into HPOSP0. To draw the player in a different vertical position, change VERT. To use a }different player or missile, use the memory maps above to find the starting address of the player you want to use. For examp}le, to use player 1 change line 40 to PM1=1280. Then change line 130 to PMSTART=PMRAM*256+PM1. The variable "LINES" determi}nes the vertical resolution. The number poked into SIZEP0 determines the width.P/M PRIORITYThe priorities of players, m}issiles and non-P/M graphics can be controlled by the PRIOR register [$D10B (53275)] and its shadow register, GPRIOR [$26F (6}23)]. Objects with higher priority will appear to move in front of lower priority objects. The format of PRIOR is as follow}s:PRIOR bit assignment 7 6 5 4 3 2 1 0 ----------------- | | | | | | | | | ----------------- 1} 6 3 1 8 4 2 1 2 4 2 6 8Bits 7-6 Control the GTIA graphics modes. 00 = normal 01 = mode} 9 10 = mode 10 11 = mode 11 5 1 = multiple color player enable. Permits overlappin}g of players 0 and 1 or 2 and 3 with a third color in the overlapped region. 4 1 = fifth} player enable. All missiles will assume the color controlled by COLOR3 [$2C7 (711)]. missiles }are positioned together to make the fifth player. 3-0 Controls the priorities of players, }missiles 20and other graphics. Objects with higher priority will appear to move in front of those with lower priority.Th}e following chart may need some clarification. In the chart: 22PM0 = player 0 and missile 0 C0 = COLOR0, plotted graphic}s controlled by color register 0 in the SETCOLOR command. P5 = all four missiles when combined into one p}layer.BAK = the background, known as COLOR4 or color register 4 in the SETCOLOR command. 10Etc.Bits 0-3 of PRIO}R and P/M prioritiesBit 3=1 2=1 1=1 0=1 C0 C0 PM0 PM0 highest C1 C1 PM1 PM1 }priority PM0 C2 C0 PM2 PM1 C3+P5 C1 PM3 PM2 PM0 C2 C0 PM3 PM1 C3+P5 } C1 C2 PM2 PM2 C2 C3+P5 PM3 PM3 C3+P5 lowest BAK BAK BAK BAK priorityOnly one p}riority bit can be set at a time. If more than one priority bit is 1, overlapping areas of conflicting priorities will turn }black.COLLISIONSEach player or missile has a register showing overlap (collisions) with other objects. Each player has t}wo registers assigned to it; one to detect collisions with other players and one to detect collisions with plotted objects. }Likewise each missile has two registers; one to detect collisions with players and one to detect collisions with plotted obje}cts. Careful use of these 16 registers can detect any type of collision.Each register uses only the lower 4 bits. The bi}ts which equal 1 tell what the associated object has collided with. For example, to detect collisions of player 1 to other p}layers examine P1PL [$D00D (53261)].P1PL, player 1 to player collisions 7 6 5 4 3 2 1 0 -----------------P1PL} |unused | | | | | ----------------- 8 4 2 1 3 = 1 collision with player 3 2 = 1 collision wi}th player 2 1 = 1 invalid 0 = 1 collision with player 0Etc.When looking for collisions with plotted objects,} the bit number tells what color register is assigned to the object the collision was with. For example, to detect collision}s between player 1 and plotted objects (officially called the play field), P1PF [$D005 (53253)] is used.P1PF, player 1 to }ploted object collisions 7 6 5 4 3 2 1 0 -----------------P1PF |unused | | | | | ----------------- } 8 4 2 1 3 = 1 collision with COLOR3 2 = 1 " COLOR2 1 = 1 " COLOR1 0 =} 1 " COLOR0Etc.Once a collision occurs it remains indicated in its collision register. To clear out all c}ollision registers, write anything to HITCLR [$D01E (53278)]. STA HITCLR or POKE 53278,0 will do.Useful database variabl}es and OS equates 575HPOSP0 $D000 (53248): write: horizontal position of player 0M0PF " " : read: mis}sile 0 to plotted graphics collisionsHPOSP1 $D001 (53249): write: horizontal position of playe}r 1M1PF " " : read: missile 1 to plotted graphics collisionsHPOSP2 $D002 (5325}0): write: horizontal position of player 2M2PF " " : read: missile 2 to plotted graphics } collisionsHPOSP3 $D003 (53251): write: horizontal position of player 3M3PF " " : read: missile 3 t}o plotted graphics collisionsHPOSM0 $D004 (53252): write: horizontal position of missile 0P0P}F " " : read: Player 0 to plotted graphics collisionsHPOSM1 $D005 (53253): write: horizontal position of }missile 1P1PF " " : read: Player 1 to plotted graphics collisionsHPOSM2 $D006 (53254): write: horizontal} position of missile 2P2PF " " : read: Player 2 to plotted graphics collisionsHPOSM3 $D007 (53255): writ}e: horizontal position of missile 3P3PF " " : read: Player 3 to plotted graphics collisionsSIZEP0 $D008 }(53256): write: size of player 0M0PL " " : read: missile 0 to player collisionsSIZEP1 $D009 (53257): wri}te: size of player 1M1PL " " : read: missile 1 to player collisionsSIZEP2 $D00A (53258): write: size of }player 2M2PL " " : read: missile 2 to player collisionsSIZEP3 $D00B (53259): write: size of player 3M3P}L " " : read: missile 3 to player collisionsSIZEM $D00C (53260): write: widths for all missilesP0PL } " " : read: player 0 to other player collisionsGRAFP0 $D00D (53261): write: player 0 graphics (used by OS)}P1PL " " : read: player 1 to other player collisionsGRAPF1 $D00E (53262): write: player 1 graphicsP2PL } " " : read: player 2 to other player collisionsGRAFP2 $D00F (53263): write: player 2 graphicsP3PL " } " : read: player 3 to other player collisionsGRAPF3 $D010 (53264): write: player 3 graphicsGRAFM $D011 }(53265): write: missile graphics (used by OS)COLPM0 $D012 (53266): color for player/missile 0COLPM1 $D013 (53267): } 1COLPM2 $D014 (53268): 2COLPM3 $D015 (53269): } 3COLPF0 $D016 (53270): color register 0COLPF1 $D017 (53271): 1COLPF2 $D018 (53272): } 2COLPF3 $D019 (53273): 3COLBK $D01A (53274): background color (register 4)PRIOR $D01B } (53275): priority select, GTIA modesGRACTL $D01D (53277): graphics controlHITCLR $D01E (53278): writing anything} clears all collision bitsDMACTL $D400 (54272): direct memory access (DMA) controlPMBASE $D407 (54279): start of P/}M memoryShadow registersSDMCTL $022F (559): DMACTLGPRIOR $026F (623): PRIORPCOLR0 $02C0 (704): COLPM}0PCOLR1 $02C1 (705): COLPM1PCOLR2 $02C2 (706): COLPM2PCOLR3 $02C3 (707): COLPM3COLOR0 $02C4 (708)}: COLPF0COLOR1 $02C5 (709): COLPF1COLOR2 $02C6 (710): COLPF2COLOR3 $02C7 (711): COLPF3COLOR4 $02C8 } (712): COLBK $02C5 (709): COLPF1COLOR2 $02C6 (710): COLPF2COLOR3 $02C7 (711): COLPF3COLOR4 $02C8 12 4 1 5 0 10 70 2 12 13227E27H17-@CHAPTER 17SOUNDGenerating sound can be very simple. For simple s}ounds there are four audio channels, each controlled by two control registers.GENERATING SOUNDSTo generate a sound in cha}nnel 1, put the frequency and volume codes into the frequency and control registers. The frequency register for channel 1, A }UDF1 [$D200 (53760)] can have any number from 0 to $FF (255). 0 causes the highest frequency; 255 causes the lowest. The vo }lume/noise (control) register for channel 1, AUDC1 [$D201 (53761)] is more complicated.Audio channel control (volume/noise }) register 11 7 6 5 4 3 2 1 0 -----------------AUDCx | noise | volume| ----------------- 1 6 } 3 1 8 4 2 1 2 4 2 6 8 10The noise bits can have various values. The best way to learn to use them is by e }xperimentation. The technical details of the polynomial counters which generate the noise has little bearing on what is hear}d. The two special values of interest are: $1 (volume+16 in decimal), which causes a DC voltage proportional to the volume b}its and; $A (volume+160), which causes a pure tone (square wave). The volume bits select the relative volume, 0=off. Theref}ore, the number, $A8 (168 [8+160]) in AUDC1, will cause the frequency selected by AUDF1 to be a pure tone of medium volume.}27GIn BASIC the dirty work is done fore you. The SOUND command will do all the calculations for you. The Sound command for}mat is shown below.The BASIC sound command format SOUND channel,frequency,noise,volumeThe channel numbers is 0 to 3 i}nstead of 1 to 4. The frequency, 0 to 255, is put into the frequency register. The noise is put into the high bits of the ch}annel control register with volume in the low bits. Therefore... SOUND 0,125,10,8will produce a pure tone of medium freq}uency and volume in channel 0 (called channel 1 in assembly language).ADVANCED SOUND27HThe Audio Control register, AUDCT}L [$D208 (53768)], (not to be confused with the four audio channel control registers), adds more control for assembly languag}e programmers. Again, to go into technical details will be less productive than experimentation.The audio control registe}r. (AUDCTL) 7 6 5 4 3 2 1 0 ----------------- AUDCTL | | | | | | | | | ----------------- }1 6 3 1 8 4 2 1 2 4 2 6 8 7 0 = 17 bit polynomial noise 1 = 9 bit below polynomial noi}se 6 0 = clock channel 1 with 64 KHz 1 = clock channel 1 with 1.79 MHz 5 0 = clock channel 3 wit}h 64 KHz 1 = clock channel 3 with 1.79 MHz 4 0 = clock channel 2 with 64 KHz 1 = clock channel} 2 with channel 1 3 0 = clock channel 4 with 64 KHz 1 = clock channel 4 with channel 3 2 1 = ins}ert logical high-pass filter in channel 1, clocked by channel 3 1 1 = insert logical high-pass filte}r in channel 2, clocked by channel 4 0 0 = 64 KHz main clock 1 = 16 KHz main clock 11Al}l bits of AUDCTL are normally zero. The BASIC sound command causes it to be reset to zero. 10By clocking one channel with  }another, the range can be increased. This essentially allows two channels with twice the range as each of the four normal ch!}annels. This is called 16 bit sound.To calculate exact frequencies, use the following formulas. The exact clock frequenci"}es are also given if more accuracy is needed. The clock frequencies are acquired by dividing the signal from the TV color-bu#}rst crystal. This crystal has a frequency of 3.579545 MHz.Clock frequencies: 1.7897725 MHz (color-burst/2) $} 63.920446 Khz (color-burst/56) 15.699759 KHz (color-burst/228)Formulas: For 1.79 MHz %} clock clock f = ------------ f = ------------ 2(AUDFn + 7) &} 2(AUDFn + 4) 16 bit 8 bit AUDFn is the number in the audio frequency register. For'} 16 KHz and 64 KHz clock f = ------------ 2(AUDFn + 1)AUDIO TIMER INTERRUPTSW(}hen the audio timers count down to zero they generate IRQ interrupts (if enabled). The timers can be reset by writing any nu)}mber to STIMER [D209 (53769)].THE CONSOLE SPEAKERThe console speaker is where key clicks and the cassette signals come f*}rom. On XL and XE models this speaker is heard through the TV speaker. It is operated by toggling bit 3 of CONSOL [$D01F (5+}3279). This bit always reads 0 but it is actually set to 1 during vertical blank.Useful data base variables and OS equat,}esCONSOL $D01F (53279): bit 3 controls console speakerAUDF1 $D200 (53760): Audio frequency 1AUDC1 $D-}201 (53761): audio control 1AUDF2 $D202 (53762):AUDC2 $D203 (53763):AUDF3 $D204 (53.}764):AUDC3 $D205 (53765):AUDF4 $D206 (53766):AUDC4 $D207 (53767):AUDCTL $D208 (537/}68): general audio controlSTIMER $D209 (53769): audio timer reset207 (53767):AUDCTL $D208 (537M12 4 1 5 0 10 70 2 12 13227E27H18-@CHAPTER 18THE JOYSTICK PORTSThe joystick ports are the I/O ports 1}of the PIA chip. This means that they are bidirectional, capable of output as well as input. The joystick ports are usually2} set up for input. To read them, simply read the port registers. PORTA [$D300 (53016)] will read joystick ports 1 and 2. P3}ORTB [$D301 (54017)] will read joystick ports 3 and 4. Joystick ports 3 and 4 are used for memory control on the XL/XE model4}s and don't have external connectors.Each bit of each port can be configured independently for input or output. To reconfi5}gure a port, the port control registers, PACTL and PBCTL [$D302 (54018) and $D303 (54019)], are used. The port control regis6}ters also control some lines on the serial I/O connector.The port control registers 11 7 6 5 4 3 2 1 0PACTL 7} -----------------or |n 0 1 1 n n 0 n|PBCTL ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8} 8 bits PACTL 7 Peripheral A interrupt status. Set by peripheral interrup9}t; reset by reading PORTA. 3 Cassette motor control (0 = on: 1 = off). 2 0 = PORTA is now port A direction co:}ntrol. Writing to PORTA will now set bits for input or output. 0 sets bit for input; 1 sets ;}bit for output. 1 = PORTA operational 1 1 = peripheral A interrupt enabled. PBCTL <} 7 Peripheral B interrupt status. Set by peripheral interrupt; reset by reading PORTB. 3 Serial conn=}ector command line. 2 0 = PORTB is now port B direction control. Writing to PORTB will now set bits for in>}put or output. 0 sets bit for input; 1 sets bit for output. 1 = PORTB operational 1 ?}1 = peripheral B interrupt enabled.The electronic configuration of the controller ports is as follows. ----------- -@}---------- \0 1 2 3 R/ \4 5 6 7 R/ \t + - L/ \t + - L/ ------- ------- 110 through 7 A}are the binary data bits for port A or port B.+ and - are +5 volts and ground respectively.R and L are the left and rightB} game paddles.t is the joystick trigger line. 10The data bits in the joystick ports are used as follows for the joysticksC} and game paddles.The joysticks and the port registers 11 7 6 5 4 3 2 1 0 -----------------PORTA D} |U|D|L|R|U|D|L|R| ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8paddle | | E} | |triggers 3 2 1 0PORTB -----------------(400/800 |U|D|L|R|U|D|L|R|only) -----------------paddle F} | | | |triggers 7 6 5 4 U = up D = down L = left R = right 10The joysticks may be rG}ead either directly from the port registers or from the joystick shadow registers. During vertical blank, the data in the poH}rt registers is separated and put into the shadow registers. These registers are, STICK0 [$0278 (632)], STICK1 [$0279 (633)]I}, STICK2 [$027A (634)] and STICK3 [$027B (635)]. The triggers may be read from the joystick trigger registers, TRIG0 - TRIG3J} [$D010 - $D013 (53264 - 53267)]. These register have shadow registers, STRIG0 - STRIG3 [$0284 - 0287 (644 -647)]. If theseK} registers read zero the associated triggers are pressed. The paddle triggers may be read from their shadow registers also. L}They are, PTRIG0 - PTRIG 7, [$027C - $0283 (236 - 643)].THE GAME PADDLE REGISTERSAlthough the game paddles are plugged inM}to the joystick ports, they are not read from the port registers. The game paddles are read by first writing any number to tN}he start-pot-scan register, POTGO [$D20B (53771)]]. This turns off the capacitor dump transistors and allows the pot readingO}capacitors to begin charging. It also sets the TV scan line counter to zero. As each capacitor crosses a certain triggerP} voltage, the number of TV lines scanned is put in the respective pot value register. When the scan counter reaches 228, theQ} capacitor dump transistors are turned on and the number 228 is put into any pot value registers which are still empty.BefoR}re reading the pot value registers, ALLPOT [$D208 (53768)] should be checked. In this register, each bit corresponds to the S}validity of a pot value register. If a bit is zero, its' associated pot value register is valid. If bit 2 of SKCTL, [$D20F T}(53775)], is 1, the pots go into the fast scan mode. In this mode the paddles are read in only 2 TV scan lines. They can alU}so be read without regard to POTGO or ALLPOT.The pot value registers contain the number of TV scan lines it last took for tV}he paddle reading capacitors to charge (up to 228). These registers are POT0 - POT7 [$D200 - $D207 (53760 -53767)]. Their sW}hadow registers are PADDL0 - PADDL7 [$0270 - $0277 (624 - 631)].THE LIGHT PEN REGISTERSWhenever a joystick trigger is preX}ssed, the light pen registers, PENH and PENV are updated. PENH [$D40C (54284)] takes a value based on a color clock counter.Y} The value can be from 0 to 227. PENV [$D40D [54285)] takes the 8 highest bits of the vertical line counter. A light pen iZ}s simply a photo transistor connected to a joystick trigger line and focused on the TV screen. When the electron beam strike[}s the part of the screen the light pen is focused on, the transistor turns on pulling the trigger line low. The light pen re\}gisters then contain numbers relative to where the light pen was pointing. The shadow register for PENH and PENV are LPENH []}$0234 (564)] and LPENV [$0235 (566)). 5Useful operating system equatesTRIG0 $D010 (53264): joystick trigger^}s |TRIG3 $D013 (53268):POT0 $D200 (53760): paddle value |POT7 $D207 (53767):ALLPOT _}$D208 (53768): reads validity of pot valuesPOTGO $D20B (53771): starts paddle readSKCTL $D20F `}(53775): bit 2 enables fast pot scanPORTA $D300 (53016): port A dataPORTB $D301 (53017): port B dataPAa}CTL $D302 (54018): port A controlPBCTL $D303 (54019): port B controlPENH $D40C (54284): lighb}t pen horizontal value PENV $D40D (54285): light pen vertical valueShadow registersLPENH $0234 c} (564): light pen horizontal valueLPENV $0235 (566): light pen vertical valuePADDL0 $0270 (624): gamd}e paddle values |PADDL7 $0277 (631)STICK0 $0278 (632): joystick registers |STICK0 $027B e} (635):PRTIG0 $027C (636): paddle triggers |PTRIG7 $0283 (643):STRIG0 $0284 f}(644): joystick triggers |STRIG3 $0287 (647): |PTRIG7 $0283 (643):STRIG0 $0284 ?12 4 1 5 0 10 70 2 12 13227E27H19-@CHAPTER 19MISC HARDWARE REGISTERS AND INFORMATIONVERTICAL LINE COq}B%DOS SYSB*)DUP SYSB<SCHAP15 1 B2CHAP16 BECHAP16 1 B*CHAP17 B70CHAP18 BgCHAP19 B.CHAP20 B?APNDXA B?APNDXA 1 B-7APNDXA 2 BKdAPNDXB EAPNDXB 1 #APNDXB 2 APNDXC UNTERThe ANTIC chip has a vertical line counter at $0D4B (54283). This counter shows the high 8 bits of a 9 bit counter. r}This gives two line resolution. The value of this counter is placed into PENV [$D40D (54285)] when a joystick trigger is pres}ssed.SERIAL PORT REGISTERSThe POKEY chip has some registers which control the serial port.The serial port control regist}ter, SKCTL [$D20F (53775)], controls the serial port configuration and the game paddle scan mode. and some keyboard circuitru}y.The serial port control register 7 6 5 4 3 2 1 0 ----------------- SKCTL | | | | | | | | |v} ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8 bits 0 1 = enable keybw}oard debounce 1 1 = enable keyboard scan both 0 = set initialization mode. 2 1 = fast pot scan 3 x} 1 = serial output is two tone (for cassette) instead of logical true/false 4\ 5 >- serial port mode cony}trol 6/ 7 1 = forced logical 0 on outputIf the serial port control register is read from it gives the serial z}port status. The register is then called SKSTATSerial port status register 7 6 5 4 3 2 1 0 -----------------{} | | | | | | | |1| ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8 bits 0 not used, reads |}1 1 0 = serial input shift register busy 2 0 = last key is still pressed 3 0 = shift key pressed }} 4 0 = direct from serial input port 5 0 = keyboard over-run 6 0 = serial data input over-run 7 1 ~}= serial data input frame errorThe serial port status is latched and must be reset by writing any number to its' reset regi}ster, SKRES [$D20A (53770)].SERIAL PORT INPUT AND OUTPUT DATAWhen a full byte of serial input data has been received, it }is read from the serial input data register, SERIN [$D20D (53773). Serial output data is written to the same register, which} is then called the serial output data register, SEROUT. This register is usually written to in response to a serial output }data interrupt (bit 4 of IRQST).HARDWARE CHIP MEMORY ALLOCATIONThe addresses for the hardware chips are not completely de}coded. For example, the PIA needs only four bytes of memory but is active from $D300 - D3FF. Enough room for 64 PIA chips. } A second pair of parallel ports could be added by accessing the address bus and further decoding the address for a second PI}A. (This would also require a small modification of the computer's circuit board to disable the original PIA when the new on}e is active.) Similarly, there is room for 15 more POKEY or ANTIC chips and 7 gtia chips, should you ever need them. (GTIA }uses $D000 - D0FF, POKEY uses $D200 - $D2FF and ANTIC uses $D400 - $D4FF.)Useful data base variables and OS equates 5}75SKRES $D20A (53770): serial port status resetSEROUT $D20D (53773): serial output dataSERIN $D20D (53773): }serial input dataSKCTL $D20F (53775): serial port controlSKSTAT $D20F (53775): serial port statusVCOUNT $D40B } (54283): vertical line counterOs shadow registersSSKCTL $0232 (562): SKCTL serial port statusVCOUNT $D40B Y12 4 1 5 0 10 70 2 12 13227E27H20-@27GCHAPTER 20THE XL AND XE MODELSBASIC B BUGSMost of the Atari!} 600XL and 800XL models were supplied with the "debugged" version B of Atari BASIC. This new BASIC got rid of the minor bugs!} of BASIC A and introduced some new major bugs of it's own. 11Each time a program is saved, 16 extra bytes are tagged onto !}the end of the program. After many saves and reloads, as when developing a long program, the program becomes too large for t!}he memory.The computer may lock up unpredictably.Program line links may get messed up, leaving garbage in the listing and!} the program unrunable.Large LISTed programs may not run unless SAVed and reLOADed.If the length of a listed program is a!} multiple of a certain number of bytes, it will not run unless the length is somehow changed. 10BASIC version B has been re!}placed by version C. All of the XE models have this truly debugged version of BASIC.NEW OPERATING SYSTEM PROBLEMSI have !}heard of only one bug in the operating system in XL and XE models. This is a mishandling of the printer timeout. The comput!}er cannot tell if there is a printer attached or not. This may have been fixed in the XE models. However, many programs, so!}me even formerly sold by Atari, do not jump through published jump vectors when using the operating system. These programs w!}ill not run on XL/XE models. (Some of these programs are Atari Word Processor (not Atariwriter) and LJKs Letter Perfect and !}Data Perfect.) Since the operating system ROM can be switched to RAM, a "translator" can be used to load the 800 operating s!}ystem into an XL or XE model.130XE MEMORY MANAGEMENTThe 130XE has an extra 64K bank of memory. It is divided into four !}blocks of 16K each. Each block can be switched to replace part of the main bank of RAM from $4000 (16384) to $7FFF (32767). !} Furthermore, it can be switched in such a way that only the 6502, or the ANTIC chip can see the extra memory.27HPort B (f!}ormerly the two extra joystick ports of the 400/800) is used to manage the memory.Port B and memory management 11 !} 7 6 5 4 3 2 1 0 -----------------PORTB |T|U|A|C|S S|B|R| ----------------- 1 6 3 1 8!} 4 2 1 2 4 2 6 8 R 1 = OS replaced by RAM B 0 = BASIC enabled S S bank select bit!}s C 0 = CPU sees switched RAM at $4000 A 0 = ANTIC sees switched RAM U unused T 0 = self test 1!}0Bits 2 and 3 of PORTB select which block of the extra bank of memory is switched in.Bank select bits bits blo!}ck 2 3 address ------------------------- 0 0 $0000 - $3FFF 0 1 $4000 - $7FFF 1 0 !} $8000 - $BFFF 1 1 $C000 - $FFFFBits 4 and 5 select which chip sees the switched in RAM at $4000 - $7FFF!}Chip select bits bits ANTIC 6502 4 5 -------------------------- 0 0 Ext. Ext. 0!} 1 Ext. Main 1 0 Main Ext. 1 1 Main MainTHE XL PARALLEL PORT Pin out o!}f the parallel port top from rear 111112222233333444445 2468024680246802468024680 !} ------------------------- ------------------------- 11111222223333344444 1357913579!}135791357913579 1 2 GND 3 A1 4 A0 5 A3 6 A2 7 A5 8!} A4 9 GND 10 A6 11 A8 12 A7 13 A10 14 A9 15 A12 16 A11 1!}7 A14 18 A13 19 A15 20 GND 21 D1 22 D0 23 D3 24 D2 25 D5 !} 26 D4 27 D7 28 D6 29 GND 30 GND 31 GND 32 phase 2 clock 33 RESET !} 34 35 RDY 36 IRQ 37 37 39 40 41 GND 42 43 RAS 44!} 45 R/W 46 GND 47 +5V 48 +5V 49 GND 50 11The phase 2 clock runs at 1.8 MHz. Wh!}en the clock is high, the address and R/W lines are valid. The clock goes from high to low, when the data lines are also val!}id. All lines then become invalid. 10The 130XE doesn't have the parallel port. However, it has a cartridge slot expansion!}. This is a small cartridge-slot-like connector with the necessary connector to use parallel expansion.FINE SCROLLINGIf !}address $026E (622) is $FF, graphics 0 will be in the fine scroll mode.OTHER ADDRESSESDSCTLN [$0D25,2 (725)] is the disk !}sector size. should be $80 (128).DMASAV [$02DD (735)] is a copy of the DMA control register, SDMCTL [$022F (559)]. It is !}set up when a channel is opened to the screen. The value is moved to SDMCTL whenever a key is pressed. It is used to restor!}e the display if DMA is disabled.PUPBT [$033D,3 (829-831)] is used to test memory integrity when [RESET] is pressed. If th!}ese bytes are not $5C, $93 and $25, the computer will do a cold start when [RESET] is pressed.The self-test ROM is from $D0!}00 to $D7FF, the same addresses as the hardware registers. This part of the operating system ROM is disabled when not used. !} When The computer is put into the self-test mode, This part of ROM is copied to $5000 to $57FF and run from there.GINTLK [!}$03FA (1018)] is a logical 1 if a cartridge is installed (built-in BASIC is considered a cartridge). BASIC can be disabled b!}y poking 1018 with a non-zero number. If [RESET] is then pressed, the computer will attempt to load the DUP.SYS file and bas!}ic will be completely disabled.ber. If [RESET] is then pressed, the computer will attempt to load the DUP.SYS file and bas !4 4 1 5 0 5 75 2 4 132A-@27EAPPENDIX AHARDWARE REGISTERS Register %} Shadow Name Description %} Address Name Address ---------------------------------------------------------------------- ALLPOT%} game paddle ready indicators $D208 53768 AUDC1 Audio channel 1 control $D201 53761 %} AUDC2 Audio channel 2 control $D203 53763 AUDC3 Audio channel 3 control %} $D205 53765 AUDC4 Audio channel 1 control $D207 53767 AUDCTL general audio %}control $D208 53768 AUDF1 Audio frequency 1 control $D200 53760 AU%}DF2 Audio frequency 2 control $D202 53762 AUDF3 Audio frequency 3 control $D204 53764 %} AUDF4 Audio frequency 4 control $D206 53766 CHACTL character control %} $D401 54273 CHART $02F3 755 CHBASE Address of character set / 256 $D409 54281 CHBAS $O2F4 756 COLBK color/brig%}htness of setcolor 4 $D01A 53274 COLOR4 $02C8 712 COLPF0 Color/brightness of setcolor 0 $D016 53270 COLOR0 $02C4 708%} COLPF1 color/brightness of setcolor 1 $D017 53271 COLOR1 $02C5 709 COLPF2 color/brightness of setcolor 2 $DO18 532%}72 COLOR2 $02C6 710 COLPF3 color/brightness of setcolor 3 $DO19 53273 COLOR3 $02C7 711 COLPM0 color/brightness, player/%}missile 0 $D012 53266 PCOLR0 $02C0 704 COLPM1 color/brightness, player/missile 1 $DO13 53267 PCOLR1 $02C1 705 COLPM2 color/%}brightness, player/missile 2 $DO14 53268 PCOLR2 $02C2 706 COLPM3 color/brightness, player/missile 3 $DO15 53269 PCOLR3 $02C3%} 707 CONSOL [START], [SELECT], [OPT.], speaker $D01F 53279 DLISTH display list pointer high byte $D403%} 54275 SDLSTH $0231 561 DLISTL display list pointer low byte $D402 54274 SDLSTL $0230 560 DMACTL Direct Memory access %}control (DMA) $D400 54272 SDMCTL $022F 559 GRACTL graphics control $D01D 53277 GRAFM mi%}ssile graphics $D011 53265 GRAFP0 player 0 graphics $D00D 53261 %} GRAFP1 player 1 graphics $D00E 53262 GRAFP2 player 2 graphics $%}D00F 53263 GRAFP3 player 3 graphics $D010 53264 HITCLR clear collisions %} $D01E 54278 HPOSM0 horizontal position of missile 0 $D004 53252 HPOSM%}1 horizontal position of missile 1 $D005 53253 HPOSM2 horizontal position of missile 2 $D006 53254 %} HOPSM3 horizontal position of missile 3 $D007 53255 HPOSP0 horizontal position of player 0 %} $D000 53248 HPOSP1 horizontal position of player 1 $D001 53249 HPOSP2 horizontal po%}sition of player 2 $D002 53250 HPOSP3 horizontal position of player 3 $D003 53251 H%}SCROL horizontal scroll $D404 54276 IRQEN interrupt request enable (IRQ) $D20E 53774 %}POKMSK $0010 16 IRQST IRQ status $D20E 53774 KBCODE keyboard code %} $D209 53769 CH $O2FC 764 M0PF missile 0 to graphics collisions $D000 53248 M0PL missile 0%} to player collisions $D008 53256 M1PF missile 1 to graphics collisions $D001 53249 %} M1PL missile 1 to player collisions $D009 53257 M2PF missile 2 to graphics collisions $D002%} 53250 M2PL missile 2 to player collisions $D00A 53258 M3PF missile 3 to graphics%} collisions $D003 53251 M3PL missile 3 to player collisions $D00B 53259 NMIEN no%}n-maskable interrupt enable (NMI)$D40E 54286 NMIRES NMI reset $D40F 54287 %} NMIST NMI status $D40F 54287 P0PF player 0 to graphics collisions $%}D004 53252 P0PL player 0 to player collisions $D00C 53260 P1PF player 1 to graph%}ics collisions $D005 53253 P1PL player 1 to player collisions $D00D 53261 P2PF %} player 2 to graphics collisions $D006 53254 P2PL player 2 to player collisions $D00E 53262 %} P3PF player 3 to graphics collisions $DOO7 53255 P3PL player 3 to player collisions %} $D00F 53263 PACTL port A control $D302 54018 PAL Europe/North %}America TV indicator $D014 53268 PBCLT port B control $D303 54019 PE%}NH light pen horizontal position $D40C 54284 LPENH $0234 564 PENV light pen vertical position $D40D 54285 L%}PENV $0235 565 PMBASE player/missile address / 256 $D407 54279 PORTA port A %} $D300 54016 STICK0 $0278 632 STICK1 $0279 634 PORTB port B %} $D301 54017 STICK2 $027A 634 STICK3 $027B 635%} POT0 game paddle 0 $D200 53760 PADDL0 $0270 624 POT1 game paddle 1 $D201 537%}61 PADDL1 $0271 625 POT2 game paddle 2 $D202 53762 PADDL2 $0272 626 POT3 game paddle 3 %} $D203 53763 PADDL3 $0273 627 POT4 game paddle 4 $D204 53764 PADDL4 $0274 628 POT5 game p%}addle 5 $D205 53765 PADDL5 $0275 629 POT6 game paddle 6 $D206 53766 PADDL6 $0276%} 630 POT7 game paddle 7 $D207 53767 PADDL7 $0277 631 POTGO start pot scan sequence $D20B%} 53771 PRIOR p/m priority and GTIA mode $D21B 53275 GPRIOR $026F 623 RANDOM random number generat%}or $D20A 53770 SERIN serial port input $D20D 53774 SEROUT se%}rial port output $D20D 53773 SIZEM missile size $D00C 53260 %} SIZEP0 player 0 size $D008 53256 SIZEP1 player 1 size $%}D009 53257 SIZEP2 player 2 size $D00A 53258 SIZEP3 player 3 size %} $D00B 53259 SKCTL serial port control $D20F 53775 SSKCTL $0232 563 SKRES%}T reset serial port status $D20A 53770 SKSTAT serial port status $D20F 53775 %} STIMER start timer $D209 53769 TRIG0 joystick trigger 0 %} $D010 53264 STRIG0 $0284 644 TRIG1 joystick trigger 1 $D011 53265 STRIG1 $0285 645 TRIG2 joystick trig%}ger 2 $D012 53266 STRIG2 $0286 646 TRIG3 joystick trigger 3 $D013 53267 STRIG3 $0287 647 V%}COUNT vertical line counter $D40B 54283 VDELAY vertical delay $D01C 54276 %} VSCROL vertical scroll $D405 54277 WSYNC wait for horizontal sync %} $D40A 54282 D:APNDXA.1 $D405 54277 WSYNC wait for horizontal sync $34 4 1 5 0 5 75 2 4 132NUMERICAL ORDERRegisters sharing addresses are listed first when writen to, then when r)}ead from Register Shadow )} Name Description Address Name Address ------------------------)}---------------------------------------------- HPOSP0 horizontal position of player 0 $D000 53248 M0PF )} missile 0 to graphics collisions $D000 53248 HPOSP1 horizontal position of player 1 $D001 53249 )} M1PF missile 1 to graphics collisions $D001 53249 HPOSP2 horizontal position of player 2 )} $D002 53250 M2PF missile 2 to graphics collisions $D002 53250 HPOSP3 horizontal pos)}ition of player 3 $D003 53251 M3PF missile 3 to graphics collisions $D003 53251 HP*}OSM0 horizontal position of missile 0 $D004 53252 P0PF player 0 to graphics collisions $D004 53252 *} HPOSM1 horizontal position of missile 1 $D005 53253 P1PF player 1 to graphics collisio*}ns $D005 53253 HPOSM2 horizontal position of missile 2 $D006 53254 P2PF player 2 t*}o graphics collisions $D006 53254 HOPSM3 horizontal position of missile 3 $D007 53255 *} P3PF player 3 to graphics collisions $D007 53255 SIZEP0 player 0 size $D008 532*}56 M0PL missile 0 to player collisions $D008 53256 SIZEP1 player 1 size *} $D009 53257 M1PL missile 1 to player collisions $D009 53257 SIZEP2 player*} 2 size $D00A 53258 M2PL missile 2 to player collisions $D00A 53258 *} SIZEP3 player 3 size $D00B 53259 M3PL missile 3 to player collisions $D00B * }53259 SIZEM missile size $D00C 53260 P0PL player 0 to player col* }lisions $D00C 53260 GRAFP0 player 0 graphics $D00D 53261 P1PL pla* }yer 1 to player collisions $D00D 53261 GRAFP1 player 1 graphics $D00E 53262 * } P2PL player 2 to player collisions $D00E 53262 GRAFP2 player 2 graphics $D* }00F 53263 P3PL player 3 to player collisions $D00F 53263 GRAFP3 player 3 graphics *} $D010 53264 TRIG0 joystick trigger 0 $D010 53264 STRIG0 $0284 644 GRAFM *} missile graphics $D011 53265 TRIG1 joystick trigger 1 $D011 53265 STRIG*}1 $0285 645 COLPM0 color/brightness, player/missile 0 $D012 53266 PCOLR0 $02C0 704 TRIG2 joystick trigger 2 *} $D012 53266 STRIG2 $0286 646 COLPM1 color/brightness, player/missile 1 $D013 53267 PCOLR1 $02C1 705 TRIG3 joystick trigg*}er 3 $D013 53267 STRIG3 $0287 647 COLPM2 color/brightness, player/missile 2 $D014 53268 PCOLR2 $02C2 706 PA*}L Europe/North America TV indicator $D014 53268 COLPM3 color/brightness, player/missile 3 $D015 53269 P*}COLR3 $02C3 707 COLPF0 Color/brightness of setcolor 0 $D016 53270 COLOR0 $02C4 708 COLPF1 color/brightness of setcolor *}1 $D017 53271 COLOR1 $02C5 709 COLPF2 color/brightness of setcolor 2 $D018 53272 COLOR2 $02C6 710 COLPF3 color/brig*}htness of setcolor 3 $D019 53273 COLOR3 $02C7 711 COLBK color/brightness of setcolor 4 $D01A 53274 COLOR4 $02C8 712*} VDELAY vertical delay $D01C 54276 GRACTL graphics control $D01D *}53277 HITCLR clear collisions $D01E 54278 CONSOL [START], [SELECT], [OP*}T.], speaker $D01F 53279 AUDF1 Audio frequency 1 control $D200 53760 POT0 gam*}e paddle 0 $D200 53760 PADDL0 $0270 624 AUDC1 Audio channel 1 control $D201 53761 *} POT1 game paddle 1 $D201 53761 PADDL1 $0271 625 AUDF2 Audio frequency 2 control $D*}202 53762 POT2 game paddle 2 $D202 53762 PADDL2 $0272 626 AUDC2 Audio channel 2 co*}ntrol $D203 53763 POT3 game paddle 3 $D203 53763 PADDL3 $0273 627 AUDF3 *} Audio frequency 3 control $D204 53764 POT4 game paddle 4 $D204 53764 PADDL*}4 $0274 628 AUDC3 Audio channel 3 control $D205 53765 POT5 game paddle 5 * } $D205 53765 PADDL5 $0275 629 AUDF4 Audio frequency 4 control $D206 53766 POT6 game paddle 6 *!} $D206 53766 PADDL6 $0276 630 AUDC4 Audio channel 1 control $D207 53767 PO*"}T7 game paddle 7 $D207 53767 PADDL7 $0277 631 ALLPOT game paddle ready indicators $D208 53768 *#} AUDCTL general audio control $D208 53768 KBCODE keyboard code *$} $D209 53769 CH $O2FC 764 STIMER start timer $D209 53769 RANDOM random num*%}ber generator $D20A 53770 SKREST reset serial port status $D20A 53770 *&} POTGO start pot scan sequence $D20B 53771 SEROUT serial port output $D20D 537*'}73 SERIN serial port input $D20D 53774 IRQEN interrupt request enable *(}(IRQ) $D20E 53774 POKMSK $0010 16 IRQST IRQ status $D20E 53774 SKCTL serial*)} port control $D20F 53775 SSKCTL $0232 563 SKSTAT serial port status $D20F 53775 **} PRIOR p/m priority and GTIA mode $D21B 53275 GPRIOR $026F 623 PORTA port A $D300*+} 54016 STICK0 $0278 632 STICK1 $0279 633 PORTB port B *,} $D301 54017 STICK2 $027A 634 STICK3 $027B 635 PACTL po*-}rt A control $D302 54018 PBCTL port B control $D303 54019 *.} DMACTL Direct Memory access control (DMA) $D400 54272 SDMCTL $022F 559 CHACTL character control $*/}D401 54273 CHART $02F3 755 DLISTL display list pointer low byte $D402 54274 SDLSTL $0230 560 DLISTH display list poin*0}ter high byte $D403 54275 SDLSTH $0231 561 HSCROL horizontal scroll $D404 54276 VSCRO*1}L vertical scroll $D405 54277 PMBASE player/missile address / 256 $D407 54279 *2} CHBASE Address of character set / 256 $D409 54281 CHBAS $O2F4 756 WSYNC wait for horizontal sync *3} $D40A 54282 VCOUNT vertical line counter $D40B 54283 PENH light pen hor*4}izontal position $D40C 54284 LPENH $0234 564 PENV light pen vertical position $D40D 54285 LPENV $0235 565 N*5}MIEN non-maskable interrupt enable (NMI)$D40E 54286 NMIRES NMI reset $D40F 54287 *6} NMIST NMI status $D40F 54287 D:APNDXA.2 $D40F 54287 (h4 4 1 5 0 5 75 2 4 132SHADOW REGISTER ORDERALPHEBETICAL ORDER Register .8} Shadow Name Description .9} Address Name Address ---------------------------------------------------------------------- KBCODE.:} keyboard code $D209 53769 CH $O2FC 764 CHACTL character control $D401 54273 CHART.;} $02F3 755 CHBASE Address of character set / 256 $D409 54281 CHBAS $O2F4 756 COLBK color/brightness of setcolor 4 .<} $D01A 53274 COLOR4 $02C8 712 COLPF0 Color/brightness of setcolor 0 $D016 53270 COLOR0 $02C4 708 COLPF1 color/brightne.=}ss of setcolor 1 $D017 53271 COLOR1 $02C5 709 COLPF2 color/brightness of setcolor 2 $D018 53272 COLOR2 $02C6 710 CO.>}LPF3 color/brightness of setcolor 3 $D019 53273 COLOR3 $02C7 711 PRIOR p/m priority and GTIA mode $D21B 53275 G.?}PRIOR $026F 623 PENH light pen horizontal position $D40C 54284 LPENH $0234 564 PENV light pen vertical position .@} $D40D 54285 LPENV $0235 565 POT0 game paddle 0 $D200 53760 PADDL0 $0270 624 POT1 game paddl.A}e 1 $D201 53761 PADDL1 $0271 625 POT2 game paddle 2 $D202 53762 PADDL2 $0272 626.B} POT3 game paddle 3 $D203 53763 PADDL3 $0273 627 POT4 game paddle 4 $D204 537.C}64 PADDL4 $0274 628 POT5 game paddle 5 $D205 53765 PADDL5 $0275 629 POT6 game paddle 6 .D} $D206 53766 PADDL6 $0276 630 POT7 game paddle 7 $D207 53767 PADDL7 $0277 631 COLPM0 color/.E}brightness, player/missile 0 $D012 53266 PCOLR0 $02C0 704 COLPM1 color/brightness, player/missile 1 $D013 53267 PCOLR1 $02C1.F} 705 COLPM2 color/brightness, player/missile 2 $D014 53268 PCOLR2 $02C2 706 COLPM3 color/brightness, player/missile 3 $D015.G} 53269 PCOLR3 $02C3 707 IRQEN interrupt request enable (IRQ) $D20E 53774 POKMSK $0010 16 DLISTH display list pointer .H}high byte $D403 54275 SDLSTH $0231 561 DLISTL display list pointer low byte $D402 54274 SDLSTL $0230 560 DMACTL Di.I}rect Memory access control (DMA) $D400 54272 SDMCTL $022F 559 SKCTL serial port control $D20F 53775 SSKCTL $.J}0232 563 PORTA port A $D300 54016 STICK0 $0278 632 .K} STICK1 $0279 633 PORTB port B $D301 54017 STICK2 $027A 634 .L} STICK3 $027B 635 TRIG0 joystick trigger 0 $D010 53264 STRIG0 $0284 644 TRIG1.M} joystick trigger 1 $D011 53265 STRIG1 $0285 645 TRIG2 joystick trigger 2 $D012 53266 STRI.N}G2 $0286 646 TRIG3 joystick trigger 3 $D013 53267 STRIG3 $0287 647 NUMERICAL ORDERIRQEN interrup.O}t request enable (IRQ) $D20E 53774 POKMSK $0010 16 DMACTL Direct Memory access control (DMA) $D400 54272 SDMCTL $022F 5.P}59 DLISTL display list pointer low byte $D402 54274 SDLSTL $0230 560 DLISTH display list pointer high byte $D403 5.Q}4275 SDLSTH $0231 561 SKCTL serial port control $D20F 53775 SSKCTL $0232 563 PENH light pen horizontal po.R}sition $D40C 54284 LPENH $0234 564 PENV light pen vertical position $D40D 54285 LPENV $0235 565 PRIOR p/m .S}priority and GTIA mode $D21B 53275 GPRIOR $026F 623 POT0 game paddle 0 $D200 53760 PADDL0 $02.T}70 624 POT1 game paddle 1 $D201 53761 PADDL1 $0271 625 POT2 game paddle 2 $D2.U}02 53762 PADDL2 $0272 626 POT3 game paddle 3 $D203 53763 PADDL3 $0273 627 POT4 game paddle 4 .V} $D204 53764 PADDL4 $0274 628 POT5 game paddle 5 $D205 53765 PADDL5 $0275 629 POT6 .W}game paddle 6 $D206 53766 PADDL6 $0276 630 POT7 game paddle 7 $D207 53767 PADDL7.X} $0277 631 PORTA port A $D300 54016 STICK0 $0278 632 .Y} STICK1 $0279 633 PORTB port B $D301 54017 STICK2 $027A 634 .Z} STICK3 $027B 635 TRIG0 joystick trigger 0 $D010 53264 STRIG0 $0284 644 TRI.[}G1 joystick trigger 1 $D011 53265 STRIG1 $0285 645 TRIG2 joystick trigger 2 $D012 53266 ST.\}RIG2 $0286 646 TRIG3 joystick trigger 3 $D013 53267 STRIG3 $0287 647 COLPM0 color/brightness, player/missi.]}le 0 $D012 53266 PCOLR0 $02C0 704 COLPM1 color/brightness, player/missile 1 $D013 53267 PCOLR1 $02C1 705 COLPM2 color/brigh.^}tness, player/missile 2 $D014 53268 PCOLR2 $02C2 706 COLPM3 color/brightness, player/missile 3 $D015 53269 PCOLR3 $02C3 707 ._}COLPF0 Color/brightness of setcolor 0 $D016 53270 COLOR0 $02C4 708 COLPF1 color/brightness of setcolor 1 $D017 5327.`}1 COLOR1 $02C5 709 COLPF2 color/brightness of setcolor 2 $D018 53272 COLOR2 $02C6 710 COLPF3 color/brightness of setcol.a}or 3 $D019 53273 COLOR3 $02C7 711 COLBK color/brightness of setcolor 4 $D01A 53274 COLOR4 $02C8 712 CHACTL charact.b}er control $D401 54273 CHART $02F3 755 CHBASE Address of character set / 256 $D409 54281 CHBAS $O2F4 .c}756 KBCODE keyboard code $D209 53769 CH $O2FC 764 haracter set / 256 $D409 54281 CHBAS $O2F4 ,M8 4 1 5 0 4 76 2 8 132B-@27EAPPENDIX BOPERATING SYSTEM EQUATES0100 ;0101 ; ATARI 802e}0 EQUATE LISTING0102 ;0103 ;0104 ;0105 ;This listing is based on the original release of Operating System,0106 ;version 2f}A. The vectors shown here were not changed in version B.0107 ;New equates for XL and XE models are included and noted. Cha2g}nges0108 ;from version B to XL/XE are also noted.0109 ;0110 ;Most of the equate names given below are the official Atari02h}111 ;names. They are in common use but are not mandatory.0112 ;0113 ;0114 ; DEVICE NAMES0115 ;0116 ;0117 ;SCREDT2i} = "E" SCREEN EDITOR0118 ;KBD = "K" KEYBOARD0119 ;DISPLY = "S" DISPLAY0120 ;PRINTR = "P" PRINTER0121 ;CASSET =2j} "C" CASSETTE0122 ;DISK = "D" DISK DRIVE0123 ;0124 ;0125 ;0126 ; STATUS CODES 0127 ;0128 ;0129 SUCCES =2k} $01 10130 BRKABT = $80 128 BREAK KEY ABORT0131 PRVOPN = $82 130 IOCB ALREADY OPEN0132 NONDEV = $82 2l}130 NONEXISTANT DEVICE0133 WRONLY = $83 131 OPENED FOR WRITE ONLY0134 NVALID = $84 132 INVALID COMMAND0135 NOTOP2m}N = $85 133 DEVICE OR FILE NOT OPEN0136 BADIOC = $86 134 INVALID IOCB NUMBER0137 RDONLY = $87 135 OPENED FOR2n} READ ONLY0138 EOFERR = $88 136 END OF FILE0139 TRNRCD = $89 137 TRUNCATED RECORD0140 TIMOUT = $8A 138 PERI2o}PHERAL TIME OUT0141 DNACK = $8B 139 DEVICE DOES NOT ACKNOWLEDGE0142 FRMERR = $8C 140 SERIAL BUS FRAMING ERROR012p}43 CRSROR = $8D 141 CURSOR OUT OF RANGE0144 OVRRUN = $8E 142 SERIAL BUS DATA OVERRUN0145 CHKERR = $8F 143 SE2q}RIAL BUS CHECKSUM ERROR0146 DERROR = $90 144 PERIPHERAL DEVICE ERROR0147 BADMOD = $91 145 NON EXISTANT SCREEN MOD2r}E0148 FNCNOT = $92 146 FUNCTION NOT IMPLEMENTED0149 SCRMEM = $93 147 NOT ENOUGH MEMORY FOR SCREEN MODE0150 ;0152s}1 ;0152 ;0153 ;0154 ; COMMAND CODES FOR CIO0155 ;0156 ;0157 OPEN = $03 30158 OPREAD = $04 4 OPEN FOR 2t}INPUT0159 GETREC = $05 5 GET RECORD0160 OPDIR = $06 6 OPEN TO DISK DIRECTORY0161 GETCHR = $07 7 GET 2u}BYTE0162 OWRITE = $08 8 OPEN FOR OUTPUT0163 PUTREC = $09 9 WRITE RECORD0164 APPEND = $09 9 OPEN TO AP2v}PEND TO END OF DISK FILE0165 MXDMOD = $10 16 OPEN TO SPLIT SCREEN (MIXED MODE)0166 PUTCHR = $0B 11 PUT-BYTE0162w}7 CLOSE = $0C 120168 OUPDAT = $0C 12 OPEN FOR INPUT AND OUTPUT AT THE SAME TIME0169 STATUS = $0D 1301702x} SPECIL = $0E 14 BEGINNING OF SPECIAL COMMANDS0171 DRAWLN = $11 17 SCREEN DRAW0172 FILLIN = $12 18 SCREEN2y} FILL0173 RENAME = $20 320174 INSCLR = $20 32 OPEN TO SCREEN BUT DON'T ERASE0175 DELETE = $21 330176 DF2z}RMAT = $21 33 FORMAT DISK (RESIDENT DISK HANDLER (RDH))0177 LOCK = $23 350178 UNLOCK = $24 360179 POIN2{}T = $25 370180 NOTE = $26 380181 PTSECT = $50 80 RDH PUT SECTOR0182 GTSECT = $52 82 RDH GET SEC2|}TOR0183 DSTAT = $53 83 RDH GET STATUS0184 PSECTV = $57 87 RDH PUT SECTOR AND VERIFY0185 NOIRG = $80 1282}} NO GAP CASSETTE MODE0186 CR = $9B 155 CARRIAGE RETURN (EOL)0187 ;0188 IOCBSZ = $10 16 IOCB SIZE0189 MAXIO2~}C = $80 128 MAX IOCB BLOCK SIZE0190 IOCBF = $FF 255 IOCB FREE0191 ;0192 LEDGE = $02 2 DEFAULT LEFT MARG2}IN0193 REDGE = $27 39 DEFAULT RIGHT MARGIN0194 ;0195 ; OS VARIABLES0196 ;0197 ; PAGE 00198 ;01992} LINZBS = $00 0 (800) FOR ORIGINAL DEBUGGER0200 ; $00 0 (XL) RESERVED0201 NGFLAG = $01 1 (XL) F2}OR POWER-UP SELF TEST0202 CASINI = $02 20203 RAMLO = $04 4 POINTER FOR SELF TEST0204 TRAMSZ = $06 6 2}TEMPORARY RAM SIZE0205 TSTDAT = $07 7 TEST DATA0206 WARMST = $08 80207 BOOT? = $09 9 SUCCESSFUL BOOT2} FLAG0208 DOSVEC = $0A 10 PROGRAM RUN VECTOR0209 DOSINI = $0C 12 PROGRAM INITIALIZATION0210 APPMHI = $0E 2} 14 DISPLAY LOW LIMIT0211 POKMSK = $10 16 IRQ ENABLE FLAGS0212 BRKKEY = $11 17 FLAG0213 RTCLOK = $12 18 2}3 BYTES, MSB FIRST0214 BUFADR = $15 21 INDIRECT BUFFER ADDRESS0215 ICCOMT = $17 23 COMMAND FOR VECTOR0216 DSKF2}MS = $18 24 DISK FILE MANAGER POINTER0217 DSKUTL = $1A 26 DISK UTILITY POINTER (DUP.SYS)0218 PTIMOT = $1C 2} 28 (800) PRINTER TIME OUT REGISTER0219 ABUFPT = $1C 28 (XL) RESERVED0220 PBPNT = $1D 29 (800) PRINTER BUFFER 2}POINTER0221 ; $1D 29 (XL) RESERVED0222 PBUFSZ = $1E 30 (800) PRINTER BUFFER SIZE0223 ; $1E 2} 30 (XL) RESERVED0224 PTEMP = $1F 31 (800) TEMPORARY REGISTER0225 ; $1F 31 (XL) RESERVED0226 ZIOCB = 2}$20 32 ZERO PAGE IOCB0227 ICHIDZ = $20 32 HANDLER INDEX NUMBER (ID)0228 ICDNOZ = $21 33 DEVICE NUMBER0222}9 ICCOMZ = $22 34 COMMAND0230 ICSTAZ = $23 35 STATUS0231 ICBALZ = $24 36 BUFFER POINTER LOW BYTE0232 ICB2}AHZ = $25 37 BUFFER POINTER HIGH BYTE0233 ICPTLZ = $26 38 PUT ROUTINE POINTER LOW0234 ICPTHZ = $27 39 PUT2} ROUTINE POINTER HIGH0235 ICBLLZ = $28 40 BUFFER LENGTH LOW0236 ICBLHZ = $29 410237 ICAX1Z = $2A 42 AUXI2}LIARY INFORMATION BYTE 10238 ICAX2Z = $2B 430239 ICSPRZ = $2C 44 TWO SPARE BYTES (CIO USE)0240 ICIDNO = $2E 2} 46 IOCB NUMBER X 160241 CIOCHR = $2F 47 CHARACTER BYTE FOR CURRENT OPERATION0242 ;0243 STATUS = $30 48 STA2}TUS STORAGE0244 CHKSUM = $31 49 SUM WITH CARRY ADDED BACK0245 BUFRLO = $32 50 DATA BUFFER LOW BYTE0246 BUFRHI 2}= $33 510247 BFENLO = $34 52 ADDRESS OF LAST BUFFER BYTE +1 (LOW)0248 BFENHI = $35 530249 CRETRY = $36 2} 54 (800) NUMBER OF COMMAND FRAME RETRIES0250 LTEMP = $36 54 (XL) LOADER TEMPORARY STORAGE, 2 BYTES0251 DRETRY =2} $37 55 (800) DEVICE RETRIES0252 BUFRFL = $38 56 BUFFER FULL FLAG0253 RECVDN = $39 57 RECEIVE DONE FLAG02}254 XMTDON = $3A 58 TRANSMISSION DONE FLAG0255 CHKSNT = $3B 59 CHECKSUM-SENT FLAG0256 NOCKSM = $3C 60 CHE2}CKSUM-DOES-NOT-FOLLOW-DATA FLAG0257 BPTR = $3D 610258 FTYPE = $3E 620259 FEOF = $3F 630260 FREQ 2}= $40 640261 ;0262 SOUNDR = $41 65 0=QUIET I/O0263 CRITIC = $42 66 CRITICAL FUNCTION FLAG, NO DEFFERED V2}BI0264 FMSZPG = $43 67 DOS ZERO PAGE, 7 BYTES0265 CKEY = $4A 74 (800) START KEY FLAG0266 ZCHAIN = $4A 2}74 (XL) HANDLER LOADER TEMP, 2 BYTES0267 CASSBT = $4B 75 (800) CASSETTE BOOT FLAG0268 DSTAT = $4C 76 DISPLAY S2}TATUS0269 ;0270 ATRACT = $4D 770271 DRKMSK = $4E 78 ATTRACT MASK0272 COLRSH = $4F 79 ATTRACT COLOR SHIF2}TER (EORed WITH GRAPHICS)0273 ;0274 TMPCHR = $50 800275 HOLD1 = $51 810276 LMARGN = $52 82 SCREEN LEFT2} MARGIN REGISTER0277 RMARGN = $53 83 SCREEN RIGHT MARGIN0278 ROWCRS = $54 84 CURSOR ROW0279 COLCRS = $55 2} 85 CURSOR COLUMN, 2 BYTES0280 DINDEX = $57 87 DISPLAY MODE0281 SAVMSC = $58 88 SCREEN ADDRESS0282 OLDROW = $52}A 90 CURSOR BEFORE DRAW OR FILL0283 OLDCOL = $5B 910284 OLDCHR = $5D 93 DATA UNDER CURSOR0285 OLDADR = $2}5E 94 CURSOR ADDRESS0286 NEWROW = $60 96 (800) DRAWTO DESTINATION0287 FKDEF = $60 96 (XL) FUNCTION KEY D2}EFINATION POINTER0288 NEWCOL = $61 97 (800) DRAWTO DESTINATION, 2 BYTES0289 PALNTS = $62 98 (XL) EUROPE/NORTH A2}MERICA TV FLAG0290 LOGCOL = $63 99 LOGICAL LINE COLUMN POINTER0291 MLTTMP = $66 1020292 OPNTMP = $66 102 T2}EMPORARY STORAGE FOR CHANNEL OPEN0293 SAVADR = $68 1040294 RAMTOP = $6A 106 START OF ROM (END OF RAM + 1), HIGH B2}YTE ONLY0295 BUFCNT = $6B 107 BUFFER COUNT0296 BUFSTR = $6C 108 POINTER USED BY EDITOR0297 BITMSK = $6E 1102} POINTER USED BY EDITOR0298 SHFAMT = $6F 1110299 ROWAC = $70 1120300 COLAC = $72 1140301 ENDPT = $74 2} 1160302 DELTAR = $76 1180303 DELTAC = $77 1190304 ROWINC = $79 121 (800)0305 KEYDEF = $79 121 (XL)2} KEY DEFINATION POINTER, 2 BYTES0306 COLINC = $7A 122 (800)0307 SWPFLG = $7B 123 NON 0 IF TEXT AND REGULAR RAM IS2} SWAPPED0308 HOLDCH = $7C 124 CH MOVED HERE BEFORE CTRL AND SHIFT0309 INSDAT = $7D 1250310 COUNTR = $7E 1262}0311 ;0312 ZROFRE = $80 128 FREE ZERO PAGE, 84 BYTES0313 FPZRO = $D4 212 FLOATING POINT RAM, 43 BYTES0314 FR0 2} = $D4 212 FP REGISTER 00315 FRE = $DA 2180316 FR1 = $E0 224 FP REGISTER 10317 FR2 = $E6 232}0 FP REGISTER 20318 FRX = $EC 236 SPARE0319 EEXP = $ED 237 VALUE OF E0320 NSIGN = $ED 237 SIGN OF FP 2}NUMBER0321 ESIGN = $EF 239 SIGN OF FP EXPONENT0322 FCHFLG = $F0 240 FIRST CHARACTER FLAG0323 DIGRT = $F1 2}241 NUMBER OF DIGITS RIGHT OF DECIMAL POINT0324 CIX = $F2 242 INPUT INDEX0325 INBUFF = $F3 243 POINTER TO ASCI2}I FP NUMBER0326 ZTEMP1 = $F5 2450327 ZTEMP4 = $F7 2470328 ZTEMP3 = $F9 2490329 DEGFLG = $FB 2510330 2}RADFLG = $FB 251 0=RADIANS, 6=DEGREES0331 FLPTR = $FC 252 POINTER TO BCD FP NUMBER0332 FPTR2 = $FE 2540332}3 ;0334 ;0335 ; PAGE 10336 ;0337 ; 65O2 STACK0338 ;0339 ;D:APNDXBD.1R0332 FPTR2 = $FE 2540330]0340 ;0341 ;0342 ; PAGE 20343 ;0344 ;0345 INTABS = $0200 512 INTERRUPT RAM0346 VDSLST = $0200 512 NMI VE6}CTOR0347 VPRCED = $0202 514 PROCEED LINE IRQ VECTOR0348 VINTER = $0204 516 INTERRUPT LINE IRQ VECTOR0349 VBREAK = $06}206 5180350 VKEYBD = $0208 5200351 VSERIN = $020A 522 SERIAL INPUT READY IRQ0352 VSEROR = $020C 524 SERIAL OUT6}PUT READY IRQ0353 VSEROC = $020E 526 SERIAL OUTPUT COMPLETE IRQ0354 VTIMR1 = $0210 528 TIMER 1 IRQ0355 VTIMR2 = $0216}2 530 TIMER 2 IRQ0356 VTIMR4 = $0214 532 TIMER 4 IRQ0357 VIMIRQ = $0216 534 IRQ VECTOR0358 CDTMV1 = $0218 536 6}DOWN TIMER 10359 CDTMV2 = $021A 538 DOWN TIMER 20360 CDTMV3 = $021C 540 DOWN TIMER 30361 CDTMV4 = $021E 542 DOWN 6}TIMER 40362 CDTMV5 = $0220 544 DOWN TIMER 50363 VVBLKI = $0222 5460364 VVBLKD = $0224 5480365 CDTMA1 = $0226 6}550 DOWN TIMER 1 JSR ADDRESS0366 CDTMA2 = $0228 552 DOWN TIMER 2 JSR ADDRESS0367 CDTMF3 = $022A 554 DOWN TIMER 3 FLAG6}0368 SRTIMR = $022B 555 REPEAT TIMER0369 CDTMF4 = $022C 556 DOWN TIMER 4 FLAG0370 INTEMP = $022D 557 IAN'S TEMP06}371 CDTMF5 = $022E 558 DOWN TIMER FLAG 50372 SDMCTL = $022F 559 DMACTL SHADOW0373 SDLSTL = $0230 560 DISPLAY LIST 6}POINTER0374 SSKCTL = $0232 562 SKCTL SHADOW0375 ; $0233 563 (800) UNLISTED0376 LCOUNT = $0233 563 (XL) LOA6}DER TEMP0377 LPENH = $0234 564 LIGHT PEN HORIZONTAL0378 LPENV = $0235 565 LIGHT PEN VERTICAL0379 ; $0236 6} 566 2 SPARE BYTES0380 ; $0238 568 (800) SPARE, 2 BYTES0381 RELADR = $0238 568 (XL) LOADER0382 CDEVIC = $023A6} 570 DEVICE COMMAND FRAME BUFFER0383 CAUX1 = $023C 572 DEVICE COMMAND AUX 10384 CAUX2 = $023D 573 DEVICE COMMAND6} AUX 20385 TEMP = $023E 574 TEMPORARY STORAGE0386 ERRFLG = $023F 575 DEVICE ERROR FLAG (EXCEPT TIMEOUT)0387 DFLAGS6} = $0240 576 FLAGS FROM DISK SECTOR 10388 DBSECT = $0241 577 NUMBER OF BOOT DISK SECTORS0389 BOOTAD = $0242 578 BO6}OT LOAD ADDRESS POINTER0390 COLDST = $0244 580 COLD START FLAG, 1 = COLD START IN PROGRESS0391 ; $0245 581 (806}0) SPARE0392 RECLEN = $0245 581 (XL) LOADER0393 DSKTIM = $0246 582 (800) DISK TIME OUT REGISTER0394 ; $0246 6} 582 (XL) RESERVED, 39 BYTES0395 LINBUF = $0247 583 (800) CHARACTER LINE BUFFER, 40 BYTES0396 CHSALT = $026B 619 (XL6}) CHARACTER SET POINTER0397 VSFLAG = $026C 620 (XL) FINE SCROLL TEMPORARY0398 KEYDIS = $026D 621 (XL) KEYBOARD DISABL6}E0399 FINE = $026E 622 (XL) FINE SCROLL FLAG0400 GPRIOR = $026F 623 P/M PRIORITY AND GTIA MODES0401 GTIA = $026F6} 6230402 PADDL0 = $0270 624 (XL) 3 MORE PADDLES, (800) 6 MORE PADDLES0403 STICK0 = $0278 632 (XL) 1 MORE STICK, (86}00) 3 MORE STICKS0404 PTRIG0 = $027C 636 (XL) 3 MORE PADDLE TRIGGERS, (800) 6 MORE0405 STRIG0 = $0284 644 (XL) 1 MORE6} STICK TRIGGER, (800) 3 MORE0406 CSTAT = $0288 648 (800)0407 WMODE = $0289 6490408 BLIM = $028A 6500409 ; 6} $028B 651 5 SPARE BYTES0410 NEWADR = $028E 654 (XL) LOADER RAM0411 TXTROW = $0290 6560412 TXTCOL = $0291 6} 6570413 TINDEX = $0293 659 TEXT INDEX0414 TXTMSC = $0294 6600415 TXTOLD = $0296 662 OLD ROW AND OLD COL FOR TEXT6}, 2 BYTES0416 ; $0298 664 4 SPARE BYTES0417 TMPX1 = $029C 668 (800)0418 CRETRY = $029C 668 (XL) NUMBER O6}F COMMAND FRAME RETRIES0419 SUBTMP = $029E 6700420 HOLD2 = $029F 6710421 DMASK = $02A0 6720422 TMPLBT = $02A1 6} 6730423 ESCFLG = $02A2 6740424 TABMAP = $02A3 675 15 BYTE BIT MAP FOR TAB SETTINGS0425 LOGMAP = $02B2 690 4 BY6}TE LOGICAL LINE START BIT MAP0426 INVFLG = $02B6 6940427 FILFLG = $02B7 695 FILL DIRING DRAW FLAG0428 TMPROW = $02B86} 6960429 TMPCOL = $02B9 6970430 SCRFLG = $02BB 699 SCROLL FLAG0431 HOLD4 = $02BC 7000432 HOLD5 = $02BD 76}01 (800)0433 DRETRY = $02BD 701 (XL) NUMBER OF DEVICE RETRIES0434 SHFLOC = $02BE 7020435 BOTSCR = $02BF 703 24 N6}ORM, 4 SPLIT0436 PCOLR0 = $02C0 704 3 MORE PLAYER COLOR REGISTERS0437 COLOR0 = $02C4 708 4 MORE GRAPHICS COLOR REGIST6}ERS0438 ; $02C9 713 (800) 23 SPARE BYTES0439 RUNADR = $02C9 713 (XL) LOADER VECTOR0440 HIUSED = $02CB 715 6}(XL) LOADER VECTOR0441 ZHIUSE = $02CD 717 (XL) LOADER VECTOR0442 GBYTEA = $02CF 719 (XL) LOADER VECTOR0443 LOADAD = 6}$02D1 721 (XL) LOADER VECTOR0444 ZLOADA = $02D3 723 (XL) LOADER VECTOR0445 DSCTLN = $02D5 725 (XL) DISK SECTOR SIZ6}0446 ACMISR = $02D7 727 (XL) RESERVED0447 KRPDER = $02D9 729 (XL) KEY AUTO REPEAT DELAY0448 KEYREP = $02DA 730 (X6}L) KEY AUTO REPEAT RATE0449 NOCLIK = $02DB 731 (XL) KEY CLICK DISABLE0450 HELPFG = $02DC 732 (XL) HELP KEY FLAG0451 6}DMASAV = $02DD 733 (XL) SDMCTL (DMA) SAVE0452 PBPNT = $02DE 734 (XL) PRINTER BUFFER POINTER0453 PBUFSZ = $02DF 736}5 (XL) PRINTER BUFFER SIZE0454 GLBABS = $02E0 736 GLOBAL VARIABLES, 4 SPARE BYTES0455 RAMSIZ = $02E4 740 PERMANENT ST6}ART OF ROM POINTER0456 MEMTOP = $02E5 741 END OF FREE RAM0457 MEMLO = $02E7 7430458 ; $02E9 745 (800) SPA6}RE0459 HNDLOD = $02E9 745 (XL) HANDLER LOADER FLAG0460 DVSTAT = $02EA 746 DEVICE STATUS BUFFER, 4 BYTES0461 CBAUDL =6} $02EE 750 CASSETTE BAUD RATE, 2 BYTES0462 CRSINH = $02F0 752 1 = INHIBIT CURSOR0463 KEYDEL = $02F1 753 KEY DELAY 6}AND RATE0464 CH1 = $02F2 7540465 CHACT = $02F3 7550466 CHBAS = $02F4 756 CHARACTER SET POINTER0467 NEWROW =6} $02F5 757 (XL) DRAW DESTINATION0468 NEWCOL = $02F6 758 (XL) DRAW DESTINATION0469 ROWINC = $02F8 760 (XL)0470 COL6}INC = $02F9 761 (XL)0471 CHAR = $02FA 7620472 ATACHR = $02FB 763 ATASCII CHARACTER FOR CIO0473 CH = $02FC 6} 7640474 FILDAT = $02FC 764 COLOR FOR SCREEN FILL0475 DSPFLG = $02FE 766 DISPLAY CONTROL CHARACTERS FLAG0476 SSFLAG6} = $02FF 767 DISPLAY START/STOP FLAFG0477 ;0478 ;0479 ; PAGE 30480 ;0481 ;0482 ; RESIDENT DISK HANDLER6}/SIO INTERFACE0483 ;0484 DCB = $0300 768 DEVICE CONTROL BLOCK0485 DDEVIC = $0300 7680486 DUNIT = $0301 76906}487 DCOMND = $0302 7700488 DSTATS = $0303 7710489 DBUFLO = $0304 7720490 DBUFHI = $0305 7730491 DTIMLO = $0306}6 7740492 DBYTLO = $0308 7760493 DBYTHI = $0309 7770494 DAUX1 = $030A 7780495 DAUX2 = $030B 7790496 TIM6}ER1 = $030C 780 INITIAL TIMER VALUE0497 ADDCOR = $030E 782 (800) ADDITION CORRECTION0498 JMPERS = $030E 782 (XL) O6}PTION JUMPERS0499 CASFLG = $030F 783 CASSETTE MODE WHEN SET0500 TIMER2 = $0310 784 FINAL VALUE, TIMERS 1 & 2 DETERMIN6}E BAUD RATE0501 TEMP1 = $0312 7860502 TEMP2 = $0313 787 (XL)0503 TEMP2 = $0314 788 (800)0504 PTIMOT = $0314 6} 788 (XL) PRINTER TIME OUT0505 TEMP3 = $0315 7890506 SAVIO = $0316 790 SAVE SERIAL IN DATA PORT0507 TIMFLG = $0316}7 791 TIME OUT FLAG FOR BAUD RATE CORRECTION0508 STACKP = $0318 792 SIO STACK POINTER SAVE0509 TSTAT = $0319 793 6}TEMPORARY STATUS HOLDER0510 HATABS = $031A 794 HANDLER ADDRESS TABLE, 38 BYTES0511 MAXDEV = $0321 801 MAXIMUM HANDLER6} ADDRESS INDEX0512 PUPBT1 = $033D 829 (XL) POWER-UP/RESET0513 PUPBT2 = $033E 830 (XL) POWER-UP/RESET0514 PUPBT3 = $06}33F 831 (XL) POWER-UP/RESET0515 ;0516 ;IOCB's0517 ;0518 IOCB = $0340 8320519 ICHID = $0340 8320520 ICDNO =6} $0341 8330521 ICCOM = $0342 8340522 ICSTA = $0343 8350523 ICBAL = $0344 8360524 ICBAH = $0345 8370526}5 ICPTL = $0346 8380526 ICPTH = $0347 8390527 ICBLL = $0348 8400528 ICBLH = $0349 8410529 ICAX1 = $034A 6} 8420530 ICAX2 = $034B 8430531 ICAX3 = $034C 8440532 ICAX4 = $034D 8450533 ICAX5 = $034E 8460534 ICAX66} = $034F 8470535 ; OTHER IOCB's, 112 BYTES0536 PRNBUF = $03C0 960 PRINTER BUFFER, 40 BYTES0537 6}; $03E8 1000 (800) 21 SPARE BYTES0538 SUPERF = $03E8 1000 (XL) SCREEN EDITOR0539 CKEY = $03E9 1001 (XL) STAR6}T KEY FLAG0540 CASSBT = $03EA 1002 (XL) CASSETTE BOOT FLAG0541 CARTCK = $03EB 1003 (XL) CARTRIDGE CHECKSUM0542 ACMVAR 6}= $03ED 1005 (XL) RESERVED, 6 BYTES0543 MINTLK = $03F9 1017 (XL) RESERVED0544 GINTLK = $03FA 1018 (XL) CARTRIDGE INTE6}RLOCK0545 CHLINK = $03FB 1019 (XL) HANDLER CHAIN, 2 BYTES0546 CASBUF = $03FD 1021 CASSETTE BUFFER, 131 BYTES TO $047F06}547 ;0548 ;0549 ; PAGE 40550 ;0551 ;0552 USAREA = $0480 1152 128 SPARE BYTES0553 ;0554 ; SEE APPENDIX C 6}FOR PAGES 4 AND 5 USAGE0555 ;0556 ;D:APNDXBD.20552 USAREA = $0480 1152 128 SPARE BYTES0553 ;0554 ; SEE APPENDIX C 430557 ;0558 ;0559 ; PAGE 50560 ;0561 PAGE5 = $0500 1280 127 FREE BYTES0562 ; $057E 1406 129 FREE BYT:}ES IF FLOATING POINT ROUTINES NOT USED0563 ;0564 ;FLOATING POINT NON-ZERO PAGE RAM, NEEDED ONLY IF FP IS USED0565 ;0566 L:}BPR1 = $057E 1406 LBUFF PREFIX 10567 LBPR2 = $05FE 1534 LBUFF PREFIX 20568 LBUFF = $0580 1408 LINE BUFFER0569 PLY:}ARG = $05E0 1504 POLYNOMIAL ARGUMENTS0570 FPSCR = $05E6 1510 PLYARG+FPREC0571 FPSCR1 = $05EC 1516 FPSCR+FPREC0572 F:}SCR = $05E6 1510 =FPSCR0573 FSCR1 = $05EC 1516 =FPSCR10574 LBFEND = $05FF 1535 END OF LBUFF0575 ;0576 ;0577 ; :} PAGE 60578 ;0579 ;0580 PAGE6 = $0600 1536 256 FREE BYTES0581 ;0582 ;0583 ; PAGE 70584 ;0585 ;0:}586 BOOTRG = $0700 1792 PROGRAM AREA0587 ;0588 ;0589 ; UPPER ADDRESSES0590 ;0591 ;0592 RITCAR = $8000 32768 RA:}M IF NO CARTRIDGE0593 LFTCAR = $A000 40960 RAM IF NO CARTRIDGE0594 C0PAGE = $C000 49152 (800) EMPTY, 4K BYTES0595 C0PAGE:} = $C000 49152 (XL) 2K FREE RAM IF NO CARTRIDGE0596 ; $C800 51200 (XL) START OF OS ROM0597 CHORG2 = $CC00 52224 (:}XL) INTERNATIONAL CHARACTER SET0598 ;0599 ;0600 ; HARDWARE REGISTERS0601 ;0602 ;0603 ; SEE REGISTER LIST FOR MORE:} INFORMATION0604 ;0605 ;0606 HPOSP0 = $D000 532480607 M0PF = $D000 532480608 SIZEP0 = $D008 532560609 M0PL = $D0:}08 532560610 SIZEM = $D00C 532600611 GRAFP0 = $D00D 532610612 GRAFM = $D011 532650613 COLPM0 = $D012 532660614 CO;}LPF0 = $D016 532700615 PRIOR = $D01B 532750616 GTIAR = $D01B 532750617 VDELAY = $D01C 532760618 GRACTL = $D01D 532;}770619 HITCLR = $D01E 532780620 CONSOL = $D01F 532790621 AUDF1 = $D200 537600622 AUDC1 = $D201 537610623 AUDCTL = ;}$D208 537680624 RANDOM = $D20A 537700625 IRQEN = $D20E 537740626 SKCTL = $D20F 537750627 PORTA = $D300 540160628;} PORTB = $D301 540170629 PACTL = $D302 540180630 PBCTL = $D303 540190631 DMACLT = $D400 542720632 DLISTL = $D402 ;}542740633 HSCROL = $D404 542760634 VSCROL = $D405 542770635 CHBASE = $D409 542810636 WSYNC = $D40A 542820637 VCOUNT;} = $D40B 542830638 NMIEN = $D40E 542860639 ;0640 ; FLOATING POINT MATH ROUTINES0641 ;0642 AFP = $D800 552960643 ;}FASC = $D8E6 555260644 IFP = $D9AA 557220645 FPI = $D9D2 557620646 ZFR0 = $DA44 558760647 ZF1 = $DA46 5;}58780648 FSUB = $DA60 559040649 FADD = $DA66 559100650 FMUL = $DADB 560270651 FDIV = $DB28 561040652 PLYEVL ;}= $DD40 566400653 FLD0R = $DD89 567130654 FLD0P = $DD8D 567170655 FLD1R = $DD98 567280656 FLD1P = $DD9C 5673206; }57 FSTOR = $DDA7 567430658 FSTOP = $DDAB 567470659 FMOVE = $DDB6 567580660 EXP = $DDC0 567680661 EXP10 = $DDCC; } 567800662 LOG = $DECD 570370663 LOG10 = $DED1 570410664 ;0665 ;0666 ; OPERATING SYSTEM0667 ;0668 ;0669 ; }; MODULE ORIGIN TABLE0670 ;0671 CHORG = $E000 57344 CHARACTER SET, 1K0672 VECTBL = $E400 58368 VECTOR TABLE0673 VC; }TABL = $E480 58496 RAM VECTOR INITIAL VALUE TABLE0674 CIOORG = $E4A6 58534 CIO HANDLER0675 INTORG = $E6D5 59093 INTERRUP; }T HANDLER0676 SIOORG = $E944 59716 SIO DRIVER0677 DSKORT = $EDEA 60906 DISK HANDLER0678 PRNORG = $EE78 61048 PRINTER HA;}NDLER0679 CASORG = $EE78 61048 CASSETTE HANDLER0680 MONORG = $F0E3 61667 MONITOR/POWER UP MODULE0681 KBDORG = $F3E4 624;}36 KEYBOARD/DISPLAY HANDLER0682 ;0683 ;0684 ; VECTOR TABLE, CONTAINS ADDRESSES OF CIO ROUTINES IN THE0685 ; FOLLOWING O;}RDER. THE ADDRESSES IN THE TABLE ARE TRUE ADDRESSES-10686 ;0687 ; ADDRESS + 0 OPEN0688 ; + 2 CLOSE0689 ; ;} + 4 GET0690 ; + 6 PUT0691 ; + 8 STATUS0692 ; + A SPECIAL0693 ; + C JMP TO I;}NITIALIZATION0694 ; + F NOT USED0695 ;0696 ;0697 EDITRV = $E400 58368 EDITOR0698 SCRENV = $E410 58384 SCREEN;}0699 KEYBDV = $E420 58400 KEYBOARD0700 PRINTV = $E430 58416 PRINTER0701 CASETV = $E440 58432 CASSETTE0702 ;0703 ; ;} ROM VECTORS0704 ;0705 DSKINV = $E453 584510706 CIOV = $E456 584540707 SIOV = $E459 584570708 SYSVBV = $E45F ;}584630709 VBIVAL = $E460 58464 ADR AT VVBLKI0710 XITVBV = $E462 58466 EXIT VBI0711 VBIXVL = $E463 58467 ADR AT VVBLKD0;}712 BLKBDV = $E471 58481 MEMO PAD MODE0713 WARMSV = $E474 584840714 COLDSV = $E477 58487 = $E463 58467 ADR AT VVBLKD08^12 4 1 5 0 10 70 2 12 132C-@27EAPPENDIX CMEMORY USEPage 0$00-$7FOperating system zero-page. The ?}entire first half of page zero is reserved for the operating system.$80-$FFFree zero-page. The top half of page zero is ?}free if BASIC is disabled. BASIC uses all but $CB-$D1. The floating point math routines use $D4-$FF. If the floating point?} arithmetic package is not used this memory is free.Page 1$100-1FFThis is the 6502 stack. The stack pointer initializ?}ed to $1FF and moves downward as the stack is filled.Pages 2-5$200-$47FThis area is used for operating system database?} variables. Parts which are not used in some particular programs, such as the cassette buffer or printer buffer, may then be?} used for other purposes. See the O.S. equate listing for these locations.$480-$57D ($480-$6FF if no floating point)This?} is called the user work space. It is free to be used by programs. If the floating point arithmetic package is not used the?} user work space extends to $6FF. This area is used by BASIC.$57E-$5FFThis area is used by the floating point arithmetic? } package. It is free if the package is not used.Page 6$600-6FFAtari has solemnly sworn never to put anything in this?!} page of memory.Page 7-the screen region$700This is called the boot region. Most machine language programs which don'?"}t use DOS load at this address. DOS extends from $700-$1CFB.MEMLOThe address pointed to by the O.S. database variable M?#}EMLO [$02E7,2 (743)] is the first byte of free memory. This pointer is usually changed by any program's initialization routi?$}ne. For example, upon power-up, MEMLO points to $700. When DOS loads in, DOS changes MEMLO to point to $2A80. If an AUTORU?%}N.SYS program then loads in just above DOS, such as DISKIO, it will usually change MEMLO to point above itself. One importan?&}t reason for this is to protect the program from BASIC. BASIC uses memory starting at MEMLO.MEMTOPMEMTOP [$2E5,2 (741)] ?'}is set by the O.S. whenever a graphics mode is entered. The graphics region is at the very top of ram and extends downward. ?(} The address MEMTOP points to depends on how much memory the screen region uses.APPMHIAPPMHI [$0E,2 (14)] should be set b?)}y any program to point to the highest address required by the program. If the O.S. cannot set up a screen without going belo?*}w APPMHI it will return a not-enough-memory-for-screen-mode error.The cartridge slots$8000 (32768)This is the beginnin?+}g of the 8K bytes used by the right cartridge slot of the 800. This is also where 16K cartridges begin. If there is no cart?,}ridge here it is ram.$A000 (40960)This is the beginning of the left cartridge of the 800 or the only cartridge slot on a?-}ll other models. This is where the BASIC ROM resides in the XL/XE models. This area is RAM is there is no cartridge or BASI?.}C is disabled on XL/XE models.above the cartridges$C000-$CFFF (49152-53247)This area is empty on the 800. Sometimes s?/}pecial ROM chips, such as Omnimon are wired in here. On the XL/XE models $C000-C7FF is free ram if there are no cartridges. ?0} On XL/XE models, the O.S. ROM starts at $C800$D000-$D7FF (53248-57373)This area is taken up by the hardware chips. The ?1}chips actually take only a fraction of this space. If these addresses are further decoded there is space for many, many more?2} hardware chips. For example, The PIA chip uses 256 bytes of memory but needs only 4 bytes. There is room for 64 PIA chips ?3}in this reserved memory.$E000-E3FF (57344-58367)This is the location of the ATASCII character set.$E400-FFF7 (58368-655?4}27)This is the operating system ROM$FFF8-$FFFF (65528-65535)These last 8 bytes contain the addresses of the interrupt v?5}ectors. Upon power up the 6502 gets a reset pulse and looks up the reset routine here.tain the addresses of the interrupt v<X