Operation book for ATMAS - II A macro assembler, editor and machine language monitor ATARI computer 400 / 600XL / 800 / 800XL and Atari 130XE with disk station and minutes. 48KByte RAM The programs, diskettes and instruction manuals the ATMAS-system are Copyright Ing. W. Hofacker GmbH and Dipl.-Ing. Peter Finzel Any rights reserved CHARGING INSTRUCTIONS ============= 1) Remove any plug-in modules from the Cartridge slot of your ATARl computer. 2.) Turn the floppy disk drive and the TV (or monitor) a. 3.) When the red LED of the disk drive has gone out, place the floppy disk containing the Inscription at the top and the oval window to the rear in the drive. Close the door of the Floppy bay. 4.) then Turn on your ATARI computer. at XL models must during turn the OPTlON button must be pressed. 5.) ATMAS-II is now loaded, after a short time appears the bias, then notify the Editor, charging is completed. If the message 'ATMAS-II requires 48K memory' appears, so there are several options: a) There are still plug-in modules in the shaft. b) OPTION has not been pressed (only for XL). c) your computer has insufficient memory. ATMAS-II requires at least 4BKByte. FURZBEISPIEL FOR DEMO PROGRAMME ============================== If you are in front of the reading of the operating hand book short a demo program of ATMAS-II system To view, so you can do that with the following reach commands: RD: DEMO (Demo program is loaded) -Y (program assemble) (back to the editor) (Start program) U (End Program) Note: Press the Escape key . -Y hold Control key and the 'Y' key. INTRODUCTION ========== ATMAS-II is a powerful development system for machine programs on your Atari computer. ATMAS-II consists of three integrated subsystems: Editor, macro assembler and machine language monitor. These components together provide for convenient and rapid development program at the machine level. All three parts of this integrated programming environment match and only a Keystroke away from each other. A comfortable, screen-based editor that we Features Copy-registers, repeatable command sequences and space-saving genuine tabulators has facilitated the input also extensive programs. The macro- Assembler is working to achieve a shortest possible Assemblierzeit with modern hashing Algorithms, so that longer programs in a few Seconds are assembled. Finally lhner stands as a tool for testing of machine programs Monitor. Although someone who has never been in Assembler has programmed quickly familiar with ATMAS II feel is, it offers the user many advanced Options: starting at the powerful Editor functions to programming Macro commands. It should be noted that this Users Manual no textbook of 6502 Machine language is and also can not be. Reference is made to further reading, in particular in the autumn of '85 upcoming book by the author of this operating hand book, specifically on the Atari computer tailored. In addition, also provide the Examples in Part 4 of this handbook a small Insight into the assembler programming Atari computer. Part 1: THE EDITOR ================== When ATMAS II Editor is an image- screen oriented editor that without any Line numbering manages, essentially similar to a word processing system behaves. This eliminates the tedious entry of LIST Commands like these from various other Editors know (eg in BASIC). you can simply with the aid of the cursor keys to scroll through the Moving listing, which then from top to bottom or from bottom to top scroll through the text window. 1.1 Using the editor ------------------------- Once ATMAS-II has been loaded from disk, giving direct access to the editor that were, the Control Center is the ATMAS-II system. From here you can the macro assembler and the Calling machine language monitor, also brings the key always returns-in the editor. After booting you will see the following screen Mask Editor see: + --------------------------- + IP: 00000 T: 17408 C: 1O24 OK I <--- Status Bar + --------------------------- + Cursor -> ICI II I text window I II II + --------------------------- + I .......................... I <--- commandline + --------------------------- + The status bar --------------- In the status line you are constantly information on cursor position, free Textspexcherplatz, communicated Kopierreqister and editor state. From 'P: nnnnn' can be the distance (in characters) remove the cursor from the beginning of the text, 'T: xxxxx' are wages sent information about the free text space, (Ie you can still max 'xxxxx' attacks enter). 'C: yyyy' provides information on the free Storage of the copy register (the so-called. C register) of the still unused state 1024 includes characters. The last two characters of the give status line wages sent a status message of Editor again, if everything is in order, you will find there '0K'. Any error or status messages (eg when the copy tab is open) be spent there, a list of messages See Appendix B. text window ----------- The next 21 lines make up the text window here you always see the current text you in the Edit following discussed editing can. In literally is this image screen part to understand as a window in the text, inter alia, with the cursor keys up and down over the Text can be moved. All editing functions are reflected in the text window. command line ------------- The letze line of the screen is for entering reserved commands. Besides a number of Direct commands directly in the text window are added, there is additionally a Command Mode of the editor of the is called. Here are usually commands entered, the need additional information, eg a word, is to be sought after. Even commands Input / output of text to be entered here. 1.2 Text Input --------------- They may be the same without assigning row numbers start entering the text. Each typed Mark is placed at the current cursor position and the cursor moves one position to the right. You can at any time a new row (RETURN) begin. Rated more than 38 characters in a row Enter, the cursor disappears from the right Screen once you dive press (RETURN) this again at the beginning of the next line. This Behavior seems at first glance unusual, However, you will soon find that it in Assembler programs is quite advantageous. Of the is essential part of an assembler program always in the first 30 characters, because there the. Assembler instruction can be found. Nominal you longer lines want to edit (for example, the comment field), so have To do this, a special function available ( -V, see 1.2 / Special functions), the maximum of 76 characters is in two lines on the screen. you will be However, notice that the normal 38-character screen much better for editing is assembler programs, since all assembler dictate contrary to the two-line mode uninter- broken with one another are. As usual, all keys have automatic re- holfunktion, lowercase letters with the - Button can be achieved. 1.3 editing commands in text mode ------------------------------- As mentioned above, offering them the ATMAS-II Editor two different levels of command entry. The simpler of the two planes form the so-called. Direct commands or commands in text mode called. These commands are either Special keys such as key (For 600 / 8OOXL: hold ) key while another Press the key, very similar to how you in ATARI BASIC move the cursor. So if you in following Read -X, so this means that you hold depressed, while the 'X' button to press. Cursor control ---------------- In text mode, you have the cursor functions available: To move the cursor to the right, press - A Cursorbewequng left occurs with - If you are doing on the right end of a line arrive, so the cursor to the beginning of the will next line set. Drive on the left End, then the cursor is at the end of previous line. To move the cursor up tap - The cursor will turn into, if it is not already on left margin is, there first reset. In this case leads only the second keypress to above. The cursor can with - a line down to the beginning of the next Line are set. All cursor movements You can not start and end of the text addition. Unlike other editors, you are notice that the cursor does not run over the text, but is inserted. This has the advantage that You always know exactly where are actually inserted can. delete character --------------- To delete a character to the left, press When the cursor is located at the beginning of the line, then the return character is deleted, ie the line, which housed the cursor is at the previous attached. If this was a blank line and thus only a return character was, the Blank line deleted. To delete a character right of the cursor tap - -X The line from the current cursor position to deleted beginning of the line. If the cursor already at the beginning of a line, so is the whole previous line deleted. Cursor jumps -------------- -E takes you to the beginning of the text -D will bring the end of the text tab --------- The ATMAS editor features a real tab, the space occupied to 9 depending on the requirements 1, but has been saved only as a sign. in order to tap to enter the next point vortabulierte simply If you later on such a tab with the Move the cursor, you will notice that the cursor it 'jumps', and also before a Einfüqungen Tnbulator the following text does not move. The Tahulator is stored only as a sign, so that you so easily readable Listings low can customize Speicherplatzhedarf. Copy register (C register) ---------------------------- The C register is a second, larger 1024 characters TextBuffer you for transferring and copying can use text parts. Position first to moving the cursor on the lower end of the Text part, then open the C register with -R The left part of the status line is this state the message 'CR' detained. Nominal now the Move the cursor backward, so are the uncrowded Parts of the text written in the C register. You can following this operation in the status line with that Number of free characters in the copy register ( 'C: 1O24') decreases with the number of cursor movements. Located yourself of all of the desired text in C register, connect this with the command -F Now you can copy the contents of the register use any cursor position by -J enter. The contents of the C register we not present destroyed, that there are also comfortable multicopy possible. Delete the copy-register with the command -K possible. The C-register is automatically by calling the assemblers as well as an I / O command closed. A few comments on the C-register: You can thus parts of the text to prepare for copying if you this backward with - or - through . equally possible You transfer blocks of text by cursor to by the erase commands and -X move backward. The deleted text will remain in Copy-register and can in any other place be reinstated. You can also buy a block of text from different Text parts composed by the C register at various passages opened several times and is closed without intervening its contents with -K delete. Is the C-Reglster full ( 'C: 0000), indi- cated at additionally on the top left, the error message 'C?'. Special commands of the editor -------------------------- The two-line mode, you can -V turn on. Thereby lines longer than 38 Characters are shown on the screen with two lines. The maximum line length, this mode is therefore 76 Mark, although shown only 11 lines can be. Another -V puts you in the normal one-line mode. Control characters, especially Tabs and Return Characters with -T be made visible. are all control characters 'Reverse' is shown. Another -T switches in the back normal mode. -G used to repeat the in the command line standing chain of command. Please read section 1.4. Calling the assembler and the monitor -------------------------------------- The ATMAS II Makroassembler is -Y called. ATMAS-II will immediately start with the Assembly located in the TextBuffer Source code (see Section 2), after completion of the Assembly will take any keystroke in the Editor. The machine language monitor can Duch entering -P be called. He responds with 'MONITOR.' and expects your input (s. Section 3). Back in the Editor can be reached by typing 'E'. 1.4 Command Line ============================= Apart from the direct commands in text mode has the ATMAS II Editor via another powerful Editing! The command line. You are here primarily find commands that the except actual call of the instruction further details need, wanted about a string after shall be. Furthermore, you will find some commands find that you know from the text mode ago, this but can in command mode with repetition factors be provided and linked, a type of 'Command macros'. Using the command line --------------------------- You enter the command mode by pressing the as dollar sign ( '$') is shown. Now you can individual commands (see below) Enter while the key to use as a delimiter. The command line is executed as soon as you twice Press succession. Execution with a hash mark behind the chain of command acknowledged, you are then again in Text mode. If the command line as have proven faulty, you will in the upper left corner indicated by an error codes. All commands (except for the I / O commands R and W) can preceded by repetition factors 2 to be executed 255 times. In addition, a complete repetition of an input Command line carried by the text mode, press -G. Errors in the command line itself can be corrected -X leads to Delete the command line and return to the Text mode. Editing in command mode ---------------------------------- B: cursor one back Q: cursor one forward Delete one character to the left ': D T: delete from the cursor to the beginning of the next line d. These commands example is a fast cursor Movement in the text possible. öffenen the command line with and enter '200F' followed by twice . Each repetition of the command line with -G brings you now 200 characters in the text buffer continue. Other editing commands: ----------------------- H : insertion of any ATASCII codes in the text, for example, to the printer controller. EXAMPLE: $ $ H0F on EPSON printers on Engschrift S : Searches for the string (string) from the current cursor position to the End of the text. If not available, appears 'S?' in the status bar. EXAMPLE: $ SLabel $ searches for word LABEL. : Sets string on current Cursor position. Can relating with the S command to search and expanded exchange function (see below). special features ----------------- J: Repeats the entire Rommandozeile. For example you can search and a Exchange function to the end of text re- Get. K: Deletes all text buffer. CAUTION: The entered text is deleted! U: USER command. Gets a machine program which must be in memory at $ A8OO, per JSR Belehl on. CAUTION Use only if you are also a program there have. @ : Sets the tab width to Sign (n 0-9). Without specifying a width of 8 is used. EXAMPLE: $ @ 6 $: tab size 6 characters. M: Return to DOS. With 'B' - '* ATMAS-II *' join back in ATMAS-II. Two more commands that affect the C-register: E: Deletes C-register (as -K) _ Insert C register in text ( -J): G Commands for input / output of text --------------------------------- If you are an in-TextBuffer Text want to save disk, you can copy the 'W' do-command. You only need to desired name of the file with a device description Specify drawing. Example: You want the current text under the Save names TEST.SRC to drive. 1 Add The following entries: WD1: TEST The extension is added by .SRC ATHAS itself, You can of course also another Specify extension, about $ WD1: TEST.ATM $ . CAUTION: The text is always in the STARTING listed ========= current POSITION THE CURSOR distinguished. Therefore always to store the whole text before Enter -E. On similar Heise You can use a text file of the License disk into memory. Given the command 'R' is used, which is as 'W' is used. Example: Loading the demo files from the DEHO.SRC ATMAS-II disk (in Drive 1): RD1: DEMO The Extender .SRC will turn automatically angehäng The file will now be starting at the current Cursor position is read. This results in two Possibilities: 1) When a new file is to be loaded, then delete previously the TextBuffer previously with K . 2.) You can also individual files in text buffer paste (similar to the copy-registers), by Move the cursor to the desired location and then enter the load command. If during an I / O command errors to be shown in the status bar by the message 'RW' displayed. listings -------- Printouts of the code can use the 'L' command getting produced. There are several options: 'L': Listing scrolls across the screen 'L0': Output to RS232 port # 1 of the 850th interface modules (R1 :) 'L1': Output to the normal Printer handler 'P', so as a rule on the Atari 850 interface module. 'L7': Listinq is Centronics interface from the joystick ports 3 and 4 output. These Possibility is only 400/800 computer. Notes to Editor advanced use ---------------------------------------------- The possibility of command chaining in the command line allows very comfortable editing tools: $ SLDA $ 3D $ ILDX $ J $ This chain of command would all LDA commands from the Change cursor position in LDX commands. As it works? First, an LDA instruction is wanted ($ SLDA), the cursor can then be behind the this string think stationed. '$ 3D' now deletes three character to the left (remember: The Repetition factor!), While '$ ILDX the string' LDX ' uses. '$ J' in turn causes the entire Command line is executed until the text to End, ie a 'south' - error (string not found) occurs. Part 2: The macro assembler =========================== 2.1 Use of macro Assembleres ---------------------------------- From the editor, the ATMAS-II Macro Assembler is with -Y called. It begins immediately with the Assemblie- tion of the source code of the in TextBuffer Editors must be located. The assembly is in three passes (so-called. passes), wherein the second passage his Activity by a rapidly changing signs in the upper left corner of the screen displays. The third Pass, a listing of the assembled program on the printer or the screen output (s. OUT- Directive). The process of Assemblierens will continue as long set until either the source code to the end is a -Z mark is detected (assembler Stop Mark) or an error has been detected. in the latter case, an error message (s. Annex B) displayed on the screen. Pressing any key brings you back to the editor, and exactly at the Body that has caused the error. You can immediately improve the errors and the assembler -Y restart. This comfortable 'hand-in-hand' work between Editor and Assembler is a key point of ATMAS-II as a development system for Maschinenpro- programs so powerful makes, and yet here the Operation simple. 2.2 Input format of the assembler -------------------------------- The ATMAS II Makroassembler knows all opcodes of 6502 CPU, as far as these in the 'MOS Technology 6502 pro- ming manual 'are described. It follows in the Notation of addressing modes of in that book proposed notation (see below). A Ouellteutzeile can have the following formats: A) blank line: ------------- It consists of only a character. B) comment line: ------------------ Starts with a '*' in the first column. Example: * Copyright (c) M. Huber C) command line with label: -------------------------- Begins with a label, followed by a separation sign (space or tab), then a 6502 opcode or an assembler directive, finally , an even for a further separator follow comment. Examples: LOOP LDA # $ 10 DOSVEC EQU $ 000C DOS entry point D) command line: ---------------- Must always start with a separator: To clean to obtain listings, it is advisable to do this with a tab starting allow. Then follows 6502 opcode or an assembler directive, as in preceding case, also here according to a further Delimiters are a comment. Examples: STA COLOR0 COLOR CHANGE DFB 100,120,140 Addressing Modes: ------------------- In the following a short Zusammeniassung of Cards have the individual Adresslerungsarten, each with an example is provided: Implied battery ASL Immediate # LDA # $ FF Absolutely, Zero Page STA $ 600 Relatively BNE * + 4 Absolute X-indexed , X CMP $ 3000, X Absolute Y-indexed , Y LDA TABLE, Y lndirekt-indexed (), Y EOR ($ F0), Y Indexed indirectly (, X) STA ($ F0, X) : Valid 6502 assembler command (opcode) : arithmetlscher expression As already mentioned, before each a label possible after each assembler instruction, a comment stand, which is sold with a delimiter. EXCEPTION: After implied battery commands the coming must box, any be separated by a semicolon. LABELS ------ Labels oestehen of letters and numbers, the first character must always be a letter. The maximum length is 8 characters, all characters are significant. Valid Labels: Invalid Labels: --------------- ----------------- GRINDING 1LOOP SCHLEIF1 GRINDING (9 letters!) S12345 Constant: ---------- ATMAS-II has four types of constants: decimal, Hexadecimal, binary and character constant. A) decimal constant --------------------- Existence simply from the number itself (in the range 0 to 65535). Examples: 10, 100, 3000, 65535 B) Hexadecimal constant ------------------------- Consist of a dollar sign ( '$') and valid Hexadecimal (O-9, AF). Examples: $ 10, $ FF, $ AB00, $ FFFF C) binary constant ------------------- Consist of a percent symbol with succeeding valid binary digits (0.1). Examples:% 1,% 1001% 11110000 D) character constant -------------------- If from an apostrophe with subsequent ASCII (Or ATASCII) formed character. The characters are in 7-bit nerte converted (bit 7 is always zero). Examples: 'X,' # 'e,' " Negative constant: ------------------- All Vonstanten can by a preceding interpreted minus sign as negative numbers will. The depicted in a double (-1: $ FFFF). Examples: -1, - $ 100, -% 101101, -'B ' Internal address counter: ---------------------- ATMAS-II leads during assembly a internal address counter with which each of the Upcode. the just translated statement showing (or on the next available byte after the last calculated Expression in DFB / DFW directives). This internal Address counter may at any time by the '*' - symbol be retrieved. This can result in a variety of ways to be used: A) space reservations: ORG * + $ 100 Reserved 256 bytes B) relative jumps without a label: GNI * + 4 skips the next 4 bytes C) Address Offset Labels for software Stackinq RETADR EQU * -1 current address minus 1 Expression: --------- An expression can be a constant, a label, a Macro parameters (see 2.4), the current address Counter ( '*') or an arithmetic logic thereof. Permitted links are: +, -, *, /, The computing area is O-65535th Some Examples: LDA # $ FF constant LDA # LABEL1 Label STA LABEL + $ A0 link LDA * + $ 10 Current Addr counter + 0ffset In addition, also parentheses to clarify the priorities ity possible: LDA # ($ A0 + 5) / 1O LDA # LAB1- (Lab1 / 256) * 256 2.3 assembler directives ======================== 2.3.1 ORG --------- Purpose: To determine the contents of the internal assembler address Counter. Syntax: [