ATARI Assembler Editor User Manual
Total Page:16
File Type:pdf, Size:1020Kb
ERROR CODES ERROR ERROR CODE ERROR CODE MESSAGE CODE ERROR CODE MDSSAGE 2 Memory insufficient 142 Serial bus data frame overrLur 3 Value error 143 Serialb us data frame checksume rror 4 Too many variables 144 Device done error s Stdng length error 145 Read after write compare error 6 out of data error 146 Function not implemented ? Number greater tltan 32767 147 Insufficient RAM I Input statement error 160 Drive number error I Array or string DIM error 161 Too many OPEN files 10 Argument stack overflolv 162 Disk iull 11 Floating point overflod 163 Unrecoverable system data I/O e|ro. underflow etror 164 File number mismatch 72 Line not found 165 File name error 13 No matching FOR statement 166 POINT data length error 74 line too long error 167 File locked 15 GOSUBo r FOR line deleted 164 Command invalid 16 RETURNe rror 169 Directory full az Garbagee rror 1?o File not found 1a Invalid string character 171 POINT invalid -lfoter The fouowing are INI'UT/OUTPUT er- rors rhdl rerult during rhe useo f di"k dri!e". prinlerr.o r othera cce.soryd evice\.r uflher in- formation is provided with th€ auxiliary hard' 19 LOAD program too long 20 Device number larger za LOAD file erlor aza BREAK abort 7zs IOCB 13o Nonexistent device 131 IOCBw rite only 132 Invalid command 13J Device of lile not open 7J4 Bad IoCB number 13s IOCBr ead only error 136 EOF 737 Truncated record 13a Device timeout 139 Device NAK 74o Serialb us 117 Cursor out of range ror explmation of Errcr Messges see Appendix 1. ASSEMBLERE DITOR MANUAL ATARI'/t\ OAwame' communicoanr sc ompany 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:dh ardware, ATART,r NC.c annotg udaDtee lhe ae cuacy or printeJ mlenal after the datc ofpublication and onnor acepi responsibnityf or 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.i;w rhe"ATARr BASIC Reference Manual ifyou are Lrnsure of ho.w to do screen editing. This manual stafls by showing the structure of sLarementsi n assembly language.T he mdnual then illusrraresL hed iflereni rype6o f6502 operands.T hi Assembl€r Editor ca:rtridge contains three separate programs: . tDlT (rdiror program). Helpsy ou pur programmings rarementisn a form rhe Ahrembler (ASMIp rogram undersrands.T he tDIT program leis you u"e a prinier to p.int a lisiing ofyour program. programs can alsob e stored and rccalled using ENTIRJ LIST and SAVX, LOAD. The Assembler Ediior allows automaticn umbedng, rerumbering, delete,f ind and .eplace. ASM (Assemblerp rogram) - Take6 the program statementsy ou ceate in the EDIT step and converts to machine code. DEBUGGER- Hetps you trace through the program stepsb y running the program a step at a time while displaying th€ contents of important internal 6502 registers. The DEBUGGERp rogram also contains programming rcutines which allow you io display registers, change register contentsJ display memory, change memory contents, move memory, ve fy memory, list memory with disassembly,a ssembleo ne instruction into memory, go (execuie prograd, exit. The disassembly rouiine is especially usefut ir rcading and understandingm achine languagec ode. The Assembler Editor cartridge allows you to talk in the mmputer's natural language - machine language.A ssembly languag€ programming offers you f:lster running programs and the ability io iailor programs to your exact needs. CONTENTS PREFACE 1 INTRODUCTION About This Book 1 ATARI PeisonalC omputer Systems 1 How anAssembler Editor Is Used 2 GETTING STARTED Allocating Memory 5 Program Format*How to Write a Statement a StatementN umber a Label a Operation CodeM nemonic a Operand a Comment a How to Write Operands a2 Hex Operands 12 Immediate Operands t2 PageZ ero Operands t2 Absolute Operands 7.2 Absolute Indexed Operands 12 Non-indexedI ndirect Operands 13 Indexed Indirect Operands 13 Indirect Indexed Operands 13 Indexed PageZ ero Operands 13 String Operands 13 3 USING THE EDITOR Commandst o Edit a Program 15 NEW Command 7.5 DEL Command 15 NUM Command 15 REN Command 15 FIND Command 7.5 REPC ommand 77 Commandst o Save( or Display) and RetrieveP rograms 19 LIST Command 19 PRINTC ommand 27 ENTERC ommand 27 SAVE Command LOAD Command 4 USING THE ASSEMBLER The ASM Command 2E Directives 27 OPT Directive 27 TITLE and PAGED irectives 2A TAB Directive 2S BYTE,D BYTE,a nd WORD Directives 30 BYTE 30 DBYTE 30 w'ORD 31 LABEL = Directive 31 * = Directive 31 IF Directive 32 END Directive 5 USING THE DEBUGGER p 1 r r n ^ c p ^ f n p h r r d d p r a a l l i h d + L p n p } ! ' r d d p r Debug Commands DR Display Registers 36 CRC hangeR egisters 36 D or Dlnmmm Display Memory 36 C or Cmmmm ChangeM emory 3Z Mmmmm Move Memory 3B Vmmmm Verify Memory 3B L or Lmmmm List Memory With Disassembly 38 A AssembleO ne Instruction Into Memory 40 Gmmmm Go (ExecuteP rogram) 40 Tmmmm Trace Operation 40 So r Smmlnm StepO peration 4a X Exit 4l APPENDICES 1 Errors 43 2 Assembler Mnemonics( Alphabetic List) 45 3 Special Symbols 47 4 Table of Hex Digits with Corresponding Op CodeM nemonicsa nd Operalds 49 5 Expressions 51 6 Directives 53 7 ATASCIIC odea nd Decimal/ Hexadecimal Equivalents I References 61 9 Using the ATARI AssemblerD diror Cartridge to BestA dvantage 63 10 Quick Reference for Command6 Recognizebdy the AssemblerE diror 11 Modifying DOS I to Make Binary Headers Compariblew ith AssemblyC arr;idge ILLUSTRATIONS Relationshipo fvarious partso f Assembler tditor carrridger o you andy our sollware 3 Figure 2 Memorym ap withour useo f LOMEM Figure 3 Memory map with u6eo f LOMEM Figure 4 Example ofhow to write Line No., Label. Op Code.O perand.a nd Commenti n rhe ATARI programming form Figure 5 Statemenras6 rhey would appearo n the screenw hen enteredo n the keyboard with the recommendeds pacin- e. !O -r-xntolr I Sampler eproducible A'I'ARI programming form j,B Figure 6 S_amplper ogram as you write it on lhe ATARI programmingf orm lB -rlqure / Appearance of the screena s your program is entered on the keyboard 1a Figure B Appearance of the screena s your samplep rogram is assembled 25 Figure 9 Normal (defaulrt format of assembly listing asi t appearso n the screen 26 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"el he rdrrri,lgei rselr.S econdv, ou ne.a r,, know abo-urh e ArARI rcrsonalC ompurcrs ysremy ou ar( uring wir h rhpc arrr idge.I hird. you needr o .om.'hing knou dbourb 502A n"cmbtvL angurgpn rogramm,ng.A nd. tourrh, lhe AssemblcrE dilorC arrrideew asd e\Unedl o bc u"edw irh lhc At ARJd i"k drives and DOSI I ABOUT THIS This manual explainsi he operation ofttre ATARr AssemblerE diior cartridge. rt MANUAL do.s nor e\pl,in 6502A ssemblvL dnH,raeppr .^qrammin]-l.t vou are ahe.dv Idmilirr wirh 6so2A J.embll rangu"ge.v ou u i)i rind rhis'maIualr mply .uire-d io J our nced':o rhcrwi:". vou Jroutd I pter ro one,,f rh. many Look"i har ex. plain 4502 AssFmblyL d Buagep ro8rdmming:. uir:bJe books dce ti",ed r,l Ifyou are familiar with ATARr BASICa nd have written somep rograms on your ATARI 400rr1o r ATARI 800N personatC ompute. System,^yoi will fini1 no better way to learn assemblyl anguagei han the combination oithis manuat.t he ATARI A.semblert drror carrridger. nd a 6502p rogrammingb ook. lfyou haveh ad no experiencew irh compurer!a nd no Droerammrnde xDer- ien,e .r hen thi" manudli s pro babtJr ooa dvancedto r you anJyou st oita "rarr Dy wntlng somep rograms using ATARr BASICa nd your ATARr personalC om, pt'rcrS ysremr ob c,o me lamiliars rlh proqramminei n eenp1.3Rt.e adineo neo l thF hooksr e.nmn,endedin Appcndi\ I wi helpy ou leirn as.embtvl anguase. ATARI The 4TARI Assembler Editor cartridge is installed in ihe cart dge slot ofihe PERSONAL ATARI 400 computer consolea nd in the tcft cart.idee slot of the "1TARr 800 (ompurFr COMPUTER consoleY. oum usrh e tamitiarw h rhe ke1;boaradn d all rhe scree_ editing lunctions.T hat matedal is coveredi n the app;opriaie operator,s Manual perconal SYSTEMS supplied rvith yolll. A'rARI computer *st;m. Th; special sc.een_ editing keys are described in Section6 of fue Opeiator's uanual. you shoutd readSection6 and follo.lvt he instmctions untit yoir are compietelyf amiliar with I th. keyhoard" nd rhe.creen-edr.ig lun(1ion,. Youn cedn Ir havpa ny equipmener j.epr rhe ATARI rer$onaCt ompurcrS ts rFm .onsole.y our lele\ision or d \ideo moniror tor disotav.d nd-rhe 4fARr AssemblprL dirorc ar-rridgeH.o wever.w irhoura pcrmanenis ror"ged evicey ou pnle' wrrr havel o yo,'r programo n rhek pyboarde a(h rimey ou u i.h to uspi r.