ERROR CODES ERROR CODE 2 3 4 s 6 ? I I 10 11 72 13 74 15 16 az 1a ERROR CODE MESSAGE Memory insufficient Value error Too many variables Stdng length error out of data error Number greater tltan 32767 Input statement error Array or string DIM error Argument stack overflolv Floating point overflod underflow etror Line not found No matching FOR statement line too long error GOSUBor FOR line deleted RETURNerror Garbageerror Invalid string character ERROR CODE ERROR CODE MDSSAGE 142 Serial bus data frame over
ASSEMBLEREDITOR MANUAL /t\ ATARI' onscompany OAwame' communicar lveD' etfort has b€en hade to eNure thal thid manu.l .m.ately documenls rhis prcdud ofthe ATARr compurer Division. Hove@rj beoue ot rhe ongong imlroLement.and updatin8 ofthe omputer sftwe an:dhardware, ATART, rNC. cannot gudaDtee lhe ae cuacy or printeJ mlenal after the datc ofpublication and onnor acepi responsibnityfor eriors or omissrons.
PREFACE This manual assum€s the user has read an introductory book on assembly languag€. It is not intended to teach assembly language. Suggested rcferencis for assembly languag€beginners are 6'502Assembll ranguage programmingby Ladce L€v€nthal and Progamming the 65U by Rodney Zaks (6eeAppendix 8). The wer should also know how to use the scleen editinq and control features of rhe ATARIo 400rM and ATARI 8OOtu personal CoriDuter Svsrems. Thes€ (eatures are the same as used in ATARI 8AS|C. Rer.
CONTENTS PREFACE 1 INTRODUCTION About This Book ATARI PeisonalComputer Systems How anAssembler Editor Is Used 1 1 2 GETTING STARTED Allocating Memory Program Format*How to Write a Statement StatementNumber Label Operation CodeMnemonic Operand Comment How to Write Operands Hex Operands Immediate Operands PageZero Operands Absolute Operands Absolute Indexed Operands Non-indexedIndirect Operands Indexed Indirect Operands Indirect Indexed Operands Indexed PageZero Operands String Operands 5 a a a a a a a2
4 USING THE ASSEMBLER The ASM Command Directives OPT Directive TITLE and PAGEDirectives TAB Directive BYTE,DBYTE,and WORD Directives BYTE DBYTE w'ORD LABEL = Directive * = Directive IF Directive END Directive 2E 27 27 2A 2S 30 30 30 31 31 31 32 5 USING THE DEBUGGER p1rrn^cp aallihd ^fnphrrddpr +Lp np}!'rddpr Debug Commands DR Display Registers CRChangeRegisters D or Dlnmmm Display Memory C or Cmmmm ChangeMemory Mmmmm Move Memory Vmmmm Verify Memory L or Lmmmm List Memory With Disassembly A AssembleOne
11 Modifying DOS I to Make Binary Headers Compariblewith AssemblyCarr;idge ILLUSTRATIONS Figure 2 Figure 3 Figure 4 Figure 5 -r-xntolr I Figure 6 -rlqure / Figure B Figure 9 Relationship ofvarious partsof Assembler tditor carrridgero you and your sollware 3 Memory map withour useof LOMEM Memory map with u6eof LOMEM Example ofhow to write Line No., Label. Op Code.Operand.
l
7 INTRODUCTION ) To use the ATARI@ Assembler Editor cariridge effectively, there are ftur kinds ofinformation that you must have. Firsi, y;u need someguidarc€ about ho$ ro Lr"elhe rdrrri,lge irselr.Second,vou ne.a r,, know abo-urrhe ArARI rcrsonalCompurcrsysremyou ar( uring wir h rhp carrridge. I hird. you needro knou .om.'hing dbourb502 An"cmbtvLangurgpnrogramm,ng.And.
The ATARI 410 Program Recorder i6 an acc€ssory that functions with ihe The proper opFraATARI 400and LheATART800Per"onalComputerSystems. tion ofyour ProgramRecorderis expla;nedin Secljon8 ofrhP ATARI 400and ATARI 800 Opdator's Manuals.Befor€usiDg the Program Record€r with the Assembler Editor cartridge, be sure you know how to operate the Program Recoder. The disk &ives are accessodesthat function with any ATARI Personal Comput€r system with ai leasi 16K RAM.
resultingobiecl program.The rhjrd progrdm is.a ed rhe Debugspri;r helps you to monnoranddFbugyolll objen program.The relarionship berweenrhese ihree programs is depicted as follows: YOU SourceProgram ObjectProgram Figure 7. Rel.,tiot?.ship ofvariorr,s pans of Assembter Editor to you and your softwdre, .llrtridee In Section3 we explain the Editor; in Section4, the Assemble( and in Section5. rhe Debugger.There are somefunddmentatideauwe musr explainfirsl.
), GETTING STARTED ALLOCATING MEMORY The very lirst.decisionyou must make when you sii down to write your source program involves the allocationofmcDlory spac€. All p, ogram".,lgdrdlpss,,f l"ngu"ue.occrrplme ,ory \p4ce.rhe(.ompurerha" a rrmrrc(ldrnounlot ,npmoryand mu5t manr.'Fiti merno|v.dr.full\ . alloLJlmu p " r t i o n "o f m . r , r o l Jr o r p r o g r d m . d r r a . d r . p i r y " f , a , " . r , , d . o r o l t .r r . , . ; , , i i donr automdlRatlyin BASIC.c,,rhc BASICu".
You can find olrr wherF rhis empty memory area is by ryping SrZr mffini. I hree hexade.rmaL number" will be displayed.likF so: SIZEffi 0700 0880 5c1F NDIT The tust number (0700in this example)is the addressofihe bottom of usable RAM, th€ point labeled "A" on ih€ m€mory map. The second number is the addrcssofthe top of th€ edit text bufer, Iabeled.r8,, on the memory map. The third number is ihe addressofthe top of empty memort, labeled-,,C,,;n the memory map.
I i t I os Dos Empty 180 Emply Dlsplay Top ol YoUiRAM BAM Figure I EdilTexl Buffer 3. Memory tnap with ttse of LOMEM. This bumping is accomplishedwfth a speciat cornmand ca ed LOMIIM. The command rs specialbecauseir must be rhe very fir"l command you enler aner iuning on the computer. Its form is simple: LOMEM xxxx g!19fiffi1 wher€ XXXX is the hexadecimal address ofth€ new boftom edge ofthe edit t€xt buffer rpoint A in the mernory mapr.
PROGRAM FORMAT-HO\^/ TO WRITE A STATEMENT. A source program consistsof statements.Each statement is ierminated with g:!8W. A statementmay be 1-106charact€rslong, or almost ihree lines on the scleen. A statement is al6o called a line. The distinction is made between a physical line (a line on the screen)and a logical line (the stdng ofcharacie$, up to three physical lines between ffiFs).
There are two ways to hawe the Assembler interpret €ntries as comm€nts. One way is ro mal.elhe entriesin lhe commenifield.;hich occupiesrhe remainder of the line afier the insrru.lion fieldtsl. Ar leasr one sDacemusr seDaraLerh€ instruflion fields from rhe commenl field. There may iror be enougL spacein the comment field for the comment you wish to write th€re. rn th;t c;se it is best to use one or more lines as comment lines dedicated onlv to makinq comments and conraining no code. To do so. you .nt.
The spacingon ihe pmgramming form is not the sameas the spacingto be used on the screenjcontrolled by keyboard eDtry. On the screenthe classesofeniry (the {i€lds) are not lined up verticaly. The screen has 38 positions (you can change it to a maximum of40), {ewer than the progrsrnming form) and that is the main reasonnot to use many spacesbetween fields. Another differenceber\{raparound' on the tw€€n the programming form and screen is the screen-auiomatic continuation of charactersonto the next line.
HOW TO \ /RITE OPERANDS . This sectionshowshow to write operands.The examplesusestatemenrnumber xxxx (alsocaled line number xxxx). An insiructi; entered without a siate_ ment number is not alowed by the Editor. The examplesuse By (for b)1€) and ABS (for absotuie)as a one_byteand a two_ byte number, respectjvety.Thi$ use implies rhar the proeram i;cludes defini_ rionsofBy and ABSrs.
Examplesr 10 AND $3C26,x 110 F,OR 20955,Y 1110 STA Non-Indexed Indireca operands ln Eeneral.an indjrecl operand is wrilten with pa-rentbesesThe addresswirhin rbe-Darenihesesi" an i;rermediare addresswhich itself con(ains Ihe effective addrless.The onlv instrudion with a non-indexedindirecl operand isJump In' dired. The operand is a number enclosedin parentheses.The parcnlhesesin the operand enciosea number or an expression lhar is inlerpreted ae an intermediate addr€ss.
Exhibit I Sample, Reproducible ATARI Programming Form L I N EN O , LABEL OP CODE OPERAND COMMENT
NOTES:
3 0 USING THE EDITOR Now that we havc explanrcd how to gct started writire a proeram. rt is uD ro you to actually $'ritc the program. This manual coniiins-r eiy liiitc jni;r mdijon on assem}]y .laDguage pfogramDring rectrniques. wc assume thar you are alrcrLly fdmilirr wilh Jssenrbty language. ihe remainder of the section , i F s . . i L r p s l r nr o $ r b " r h c A . s c m L r t ^r d . i r , , r, n , r r i d g r COMMANDS EDIT A PROGRAM au n commano rs nor rhe same fhine as an instruction.
number The eff€ct ofthe NUM commanal stops automatically when a statement that already €xists is reach€d. For examplel LDX *$EF 2n CMP MEMORY NUM 75,5 75 10 which A{ier statement number 15, the next statement number v\rould be 20, of numbedns rhe automatic NtM c;mmand is cancelled' ;;;;;;;;-iJ.;lh; an existing to equal is exactlv next number until the -"tl""e "i'i"i'""i"Gri ""t"iler. .
In these examples, the string SoUGHT is delimited (marked ofD by the character /. Actually, any character except space,tab and @ can be used as th€ delimiter. For exampl€, the command FIND DAD finds the lirst occur:rence ofthe character A. The delimiter is the character D. The delimiter is de{ined as the flrst character fnot cowting space or tab) a{ter ih€ keyword FIND.
Sample Prograln Let us assume you have wdtten a program on an ATARI Programming Form as shown in Figure 6: 'lu, I FEure 6. Satnple Prcgrarn a6 you write it on the ATARI progranming form Then when you type it in it would appear on the screen as shown in figure 7: Figure 7. Appearance oJl entereil on the keybodrd.
COMMANDS TO sAvE (OR DISPLAY) AND RETRIEVE PROGRAMS The commands to save (or display) and reideve programs are: I-IST PRINT ENTER sA\.E LOAD savesor displays a source program is the sam€as LIST,but omits line numbers retri€v€s a source prcgram saves an object prcgram retriev€s an object Fogram wirh ea,h ot rhesecommandsrhereis a paramFrerr har sppcifie$ rhedevi.e rhar rs rhe sour.e or desiinationof rhe program thar is ro be saved.di"ptayedor r€trievpd.
The forms ofthe commands to transfer only particdar lines (lines xx to yy) to a LISTTE:,xx,yJr LISTTP:,xx,yJr LISTTC:,xx,J,'y (LISTtE:,xx,yy is the sarne as LIST,xx,ry) (Us€cascelte-handling procedues described in ihe Program Recorder operator's Manual.) LIST*D:NAIm,xrK,yy where "NAME" is an arbitrary name you give to the program. Seethe description above. A single line may be display€d or saved with the command: LlsTlineno wher€ lineno tu the line number.
PRINT Comnand This command- is the same as LIST, excepi that it prints statements without statement numbers. Erampl€: EDIT PRINT E@ * -$3000 I,DY 'OO REP I,DX ABSX, Y BNE XEQ SAME PAGX INY TALLY JMP REP ABSX-$3744 xEQ= * +$60 .END EDIT PRrNT3O@!1o REP I,DX ABSXJ Y I@ EDIT PRrNr60.80tr4El JMP REP ABSX= $3744 xEQ- ' + $60 @D EDIT l After using a PRINT command, no funher command can be enter€d unlil vou pressE@t, which causesrhe jtDlt messageand culsor to be displayed.
'where "NAME ' is the aibitrary name you gave to the program rvhen you listed it on the disketi€. This command cleaft the edit text bufer before transferdng data from the disk€tte. To retdewe a souce program from mssetie, the command fu: (Follow the cLoAD Procedue given in your 410 ProEram RecorderOperator's Manual.) Nole tbal ENTDRzC: ;lears ihe edit re;tbufier before rerfieving the sorfce program.
To retrieve.dnobjen program that had preyiously been SAVED aod which had pre!,rousryOeencalled NAMX, rhe command fu: LOAD/D:NAME wfrere NAME i6 the arbilrary name lhar you gave io rhe obJeclprogram when you savedit on disketle. LOADral (Us€the CLOAD proc€dure descfibed in your 410 program Recorder Operator's Manual.) These commands will reload rhe memory locationsaddresst ro ad&ess2 with the conlents thar were previously saved.
NOTES:
USING THE ASSEMBLER THE ASM COMMAND Th€ eeneral form ofth€ ASSEMBLEcommand is f,t#PN l,EEi AsM*[#Dln]:PROGNAME[.SRCl] I I L,t{Dtnl:LrSTlNGI.LSTlll [,*Dln]:SEIVBLEoI.OBJI] Wherea$embly lisring ls to be sroredordisplay€d The defaulr valuesof lhe rhree paramelers of lhe ASM command are lhe edjr len buffer for the source program. rhe relevision screen for ihe assembly lilting. and compuier RAM for rhe objecl program rthe ass€mbledprogram). To assemblea program tr8ing defauli values of ASM.
:i:19:'f;il"7 ti?::??":T'":1,j1""trffi ""f :H'f:is""i".?:,Ti,"1"?:tif; TAB directive. 8E4437 D064 Operand Op CodeMnemonic Label StatementNumber lnstruction Commentfrom Previous Iine starts here Address Fisiuie e. Normal (de*to"fffr:t-"3.f;:Trnblv listing as it appears :'l"J*'fi"Hx: ffiLT:i$?,'#H.:'#T:il*i?Yff"1*:i:##i?1f overide s€lections are explained below Location of Sourc€ Prograln :.iif{'ffi iJ:.Hffi$Filrd#ff :tiIEt,ffi?.ti:,1:T*'J.
with your Progran Recorder. Iirst transfer the program from program Recorder to the edit text buffer with the command: ENTERTC:*i{Eal (Follow the cassette-handling instruciions in your Prograi-r RecorderOperator'sManual.) The ASM command with no default param€ters is illustrated in the example ASM/D:SOURCI,TP:,$D2:SEMBLED.
The second listed of€ach pair represents the standard or default condiiion. ti{&i I 100 . OPT NOLIST The effec1ofthese directives is to omit from the listed (part ofsourc€ form ofthe assembledprogram the lines between lines program) 100 and 200. (The6eline numbers arc arbitrary.) 2OO. OPT LIST 1OO. OPT NOOOBJ (part of source progran) 200 . oPT oBJ Assembly is suppressedbetween lines 100 and 200.
To .emove a title, use the following form 1000 .TITLE "" The above directive removes titles afier line 1000. The PACt di-re(ljve.onirs owr causesa pagebreak -rhe prinrer simpty purs out a nrunDef oI bl:rDRlrnes Tab Directive 10 - TAB n1,n2Jn3 The TAB directive seis the lields ofth€ statement as they appear when assembled and lisred_onrhe screenor the prinr".. r..r u. u.e ri,. !p".i,jc e\arnpte ot slatement 40 ofthe small sampleprogram we previously u6edfor itjusi ration.
I]]]l Th€ appearance of this line on the screen will be different only because the screenhas 38 characterspositions,while the printer has ,10. BYTE, DBYTE and ['ORD 100 200 300 400 w4) Dir€ctives . BYTEa,b,...,n . BYTE*A,B,... N" . DBYTEa,b,...,n .],I/ORDa,b,... ,n These direciives are similar in ihat they are used to insert data rather than insiructions into the proper placesin the program. Each directlve is slightly different in ihe manner in which ii insefts data.
WORD Dlr€ctive The WORD directive is the sam€as the DBYTE directiv€ €xcept that ihe value of th€ €xpression i6 stored with th€ low-order bj,te Iirst. For example: 10 ' =$4000 20 .woRD ABS+$3000 When line 20 i6 assembledand rhe valueofABS+g3000 i! derermined.as b€foreto be $5123.923 is pur in locarion s'4000and $5r is pur in location ga00r. The wORD dfective sjmplifies someprogramming sinceaddesses in machine mde are always given in rhe order low byre fotlowed by high byre.
You write *= without the initial "." that the other directives have (exc€pi LABEL= ). Also, note that you write * = wiihout any spacesbetween * and = . t{! You should not confuseihe * = directive with the LABEI-- direclive. The * in * = is not a label. Note, however, that the - = directiv€itselfmay have a label, as follows: 200 GO * =expression 500 JMP GO The Assemblerwill assemblestatement500 as ajump to the value the program counter had BEFOREit was changedby line 200.
ASSEMBLY LISTING (.to-coL forrnat) 0100 ;CONDITIONALASSEMBLYE XAMPI,E oooo 0120z = o 0000 0130 *= $5000 5000 A945 0140 LDA r$45 5002 0150 . rF z@zNoTEQUA LO 5002 AA 0160 TAX ; THIS CODXASSEMBI,ND IIF Z=O 0170 zNoTEQUAr,o 5003 0180 .IF Z I@ZNOTEQ UAIl O19OASL A 0200 ZNOTEQUAT-1 5003 x8 0210 INX ; THIS CODE AIWAYS ASSEMBLED O1OO;CONDITIONALASSEMBLYE XAMP]-E OOOI O12OZ = 1 0000 0130 *= $5000 5000 ,4.945 0140 r,DA 445 5002 0150 .IF Z@ZNOTEIU1.
t"- { NOTES: q-{
DEBUGGING PURPOSEOF DEBUGGER The Debuggerallow6.youto follow rhe operarionofan objeci program in derail ano ro maKe mtnor chandesin it. A knowledge ofmachin€ langxageis helpfr when you usethe debugger.buLir is not essential.The Debugger is able to convefi machine mde intoissembtv language(disassemble). so you can make code allerarionsat parricl ar memorv locarions.All numbers usedby rhe Debugger.borh in inpur andouipur.
we now give several examplesshowing horir to use the commands.In the examplesjthe line8ending with @ are edteredon the keyboard. Ttre other lines show the re8ponseofthe system,as displayedon the screed. DR Dtsplay Regtsters r:xample: EDIT BUG @ DEBUG DR@ A=BA X=12 Y-34 P-80 S=DF DEBUG I] The regist€rs and contents are displayed as shown. A is the Accumulator, X and Y are the Index Registers, P is the Processor Status R€gister, and S is th€ Stack Pointer.
This shows that address5000containsthe nwnber A9. Ifthe secondad&ess(yt?T) is omitted, the contedtsofeight successivelocatio4s are Bhorrn. The processcan be continuedby typrng D @EO. Example: DEBUG D5000 @ 5000 A.9 03 18 E5 F0 4C 23 97 DEBUG D@@ 5008 1a 41 54 41 52 49 20 DEBUG I] Dmmmm,,'J'yy where yyw addresses mmmm to yyly.
The secondcorrlmandpuis 34 and 87 in locations7008 and 700t resp€ctively. You can conveniently use th€ C command in conjunction with the Display Memory command, and you n€ed not enter the addres€a second time rvith the C command. The C command will default to the last specifled addre6s. Erample: Dsoool@ 5000 A0 03 18 E5 r0 4C 23 91 c
F.ramplea: I-7000 @ Ltut a screen page (20 lines of code) starting at memory location 7000. Pressing the @ key during lisLing halrs rhe lisiing. L @ This form ofthe command lists a soeen page starting at the instruction last shown, plus 1. L7OOO, O @ L7OOO,70OOl@ L7000,6000 @ Theseforms list the instructiom at address 7000oriy. L345, 567 This form lists addr€ss345 through 567. Only the last 20 inshuctions will actu€lly be visible at the compleiionofrhe responseofthe system.
i, Because the disassembler starts disassembling from the first address you specify, you have to take care that the frst address contains the fir6t ble ofa "real" instruction, A Assemble One Instruction i. Into Memory The DEBUGGERhas a mini-dssembler, that can ass€mble one ass€mbly language ifftruction at a time. To enter th€ Assemble mode. tvDe: A @ Once in the Ass€mble mode, you stay there until you wish to retlfn (on an empty tine].
Exatnple: DEBUG r5ooo l@ 5000 A=03 5002 A=03 5003 A:03 5005 A:03 7723 A=03 DXBUG A9 LDA X=02 Y-03 P= 34 18 cLc X-02 Y=03 P= 34 t5 IO SBC X=02 Y=03 P= 34 4C 23 71 JMP X=02 Y=03 P- 34 00 BRK X=02 \=O3 P=34 r$03 s=05 S=05 $r0 S=05 $7123 S=05 S=05 S or Smmrnm Step Op€ratlon This comnand has the s€me e{fect as T or Trnlnmm, except that only one inslruction is executed.To step through a program.
NOTES:
APPENDIX 1 ) * , ERRORS when an elror occrlls, the consolespeakergiwesa short "beep" and ihe error number is displayed. Errors numbered less than 100 refer to the Assembler Editor cari dge, as follows: ERROR NUMBER 1, 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 73. 16. 17. 18. 19. The memory available is insufiicient for the program to be assembled. For the command "DEL xx,yy" the number xx cannot be found. There is an ellor in specifying an address(mini-assembl€r). The ffle named cannoi be loaded.
140 142 143 145 146 162 165 Serial bus input framirg error. Serial bu6 data fiame ov€rrun. Serial data checksum error. Devic€ done effor. Dfukette erlor: Read-after-write comparison fail€d. Function not implem€nted. Disk flrll.
APPENDIX 2 | \ul ASSEMBLERMNEMONICS (Alphabetic List) ADC AND ASL BCC BCS BEQ BIT BMI BNX BPL BRK BVC BVS cLc CLD CLI CLV CMP cPx CPY DEC DEX DEY EOR INC INX INY JMP JSR LDA LDX LDY LSR NOP ORA PIIA PHP PLA PLP ROr, ROR RTI RTS sBc sEc SED SEI Add Memory to Accumulator with Carry AND Accumulato.
STA sTx STY TAY TSX TXA TXS TYA Stor€Accumul.ator Stor€R€gistex x Stor€R€gister Y Transfer Accumulator to R€gister X tansfer Accumulator to Register Y Tra[6fer Register SPto Register X Transfe.
APPENDIX 3 SPECIAL SYMBOLS ) Below we give a lisi of specialsymbols that have a restricted meaninE io the Assembler.You shouldavoid using rhesesymbol! as a marrerofcourie. lrosr atremprslo u\e rhescsymbolsin dnv bur rheir specidlsensewill resujrin Frror". They mry be u.ed. wirhour rhFir .pecjatmeining. in commenrFand in rhe operands01 memory r€senation directiwes. The semicolon is used to indicate the start of a comment.
NOTES:
APPENDIX 4 :E 6qi5 6=H?R! ?\ eg;ggFHlIFgn rh z o zz 4 a f,,,l : { E; ; E E : 't ,nj e!4SS =gfic! r'\ z F a BU a z F 4 €. 4 :t9 a s . . e . E: ! r E ! s = g = g = 1 I t€ i { i g = : : ? i €B t t ; : E t e t i r i H ; =: a; z F } E i lfr: ; ! -. .i "Fi.Fi3:.sFF.' i t r , g::lHEt!; *:!! c rr''l .l c . * tr +EEEfiEe ri ti;; !:8PEn ;;Eg!cEigiEH !FElFIgE odg H I Frl riEESEt5;fiE r3 :F . : .
NOTES:
APPENDIX 5 EXPRESSIONS WheD an insrrucrion or djrefljve callsfora number in the op€rand,lhe number may be given as an ,,expafession.', the n being *1i**r.'.. a' "*i,"".;;; i:"ffii; i[T "' ffieraused the varueor the Exprcssionsare rnade up ofoperators and Lerms.Terms are either numbers or laDelswhich sfand for numbers. An expressionconLaining a f"Ua ,.rrn_,f,ri cloe8not have a nlrmeric value will be nagged as an error. There are five operatorsj four are arithmetiq and one is logicat.
NOTES:
APPENDIX 6 DIRECTIVES ) . OPT Operand , TITLE "NAME" . PAGE (MESSAGE' causesNAME to be printed at the top ofeach page. produces a blank space in th€ listing, then caus€s MESSAGEto be pdnted alier NAME. . TAB n1,n2,n3 contrcls the spacing of the {ields of Op Code Mnemonic. Op€rand. and Commenl as lhey appear in the listing. . BYTE a,b...n places in successivememory locations the values ofthe expressionsa, b, ..., n [one byte for each value). . BYTE *AB...
NOTES:
APPENDIX 7 ATASCII CHARACTER SET AND HEXADECIMAL TO DECIMAL CONVERSION t'n o'o' .p" r"y -"8 t r+/ c.' d 0 0 1 1 2 ) _.r ! e G il g il il 3 3 4 4 5 5 6 6 B 7 7 S B B I I El E tr 1U ) o 11 B 1.2 C E g 6$i,. #""u$".'"t /ne ..J,{, ""{ .re ."*t{"o"o'"'" FI 26 1A E t 27 1B F il 2B 1C 1D E EI o tl 10 tr 29 11 b 30 L2 EI 31 1F 32 20 Space 33 21 ! 3+ 22 35 23 36 24 13 u tr 75 16 1.
*1/ ,o! ..\w^} .$ '"""{"""t"6_& ..sv *Y.-ilr' ^of o' 39 27 40 2B ( 41 29 ) 4) -$t # 3 7 7 71. 56 3 8 B 72 57 3 9 9 73 42 3A 28 .$' .9,': -g'-o' - r'' " +9" .lo 4 49 4 48 8 ; 3 C < c H ..
'"$*'$"d 103 67 c 119 77 x 104 6B h 720 78 69 I 121 79 j 122 87 8B ,"d"/d$'"t$"*" {""$ 89 59 Y 105 90 5A z 106 i 707 6B 10B 6C I 109 6D Ifll 94 110 6E n 726 tr 95 777 6F o 727 D p 728 B0 q 729 81 r 130 B2 131 B3 B4 91 92 93 5D l 723 o 772 70 97 61 a 773 7 98 62 b 174 '72 99 63 c 115 100 64 d 116 1.32 e 1.1.
srv r.:$ .c! ^v^t .+ O- r't ..I} .+ ^w -t'- 1n) ,/n, 61v"*$$.."*c 4::'.arr' $Yt, 735 a7 97 136 BB 98 737 B9 99 138 BA 9A 139 BB 9B (EOL) uEtt]iut 140 BC 9C tr 747 BD BE .745 ,o\'- 156 9D 158 9E 8F 9F 90 AO 167 A8 169 tr tr tr A9 AB 772 AD 174 AE AF BO 91 177 B1 92 778 B2 779 B3 747 93 A3 148 94 749 95 A5 150 96 A6 B4 B6 .
"-.;$".tt$r"d A:: C d 0'6' .lY 183 B7 199 C7 184 BB 200 C8 185 B9 207 C9 186 BA 202 1.87 BB 203 1BB BC 189 - ts orr {,5 $o D7 216 DB D9 21.8 DA CB 279 DB 204 CC 220 DC BD 205 CD 221 DD 190 BE 206 CE 222 DE 191 BF 207 CF 223 DF 792 CO 208 DO 224 EO 193 C1 209 D1 794 C2 21.O D2 226 195 C3 21.7 D3 227 E3 196 c4 21.2 D4 228 EA L97 C5 213 D5 229 198 C6 274 D6 230 E6 *1r' "$, .
.$t .+ "t$ .".."$"".*cf 231 E7 232 EB 233 E9 234 236 F9 FB FC EB FD EC FE ED FF 238 EE 239 EF f,'?;::n",' 1. ATASCII stands for ATARI ASCIL Letters and nurlrbels hav€ the same values as those in ASCrr, but some of the special characters are different. 2. Except as shown, characiers Ilom 128255 arc reverse colors of 1 to 127. 3. Add 32 to upper casecode io get lower casccode lbr same ]erte.. 4.
APPENDIX B REFERENCES ATARI PUBLICATIONS Obtainabl€ from your ATARI dealer, or ATARI Consumer Division, Customer SupportJ1195Bonegas Avenue, SunnyvaleJCA 94086 ATARI4!00rMOperator'sManual COl4zGa ATARI S00TMOperator's Manual CO:.476g ATARI SIoTM Op€rator's Manual CO1476O ATARI SI5TM O-perator's Manual CO76377 ATARI Disk Op;raring Sysiem II ReferenceManual ATARj4l0rM Operaroi's'Manual CO148t0 OTHXRPUBLICATIONS 6502 Progt'clmtni.
NOTES:
APPENDIX 9 USING THE ASSEMBLERCARTRIDGE TO BEST ADVANTAGE ) #ir$#t{i*lfu i;rt*i#:i':'i'.$"q!'ffi :l:{f *x.r.:"* rd;r:."Iffi L*|tl:r,*,k*Hr*l}*il:f $$ilHf ;'":*:i :ri",rr#.#di#*1rf tr13*lkt${$"::ji:J3";::,. n+'.:l;'*l*+iili*n**h{+ used todev€,op machine 11ffi:TT#::itJ#ff.li1#:"'ilxr1t,'" rrest ' ,]:i{*ffi ."',;'#*: il#f :f i$:.1=:1ixii:,?tir,."-..";fi*"ffi +:ffi1"i':JTi*JtT i::i"iii,Tl"**'"stemwiththis-'r'r""i'" - m!;xl*";xniil""?Hl{irxid**f.'fi::"l;:i" . ff.l;.
show horv to execute some of the most commonly used funclions. These programs are meant only for demonstration purposesrrhey certain)y do nor exercise ihe full power ofthe machine. You may \' ish to entranc€them, adding whatever features you desirc. In this rvay you will leam mor€ about the ATARI Personal Computer System. All four programs have been written to .eside on page 6 ofmemory. These256 bytes have been reserved for your use.
x+*x#l*irffi$ *ff 1g*tilixflrfr ?PEEK(1536J mfig #r*.',f..r;r*:ti11f#*"lfu;g;$ l A-USR(1S36, 1, 3):?A Ggm, ut;***g*$*ffirim g**-**$$**#*H* ***$ffi*t**lm*fis A USRfrs36. 50. ro.s0.200jE!&Et ffi$;tilg"mqg$*#:s$ e$#5f $#1lj#l#iF:#"#; cR. 19:A -USR{15361 F&g{! fl?:,,f""Fffi *:il $hr#iH:,:""#,tt*H?i"T:5#ii;"&.
The lasi sample program demonstrai€sa very useful capabiliiy ofthe ATARr Personalcomputer System-the display list inierrupt. perhaps you have been itching to have more than five colors on the scre€n.with display lisi interrupts you can have up to 128 colors. Her€'sthe idea behind it: the ATARr displav svsiem u"esa displd) li"r and di"plry memory.The displa) lisr i" a *quence oiinvruc ||on" rhar rpll rhe ' ompurerwhar Eraphicsformat ro usein purringinformarion onlD lhe scrcpn.
Now start writing a BASIC program, begin with: 2 DIM ES(2179i Ther add this subroutine (which you can delete later): 25OOO A =90*J+ 1:B=A+89: II B > LIMIT THEN B =LIMIT:?"LAST LINE" 250101+ 5;"E$(";A;",",B,") - ";CHR$(3a); 25020FORI-A TO B:?..8M @,,;CHR$(PEEK)I+C));:NEXTI -l +1:RETURN 25030?CHR$(34)J Herc the m W symbol m€ans ihat you pre$ the escapekey twice.
A = USR(ADR(E$)) But there is still another possibl€ hitch. Th€ 6502 machine language code is not fully relocatable; any absolute memory references to the program are certain to fail. For example, suppose yoru progran has a jumpto-subroutine oSR) insiruction that refe$ to a subroutine within the object code. This instruction would rell ii rojump Loa specincaddress.Unforruna-tely.
. oooo D2OO D201 OOCC OOCD OOCE 0600 68 0601 68 0602 6a 0603 8DOOD2 0606 68 0607 85CC 0608 68 060A 68 0608 68 O6OC 85CD 060E 68 0601 68 0610 85CN 0612 0674 0617 0619 o61C 051D 061F 0621 A9AO ADO7D? A6CC 204106 18 6901 C9B0 D0F1 0623 0625 0627 0624 0628 062D A90E A6CD 204106 38 E901 D0F6 O62E Ag1^F 0631 8D01D2 0634 A6CE oa36 204106 70 80 90 0100 0110 0720 o13O ot4o O15O i WHERE ; F Is THE FREQUINCY ; A Is THE ATTACK TIMI ; p IS THE PEAK TrME ;D rs THE DECAY TIME ; ; ALL TIMES GIVEN IN UMTS oF 1.
0639 063"1 063C 063E 0640 38 E901 C99F D0F1 60 0641 0643 0644 0646 0647 0649 064A A013 8a D0rD CA DOFA 60 0600 0610 0620 0630 0640 0650 0660 0670 0680 0690 0700 0770 0720 sxc ; DELAY DELAY2 sBc cMP r$01 *$9F BNE RTS DCLOOP LDY DEY BNN DEX BNX RTS .END r$13 DLLAYZ DEI,AY Example 3.
iiSi 35"' 3:33 srA xr'oc sroRn rHxRE'u,r 3313?8Sj :f: :* 1j0u crr x_DrsrANcE rRoM CENTER #, i:'J;:?:iilf,ff,u'iffi,?l* # aoc o$0, :::l 9:Sl ::i: ljri_ i1i3ff""". ilx il'I".,:iI"^1H.ffi.*,HJ#i1,,,. ,!r MASK oFrLowER 5 B:t;i;" 3j* o44o 3:f ra :31: oezznoiz ;;; i:# 3:"' ff?8 3r; Hff ffi3 :::: 0;; 291f 4A 4A 4A 85D1 fl?9^* ;;" 0642 Fooz 06D1 06D1 88 DOF9 ]15CE OA .0600 xB 0610 o62n 0630 : ; !ff8 fRoM.ENTER oFscRErN cLc i:9 ADC ?]..
064E 0650 0651 0652 0654 0656 0657 0659 0658 065C 85CC 0A 0A 65CC 65CD A.8 A5D1 9158 CA DOA6 065E 0660 0662 0664 C6D0 A5D0 297F D09E 0666 066A 0669 0664 0668 066C 066D 066F A5D0 4A 4A 4A 4,{ 4,4. 2903 AA 0670 0673 0676 0679 /'DoADz 9DC402 4CO406 0910 0920 0930 0940 0950 0960 4970 0980 0990 1000 1010 7020 1030 1040 1050 1060 1070 1080 1090 1100 1110 1120 1130 1740 1150 1160 7770 1180 1190 1200 1.
0000 00cc 0OcE 00cr 0230 DlOE D{OF D4OF 0200 DOlA D016 DO17 D018 D4OA 0600 68 0601 0604 0606 0609 AD3002 85CC AD3102 85CD 0608 A007 060D A98A 060F 0611 0672 0614 91CC C8 C017 D0F9 0616 0617 0618 0619 C8 C8 C8 C8 0614 061C 061D 061F 91CC C8 C02B DOFg 0621 A950 0623 8D0002 062A A906 0110 o12O O13O O14O O15O 0160 O17O O18O O19O ; POINTA COI,CNT DECK DSLSTL NMIEN NMIRIS NMIST 0200 vDslsr O21O O22O 0230 0244 0250 0260 0270 0280 0290 0300 0310 O32O O33O 0340 0350 0360 0370 O38O 0390 O4OO 0410 O42O O
062A 4D702 0640 0650 0628 A900 0660 O62D 85CE 0670 O62F 85CF 0680 0631 8DOFD4 0690 0634 ADOFD4 OTOO 0637 2940 O71O 0639 FOTg O72O 0638 ADOED4 O73O 063E 0980 O74O 0640 8DOED4 O75O 0643 60 0760 0770 0780 0790 0644 0800 0650 48 O81O 0651 AsCN OA2O 0653 18 0830 0654 6910 0840 0656 85CE 0850 0658 DO13 0860 0870 .
APPENDIX 10 QUICK REFERENCE: COMMANDS RECOGNIZED BY THE ASSEMBLER EDITOR Y."1i:r""i'.
Cxxxx < yy Mxxxx
APPENDIX 11 MODIFYING DOS I TO MAKE BINARY HEADERS COMPATIBLE WITH ASSEMBLER EDITOR CARTRIDGE The following assemblylanguageproqrar fq+'i*$'r:r*.:nf""rH.iri';i*,I.tl-. '1",*:#j#?*:n|::#jj;i;;FFFi;;''til;; ;:,fi?,f :;H",fl EDIT 10 20 30 40 50 60 70 LDA STA STA STA STA r:600 r$IF $u41 $2448 $148F $14C0 END To assemble the modification program, rype ASM and press G@.
To mn this prograrn, you must be in DEBUG mode so, t}T'e the following. . . Type BUG and prcss @. Type c600 and press @. The screen will display: DoS I will now have header bles that are fully compatible with the Assembler Editor cart dge. To chang€ DOS I permanently on your diskette: 1. 2. 3. a. Run the Modilication Program. T}?e x G@ to g€t out ofBUG. Typ€ DOSEn@ to enter DOS. Type H l@ to $ryite a fully compatible Dos on diskette.
NOTES:
INSTRUCTION SET (oPERAT|ON CODES) A""' s.r l.
/\ ATART a warnercommuf,calions companyO