@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 D8u*********************************************************************** T} ** From: Chuck Steinman/DataQue Software ** Date: 5/24/89 U} ** Subj: Turbo-Info #1, An introduction to the Turbo-816 ** V} ***********************************************************************TW}his will be the introductory article in a series, which will presentthe Turbo-816 from DataQue Software, for the Atari XL/XEX} Computers.Initially, the features of the product will be presented, and later Iwill progress to actual applications and prY}ogramming hints. If you have any comments or critisizms, I would appreciate it greatly if youwould write a note, and expresZ}s your thoughts.For those of you which are not familiar with the Turbo-816, it is ahardware, and firmware upgrade for the[} Atari XL and XE computers which will expand the capability of those machines, while still maintaining the compatibility wi\}th your existing software and hardware investment. There will also be a version for the original800, although no release d]}ate has been set at this time. The XL/XE kit is called the Turbo-816x, and will sell for $120 plus $4.00 S&Hwithin the US. ^} Foreign destinations, COD, and other special handlingwould be extra.The main component of the T816 (short for Turbo-816)_} is the CPU adapter board. For those of you which are not familiar with computer jargon, CPU stands for Central Processing`} Unit, which is the main'brain' of your computer. The CPU which came in your XL/XE computer is an 8-bit 6502. The actual a}CPU in the Atari XL/XE computers, is actually a slightly modified version of the 6502.The T816 adapter board, along with b}a short ribbon cable, will replaceyour existing 6502 CPU, with a new more powerful 16-bit CPU. This new CPU has the uniquec} capability of also being able to understandthe 8-bit 6502 CPU instructions. That allows the adapter board tostill executed} your original 8-bit programs. The CPU adapter boardis approximately 5 inches, by 2 1/2 inches, and takes care of allof the}e timing, and control functions, which allow it to fully emulate(or function like) the special Atari version of the 6502, whf}ile alsoextending the addressing range. One jumper must be added to yourAtari XL/XE motherboard to make the system work. Ig}nstallation andmodification information is provided as part of the Turbo-816 kit.The other component of the Turbo-816 sysh}tem, is the Turbo-OS ROM. This part is a 28-pin integrated chip, which holds the initializationand control software that moi}st of you take for granted. Originally Ihad planned on this chip fully replacing the Atari OS, and just adding any new funcj}tions required by the new CPU to allow it to workproperly. Well it wasnt long before I ran into a snag. Atari wouldnot rek}lease the source code for the XL/XE Operating System ROM to me.I offered to sign any non-disclosures and pay any required fel}es, butthe best offer they could come up with was $1000 up front, and 50 cents per unit sold, for the right to copy only cem}rtian sections ofthe Atari Operating System ROM, but no source code was to be includedin that agreement.I was not impresn}sed with their support, so I proceeded to write theentire Turbo-OS from scratch. This not only cost several additionalmonto}hs of programming effort, but also increased the amount of time to test each and every function. The resulting Operating Syp}stem is100% compatible with software which uses the published, legal entrypoints into the Atari OS, and legal RAM locationsq}. Because of manyprograms making illegal calls to the OS, or use reserved RAM, Isuggest that BOTH the Atari OS, and the Tur}rbo-OS are installed, anda toggle switch be used to select which is active. Details on howto make this modification, are as}lso included in the kit.A popular misconception about the upgrade, is that it will execute STand/or IBM/PC programs. It t}will not. I have never advertised, or claimed it would, so I can only guess someone that was not familiarwith assembly codu}e, or the internal workings of computers started this rumor. The ST uses a 32-bit 68000 processor, and the IBM usesa 80x86v} based processor. The 65816 is not software compatible witheither of those CPU's, and neither of those CPU's can directly w}understand the 6502 code. If someone wants to write such an emulatorfor either of those CPU's, let me know when you have itx} done!The Turbo-816, uses the WD65C816P5 CPU, which was designed by WesternDesign Center, and is manufactured by Californy}ia Microsystems. Thisis the same CPU which is used in the Apple ][gs. Any of you which have seen this machine, know that z}it is a powerful little machine, although it does have a few design problems which prevent it frombeing able to fully take {}advantage of the CPU.Many have asked, 'What will this do for me?'. There are many ways toanswer that question depending |}on what you use your computer for, andwhether you program. The Turbo-816 not only adds 16-bit working registers, but also,}} new more powerful instructions, and a 24-bitaddress bus. Now with these new capabilities, more powerful new programs can b~}e written to allow the Atari Computers to compete againwith the more expensive 16-bit computers. The new addressing capabil}ity allows for up to 16 megabyte of memory and peripherals, and the new instructions make smaller, faster, and more complex }routines possible.To the non-programmer, at this time there are no programs which takefull advantage of the Turbo-816. }Current applications will run from5% to over 300% faster depending on how much they use the Turbo-OS. Since the current sof}tware was not written to access the new memory,or take advantage of the new instructions, it can only gain performance by c}alls to the Turbo-OS. I have made available MAC/65Macros and other information to all registered owners via my BBS, and the} GEnie telecommunications service, which will allow owners of MAC/65, or any other macro assembler, to begin using the new 6}5816instructions immediately.I will have several new applications which will take advantage of thenew memory and power t}hough. The first of these will be a spreadsheetprogram called the Turbo-S16. It will be similar to VisiCalc, andSynCalc. }The program will determine if a Turbo-816, and Turbo-OS areavailable, and then use any expanded or explicit memory if availa}ble.Otherwise it will run on a stock Atari 400/800/XL/XE using the normalRAM. Since it is not initially going to be design}ed as a concurrentapplication, it will absorb all available RAM for its use. That meansif there is 1 megabyte of explicit, }or expanded memory available, itwill allow you to use up to that amount for the application. I planon releasing this progra}m in ROM, which will be to my knowledge, thefirst spreadsheet program to be implemented in ROM for the Atari. A discount wi}ll be available (with proof of purchase) to owners ofSynCalc, SynCalc+, and VisiCalc as an incentive to upgrade to theTurbo}-S16. Details will be released later.Another application nearing completion, is the Turbo-A16. This is anassembler, whic}h will allow you to assemble native mode 65816 code. I am trying to incorporate enough versitility to allow loading of sour}ce code from popular file formats. That will allow people to use their existing libraries, without having to convert them f}irst.It has not been decided whether this application will be in ROM, ordisk based.Well, that is the basics of the Turbo}-816. If you have any specificquestions that you would like answered, please write,and I will see that you get an answer. } For thoseof you with GEnie accounts, I have a special section dedicated forTurbo-816 questions and answers, so feel free t}o drop in!you with GEnie accounts, I have a special section dedicated forTurbo-816 questions and answers, so feel free t*********************************************************************** } ** From: Chuck Steinman/DataQue Software ** Date: 5/26/89 } ** Subj: Turbo-Info #2, Where is all of my memory? ** } ***********************************************************************T }his is the second part of a multi-part information article on theTurbo-816 from DataQue Software, for the Atari XL/XE comput }ers. Thefirst installment went over the basic system, and this article willexplain the various possible types of available } memory in a Turbo-816upgraded system.Because of the limited adressing range of the 6502 CPU used in theAtari 8-bit comp }uters, there have been several techniques used toallow larger programs, and more data to be stored. None of thesetechnique }s used to date have been efficient, and are awkward at best.The Turbo-816 changes all of that.Because of a lack of defini }tion in the past of the various ways ofdescibing the many ways the 6502, I have made my own definitionsas to how the 6502 a }nd Turbo-816 can address memory. I have brokendown memory into several basic groups. They are descibed as follows: Standa }rd: This is the original 64k of memory which the 6502 can directly access without any gymnastics. In most } systems, There would be a 16k section dedicated to the ROM space and I/O devices, and the remaining 48k } is available for either RAM, or cartridges. Extended: This is the RAM which is available using a bank } selecting technique like the Atari 130XE. Many have upgraded their XL computers to also have a compati }ble bank selected RAM area. The Turbo-OS includes several routines to manage, and report the amoun }t of Extended RAM available. The Extended RAM is used, and available exactly like it always has be }en, so your programs that use the XE banked RAM will still work just fine. Explicit: This is a 1 megabyte ar }ea dedicated for RAM or ROM which is installed by using Turbo-SRAM cards. It can be any mix of eit }her Static RAMs, or PROMS. The Turbo-SRAM card is compatible with many common sizes of RAMs and E }PROMS. The Turbo-OS, checks the Explicit range from $010000 to $07FFFF every 32k for a pattern to detect } whether either ROM, or RAM exists. The reason for dedicating an area for SRAMs, and EPROMs } was to allow for resident programs to be held in either EPROM, or RAM, and for those programs to optionally } also have their own dedicated data RAM. This would allow you to have several different application } programs, or device drivers installed in the system, and select from those programs without having } to load them from a disk file, or insert a cartridge. They would normally be dormant, and be acti }vated by a system call. There are several operating system functions which support the Explicit m }emory. There are routines to allocate, and deallocate Explicit RAM. There are also routines to In }itialize, and Execute application programs which reside in the Explicit memory range. Expanded: This is an 8 } megabyte area dedicated for use by user applications as either data, or program RAM. The Turbo-O }S, will scan the range of $080000 to $7FFFFF to determine how much expanded RAM exists in a particular } system. Also, the RAM can be allocated in 256 byte blocks by applications. This will allow for multiple } applications to share the available RAM. There is also a deallocation routine to return allocated RA }M back to the system. Proto: This is an area defined for the prototyping card, which is avai }lable for any user developed applications. No production product should ever use this area. This two } megabyte area runs from $800000 to $9FFFFF, and is not checked, or used by the Turbo-OS. Video: There } is a 4 megabyte range of memory which is dedicated for video adapters, in the range of $A00000 to $DFFFFF. } This will allow for multiple video adapters to have their own RAM, without conflict. Also, this RAM is } specified as dual-port DRAM, so unlike the ANTIC video RAM, no bus arbitration, or DMA is require }d to access the RAM, either by the CPU, or Video controller. This allows the CPU to run though vid }eo refreshes, unlike the current system, in which ANTIC halts the CPU while it is reading the vide }o RAM out to the shift registers. DataQue: This is an area defined in-house applications, and products, an }d should not be used by any third party or user products. This one megabyte area runs from $E00000 } to $EFFFFF, and is not currently checked, or used by the Turbo-OS. Turbio: This block is reserved for i/o } devices and control registers. It is located from $F00000 to $FFFFFF and can be used by various } peripheral cards. There are specific ranges within this spec for certian devices. At this time, t }he only device which uses this area is the 80 column video adapter. Other peripherals such as disk } controllers, printer interfaces, and co-processors would use this area for their access, to allow }for the maximum compatibility. Each peripheral, and its supporting device driver should allow for s }everal different locations, to allow for co-existence with other peripherals, and also multiples of } like peripherals.cations, to allow for co-existence with other peripherals, and also multiples of *********************************************************************** } ** From: Chuck Steinman/DataQue Software ** Date: 6/29/89 } ** Subj: Turbo-Info #3, What is the Turbo-OS, and What does it do? ** } ***********************************************************************T}his is the third part of a multi-part information article on theTurbo-816 from DataQue Software, for the Atari XL/XE compute}rs. Theprevious installments went over the basic system, and the memory, andthis article will explain some of the unique f}unctions of the Turbo-OS.Some background on the Turbo-OS for those of you which have just tunedinto the AIM Channel #816.}... The Turbo-OS is an operating system forthe Atari XL, and XE computers which either can fully replace the Atari OS you n}ow have, or be used in addition to the Atari OS. The latter application, requires the addition of a toggle switch to allow}for user selection of which Operating System is active. A version forthe 800 computer will be offered also. The Turbo-OS wi}ll only operate in systems with the Turbo-816 CPU adapter card installed. My original intent was to have both the Atari O}S, and the Turbo-OS inone PROM. This would have reduced the amount of hardware needed, andsimplfied installation. Due to }not being able to aquire an acceptableagreement for the Atari OS, the Turbo-OS is a seperate PROM, without theAtari OS incl}uded. This results in an additional 28 or so solderconnections if the 'Dual-Prom' option above is installed. Another opti}on is to use one of the commercially available OS switchers, whichinclude a PC board with multiple OS sockets, and a selecti}on switch.There is two sections to the Turbo-OS, the normal CIO/SIO systeminterface, and the new user interface. The lat}ter is a menu systemwhich allows the user to perform many new unique features. Alsothere are many new CIO vectors, which p}erform memory management, andsystem control functions.The Turbo-OS menu features include the following:- A non-interact}ive NotePad mode which is similar to the Atari 400/800 memo pad mode. While not too useful, kids get a kick out of it, and} it does come in handy for certian applications.- A full 16 megabyte hexidecimal and atascii dynamic memory dump utility.} This will continuously dump the contents of a specified block of memory to the screen. There are several command keys to} make moving about the large addressing range a breeze.- A system congiguration key, which will scan the addressing range }of the Turbo-816 for applications, and memory. If applications are found, they are installed into a menu, where they can} be executed by a single key selection. Up to 8 of these applications can exist.- There is a memory option to clear areas} of RAM including; Standard RAM, Banked RAM (extended), Application RAM (explicit), and Expanded RAM. There are several o}ptions as to exactly how the RAM is cleared.- There are many built in keyboard 'hot' keys, which can be made active from t}he Turbo-OS menu. An indictor shows the current status of the hot keys. These keys will allow the cursor to be moved about} the screen quicker, and turn the video, key-click, and sio noise on and off. Also key repeat, and delay rate are adjusta}ble from the keyboard.- A built in diagnostics screen will allow for verification of all memory types, including the Turbo}-OS PROM. Also, there are provisions for testing the keyboard, joystick controls, paddle controls, and other peripherals}.- There are also keys to select either a cold start of the system, or an option to return to the users application progra}m if one is active. The new CIO (Central Input/Output) system calls include the following:- CalcOS: Calculate and retu}rn the checksum of the OS ROM in register A.- TRAMCk: Scan one (or all) of the three types of non-standard RAM.- TAlloc: }Allocate a specified amount of one of the four types of RAM.- TDaloc: De-Allocate a specified amount of one of the four typ}es of RAM.- TExecu: Execute an installed Turbo-Application.- TIniti: Initialize an intalled Turbo-Application.- DoBank: } Select one of the 16 possible Extended RAM banks.- NatVec: Call an OS function from outside the normal 64k address range.}- CpyBuf: Copy up to a 64k block from-to anywhere in the 16MB range.- FilPat: Fill a block anywhere in the 16MB addressing} range with a pattern.Another feature of the Turbo-OS is the improved floating point package.These routines are called by} many application programs, and languagessuch as the Atari BASIC, and Atari Assembler/Editor cartridge. The amount of incr}ease in speed ranges from 10% to over 300%, and is beingimproved further. The improved routines were originally coded by Ch}arlesMarslett, and were merged with the Turbo-OS under his direct authorization.Some items, which should be noted about th}e Turbo-OS, and compatibilitywith current applications are:- The C: (cassette) handler was removed to make room for the Tu}rbo-OS enhancements, and Turbo-menu. If the C: device is used, there is an installation option to allow the original Ata}ri OS to be selected by a toggle switch. Any time the cassette is needed, a flick of the switch will allow the system to} communicate with the cassette.- The extended character set table was also removed to free up more memory. This should no}t be a significant problem for domestic units, and like the cassette device, could be selected by switching in the Atari }OS.- Two routines to support the uploadable device linker from the 1090 interface were deleted. Their entry vectors termi}nate with an apropriate error. It was felt that there was no need to support this device in the Turbo-OS, and again, the} switch option could be used if needed. Insufficient documentation would have precluded me from being able to write the r}outines from scratch anyway.- A few games, and even fewer applications, scan the OS and compare it against the Atari OS. } If any OS other than the Atari OS is resident, either an error message is printer, or some other abnormal sequence follo}ws. The switch option will allow these programs to run as normal.- Some user written programs, and a few commercial progr}ams have used illegal entry points into the OS. The only valid entry points in the OS are on page $E4xx as listed in sev}eral reference documents. To simplify coding, or reduce code size, some people feel that using subroutines in the OS, oth}er than the vectored ones, is a way to reach that goal. This is not as common as it was before the XL series was introdu}ced.- A very rare compatibility problem exists where a program either uses an unpublished 6502 op-code, or feature. This }has only shown up in two programs out of the several hundred programs tested by the beta testers. There is no easy fix f}or this, unless the program itself can be patched to remove the conflict. This would be evident if the program would not} run with either OS activated.- Finally there is a compatibility problem with certian pbi devices which do not buffer the }address and data lines properly. At this point, the number of problems of this type are limited, but I am looking at severa}l modifications to the Atari motherboard to correct the problem in all cases. The problem occurs only when the pbi devic}e is attached to the Atari, and is related to noise generated when that device is accessed.ccurs only when the pbi devic`*********************************************************************** } ** From: Chuck Steinman/DataQue Software ** Date: 9/15/89 } ** Subj: Turbo-Info #4, New 65C816 registers. ** } ***********************************************************************Th }is is the fourth part of a multi-part information article on theTurbo-816 from DataQue Software, for the Atari XL/XE compute }rs. Theprevious installments went over the basic system, memory, and OS.This article will cover some of the new 65C816 add }ressing modes.The 65C816 is a 16-bit processor, which also has the capability ofexecuting 8-bit 6502 instructions. To all }ow for this, there are twooperating modes for the CPU, the EMULATION mode, and the NATIVE mode.The emulation mode as it imp }lies, will fully simulate a 6502. Thenative mode, opens up the full power of the new processor.Even while in the emulati}on mode, many new instructions are available.Some are of little use, because of being limited to the 64k addressingrange of} the 6502. Many of the new instructions allow for smaller,faster code. Other instructions offer power which was previously} notfeasable, or practical.Because of the limited 16-bit addressing range of the 6502, The designersof the 65C816 realiz}ed that if their new processor was to survive, itmust be able to address more than 64k, while still maintaining 6502compati}bility. This was done by using multiplexing, which adds anothereight lines to the address bus. This new 24-bit address bus} allows fora full 16 mega-byte range.Obviously, there was no inherent way to control these extra eight lineswith the 650}2 instruction set, so new instructions and addressing modeswould have to be added. To maintain 6502 compatibility, there wo}uld becertian limits as to the functionality of those lines while in the 6502emulation mode. There must also be the additi}on of several new registersto allow for dynamic control of the state of the new address lines.There are two new registers} in the 65C816 which control the eight newaddress lines. The B register controls the new lines during access todata memory}. This would be any time that you would be loading, storingor doing manipulations to data external to the processor. This }registeris also known as the DATA BANK register. The K register is used anytime that program memory is being accessed. Th}is would be when the CPUis fetching an instruction, and its operands. This register is also knownas the PROGRAM BANK regis}ter. Both of these registers are 8-bits wide.It should be emphasized that the B and K registers are not used in theemula}tion mode on the T816, so they could be used as general purpose registers. Because of this, while in the emulation mode, th}e CPU islimited to the base 64k of memory. This lowest 64k is where the stockXL/XE motherboard resides in the memory map. } The CPU, and Turbo-816 power up in the emulation state, to maintain compatibility with the 6502.In the native mode, the B }and K registers are appended to the normal 16-bitaddresses. This allows for expanded addressing, even while still executing }the standard 6502 instructions.There are two other registers which should be mentioned at this time. Inthe 6502, the low!}est 256 bytes of memory had special addressing modes. Theywere called 'Zero Page Addressing'. There were several variations"} of zeropage addressing, depending on which, if any index registers were used, andalso if the data was loaded directly, or #}indirectly. The 65C816 expandsthis addressing mode by allowing this same addressing mode throughout thebase 64k. The regi$}ster which allows this to be done is the D, or Directregister. The D register is 16-bits wide. The contents of this registe%}rare added to the user supplied operand, to form the 16-bit address. Thisregister is active whether in native or emulation &}mode, which causes someprogrammers grief, as they assume it is always on page zero while in theemulation mode.The last r'}egister, is really just an extension to an existing register.With the 6502, there was the limitation of only having a small (}256 bytestack range. This limited use in applications where heavy parameterpassing, and stack usage were required. The 65)}C816, allows the stackto be located anywhere in the base 64k, and in the native mode, the stackcan be up to a full 64k in t*}heory. A common mistake made here is thatprogrammers forget that the stack is always located on page one, and always256 by+}tes in size while in the emulation mode. Also, people assume thatin the native mode the stack wraps around within the curre,}nt page.Another feature of the 65C816 is that the index registers (X & Y) andaccumulator (A) may be either 8-bit or 16-bi-}ts in size while in the nativemode. The index registers are always the same size, but the accumulator may be seperately si.}zed. Of course while in the emulation mode, all threeregisters are limited to 8-bits. Any time you switch between native an/}d emulation mode the registers will be forced to 8-bits. The upper byte ofthe index registers will also be lost. The uppe0}r byte of the accumulatorwill be retained while in the emulation mode, but only accessible throughthe XBA instruction. Mem1}ory accesses will always take on the size of theaccumulator. This is easily overlooked, especially with the shift androtat2}e instructions.Another control function is the E bit in the status register. This bitcontrols whether the Turbo-816 and 3}CPU are in the emulation or nativemode. This bit is changed by using the CLC, or SEC instructions followedby the XCE instr4}uction. This instruction exchanges the Carry flag with theemulation flag. In this way, you can switch modes easily, and al5}so knowwhich mode you were switching out of (by looking at the returned carry).There are several additional control pseud6}o-registers in the Turbo-816,which are controlled by the CPU and ANTIC. This allows access to the full16Mb of address spac7}e with the CPU, while limiting ANTIC, GTIA, POKEY, andthe PIA to the lowest 64k. These registers are not user accessible di8}rectlybut are controlled via functions of the CPU, and ANTIC hardware.4k. These registers are not user accessible diN*********************************************************************** :} ** From: Chuck Steinman/DataQue Software ** Date: 9/05/89 ;} ** Subj: Turbo-Info #5, New 65C816 Instructions ** <} ***********************************************************************T=}his is the fifth installment of a multi-part information article onthe Turbo-816 from DataQue Software, for the Atari XL/XE >}computers. The previous installments went over the basic system, memory, and OS.This article will cover some of the new 65c?}816 instructions.The Turbo-816 can operate in either its native mode, or the 6502emulation mode. While in the emulation @}mode, the processor has manyof the same limitations as the 6502. Even while in the emulation mode,many new instructions arA}e available. Some are of little use, because ofbeing limited to the 64k addressing range of the 6502. Many of the new insB}tructions allow for smaller, faster code. Other instructions offer power which was previously not feasable, or practical.C}Of particular use is the PEA, PEI, and PER instructions. These allowthe programmer to push data onto the stack, without usD}ing one of thenormal registers. This is extremely usefull where parameters are passedbetween subroutines. There are threeE} different versions. The PEA instruction will push a word sized value onto the stack. This is extremely handy for paramF}eter passing, since you can pass absolute values, or addresses. You can also pre-load return addresses onto the stack, rG}emembering of course that you must subtract a value of one from the destination address. PEA is also invaluable for settingH} the Data Bank, and Direct registers, without using a register. The PEI instruction will push the contents of two consecI}utive direct page registers onto the stack. For example PEI $22 will push the contents of direct page address $23 onto tJ}he stack, followed by the contents of direct page address $22. This is very useful for pushing the contents of pointers K}onto the stack. The PER instruction will push a relative value onto the stack, which is the relative offset from the curL}rent program counter to the word operand. This can be used to generate relocatable subroutines. Since the offset is pusM}hed rather than the actual address, the location of the code will have no bearing on the resulting value (assuming that bN}oth routines are moved an equal amount). The value pushed is a signed word value.Another pair of useful instructions arO}e the INA, and DEA instructions.These instructions will increment or decrement the current value in theaccumulator. It is P}nice where you just want to change the accumulatorby a small amount, ignoring any carry. These can also be coded as INC A,aQ}nd DEC A by many 65816 assemblers.The 6502 has a nice set of branching instructions, except it overlooksthe occasion wherR}e you would like to branch, without any test. The reasonfor wanting to do this is to generate more compact code. The 65816 S}has twoversions of branch always instructions. The BRA, which is like the other branch instructions, in that it has a +127/T}-128 range. The BRL instructionwill branch always to an address within a +32767/-32768 range. Both branches are limited toU} the current program bank. Using the branch instructions also make relocatable code easier to construct.A unique instructV}ion the 65816 has, is the COP instruction. This is aninstruction for the (yet to be seen) add-on math co-processor. But noW}t only can it be used for that, but also users may add their own math 'coprocessor' (or other custom routine). The instrucX}tion has a requiredone byte parameter, which is not directly passed. Like the BRK instruction,the COP instruction generateY}s an interrupt, but does not push the operandonto the stack. The Turbo-ASM will also allow for a new SWI instructionwhich Z}will be equivalent to a BRK instruction with a one byte operand.The COP also has its own interrupt vector.There are two n[}ew instructions for bit manipulations also. The TRB(test and reset bit) and TSB (test and set bit) instructions allow yout\}o do a read-modify-write operation between the accumulator and either adirect memory or absolute memory address. I do not k]}now why they did notallow for a long-absolute, or indexed version, which would be useful.Any bits set in the accumulator wh^}en the instruction is executed, willclear (TRB) or set (TSB) bits in the specified destination address.Since there are qu_}ite a few more registers in the 65816 than the 6502, there had to be an improvement made to the stack handling. The 6502 on`}lyhad two each of the push and pull instructions. You could push or pull the accumulator (PHA/PLA) and processor status rea}gister (PHP/PLP). The 65816adds to these, instructions to push and pull both of the index registers(PHX/PHY/PLX/PLY), the b}direct register (PHD/PLD), the data bank register(PHB/PLB), and the program bank register (PHK). As you may notice, youcanc} only push the data bank register, since popping it would be somewhatdifficult to apply.Of course with all of the added ad}ddressing capabilities of the 65816,there must be some way to directly call routines outside the base 64k ofthe machine. Te}here is a JML instruction, which is available only as anindirect jump long. I also consider the JMP ABS_LONG, a JML, but thf}emanufacture does not agree. The Turbo-ASM will accept either. Thereis also a JSL, which will call a long subroutine, avag}ilable only in anabsolute addressing mode. There also must be a way to return from oneof these long subroutines, which is q}B%DOS SYSB*)DUP SYSBAST816 001B3T816 002B>T816 003B4T816 004B>9T816 005B@T816 006implemented in the RTL instruction. A few odd instructions are STP, WAI, and WDM, The STP is used in applications (primar}rily battery backed ones) where you need to putthe processor into the low-power sleep mode. The only way to recoverfrom ts}his mode is to reset the processor. The WAI instruction is similarto the STA WSYNC that is used in the Atari. This instruct}tion will haltthe processor until an interrupt occurs. Unlike the WSYNC, the processorwill wait for either an IRQ or NMI iu}nterrupt. The WDM instruction hasthe most potential. This instruction is the gateway into the 32-bit65832 processor, whicv}h includes a math co-processor. After four years ofwaiting, this CPU has not yet been seen (sound familiar?).The last tww}o instructions I will cover are XBA and XCE. The XBA allowsthe programmer to access the upper byte of the accumulator, whilx}e ineither the NATive, or EMUlation mode of the processor. It is also handyfor a temporary holding place for the accumulaty}or. The upper byte ofthe accumulator is swapped with the lower byte, each time the instructionis executed. The XCE eachanz}ges the processor status carry flag, with the emulation status bit. This is how you move to and from the nativeand emulati{}on modes. If the carry is set before the instruction, theprocessor will be in the 6502 emulation mode.Now that the basic|}s of the Turbo-816 system have been covered, I feelthat you are ready to see how a Turbo-Application is designed. I willbe}} using primarily Turbo-Calc as a reference. I will cover how youmake determinations of what resources are available, and ho~}w to implementdual-function routines, without sacrificing much speed and code size.Remember, if you have any questions pert}aining to the Turbo-816, feel freeto write.t sacrificing much speed and code size.Remember, if you have any questions pert-*********************************************************************** } ** From: Chuck Steinman/DataQue Software ** Date: 11/11/89 } ** Subj: Turbo-Info #6, Determining the System Configuration ** } ***********************************************************************T}his article will present one way to set up a program to run under theTurbo-OS, yet still be compatible with the Atari XL/XE }operating system.It is assumed that the reader has some knowledge of programming at theassembly language level. This insta}llment will concentrate on theallocation of RAM.To make memory management a bit easier for the programmer, the Turbo-OSf}eatures several different routines to control memory allocation, andde-allocation. There are no such routines in the Atari }OS, other thanmemory is deallocated by the operating system for its own use. Thereare memory locations to indicate the min}imum and maximum applicationRAM limits. These pointers are modified by the application programrather than the OS.When I} set forth to write the Turbo-OS, I determined that there werefour types of memory that I would support. To maintain compat}ibilitywith current programs, there was a limit of what could be done withstandard memory, since the current applications w}ould not be calling myroutines. The same would apply to the extended RAM, which is bankedin the $4000-$7fff range using th}e PORTB register of the PIA.There have been a few people tell me that there is no need for anymemory management on the At}ari 8-bit computers. If an application needsRAM, it just uses it, and when the program terminates, another programcan use }it. Well, that presents problems when more than one program hasto share memory. This happens quite often despite what you }may think.If you boot a disk operating system into your computer, and then anapplication program, you would have two progra}ms resident. There aremany times when there are incompatibilities between application programsand particular DOS versions.} DOS 2.x compatibles are usually the worst.Having to load in DUP.SYS is a major trauma. If there is a program inmemory }you want to preserve, you have to have a MEM.SAV file on thedisk. This allows you to save part of your program to disk, eno}ugh toload DUP.SYS into RAM. But then if you happen to want to copy a file,you are just out of luck, you either have to cor}rupt your program, orcopy a sector at a time. This all happens, even though there probablyis at least 16k of RAM being was}ted under the OS ROM. RAMDisks were afudge to help this problem, being automatic would have been better.Yeah, I know, al}l of you SpartaDOS users are grinning from ear-to-earabout now. Well, there are problems there also. Lets say my programw}ants to use the RAM under the OS, or one of the extended (XE type)banks? Can I jump in and use them? No, but not only that}, I have noway to determine if that RAM is being used. There may be 4 to 16 banksof 16k just sitting there, or SpartaDOS m}ay be using part of them asa RAMdisk. But how does the application program know? It cannot, sincethere is no means provid}ed to indicate what banks are available, andhow many banks there were to start with.Well, I hope you can see my point. P}rograms should be written to be moredynamic. If the RAM under the OS is used, then look for banked RAM, ifthat is already }used, or not available, then ask the user what he wantsto do. Not just 'hey bud, can I overwrite your valuable data?' but g}ivethe guy the option to save it, move it, or destroy it. I know, I know,why do you need this type of sophistication in a }game machine. This is where the Turbo-OS routines jump in. If you have an applicationthat needs four banks of extended }RAM, you make the Talloc call specifyingyou need 4 banks. Those four banks, if available, will be flagged asused, so that }other programs will not use them. If there are not fourbanks available, then a bitmap of all free banks is returned. Asim}ilar procedure is followed by the extended and explicit RAM types.Enough talk. I am sure you programmer types want to see} some code flyby your tired eyes about this time. Well, I will present a code segmentwhich will determine whether there is} a Turbo-OS (and Turbo-816) installed,and what memory is available. Better buckle up, here we go!------------------------}----------------------------------------------------; first some memory locations need to be defined.basebyte } dsb 1 ; memory base addressbasepage dsb 1basebank dsb 1lastbyte dsb 1 ; memo}ry ending addresslastpage dsb 1lastbank dsb 1tempvar1 dsb 1 ; temporariestempvar}2 dsb 1tempvar3 dsb 1expanded dsb 1 ; flag for expanded RAM availability; note: }this segment is fully code relocatable.apropriate lda #$a5 cmp #$c001 ; this is a fl}ag to indicated there bne not_816 ; is a Turbo-816 installed cmp #$c000 } beq was_816not_816 lda #$00 ; set all flag/pointer defaults st}a expanded ; no expanded RAM available sta basebank sta lastbank } lda #progend&255 ; construct a pointer to the lowest sta basebyte ; available standard} RAM address lda #progend/256 ; which is the end of this program sta basepage } lda memtop ; construct a pointer to the last sta lastbyte ; available s}tandard RAM address lda memtop+1 sta lastpage ldy #$00 } rts ; no t816, so we are all done!was_816 lda #$03 ; scan for expanded }RAM jsr tramck ; Turbo-OS RAM check routine lda taraml } ora taraml+1 ; was any expanded found? beq not_816 acc 16do_expand } lda taraml ; preset to max availabledo_loop sta tempvar1 pha }; push amount onto stack acc 08 lda #$03 jsr talloc ; }go allocate it acc 16 pla ; pop base address off stack } sta basepage clc adc tempvar1 ; add amount to get ending address } sta lastpage acc 08 cpy #$00 ; was there an allocation} error? bpl no_errorerror acc 16 ; RAM may not be contiguous } lda tempvar ; back off by a page, check again dea ; to find largest contigu}ous block bne do_loop ; of unused RAM. acc 08 ; return with err}or status ldy #$ff ; RAM was not found w/o error rtsno_error } stz basebyte ; always begins on a page boundry lda #$ff sta lastbyte }; always ends before a page boundry sta expanded ; set flag for later testing ldy }#$00 rtsprogend dsb 0ta expanded ; set flag for later testing ldy :