Home » CEEFAX disks » telesoftware4.adl » 04-01-88/MANUAL2
04-01-88/MANUAL2
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware4.adl |
Filename: | 04-01-88/MANUAL2 |
Read OK: | ✔ |
File size: | 134FD bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
File contents
G USING THE 65C02 ASSEMBLERH -G8. PROGRESS REPORTING- H The Assembler supports several directives that allow you to output progress reports to the screen, and to a printer or a listing file, to show the course of an assembly. -8.1 The DISP, DISP1 and DISP2 directives- These all display a message on the screen, and also send it to a printer or to a listing file. DISP displays the text on both passes; DISP1 and DISP2 display the text on pass 1 only and pass 2 only, respectively. You can use INFO as a synonym of DISP2 is you wish. The use of the directives is the same: for example, you might write DISP 'Assembling debug code' to display ---- Assembling debug code on the screen. The message you display can contain printable text, and you can also include some control characters. You specify them in the same way as you would in any other string, by preceding them with a "|" character. The control characters you can use are: |M and |J - start a new line |G - make a beep sound For example DISP 'Line 1|MLine 2|G' displays a 2 line message and rings the bell. Additionally, the text can contain numeric expressions that are evaluated as the message is output. For example, this would let you output a message to report the size of a section of code. Within the text, you can specify an expression in one of two ways. %D(<expr>) will evaluate <expr> and display the result in decimal, and 36 G USING THE 65C02 ASSEMBLERH %X(<expr>) will display it in hexadecimal. You can write any numeric expression you wish within the parentheses, but it must not contain forward references. For example, to report the size of a section of code between labels START.CODE and END.CODE, use: DISP2 'Size of code is %X(END.CODE-START.CODE) bytes' -8.2 The WAIT, WAIT1 and WAIT2 directives- These output messages in the same way as DISP, DISP1 and DISP2, but then suspend the assembly until you press a key on the keyboard. You could thus use these directives to enable you to change source discs during an assembly. -8.3 The QUERY directive- This offers a convenient way of setting up conditions for conditional assembly. QUERY operates only on pass 1 of the assembly. It displays a message on the screen in the same way as the directives above, then waits for you to type in a line. The line is treated as a numeric expression and evaluated, the result being set as the value of the symbol specified in the line's label field. If the expression is invalid, or contains a forward reference, the question will be repeated. For example, suppose that your source contains optional debug code, and you select this with IF conditions of the form IF DEBUG.MODE . debug code . FI The value of DEBUG.MODE would normally be -1 to select debug code, or 0 if it were not needed. 37 G USING THE 65C02 ASSEMBLERH Rather than define DEBUG.MODE in the source, and thus have to edit the source every time you wished to change it, you can make the Assembler ask for the value at the start of an assembly. A line such as: DEBUG.MODE QUERY 'Use debug mode' will output the question ---- Use debug mode? on pass 1. You can now type in -1 to select debug code, or 0 to suppress it. Since the line you type is an expression, and can contain symbols, you can make this more friendly by changing the source to include YES EQU -1 NO EQU 0 before the QUERY directive. Now you can reply either "YES" or "NO" to the question: the Assembler will evaluate the line and take the value of the symbol you type. -8.4 The STOP directive- STOP provides a useful way of abandoning an assembly part-way through. It operates on pass 1, and like DISP1, it displays a text message. Afterwards, though, it aborts the assembly with the error message "Stopped". 38 G USING THE 65C02 ASSEMBLERH -G9. WRITING SIMPLE MACROS- H The Assembler contains a powerful macro facility, allowing you to write very complex and sophisticated macros. In this chapter, we shall examine the simpler aspects of macros. A macro is a way of producing a number of Assembler source lines merely by specifying its name in the opcode field of a line. For example, your source might contain many occurrences of the lines: LDA VAR CLC ADC #2 STA VAR You could shorten the source, and make it easier to follow, by replacing each occurrence with a macro call: you might set up a suitable macro with the statements ADDTWO MACRO LDA VAR CLC ADC #2 STA VAR ENDM Then, instead of writing the four lines of code, simply write one line ADDTWO The Assembler will expand the macro definition, and will automatically generate the four lines for you. -9.1 Using macro parameters- Although this is useful in itself, the macro as shown above is rather limited. It couldn't, for instance, be used to add 2 to the variable COUNT instead of VAR. In order to provide this sort of flexibility, you can pass information to macros as "parameters". You could re-write the macro above to read 39 G USING THE 65C02 ASSEMBLERH ADDTWO MACRO LDA @P1 CLC ADC #2 STA @P1 ENDM Here we have replaced the occurrences of VAR by the string "@P1". Now, when the Assembler expands the macro, it will replace all occurrences of "@P1" with parameter number 1 of the macro call. To add 2 to VAR, you would then write ADDTWO VAR and to add 2 to COUNT, you would write ADDTWO COUNT You can supply up to 9 parameters when you call a macro, and they are indicated in the body of the macro by @P1, @P2, @P3 and so on. (Note that you can also specify the parameters as @1, @2, @3 and so on, omitting the "P". This is adequate for existing code; however, for new programs you should use the "@P1" form, as this is necessary when you come to use the Macro Programming Language) -9.2 Specifying macro parameters- You can specify anything you want as parameters to macros. A macro can have up to 9 parameters, separated by a comma and optional spaces. A macro with 3 parameters could be called with lines like CHECK 1,FRED,27 CHECK 1 , FRED , 27 and so on. Normally, the Assembler will remove leading and trailing spaces from each parameter. If you require leading or trailing spaces, or if the parameter has to include a comma, you will need to specify it as a string, delimited by single- or double-quote characters. Thus, a macro call might look like THING 'Here, is a comma' and "@P1" will be replaced in the macro body with the characters Here, is a comma Note that the string delimiters are not taken as part of the parameter proper. 40 G USING THE 65C02 ASSEMBLERH -9.3 Nesting macros- You can call macros from within macros, up to a depth of 5. If you attempt to nest deeper than that, the Assembler will flag an error. -9.4 Redefining opcodes and directives- The Assembler allows you to set up macros to redefine any opcode or directive. For example, you might want to redefine the JSR (Jump-to-Subroutine) opcode to automatically save the registers before entering the subroutine. You could do this by declaring a macro called JSR thus: JSR MACRO PHA TXA PHA TYA PHA JSR @P1 ENDM Now, whenever the Assembler comes across a line with JSR in the opcode field, it will expand the -macro- JSR rather than obeying the opcode. It will plant the code to save the registers, and then will come to the line JSR @P1 in the macro. Here, because it is -already- in a macro, the Assembler will not use the macro JSR. Instead it will assemble the -opcode- JSR, planting the code to enter the subroutine. 41 G USING THE 65C02 ASSEMBLERH -9.5 Labels within macros- Suppose you wish to write a macro that includes a branch of some sort. You might write the macro definition as: THING MACRO LDA @P1 BEQ ZERO EOR #$FF ZERO STA @P2 ENDM The first time the macro is called, it plants the code bytes, and defines the label ZERO as the destination of the BEQ instruction. On a subsequent call, though, the macro will produce the same code, and will attempt to define the value of ZERO again. This, of course, will fail, since it already exists from the first macro call. The Assembler provides a way round this problem, by giving you a way of generating -unique- labels. Every time a macro is called, the Assembler sets up what you can regard as a special parameter on your behalf, which contains a string that is different for every macro call. This string is substituted, in the same way as ordinary parameters, by writing "@$MC" in the line. Thus, the above macro could be changed to be: THING MACRO LDA @P1 BEQ ZERO@$MC EOR #$FF ZERO@$MC STA @P1 ENDM Then, on the first macro call, every occurrence of ZERO@$MC might be changed to ZERO1X1. On the next call, they become ZERO2X1, so that there is no clash between the macros. 42 G USING THE 65C02 ASSEMBLERH G-10. THE MACRO PROGRAMMING LANGUAGEH- A very powerful feature of the Assembler is its Macro Programming Language. This allows you considerable control in how macros are expanded - you can construct loops, manipulate macro parameters and perform several other functions that allow you to build macros of great power. Although this facility is mostly intended for use within macros, many of its facilities can also be used -outside- macros to great effect, as this section will explain. The Macro Programming Language's facilities build on two source language features known as Assembly Time Variables and Sequence Symbols. -10.1 Sequence Symbols- These are "place markers" within your source files or within macros that the Macro Programming Language uses in loops. Using directives such as AGO and AIF, you can make the Assembler move up or down within a file or a macro, letting you repeatedly assemble some parts of the source or totally omit others. Sequence Symbols are very similar to the labels that are part of the source proper, and they can contain the same characters. To distinguish them, Sequence Symbols always begin within a "%" sign in the first character of the line. The Sequence Symbol should be the -only- thing on the line: if you -do- put anything else there, the Assembler will ignore it. To take an example of how Sequence Symbols could be used, suppose your source file contained the lines: AGO %SKIP ASC 'These lines will never ' ASC 'get assembled' %SKIP ASC 'But this one will' The Assembler will encounter the AGO directive, and will then -ignore- everything in the source file until it finds the Sequence Symbol %SKIP. It will then resume its normal processing. Although this example will actually work, the technique isn't greatly useful, as ignoring source lines can be done just as easily with the IF..ELSE..FI construction. However, AGO (and the various -conditional- skips such as AIF) also allows you to go -backwards- in the source or macro - there is no other way of achieving this. 43 G USING THE 65C02 ASSEMBLERH The Sequence Symbols used in any file or macro are quite independent of those in any other; thus you can safely use ones of the same name in every file and macro, if you wish. -10.2 Assembly Time Variables- Assembly Time Variables, or ATVs, are string variables that the Assembler itself uses while assembling your source files. As it reads the program source (either from a file, or from the definition of a macro) the Assembler continually looks for references to ATVs. These are replaced - -before- the line is assembled - with the contents of the ATV, thus allowing you to vary the source that is actually processed. You can use ATVs in many ways. For example, the first line of a source might set an ATV string to hold the version number of the program you are assembling; the Assembler will then automatically replace every reference to that name with the string. Some ATVs are created by the Assembler itself, and let you incorporate such things as the name of the source file into the source itself. The main use, though, is in controlling loops within macros and within source files. -10.2.1 Creating Assembly Time Variables- ATVs have names similar to the variables that form part of the source proper, and you can manipulate them with various directives. -10.2.1.1 Local and Global ATVs- There are two types of ATV: -local- and -global- ones. a. Global ATVs exist for the whole of the assembly, and can be used anywhere. They are created and manipulated with the ASTR, ASET, ASTRIP and ALEN directives, which you can use even inside macros - the ATVs they create will continue to exist after the macro finishes. b. Local ATVs are created and manipulated by the MSTR, MSET, MSTRIP and MLEN directives. These directives can only be used inside macros, and the ATVs thy create can be used only within the -same- macro - they cease to exist at the end of the macro expansion. You would use these, for example, in controlling loops within a macro. In fact, you have already seen local ATVs in use in section 9.1 on "Simple Macros". Whenever you invoke a macro, the Assembler creates local ATVs with names P1, P2, P3 and so 44 G USING THE 65C02 ASSEMBLERH on, each holding one of the parameters you supplied on the macro call. For example, the source line NAME ASET 'OSWRCH' will set up an ATV called NAME, whose contents are the string 'OSWRCH'. Since the ASET directive has been used, the ATV is global, and can be used anywhere in the assembly. You can create local and global ATVs of the same name if you wish. However, if you wish to refer to the local ATV, you should be careful to -always- use the "M" form of the directives. The "A" forms will always create global ATVs, even if local ones of the same name already exist. -10.2.1.2 String and Numeric Values- All ATVs are stored by the Assembler as printable character strings. However, in many cases you will find you use them as counters for controlling loops: to make this easy, the Assembler will automatically convert ATVs from numbers to strings whenever necessary. The rule used is quite simple. When processing ASET or MSET directives, the Assembler examines the first character of the operand field. If it is a string delimiter, the operand is taken as a string and is not evaluated. If it is any other character, the Assembler treats the operand as a numeric expression, evaluates it, and converts the result into a string for storage. Thus, the line COUNT ASET 15+3 will set up the ATV COUNT, containing the string "18", but COUNT ASET '15+3' sets up the string "15+3". The operand can be any expression, provided it does not contain any forward references: thus COUNT ASET ADDRESS+10 sets COUNT to hold the string form of the result of adding 10 to the address label ADDRESS. 45 G USING THE 65C02 ASSEMBLERH If you use expressions that mix numeric and character literal values, some caution is needed to make sure that the Assembler does what you want: for example, VALUE ASET 'A'+3 would produce an error, rather than adding 3 to the code for the character 'A'. This is because the Assembler, seeing the operand field beginning with a "'" character, will treat the operand field as a -string- and find that it is invalid. To overcome this, you may be able to re-order the operand expression: thus you could write the above example as VALUE ASET 3+'A' Now the Assembler will treat the operand field as a numeric expression, since it does not begin with a string delimiter. In some cases, though (particularly in macros where you may not know beforehand what the expression may look like) it may not be possible to re-order things safely. Here you can simply put a dummy number in front of the expression: thus VALUE ASET 0+'A'+'B' would add the character values 'A' and 'B', the leading "0" character forcing the Assembler to treat the operand as a numeric expression. The ALEN and MLEN directives similarly convert from number to string for you. Here the operand -must- be a string: for example, SIZE ALEN 'A short string' sets SIZE to hold the string "14" - the length of the operand string, converted from a number into a string. -10.2.1.3 String slicing- The ASET and MSET directives also allow to you to "slice" strings, or extract characters from inside them. You perform this by adding some parameters in the operand field: for example SLICE ASET 'abcdefghij',3,2 will set SLICE to hold the string "cd". The second operand parameter specifies the position of the first character to be sliced out (the string starts at character 1), and the third parameter specifies the number of characters to be sliced. If you omit the third parameter, exactly one character is sliced: thus 46 G USING THE 65C02 ASSEMBLERH SLICE ASET 'abcdefghij',3 will set SLICE to hold the string "c". Occasionally, string manipulations such as slicing may result in strings that have leading or trailing spaces, and you may not be able to tell beforehand how many. The ASTRIP and MSTRIP directives remove all leading and trailing spaces, so that NEW ASTRIP ' abcd ' would set the string NEW to be "abcd". -10.2.1.4 Efficient use of memory- The strings contained by ATVs are held by the Assembler in the symbol table, and so compete for memory with other symbols. You can change the contents of an ATV to a string of different length as often as you wish: however, every time the string becomes longer, the Assembler will allocate a new block of memory for it. The previous block cannot be used again, so continually increasing the size of an ATV can be extremely wasteful of memory. To overcome this, the ASTR and MSTR directives let you pre-declare a block of memory big enough to hold the maximum size string you will use. For example, NAME ASTR 50 sets up a block long enough to hold a 50-byte string without the need to get more memory. The -minimum- amount of memory the Assembler will allocate is 5 bytes: this is enough to hold the largest possible numeric value, so that loop counters will not cause memory wastage as their values grow - you need not use ASTR and MSTR for them. -10.2.2 Simple Substitution of Assembly Time Variables- Once you have set up ATVs, you can use them to create -variable- source lines. We have already come across this concept in section 9.1 on "Simple Macros", in the discussion of macro parameter substitution. There, we saw that if the source of the macro contained the line LDA #@P1 the Assembler would replace "@P1" with whatever you had specified as the first parameter of the macro when you called it. 47 G USING THE 65C02 ASSEMBLERH ATVs are substituted into source lines in exactly the same way, and as we saw, macro parameters -are- in fact local ATVs. The rule the Assembler uses is quite simple: whenever it detects an "@" sign in the source (other than in a comment line) it expects an ATV name to follow. The "@" and the name itself are replaced by the contents of the ATV before the line is assembled. For example, you might keep the version number of a program in a small, quickly-editable file that is INCLUDEd into the source at the start of an assembly. This might contain the line VERSION ASET "3.45" which sets the ATV VERSION to hold the string "3.45". Then, at any point in the source where you needed to insert the version number (such as in a screen message) you could write, for example TITLE ASC "SuperGame @VERSION" The Assembler would replace "@VERSION" with "3.45" before it assembled the line, so the string actually planted would be "SuperGame 3.45" This technique lets you keep the version number in one easily alterable place, and lets the Assembler take care of putting the up-to-date value (or parts of the value) into the source at the appropriate places. There are some more complex uses of ATV substitution, and we shall discuss these later in section 10.3 on "Writing Complex Macros". Some useful points to note on substitution are: a. If you want the "@" character to appear in the line the Assembler processes, your source must contain two of them. Thus, if the line you -really- want to assemble is ASC 'VAT @ 15%' write it in the source file as ASC 'VAT @@ 15%' b. Once the Assembler finds an "@" character in the source, it assumes that what follows is an ATV name. The end of this name is assumed to be the first non-alphanumeric character that it meets, or the end of the line. In almost all cases, this will cause no difficulty, but occasionally will, usually in complex macros. 48 G USING THE 65C02 ASSEMBLERH As an example, suppose you had declared at ATV called EXPR, holding the string "10+". A subsequent source line might then read LDA #@EXPR3 and the intention is for this to be transformed into LDA #10+3 In this case, though, the substitution will fail, as the Assembler will look for an ATV called EXPR3. To force it to do as you want, write the source line as LDA #@EXPR/3 The "/" character enables the Assembler to detect the end of the ATV name, so it will look for EXPR as it should. The "/" will be discarded, so that the resulting line will be LDA #10+3 as intended. If you -need- a "/" character in the resulting line, write it as "//". There is another technique you might use in these circumstances. The Assembler does not regard spaces as significant in numeric expressions, so that you could write LDA #@EXPR 3 to achieve the same result. c. No ATV substitution is performed in comment lines, in lines containing Sequence Symbols, or in the definition of macros (i.e. between the MACRO and ENDM directives). Apart from these, though, substitutions can be made at -any- place in a line - you can substitute for labels, opcodes, operands or any parts of them. -10.3 Writing Complex Macros- -10.3.1 Programming macro loops- Mostly, you will use the Macro Programming Language to program macro loops, controlled by various conditions. 49 G USING THE 65C02 ASSEMBLERH -10.3.1.1 Simple loops controlled by counter- The simplest form of loop is one which is executed a fixed number of times, and needs only a counter to control it. As an example, suppose that we need a macro to plant a number of bytes containing $FF with the DFB directive, the number being specified by the first parameter. (There are much easier ways of doing this than with a macro, of course - this only shows a general technique). The macro definition might then be: PLANT MACRO COUNT MSET 0 %LOOP DFB $FF COUNT MSET @COUNT+1 AIF @COUNT<@P1,%LOOP ENDM To see how this works, we can examine each line in turn, assuming that the macro was called with a line PLANT 7 Line 1 : This is the macro definition line. Line 2 : This line sets up a local ATV called COUNT, and gives it a string value of "0". Line 3 : This is a Sequence Symbol marking the top of the loop. Note that there is nothing else on the line with it. Line 4 : This is the DFB line that plants the $FF byte required. Line 5 : This line increments the value of COUNT. As the Assembler reads the line, it encounters "@COUNT", which it replaces with the current string value of the ATV. Thus the first time this line is encountered, the Assembler will generate COUNT MSET 0+1 The second time, it generates COUNT MSET 1+1 and so on. Line 6 : This tests whether the Assembler is to loop round once more. As with line 5, the Assembler will replace 50 G USING THE 65C02 ASSEMBLERH "@COUNT" with the current value of the ATV. "@P1" is, of course, replaced by the first parameter of the macro. The first time round, the line processed is AIF 0<7,%LOOP which is true, so the Assembler skips backwards in the macro to line 4 and resumes processing from there. -10.3.1.2 Loops accessing macro parameters- Another frequently-needed form of loop is one in which all the parameters of the macro are accessed in turn. Suppose, for example, you need to write a macro THINGS, whose parameters are all numbers. Each number is to be planted in a byte in the object file with a DFB directive: to make THINGS interesting, the number of parameters must be variable. Such a macro is fairly simple to write, but uses an ATV substitution technique that can, at first sight, be somewhat daunting. If the job were simply to plant the value of parameter 1, the line in the macro that does it would simply be DFB @P1 However, we need to access each parameter in turn: the Assembler must somehow be made to see "@P1" the first time round the loop, "@P2" in the second, and so on. Effectively, then, we need a substitution technique that lets us have a -variable- ATV name: i.e. one that -first- substitutes the number ("1", "2", "3" etc) -then- substitutes for the ATV name so formed. The Assembler can do this easily, since ATV substitution operates in a hierarchic fashion. For example, suppose that a source line contains @(P@COUNT) somewhere. On seeing the first "@" character, the Assembler prepares to substitute an ATV. It finds, though, that the next character is a "(", so that it now expects a bracketed expression rather than an ATV name. It notes where it has got to in the source line, and explores within the brackets. Now, though, it stores the characters it finds (rather than passing them on to be assembled), and expects to end up with a valid ATV name by the time it gets to the ")" character. It notes the "P", then finds the second "@". This makes it try again to substitute an ATV, and this time it finds a real ATV called 51 G USING THE 65C02 ASSEMBLERH COUNT, which we shall suppose contains the string "1". After "COUNT" it finds the ")" ending the bracketed expression; thus, within the brackets the string it has built is now "P1". Having ended the bracketed expression, the Assembler goes back to where it was. The "(P@COUNT)" has provided the string "P1", and -this- now is a valid ATV name. So it proceeds to substitute the value of ATV P1, the first macro parameter, as we intended. To see how we might use this technique, we can consider a definition of THINGS: THINGS MACRO COUNT MSET 1 %LOOP AIF '@(P@COUNT)'='',%ALL.DONE DFB @(P@COUNT) COUNT MSET @COUNT+1 AIF @COUNT<10,%LOOP %ALL.DONE ENDM To see how this works, we can examine each line in turn. Line 1 : This is the macro definition line. Line 2 : This line sets up a local ATV called COUNT, and gives it a string value of "1". Line 3 : This is a Sequence Symbol marking the top of the loop. Line 4 : Since the number of parameters must be variable, we need to test whether we've processed them all. You can see the substitution technique discussed above in use here to check if the next parameter is null - any parameters that you don't supply in a macro call are strings of zero size. If the parameter -is- null, the Assembler skips forwards in the macro until it gets to the Sequence Symbol %ALL.DONE. Line 5 : This is the DFB line that plants the current macro parameter as a byte. Line 6 : This line increments the value of COUNT, as in the previous example. Line 7 : This tests whether the Assembler is to loop round once more. The final macro parameter is P9, so once COUNT reaches 10 the macro is finished. Line 8 : This is the Sequence Symbol that line 4 skips to if it finds a null parameter. 52 G USING THE 65C02 ASSEMBLERH Thus, if the macro was called with a line THINGS 1,$FE,FRED-1 the loop would be traversed three times, and the lines actually assembled would be DFB 1 DFB $FE DFB FRED-1 The technique of hierarchical substitution, though most often used to access macro parameters in turn, can be used in many other applications: you can nest substitutions to as deep as you are likely to need, so that you might write something as horrendous looking as LDA #@(XX@(COUNT@PTR)B) if you really needed to. -10.3.2 Changing macro parameters- Macro parameters are in fact local ATVs with names P1, P2, P3 and so on. This means that you can -change- them within a macro as you wish. One example of this might be to allow the use of default macro parameters (although section 10.3.3 below shows an automatic way to do this). Suppose that a macro parameter should be a number, whose default value is 1. You could define it as: TEST MACRO AIF '@P1'#'',%NEXT P1 MSET 1 %NEXT LDA #@P1 ENDM Within this example, we have: Line 1 : The macro definition line. Line 2 : This tests if parameter 1 has been supplied. If so, it will not be a null string, so the Assembler skips to %NEXT. Line 3 : This line sets parameter 1 to the default value. 53 G USING THE 65C02 ASSEMBLERH Line 4 : This is the Sequence Symbol skipped to if the parameter is not defaulted. Line 5 : This line actually uses the parameter. It will assemble correctly even if the parameter was not given, since in that case line 3 will have set it up to be the default value. -10.3.3 Setting default macro parameters- The example above showed one way of establishing a default value of a macro parameter, but in fact the Assembler gives you an automatic and easy way of doing this with the DEFPARS directive. The effect of this directive, which you can issue at any time inside a macro, is to set the values of any of the macro parameters P1, P2, P3 and so on, -unless- they are -already- defined. For example, you might call a macro with a line FRED 1,,3 where you have defined parameters 1 and 3, but not parameter 2. If the macro now executes, say, DEFPARS 100,200,300 the Assembler will check the parameters in turn. Parameters 1 and 3 are already defined, so the "100" and "300" values are not used. Parameter 2, though, is not yet defined, so it is set to "200" from this point on. If you wished, say, to establish a default for only -some- of the parameters of a macro, simply specify only those parameters in the DEFPARS directive and default the others. Thus DEFPARS ,,,44 sets a default for parameter 4, but has no effect whatsoever on parameters 1, 2, 3, 5, 6, 7, 8 and 9. -10.3.4 Listing control for macros- If you write complex macros with lots of loops, you will find that the Assembler actually executes a large number of lines that just contain the AIF, MSET directives, etc. This can swamp the listing, and make it hard to see the actual directives that plant data or code (as well as using up a large amount of paper). 54 G USING THE 65C02 ASSEMBLERH To overcome this, list level 2 will not list directives such as MSET, AIF, etc, unless they contain errors. In order to see -all- the lines of a macro expansion, use list level 3. (Note that outside macros, ASET and other similar directives will list at level 2). -10.3.5 Exiting a macro prematurely- You may sometimes need to exit a macro as a result of a test. Depending on circumstances, you may be able to use AIF or AGO to skip to the physical end of the macro; however, you can also use the MEXIT directive. This exits the macro immediately, wherever in the macro body it is encountered. -10.3.6 Comment lines within macros- You can include comment lines within the definitions of macros, just as in normal code. For example, a short macro might be defined as TEST MACRO * * Adjust value in PTR0 * INC PTR0 ENDM The three comment lines will be stored in the macro definition, and (if the listing level is set to 2 or higher) will be listed whenever you call the macro. This lets you output comments to describe the actions of the macro. The disadvantage of this technique is that the comment lines are stored in their entirety in memory when the macro is defined, giving you correspondingly less space for the symbol table. When you come to writing complex macros making great use of ATVs and loops, you will find it most advantageous to include liberal amounts of comment. In order that these comments, which purely document how the macro works rather than the code it generates, shouldn't use memory, comment lines beginning with "!" are -not- stored. Thus, you could write a macro as TEST MACRO ! ! See if first parameter is null ! AIF '@P1'#'',%NEXT 55 G USING THE 65C02 ASSEMBLERH ! ! It is null, so reset it to "1" ! P1 MSET 1 %NEXT ! ! Parameter 1 now definitely has a value, ! so we can use it ! LDA #@P1 ENDM The lines beginning "!" will appear in the listing when you define the macro, but will not be stored and will not appear when the macro is called. -10.4 System ATVs- The Assembler provides a number of read-only ATVs that you can substitute. They provide information on the Assembler and the environment that you can use to control assembly. Each system ATV name starts with a "$" character: they are $CLST The current code listing level. $DEFCLST The default code listing level. $DEFLST The default listing level. $FLEVEL "1" if the current file is an INCLUDE file; "0" if it is not. $FS The number of the filing system in use, as returned by OSARGS with A=0, Y=0. The Acorn DFS returns "4", Econet returns "5" and ADFS returns "8". $LINE The number of the current source line. $LST The current listing level. $MC The macro call counter, used to generate unique labels within macros (see section 9.5) $MLEVEL The current macro nesting level. If not in a macro, the value is "0". $OBJECT The name of the current object file, which may include leading or trailing spaces. 56 G USING THE 65C02 ASSEMBLERH $OS The version of the MOS in use, as returned by OSBYTE with A=0. $OSHWM The primary OSHWM value of the machine running the Assembler. $PLENGTH The current page depth used in the assembly listing, as set by the PAGE directive. $PWIDTH The current line width of the assembly listing, as set by the PAGE directive. $PRINTING Indicates whether the assembly listing is being sent to the screen or to a printer or file. The value returned is "0" if the listing is being sent to the screen, and "-1" if it is being sent to a printer or a file. $SOURCE The name of the current source file, which may include leading or trailing spaces. $TIME The currently-set timestamp string, which may include leading or trailing spaces. $TTL The currently-set page title string, which may include leading or trailing spaces. $VERSION The version of the Assembler in use. This is returned as a numeric string, so that version 1.60 sets the string to be "160". For example, the line ORG @$OSHWM could be used to set the base address of the code to the OSHWM value of the machine being used, without the need to know what that value was. 57 G USING THE 65C02 ASSEMBLERH -GAppendix 1 : OPCODES AND ADDRESSING MODES- H The Assembler supports all the opcodes of the 6502 and 65C02 processor families, using standard MOSTEK mnemonics. For descriptions of the opcodes, see for example "The Advanced User Guide for the BBC Micro" (for 6502-compatible opcodes) and the "Master Reference Manual Part 2" (both 6502- and 65C02-compatible opcodes, although it describes the BBC BASIC Assembler syntax which cannot be used with this Assembler.) The 6502-compatible opcode mnemonics available are: ADC AND ASL BCC BCS BEQ BIT BMI BNE 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 PHA PHP PLA PLP ROL ROR RTI RTS SBC SEC SED SEI STA STX STY TAX TAY TSX TXS TYA The 65C02-only mnemonics are: BRA DEA INA PHX PHY PLX PLY STZ TRB TSB The opcode CLR can be used as a synonym for STZ. The addressing modes common to both the 6502 and 65C02 processors are: -Mode- -Syntax- Implied op Accumulator op A or op Immediate op #expr8 Low byte op #>expr High byte op #<expr Zero page op expr8 Indexed by X op expr8,X Indexed by Y op expr8,Y Absolute op expr16 Indexed by X op expr16,X Indexed by Y op expr16,Y Indirect pre-indexed op (expr8,X) Indirect post-indexed op (expr8),Y Absolute indirect op (expr) The addressing modes usable with the 65C02 processor only are: -Mode- -Syntax- Zero-page indexed op (expr8) Absolute indirect pre-indexed op (expr16,X) In these definitions, "expr8" represents an 8 bit number; "expr16" a 16 bit number; and "expr" a value that is either 8 or 16 bits long. 58 G USING THE 65C02 ASSEMBLERH -GAppendix 2: ASSEMBLER DIRECTIVES- H The Assembler supports a large number of directives, or pseudo-ops. This section gives a detailed definition of each, arranged in alphabetical order. Directives follow the normal syntax of opcodes. All can be followed by comment fields started with a ";" character; however, not all directives may have labels. In the specification, items enclosed in "[]" brackets are optional, and can be omitted. 59 G USING THE 65C02 ASSEMBLERH GAGO H Skips to a Sequence Symbol. Syntax: AGO <sequence> Example: AGO %LOOP GAIF H Skips to a Sequence Symbol if a condition is true. Syntax: AIF <expr>,<sequence> or AIF <stringexpr>,<sequence> If <condition> is false assembly continues in the next line. Example: AIF 'FREDA'>'FRED',%LOOP GAIFDEF H Skips to a Sequence Symbol if a symbol has been defined. Syntax: AIFDEF <symbol>,<sequence> Example: AIFDEF RAM.CODE,%DOING.RAM GAIFNDEFH Skips to a Sequence Symbol if a symbol has not been defined. The syntax is as for AIFDEF. GALEN H Sets a global ATV to the length of the operand string. Syntax: <label> ALEN <string> Example: SIZE ALEN 'This is a string' 60 G USING THE 65C02 ASSEMBLERH GASC H Defines an ASCII string. Syntax: [<label>] ASC <string> Within <string> you can use the techniques of section 4.3.3 to plant control characters or characters with bit 7 set. If a label is specified, it is set to the address of the first byte of the string. Example: TITLE ASC 'SuperGame 3.45' GASET H Sets a global ATV to contain a string. Syntax: <label> ASET <string>[,<expr1>[,<expr2>]] or <label> ASET <expr> The final two parameters in the operand field allow the string parameter to be sliced. Both are expressions that must not involve forward references. <expr1> specifies the first byte to be sliced from the string (the first byte in the string is byte 1). <expr2> defines the size of the slice; if omitted, one byte is extracted. Example: COUNT ASET 100 GASTR H Allocates space for a global ATV. Syntax: <label> ASTR <expr> <expr>, which must not contain forward references, defines the space needed. The value can be up to 255 bytes. Example: NAME ASTR 150 GASTRIP H Sets a global ATV to a string value, removing leading and trailing spaces in the process. 61 G USING THE 65C02 ASSEMBLERH Syntax: <label> ASTRIP <string> Example: MIDDLE ASTRIP ' aardvark ' GCASC H This is similar in action to ASC, but will plant a byte containing the number of characters within the string before the string itself. GCHN H Closes the current source file and starts another. Syntax: [<label>] CHN <filename> The directive is not allowed in an INCLUDE file. Example: CHN :2.NEXTBIT GCHR H Defines the character used by the REP directive. Syntax: [<label>] CHR character The character is specified literally, and not as a character constant. Example: CHR # GCLST H Sets the code listing level. Syntax: [<label>] CLST [<expr>] <expr>, which must not contain forward references, gives the new listing level. If omitted, the level is reset to the default from the command line. The values allowed are: 0 List only the first 3 bytes produced by any line. 62 G USING THE 65C02 ASSEMBLERH 1 List all the bytes planted by any line except a CODE directive. 2 List all the bytes planted by all lines. Example: CLST 2 GCODE H Includes a file (such as a screen dump) directly into the object file. Syntax: [<label>] CODE <filename> The specified file is copied, with no interpretation, directly to the object file. If <label> is specified it is set to the address of the first byte copied. The address count is increased by the size of the file. Example: CODE SCRDUMP GCSTR H Similar to STR, but this directive plants a byte containing the number of characters in the string before the string itself. The count includes the $0D byte that is automatically added at the end of the string. GDB H This is identical to DFB. GDDB H Defines a number of two-byte values, output in high-low order. Syntax: [<label>] DDB <expr>[,<expr>...] Each expression in the operand field is evaluated and stored as a two-byte value. If <label> is present, it is set to the address of the high-order byte of the first expression. Each expression can be preceded by a repeat count as described in section 4.2.3. Example: TABLE DDB 28,32105,[10]$FFFF 63 G USING THE 65C02 ASSEMBLERH GDEFPARSH Sets up default parameters for a macro. See section 10.3.3 for full details of this directive. GDEND H Terminates a DSECT. Syntax: [<label>] DEND The address that was saved when the DSECT directive was encountered is reset. Example: DEND GDFB H Defines a number of single-byte values. Syntax: [<label>] DFB <expr>[,<expr>...] Each expression in the operand field is evaluated and stored as a byte value. If <label> is present, it is set to the address of the first expression. Each expression can be preceded by a repeat count as described in section 4.2.3. Example: TABLE DFB 0,[27]1,FRED+2 GDFDB H This is identical to DDB. GDFS H This is identical to DS. GDFW H This is identical to DW. GDISP H Displays a message on both pass 1 and pass 2. Syntax: [<label>] DISP <string> <string> may contain references to variables: for details see section 8.1. Example: DISP 'Program size is %D(*-$8000)' 64 G USING THE 65C02 ASSEMBLERH GDISP1 H As for DISP, except that the message is displayed only on pass 1. GDISP2 H As for DISP, except that the message is displayed only on pass 2. GDO H A synonym for IF. GDS H Reserves space in the object file, setting the bytes so affected to zero. Syntax: [<label>] DS <expr> <expr>, which must not include forward references, defines the amount of space to be reserved. If <label> is present it is set to the address of the first byte reserved. Example: DS $C000-PROG.TOP.ADDRESS GDSECT H Opens a "dummy section" that allows an area of memory to be defined without generating any object code. Syntax: [<label>] DSECT When the DSECT directive is processed, the current address is noted by the Assembler, and the value is reset to that at the end of the previous dummy section (or 0, if this is the first). An ORG directive can be used to change the value if required. When the dummy section is terminated by a DEND directive, the old value of the address is restored. Example: DSECT 65 G USING THE 65C02 ASSEMBLERH GDW H Defines a number of two-byte values output in low-high order. Syntax: [<label>] DW <expr>[,<expr>...] Each expression in the operand field is evaluated and stored as a two-byte value. If <label> is present, it is set to the address of the low-order byte of the first expression. Each expression can be preceded by a repeat count as described in section 4.2.3. Example: TABLE DW FRED,BERT GELSE H Marks the end of the TRUE branch of a conditional assembly block begun by IF, IFDEF and IFNDEF. For details see section 7 GENDM H Terminates the definition of a macro begun by the MACRO directive. Syntax: ENDM GEQU H Assigns a value to a symbol. Syntax: <label> EQU <expr> <expr> must not contain forward references. Example: OSWRCH EQU $FFEE GEXEC H Specifies the bottom 16 bits of the 32 bit execution address of the object code. Syntax: [<label>] EXEC <expr> The catalogue entry of the object file will be updated to show the specified execution address. <expr> can only be a 16-bit quantity: the value of the two top bytes of the address are set by the MSW directive. 66 G USING THE 65C02 ASSEMBLERH If this directive is not used, the execution address is set to the address defined by the first ORG that is not in a dummy section. Example: EXEC START+3 GFI H Terminates a conditional assembly block begun by IF, IFDEF or IFNDEF. For details, see section 7. GFIN H This is identical to FI. GHEX H Defines a series of bytes in the object program, the bytes being specified as a hexadecimal string. Syntax: [<label>] HEX <string> <string> must contain hexadecimal digits (i.e. '0'..'9' or 'A'..'F'), and each pair of digits is output as one byte. If <label> is present it is set to the address of the first byte from the string. Example: BYTE.LIST HEX 'AB34FF2E7E' GIF H Begins a conditional assembly block. Syntax: [<label>] IF <expr> If <expr>, which cannot contain forward references, is non-zero, the condition is TRUE, otherwise it is FALSE. For details, see section 7.1. GIFDEF H Begins a conditional assembly block. Syntax: [<label>] IFDEF <symbol> If <symbol> has been defined, the condition is TRUE, otherwise it is FALSE. For details, see section 7.2 67 G USING THE 65C02 ASSEMBLERH GIFNDEF H Begins a conditional assembly block. Syntax: [<label>] IFNDEF <symbol> If <symbol> has not been defined, the condition is TRUE, otherwise it is FALSE. For details, see section 7.2. GINCLUDEH Begins assembly from a new source file, afterwards resuming with the current file. Syntax: [<label>] INCLUDE <filename> The Assembler will process lines from the specified file. Lines in the listing file will begin with an "I" to indicate their origin. At end-of-file, it resumes after the INCLUDE directive. The directive may not be used within an INCLUDE file or a macro. Example: INCLUDE :3.DEFINES GINFO H This is identical to DISP2. GLFCOND H Specifies that lines skipped in a conditional are to be listed. Syntax: [<label>] LFCOND For details, see section 7.4. GLOAD H Specifies the bottom 16 bits of the 32 bit load address of the object code. Syntax: [<label>] LOAD <expr> The catalogue entry of the object file will be updated to show the specified load address. <expr> can only be a 16-bit quantity: the value of the two top bytes of the address are set by the MSW directive. 68 G USING THE 65C02 ASSEMBLERH If this directive is not used, the load address is set to the address defined by the first ORG that is not in a dummy section. Example: LOAD $1902 GLST H Sets the source listing level. Syntax: [<label>] LST [<expr>] <expr>, which must not contain forward references, gives the new level. If omitted, the level is reset to the default specified in the command line. The allowed values are: 0 No lines are listed. 1 List lines from files, but not from macros. 2 List all lines, but not directives such as AIF within macros. 3 List all lines. Lines containing errors are always listed. GMACRO H Defines a macro. Syntax: <label> MACRO The following lines are stored as the definition of the macro. No ATV substitution is performed on the lines. The definition is terminated by an ENDM directive. Within the definition, comment lines starting with "!" will be listed but not stored in memory. The macro name may not be more than 8 characters long. The MACRO directive may not be used within a macro. Example: THING MACRO 69 G USING THE 65C02 ASSEMBLERH GMEXIT H Causes a macro to terminate immediately. Syntax: MEXIT GMLEN H As for ALEN, but this can be used only within a macro, and creates a local ATV rather than a global one. GMSET H As for ASET, but this can be used only within a macro, and creates a local ATV rather than a global one. GMSTR H As for ASTR, but this can be used only within a macro, and creates a local ATV rather than a global one. GMSTRIP H As for ASTRIP, but this can be used only within a macro, and creates a local ATV rather than a global one. GMSW H Sets the two top bytes of the load and execution addresses. Syntax: [<label>] MSW <expr> By default the bytes used are $FFFF, but if you are assembling code to run on a second processor you will need to change them to the appropriate value. Example: MSW 0 GORG H Sets the value of the address counter. Syntax: [<label>] ORG <expr> <expr>, which must not contain forward references, gives the new value. The first ORG directive that is not in a DSECT..DEND block also defines the default load and execution addresses. The object file is not affected in any way; thus if you use ORG to advance the address value, the Assembler will not plant 70 G USING THE 65C02 ASSEMBLERH any bytes in the object file to fill the gap. To accomplish this effect, you can use the DS directive. Example: ORG $1900 GPAGE H Defines the page length and width of the listing. Syntax: [<label>] PAGE <expr1>[,<expr2>] <expr1> is the physical number of lines on the paper (default 66). The Assembler leaves a small gap at the end of each page, to avoid the perforations. <expr2> is the number of characters to print on each line. If omitted, the value is set to 80. PAGE has no effect on the screen display. Example: PAGE 88,132 GQUERY H Displays a question and reads in a reply, which is evaluated as an expression and used to define a label. Syntax: <label> QUERY <string> For details, see section 8.3 GREP H Outputs a comment line to the listing to mark a source division. Syntax: [<label>] REP [<expr>] <expr> must not exceed 132, and must not contain forward references. If you omit the value, the Assembler will fill the output line to its full width. For details, see section 3.6.4 71 G USING THE 65C02 ASSEMBLERH GSFCOND H Specifies that lines skipped in a conditional should not be listed. Syntax: [<label>] SFCOND For details, see section 7.4 GSKP H Leaves a gap in the listing or starts a new page. Syntax: [<label>] SKP <expr> or [<label>] SKP H In the first form, <expr> gives the number of lines to be left blank. In the second, a new page is started. The SKP directive itself is not listed. Example: SKP 5 GSTOP H Aborts the assembly on pass 1, outputting a message. Syntax: [<label>] STOP <string> The Assembler will display <string>, then abort with the error message "Stopped". Example: STOP 'Too much in page zero' GSTR H This is similar to ASC, except that the Assembler will automatically add a $0D byte (Carriage Return) to the bytes generated. GSYSCLI H Issues a MOS command, allowing you, for example, to change the default disc drive. Syntax: [<label>] SYSCLI <string> 72 G USING THE 65C02 ASSEMBLERH You need not begin the string to be issued as a MOS command with a "*", but it doesn't matter if you do. Note that care is needed over the commands you try to execute. Anything that uses memory will almost certainly corrupt the Assembler's workspace and cause assembly to go horribly wrong. Example: SYSCLI 'DRIVE 2' GSYSVDU H Outputs one or more bytes to the screen and printer. Syntax: [<label>] SYSVDU <expr>[,<expr>...] The directive is similar to the BASIC VDU command. The low-byte of each <expr> is written with a call to OSWRCH. This gives you a means of sending control codes to a printer to set page formats, etc. SYSVDU will send all the bytes you specify to the screen. If you have used the "-P" command-line option, they will also be sent to the printer. To send the bytes -only- to the printer, precede each with a "1" value. The bytes are not sent to a listing file selected with the "-F" option. SYSVDU operates on both passes of the Assembler. Example: SYSVDU 1,27,1,'E' GSYSVDU1H This directive is identical to SYSVDU, but operates only on pass 1. GSYSVDU2H This directive is identical to SYSVDU, but operates only on pass 2. GTABS H This directive allows you to redefine the TAB positions the Assembler will use when listing source lines. Syntax: [<label>] TABS <expr>[,<expr>...] You may specify up to 14 TAB positions: any excess values will be ignored. Specifying the directive with no operand field will reset the built-in defaults. See section 3.2 for more details. 73 G USING THE 65C02 ASSEMBLERH GTTL H Defines the title string on the top of each listing page. Syntax: [<label>] TTL <string> The Assembler uses the first 20 bytes of the string as the page title, and also starts a new page. Example: TTL 'Screen Dumper' GTIME H Defines the timestamp string output on each listing page. Syntax: [<label>] TIME <string> The Assembler uses the first 24 bytes of the string for the new timestamp. The value need not be a time; you can use it as a subsidiary page title. On a Master 128 the directive is ignored, as the timestamp is read from the real-time clock. The Assembler can also be configured to read a third-party real-time clock fitted to other models. Example: TIME '25-August-1986 13:00' GWAIT H This displays a string (see under DISP), then pauses the assembly until you press a key. GWAIT1 H As for WAIT, but operates only on pass 1. GWAIT2 H As for WAIT, but operates only on pass 2. 74 G USING THE 65C02 ASSEMBLERH -GAppendix 3. DIFFERENCES FROM THE ADE ASSEMBLER- H The 65C02 Assembler contains a number of similar directives to the ADE Assembler, and in almost all cases it will be possible to assemble programs written for ADE with it. A few directives, though, have some minor differences, and there are also some small points on source format that must be considered. - Only single- and double-quote characters may delimit strings. - The second delimiter must not be omitted from character constants. - Character constants obey the same rule as strings in the ASC and STR directives for control characters and those with bit 7 set. Thus the "|" and "^" characters need to be doubled if they are being defined as constants. - Strings containing commas, or leading or trailing spaces, are specified as macro parameters within normal string delimiters rather than in [] brackets. - Macro parameters must always be separated by commas. - The SYSFX directive is ignored: to achieve the desired effect you should use the SYSCLI directive to issue a *FX command. - Macro libraries are not implemented. - Local labels within macros are not implemented. The system ATV $MC should be used to construct unique labels as described in section 9.5. - Expressions are evaluated fully hierarchically rather than left-to-right. - The "#" arithmetic operator is used for "inequality", returning -1 if unequal and 0 if equal, rather than "modulus". - The LST directive has a numeric operand rather than the strings OFF, ON and FULL. For ADE compatibility, define symbols OFF, ON and FULL with the EQU directive to have values 0, 1 and 2. List level 3 has no equivalent in ADE. - The load and execution addresses are set by the first ORG directive only. To set them to different values use the LOAD and EXEC directives. 75 G USING THE 65C02 ASSEMBLERH -GAppendix 4. DIFFERENCES FROM PREVIOUS RELEASES- H Version 1.60 of the 65C02 Assembler includes several new facilities and a number of corrections from the previous 1.52 release. The most important changes made are as follows: - A new directive, TABS, allows the layout of listing lines to be configured. A patch facility allows the default settings to be configured. - New directives SYSVDU1 and SYSVDU2 perform the same action as SYSVDU but only on pass 1 and pass 2 respectively. - Comment lines can be started with a "!" character; such lines within macro definitions are not stored in memory and can be used to annotate the macro itself. - Printer handling has been extensively rewritten to avoid problems when using Econet print servers. - Assembly listings can be directed to a file with the "-F" command-line option. - String slicing operations in the ASET and MSET directives now work exactly as documented. In version 1.52, the string start and slice size parameters were reversed, and the first byte of the string was numbered 0 and not 1. - A new MOS command, *CLI, allows the Assembler's CLI mode to be explicitly entered from any language. - A REP directive with no operand now fills the output line to its defined width. - System ATVs $PWIDTH and $PLENGTH allow the values set by the PAGE directive to be read. - System ATV $PRINTING allows the source to determine if an output listing is being sent to printer or file, or to the screen only. - A repeat count of zero in directives such as DB causes no bytes to be written to the object file, rather than repeating the operand 65536 times. - A zero operand in the DS directive causes a gap size of zero rather than 65536. - Patch facilities allow the Assembler's translation of source bytes in the range 128..255 to be configured. - Patch facilities force the Assembler to read a real-time clock on machines other than a Master 128. 76 G USING THE 65C02 ASSEMBLERH - Patch facilities enable the "~" character to be used in character constants and strings to plant the following character as a control character with bit 7 set. - Patch facilities allow the Form Feeds sent to a printer at the end of a listing to be suppressed. - Source file repositioning (in directives such as AGO, AIF) no longer causes random failures with files larger than 14kbytes on a second processor. - The DB directive now accepts negative operands in the range -1 to -128. 77 G USING THE 65C02 ASSEMBLERH -GAppendix 5. CUSTOMISING THE ASSEMBLER- H Version 1.60 of the Assembler contains a number of options that can be configured or activated by changes to the ROM image. Typically the facilities controlled in this way are highly specific to particular hardware or modes of working, rather than of general use. In order to configure the Assembler you will need to alter some bytes within it, using a machine code monitor such as Exmon or Beebmon. The things you need to do are simple and straightforward, but as with all such operations, you should make sure you have an unaltered copy of the Assembler stored safely on a disc before you begin. You -will- need to be careful that you alter the correct locations and put in the correct values: the Assembler will be unlikely to work correctly, and probably will not work at all, if you make a mistake. -A5.1 The patch area- In order to patch the Assembler, you will first need to locate the patch table. This is an area of memory that either contains the actual locations you alter, or contains the addresses of the locations in other parts of the ROM. The patch area is not held at a fixed absolute address, but will always follow the standard sideways ROM header. To find it, look first at byte $8007 in the ROM (in this section, all addresses are given from the base of $8000, which is the memory address the Assembler runs at. To get the offset within a file for the bytes concerned, simply subtract $8000 from all values). Add the value of byte $8007 to $8000, to obtain the address of the copyright string (in version 1.60 it reads "(C)1987 Alan Phillips"). At the end of the copyright string you will find a byte containing the value of zero; the patch area starts at the byte immediately following this one. Although the absolute position of the patch area is not fixed between releases, the format of it is, so that the following sections apply to 1.60 and any future releases. -A5.1.1 The default TAB position list- Bytes 0 and 1 of the patch table are the address of the default TAB table used by the Assembler when listing source lines. (Note that, as usual, the address is stored with the least significant byte first). The address in the patch table takes you to the area of the ROM where the default TAB positions are held. To change them, you should alter the first byte of the table to contain the number of TAB positions you wish to define (the number you use must be 78 G USING THE 65C02 ASSEMBLERH between 1 and 14). Following this you should place the TAB positions themselves; they must be in ascending numeric order. For example, to define 5 default TAB positions at columns 8, 17, 26, 32 and 40, you would change the bytes in the TAB table to be 05 08 11 1A 20 28 -A5.1.2 Source character translation- Byte 2 of the patch area controls how the Assembler treats characters in the source file with bit 7 set. Normally the value is zero, instructing the Assembler to ignore such bytes. Changing it to some other value makes the Assembler -replace- such bytes with the value you supply. Thus, for example, you could change the byte in the patch table to the value $20 (the code for a space character) to replace source characters with bit 7 set with a space). It is up to you to make sure that the value you use is sensible: you should set the byte either to a space or to a TAB character. -A5.1.3 Real time clock handling- Byte 3 of the patch area controls how the Assembler uses any real-time clock you may have fitted. By default the value is $FF, and the Assembler will attempt to read a real-time clock only on a Master 128. You may, though, have fitted a third-party clock to another model: setting the byte value to 0 will make the Assembler try to read the time on all models. Note, though, that your real-time clock must respond to -exactly- the same *FX calls as used on the Master 128: the Assembler has no means of knowing how to read the time from clocks that are operated in other ways. -A5.1.4 Character constant and string options- Byte 4 of the patch area controls how the "~" character is treated in character constants and strings. By default the value of the byte is zero, and the character has no special effect. Changing the value to $FF causes the "~" character to take on a special meaning: it will now cause the -following- character to be planted as a control character with bit 7 set. Naturally, you would need to write '~~' in a character constant to obtain the "~" character itself if you turn this option on. 79 G USING THE 65C02 ASSEMBLERH -A5.1.5 Page throws at the end of a listing- Byte 5 of the patch area controls whether the Assembler outputs Form Feed characters to a printer or listing file at the end of a listing. By default the value of the byte is $FF: this makes the Assembler output a Form Feed both before and after the lines of statistics that tell you the number of errors, etc. Changing the byte to 0 suppresses the Form Feeds, so the statistics immediately follow the symbol table listing, with no throw to head-of-form following them. 80
00000000 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 20 |...G | 00000010 20 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 20 | USING | 00000020 54 48 45 20 36 35 43 30 32 20 41 53 53 45 4d 42 |THE 65C02 ASSEMB| 00000030 4c 45 52 1b 48 0d 0d 0d 0d 1b 2d 01 1b 47 38 2e |LER.H.....-..G8.| 00000040 20 50 52 4f 47 52 45 53 53 20 52 45 50 4f 52 54 | PROGRESS REPORT| 00000050 49 4e 47 1b 2d 00 1b 48 0d 0d 0d 20 20 20 54 68 |ING.-..H... Th| 00000060 65 20 20 41 73 73 65 6d 62 6c 65 72 20 73 75 70 |e Assembler sup| 00000070 70 6f 72 74 73 20 73 65 76 65 72 61 6c 20 64 69 |ports several di| 00000080 72 65 63 74 69 76 65 73 20 74 68 61 74 20 61 6c |rectives that al| 00000090 6c 6f 77 20 79 6f 75 20 74 6f 20 6f 75 74 70 75 |low you to outpu| 000000a0 74 0d 70 72 6f 67 72 65 73 73 20 72 65 70 6f 72 |t.progress repor| 000000b0 74 73 20 74 6f 20 74 68 65 20 73 63 72 65 65 6e |ts to the screen| 000000c0 2c 20 61 6e 64 20 74 6f 20 61 20 70 72 69 6e 74 |, and to a print| 000000d0 65 72 20 6f 72 20 61 20 6c 69 73 74 69 6e 67 20 |er or a listing | 000000e0 66 69 6c 65 2c 20 74 6f 0d 73 68 6f 77 20 74 68 |file, to.show th| 000000f0 65 20 63 6f 75 72 73 65 20 6f 66 20 61 6e 20 61 |e course of an a| 00000100 73 73 65 6d 62 6c 79 2e 0d 0d 0d 1b 2d 01 38 2e |ssembly.....-.8.| 00000110 31 20 54 68 65 20 44 49 53 50 2c 20 44 49 53 50 |1 The DISP, DISP| 00000120 31 20 61 6e 64 20 44 49 53 50 32 20 64 69 72 65 |1 and DISP2 dire| 00000130 63 74 69 76 65 73 1b 2d 00 0d 0d 20 20 20 54 68 |ctives.-... Th| 00000140 65 73 65 20 61 6c 6c 20 64 69 73 70 6c 61 79 20 |ese all display | 00000150 61 20 6d 65 73 73 61 67 65 20 6f 6e 20 74 68 65 |a message on the| 00000160 20 73 63 72 65 65 6e 2c 20 20 61 6e 64 20 61 6c | screen, and al| 00000170 73 6f 20 73 65 6e 64 20 69 74 20 20 74 6f 20 20 |so send it to | 00000180 61 0d 70 72 69 6e 74 65 72 20 6f 72 20 74 6f 20 |a.printer or to | 00000190 61 20 6c 69 73 74 69 6e 67 20 66 69 6c 65 2e 20 |a listing file. | 000001a0 20 20 44 49 53 50 20 64 69 73 70 6c 61 79 73 20 | DISP displays | 000001b0 74 68 65 20 74 65 78 74 20 6f 6e 20 62 6f 74 68 |the text on both| 000001c0 20 70 61 73 73 65 73 3b 0d 44 49 53 50 31 20 20 | passes;.DISP1 | 000001d0 61 6e 64 20 20 44 49 53 50 32 20 20 64 69 73 70 |and DISP2 disp| 000001e0 6c 61 79 20 20 74 68 65 20 20 74 65 78 74 20 20 |lay the text | 000001f0 6f 6e 20 70 61 73 73 20 31 20 6f 6e 6c 79 20 61 |on pass 1 only a| 00000200 6e 64 20 70 61 73 73 20 32 20 6f 6e 6c 79 2c 0d |nd pass 2 only,.| 00000210 72 65 73 70 65 63 74 69 76 65 6c 79 2e 20 20 59 |respectively. Y| 00000220 6f 75 20 63 61 6e 20 75 73 65 20 49 4e 46 4f 20 |ou can use INFO | 00000230 61 73 20 61 20 73 79 6e 6f 6e 79 6d 20 6f 66 20 |as a synonym of | 00000240 44 49 53 50 32 20 69 73 20 79 6f 75 20 77 69 73 |DISP2 is you wis| 00000250 68 2e 0d 0d 20 20 20 54 68 65 20 75 73 65 20 6f |h... The use o| 00000260 66 20 74 68 65 20 64 69 72 65 63 74 69 76 65 73 |f the directives| 00000270 20 69 73 20 74 68 65 20 73 61 6d 65 3a 20 66 6f | is the same: fo| 00000280 72 20 65 78 61 6d 70 6c 65 2c 20 79 6f 75 20 6d |r example, you m| 00000290 69 67 68 74 20 77 72 69 74 65 0d 0d 0d 20 20 20 |ight write... | 000002a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000002b0 20 44 49 53 50 20 20 27 41 73 73 65 6d 62 6c 69 | DISP 'Assembli| 000002c0 6e 67 20 64 65 62 75 67 20 63 6f 64 65 27 0d 0d |ng debug code'..| 000002d0 0d 74 6f 20 64 69 73 70 6c 61 79 0d 0d 0d 20 20 |.to display... | 000002e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000002f0 20 20 20 20 2d 2d 2d 2d 20 41 73 73 65 6d 62 6c | ---- Assembl| 00000300 69 6e 67 20 64 65 62 75 67 20 63 6f 64 65 0d 0d |ing debug code..| 00000310 0d 6f 6e 20 74 68 65 20 73 63 72 65 65 6e 2e 0d |.on the screen..| 00000320 0d 0d 20 20 20 54 68 65 20 6d 65 73 73 61 67 65 |.. The message| 00000330 20 79 6f 75 20 64 69 73 70 6c 61 79 20 63 61 6e | you display can| 00000340 20 63 6f 6e 74 61 69 6e 20 70 72 69 6e 74 61 62 | contain printab| 00000350 6c 65 20 20 74 65 78 74 2c 20 20 61 6e 64 20 20 |le text, and | 00000360 79 6f 75 20 20 63 61 6e 0d 61 6c 73 6f 20 69 6e |you can.also in| 00000370 63 6c 75 64 65 20 73 6f 6d 65 20 63 6f 6e 74 72 |clude some contr| 00000380 6f 6c 20 63 68 61 72 61 63 74 65 72 73 2e 20 59 |ol characters. Y| 00000390 6f 75 20 73 70 65 63 69 66 79 20 74 68 65 6d 20 |ou specify them | 000003a0 69 6e 20 74 68 65 20 73 61 6d 65 20 77 61 79 0d |in the same way.| 000003b0 61 73 20 20 79 6f 75 20 20 77 6f 75 6c 64 20 20 |as you would | 000003c0 69 6e 20 20 61 6e 79 20 20 6f 74 68 65 72 20 20 |in any other | 000003d0 73 74 72 69 6e 67 2c 20 20 62 79 20 20 70 72 65 |string, by pre| 000003e0 63 65 64 69 6e 67 20 74 68 65 6d 20 77 69 74 68 |ceding them with| 000003f0 20 61 20 22 7c 22 0d 63 68 61 72 61 63 74 65 72 | a "|".character| 00000400 2e 20 20 54 68 65 20 63 6f 6e 74 72 6f 6c 20 63 |. The control c| 00000410 68 61 72 61 63 74 65 72 73 20 79 6f 75 20 63 61 |haracters you ca| 00000420 6e 20 75 73 65 20 61 72 65 3a 0d 0d 0d 20 20 20 |n use are:... | 00000430 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000440 20 7c 4d 20 61 6e 64 20 7c 4a 20 20 2d 20 73 74 | |M and |J - st| 00000450 61 72 74 20 61 20 6e 65 77 20 6c 69 6e 65 0d 20 |art a new line. | 00000460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000470 20 20 20 7c 47 20 20 20 20 20 20 20 20 20 2d 20 | |G - | 00000480 6d 61 6b 65 20 61 20 62 65 65 70 20 73 6f 75 6e |make a beep soun| 00000490 64 0d 0d 20 20 20 46 6f 72 20 65 78 61 6d 70 6c |d.. For exampl| 000004a0 65 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |e.. | 000004b0 20 20 20 20 20 20 20 20 20 44 49 53 50 20 20 20 | DISP | 000004c0 27 4c 69 6e 65 20 31 7c 4d 4c 69 6e 65 20 32 7c |'Line 1|MLine 2|| 000004d0 47 27 0d 0d 64 69 73 70 6c 61 79 73 20 61 20 32 |G'..displays a 2| 000004e0 20 6c 69 6e 65 20 6d 65 73 73 61 67 65 20 61 6e | line message an| 000004f0 64 20 72 69 6e 67 73 20 74 68 65 20 62 65 6c 6c |d rings the bell| 00000500 2e 0d 0d 20 20 20 41 64 64 69 74 69 6f 6e 61 6c |... Additional| 00000510 6c 79 2c 20 20 74 68 65 20 74 65 78 74 20 63 61 |ly, the text ca| 00000520 6e 20 63 6f 6e 74 61 69 6e 20 6e 75 6d 65 72 69 |n contain numeri| 00000530 63 20 20 65 78 70 72 65 73 73 69 6f 6e 73 20 20 |c expressions | 00000540 74 68 61 74 20 20 61 72 65 0d 65 76 61 6c 75 61 |that are.evalua| 00000550 74 65 64 20 20 61 73 20 20 74 68 65 20 6d 65 73 |ted as the mes| 00000560 73 61 67 65 20 69 73 20 6f 75 74 70 75 74 2e 20 |sage is output. | 00000570 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 68 | For example, th| 00000580 69 73 20 77 6f 75 6c 64 20 6c 65 74 20 79 6f 75 |is would let you| 00000590 0d 6f 75 74 70 75 74 20 61 20 6d 65 73 73 61 67 |.output a messag| 000005a0 65 20 74 6f 20 72 65 70 6f 72 74 20 74 68 65 20 |e to report the | 000005b0 73 69 7a 65 20 6f 66 20 61 20 73 65 63 74 69 6f |size of a sectio| 000005c0 6e 20 6f 66 20 63 6f 64 65 2e 0d 0d 20 20 20 57 |n of code... W| 000005d0 69 74 68 69 6e 20 74 68 65 20 74 65 78 74 2c 20 |ithin the text, | 000005e0 79 6f 75 20 63 61 6e 20 73 70 65 63 69 66 79 20 |you can specify | 000005f0 61 6e 20 65 78 70 72 65 73 73 69 6f 6e 20 69 6e |an expression in| 00000600 20 6f 6e 65 20 6f 66 20 74 77 6f 20 77 61 79 73 | one of two ways| 00000610 2e 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 00000620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000630 20 25 44 28 3c 65 78 70 72 3e 29 0d 0d 77 69 6c | %D(<expr>)..wil| 00000640 6c 20 65 76 61 6c 75 61 74 65 20 3c 65 78 70 72 |l evaluate <expr| 00000650 3e 20 61 6e 64 20 64 69 73 70 6c 61 79 20 74 68 |> and display th| 00000660 65 20 72 65 73 75 6c 74 20 69 6e 20 64 65 63 69 |e result in deci| 00000670 6d 61 6c 2c 20 61 6e 64 0d 0d 0d 20 20 20 20 20 |mal, and... | 00000680 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000690 20 20 20 20 20 20 20 20 20 20 20 20 33 36 0d 0d | 36..| 000006a0 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 |.....G | 000006b0 20 20 20 20 20 20 20 20 20 20 20 20 55 53 49 4e | USIN| 000006c0 47 20 54 48 45 20 36 35 43 30 32 20 41 53 53 45 |G THE 65C02 ASSE| 000006d0 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 0d 20 20 20 20 |MBLER.H..... | 000006e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000006f0 20 20 20 20 20 20 20 20 20 20 25 58 28 3c 65 78 | %X(<ex| 00000700 70 72 3e 29 0d 0d 77 69 6c 6c 20 64 69 73 70 6c |pr>)..will displ| 00000710 61 79 20 69 74 20 69 6e 20 68 65 78 61 64 65 63 |ay it in hexadec| 00000720 69 6d 61 6c 2e 0d 0d 20 20 20 59 6f 75 20 20 63 |imal... You c| 00000730 61 6e 20 20 77 72 69 74 65 20 20 61 6e 79 20 20 |an write any | 00000740 6e 75 6d 65 72 69 63 20 20 65 78 70 72 65 73 73 |numeric express| 00000750 69 6f 6e 20 20 79 6f 75 20 20 77 69 73 68 20 20 |ion you wish | 00000760 20 77 69 74 68 69 6e 20 20 20 74 68 65 0d 70 61 | within the.pa| 00000770 72 65 6e 74 68 65 73 65 73 2c 20 62 75 74 20 69 |rentheses, but i| 00000780 74 20 6d 75 73 74 20 6e 6f 74 20 63 6f 6e 74 61 |t must not conta| 00000790 69 6e 20 66 6f 72 77 61 72 64 20 72 65 66 65 72 |in forward refer| 000007a0 65 6e 63 65 73 2e 0d 0d 20 20 20 46 6f 72 20 65 |ences... For e| 000007b0 78 61 6d 70 6c 65 2c 20 74 6f 20 72 65 70 6f 72 |xample, to repor| 000007c0 74 20 74 68 65 20 73 69 7a 65 20 6f 66 20 61 20 |t the size of a | 000007d0 73 65 63 74 69 6f 6e 20 6f 66 20 63 6f 64 65 20 |section of code | 000007e0 62 65 74 77 65 65 6e 20 6c 61 62 65 6c 73 0d 53 |between labels.S| 000007f0 54 41 52 54 2e 43 4f 44 45 20 61 6e 64 20 45 4e |TART.CODE and EN| 00000800 44 2e 43 4f 44 45 2c 20 75 73 65 3a 0d 0d 0d 20 |D.CODE, use:... | 00000810 20 20 20 20 20 20 20 44 49 53 50 32 20 20 27 53 | DISP2 'S| 00000820 69 7a 65 20 6f 66 20 63 6f 64 65 20 69 73 20 25 |ize of code is %| 00000830 58 28 45 4e 44 2e 43 4f 44 45 2d 53 54 41 52 54 |X(END.CODE-START| 00000840 2e 43 4f 44 45 29 20 62 79 74 65 73 27 0d 0d 0d |.CODE) bytes'...| 00000850 0d 1b 2d 01 38 2e 32 20 54 68 65 20 57 41 49 54 |..-.8.2 The WAIT| 00000860 2c 20 57 41 49 54 31 20 61 6e 64 20 57 41 49 54 |, WAIT1 and WAIT| 00000870 32 20 64 69 72 65 63 74 69 76 65 73 1b 2d 00 0d |2 directives.-..| 00000880 0d 0d 20 20 20 54 68 65 73 65 20 6f 75 74 70 75 |.. These outpu| 00000890 74 20 6d 65 73 73 61 67 65 73 20 69 6e 20 74 68 |t messages in th| 000008a0 65 20 73 61 6d 65 20 77 61 79 20 61 73 20 44 49 |e same way as DI| 000008b0 53 50 2c 20 44 49 53 50 31 20 61 6e 64 20 44 49 |SP, DISP1 and DI| 000008c0 53 50 32 2c 20 62 75 74 0d 74 68 65 6e 20 73 75 |SP2, but.then su| 000008d0 73 70 65 6e 64 20 74 68 65 20 61 73 73 65 6d 62 |spend the assemb| 000008e0 6c 79 20 75 6e 74 69 6c 20 79 6f 75 20 70 72 65 |ly until you pre| 000008f0 73 73 20 61 20 6b 65 79 20 6f 6e 20 74 68 65 20 |ss a key on the | 00000900 6b 65 79 62 6f 61 72 64 2e 0d 0d 20 20 20 59 6f |keyboard... Yo| 00000910 75 20 20 63 6f 75 6c 64 20 74 68 75 73 20 75 73 |u could thus us| 00000920 65 20 74 68 65 73 65 20 64 69 72 65 63 74 69 76 |e these directiv| 00000930 65 73 20 74 6f 20 65 6e 61 62 6c 65 20 79 6f 75 |es to enable you| 00000940 20 74 6f 20 63 68 61 6e 67 65 20 73 6f 75 72 63 | to change sourc| 00000950 65 0d 64 69 73 63 73 20 64 75 72 69 6e 67 20 61 |e.discs during a| 00000960 6e 20 61 73 73 65 6d 62 6c 79 2e 0d 0d 0d 1b 2d |n assembly.....-| 00000970 01 38 2e 33 20 54 68 65 20 51 55 45 52 59 20 64 |.8.3 The QUERY d| 00000980 69 72 65 63 74 69 76 65 1b 2d 00 0d 0d 0d 20 20 |irective.-.... | 00000990 20 54 68 69 73 20 20 6f 66 66 65 72 73 20 20 61 | This offers a| 000009a0 20 20 63 6f 6e 76 65 6e 69 65 6e 74 20 20 77 61 | convenient wa| 000009b0 79 20 20 6f 66 20 20 73 65 74 74 69 6e 67 20 20 |y of setting | 000009c0 75 70 20 20 63 6f 6e 64 69 74 69 6f 6e 73 20 20 |up conditions | 000009d0 20 66 6f 72 0d 63 6f 6e 64 69 74 69 6f 6e 61 6c | for.conditional| 000009e0 20 61 73 73 65 6d 62 6c 79 2e 0d 0d 20 20 20 51 | assembly... Q| 000009f0 55 45 52 59 20 20 6f 70 65 72 61 74 65 73 20 20 |UERY operates | 00000a00 6f 6e 6c 79 20 20 6f 6e 20 20 70 61 73 73 20 31 |only on pass 1| 00000a10 20 20 6f 66 20 20 74 68 65 20 61 73 73 65 6d 62 | of the assemb| 00000a20 6c 79 2e 20 20 49 74 20 64 69 73 70 6c 61 79 73 |ly. It displays| 00000a30 20 61 0d 6d 65 73 73 61 67 65 20 6f 6e 20 74 68 | a.message on th| 00000a40 65 20 73 63 72 65 65 6e 20 69 6e 20 74 68 65 20 |e screen in the | 00000a50 73 61 6d 65 20 77 61 79 20 61 73 20 74 68 65 20 |same way as the | 00000a60 20 64 69 72 65 63 74 69 76 65 73 20 20 61 62 6f | directives abo| 00000a70 76 65 2c 20 20 74 68 65 6e 0d 77 61 69 74 73 20 |ve, then.waits | 00000a80 20 66 6f 72 20 20 79 6f 75 20 20 74 6f 20 20 74 | for you to t| 00000a90 79 70 65 20 69 6e 20 61 20 6c 69 6e 65 2e 20 20 |ype in a line. | 00000aa0 54 68 65 20 6c 69 6e 65 20 69 73 20 74 72 65 61 |The line is trea| 00000ab0 74 65 64 20 61 73 20 61 20 6e 75 6d 65 72 69 63 |ted as a numeric| 00000ac0 0d 65 78 70 72 65 73 73 69 6f 6e 20 61 6e 64 20 |.expression and | 00000ad0 65 76 61 6c 75 61 74 65 64 2c 20 20 74 68 65 20 |evaluated, the | 00000ae0 72 65 73 75 6c 74 20 62 65 69 6e 67 20 73 65 74 |result being set| 00000af0 20 61 73 20 74 68 65 20 20 76 61 6c 75 65 20 20 | as the value | 00000b00 6f 66 20 20 74 68 65 0d 73 79 6d 62 6f 6c 20 20 |of the.symbol | 00000b10 73 70 65 63 69 66 69 65 64 20 20 69 6e 20 20 74 |specified in t| 00000b20 68 65 20 20 6c 69 6e 65 27 73 20 20 6c 61 62 65 |he line's labe| 00000b30 6c 20 66 69 65 6c 64 2e 20 20 49 66 20 74 68 65 |l field. If the| 00000b40 20 65 78 70 72 65 73 73 69 6f 6e 20 69 73 0d 69 | expression is.i| 00000b50 6e 76 61 6c 69 64 2c 20 20 6f 72 20 63 6f 6e 74 |nvalid, or cont| 00000b60 61 69 6e 73 20 20 61 20 20 66 6f 72 77 61 72 64 |ains a forward| 00000b70 20 20 72 65 66 65 72 65 6e 63 65 2c 20 20 74 68 | reference, th| 00000b80 65 20 20 71 75 65 73 74 69 6f 6e 20 20 77 69 6c |e question wil| 00000b90 6c 20 20 62 65 0d 72 65 70 65 61 74 65 64 2e 0d |l be.repeated..| 00000ba0 0d 20 20 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c |. For example,| 00000bb0 20 73 75 70 70 6f 73 65 20 74 68 61 74 20 79 6f | suppose that yo| 00000bc0 75 72 20 73 6f 75 72 63 65 20 63 6f 6e 74 61 69 |ur source contai| 00000bd0 6e 73 20 6f 70 74 69 6f 6e 61 6c 20 64 65 62 75 |ns optional debu| 00000be0 67 20 63 6f 64 65 2c 0d 61 6e 64 20 79 6f 75 20 |g code,.and you | 00000bf0 73 65 6c 65 63 74 20 74 68 69 73 20 77 69 74 68 |select this with| 00000c00 20 49 46 20 63 6f 6e 64 69 74 69 6f 6e 73 20 6f | IF conditions o| 00000c10 66 20 74 68 65 20 66 6f 72 6d 0d 0d 20 20 20 20 |f the form.. | 00000c20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000c30 49 46 20 20 20 20 44 45 42 55 47 2e 4d 4f 44 45 |IF DEBUG.MODE| 00000c40 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00000c50 20 20 20 20 20 20 20 20 2e 0d 20 20 20 20 20 20 | .. | 00000c60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000c70 20 64 65 62 75 67 20 63 6f 64 65 0d 20 20 20 20 | debug code. | 00000c80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000c90 20 20 20 2e 0d 20 20 20 20 20 20 20 20 20 20 20 | .. | 00000ca0 20 20 20 20 20 20 20 20 20 46 49 0d 0d 0d 20 20 | FI... | 00000cb0 20 54 68 65 20 20 76 61 6c 75 65 20 6f 66 20 44 | The value of D| 00000cc0 45 42 55 47 2e 4d 4f 44 45 20 77 6f 75 6c 64 20 |EBUG.MODE would | 00000cd0 6e 6f 72 6d 61 6c 6c 79 20 62 65 20 2d 31 20 74 |normally be -1 t| 00000ce0 6f 20 73 65 6c 65 63 74 20 64 65 62 75 67 20 63 |o select debug c| 00000cf0 6f 64 65 2c 0d 6f 72 20 30 20 69 66 20 69 74 20 |ode,.or 0 if it | 00000d00 77 65 72 65 20 6e 6f 74 20 6e 65 65 64 65 64 2e |were not needed.| 00000d10 0d 0d 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |..... | 00000d20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000d30 20 20 20 20 20 20 33 37 0d 0d 0d 0d 0d 0d 1b 47 | 37.......G| 00000d40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000d50 20 20 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 | USING THE | 00000d60 36 35 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b |65C02 ASSEMBLER.| 00000d70 48 0d 0d 0d 0d 20 20 20 52 61 74 68 65 72 20 74 |H.... Rather t| 00000d80 68 61 6e 20 64 65 66 69 6e 65 20 44 45 42 55 47 |han define DEBUG| 00000d90 2e 4d 4f 44 45 20 69 6e 20 74 68 65 20 73 6f 75 |.MODE in the sou| 00000da0 72 63 65 2c 20 20 61 6e 64 20 74 68 75 73 20 68 |rce, and thus h| 00000db0 61 76 65 20 74 6f 20 65 64 69 74 0d 74 68 65 20 |ave to edit.the | 00000dc0 73 6f 75 72 63 65 20 65 76 65 72 79 20 74 69 6d |source every tim| 00000dd0 65 20 79 6f 75 20 77 69 73 68 65 64 20 20 74 6f |e you wished to| 00000de0 20 20 63 68 61 6e 67 65 20 20 69 74 2c 20 20 79 | change it, y| 00000df0 6f 75 20 20 63 61 6e 20 20 6d 61 6b 65 20 20 74 |ou can make t| 00000e00 68 65 0d 41 73 73 65 6d 62 6c 65 72 20 20 61 73 |he.Assembler as| 00000e10 6b 20 66 6f 72 20 74 68 65 20 76 61 6c 75 65 20 |k for the value | 00000e20 61 74 20 74 68 65 20 73 74 61 72 74 20 6f 66 20 |at the start of | 00000e30 61 6e 20 61 73 73 65 6d 62 6c 79 2e 20 20 41 20 |an assembly. A | 00000e40 6c 69 6e 65 20 73 75 63 68 0d 61 73 3a 0d 0d 20 |line such.as:.. | 00000e50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000e60 44 45 42 55 47 2e 4d 4f 44 45 20 20 51 55 45 52 |DEBUG.MODE QUER| 00000e70 59 20 20 27 55 73 65 20 64 65 62 75 67 20 6d 6f |Y 'Use debug mo| 00000e80 64 65 27 0d 0d 77 69 6c 6c 20 6f 75 74 70 75 74 |de'..will output| 00000e90 20 74 68 65 20 71 75 65 73 74 69 6f 6e 0d 0d 20 | the question.. | 00000ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000eb0 20 20 20 20 20 20 20 20 2d 2d 2d 2d 20 55 73 65 | ---- Use| 00000ec0 20 64 65 62 75 67 20 6d 6f 64 65 3f 0d 0d 6f 6e | debug mode?..on| 00000ed0 20 70 61 73 73 20 31 2e 20 20 59 6f 75 20 63 61 | pass 1. You ca| 00000ee0 6e 20 6e 6f 77 20 74 79 70 65 20 69 6e 0d 0d 20 |n now type in.. | 00000ef0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000f10 20 2d 31 0d 0d 74 6f 20 73 65 6c 65 63 74 20 64 | -1..to select d| 00000f20 65 62 75 67 20 63 6f 64 65 2c 20 6f 72 0d 0d 20 |ebug code, or.. | 00000f30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000f50 20 30 0d 0d 74 6f 20 73 75 70 70 72 65 73 73 20 | 0..to suppress | 00000f60 69 74 2e 0d 0d 0d 20 20 20 53 69 6e 63 65 20 74 |it.... Since t| 00000f70 68 65 20 6c 69 6e 65 20 79 6f 75 20 74 79 70 65 |he line you type| 00000f80 20 69 73 20 61 6e 20 65 78 70 72 65 73 73 69 6f | is an expressio| 00000f90 6e 2c 20 20 61 6e 64 20 63 61 6e 20 63 6f 6e 74 |n, and can cont| 00000fa0 61 69 6e 20 73 79 6d 62 6f 6c 73 2c 0d 79 6f 75 |ain symbols,.you| 00000fb0 20 63 61 6e 20 6d 61 6b 65 20 74 68 69 73 20 6d | can make this m| 00000fc0 6f 72 65 20 66 72 69 65 6e 64 6c 79 20 62 79 20 |ore friendly by | 00000fd0 63 68 61 6e 67 69 6e 67 20 74 68 65 20 73 6f 75 |changing the sou| 00000fe0 72 63 65 20 74 6f 20 69 6e 63 6c 75 64 65 0d 0d |rce to include..| 00000ff0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001000 20 20 20 20 59 45 53 20 20 20 45 51 55 20 20 20 | YES EQU | 00001010 2d 31 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |-1. | 00001020 20 20 20 20 20 20 20 4e 4f 20 20 20 20 45 51 55 | NO EQU| 00001030 20 20 20 30 0d 0d 62 65 66 6f 72 65 20 74 68 65 | 0..before the| 00001040 20 51 55 45 52 59 20 64 69 72 65 63 74 69 76 65 | QUERY directive| 00001050 2e 20 20 4e 6f 77 20 79 6f 75 20 63 61 6e 20 72 |. Now you can r| 00001060 65 70 6c 79 20 65 69 74 68 65 72 20 22 59 45 53 |eply either "YES| 00001070 22 20 6f 72 20 22 4e 4f 22 20 74 6f 0d 74 68 65 |" or "NO" to.the| 00001080 20 71 75 65 73 74 69 6f 6e 3a 20 20 74 68 65 20 | question: the | 00001090 41 73 73 65 6d 62 6c 65 72 20 77 69 6c 6c 20 65 |Assembler will e| 000010a0 76 61 6c 75 61 74 65 20 74 68 65 20 6c 69 6e 65 |valuate the line| 000010b0 20 61 6e 64 20 74 61 6b 65 20 74 68 65 20 76 61 | and take the va| 000010c0 6c 75 65 0d 6f 66 20 74 68 65 20 73 79 6d 62 6f |lue.of the symbo| 000010d0 6c 20 79 6f 75 20 74 79 70 65 2e 0d 0d 0d 0d 1b |l you type......| 000010e0 2d 01 38 2e 34 20 54 68 65 20 53 54 4f 50 20 64 |-.8.4 The STOP d| 000010f0 69 72 65 63 74 69 76 65 1b 2d 00 0d 0d 0d 20 20 |irective.-.... | 00001100 20 53 54 4f 50 20 20 70 72 6f 76 69 64 65 73 20 | STOP provides | 00001110 61 20 75 73 65 66 75 6c 20 77 61 79 20 20 6f 66 |a useful way of| 00001120 20 20 61 62 61 6e 64 6f 6e 69 6e 67 20 20 61 6e | abandoning an| 00001130 20 20 61 73 73 65 6d 62 6c 79 20 20 70 61 72 74 | assembly part| 00001140 2d 77 61 79 0d 74 68 72 6f 75 67 68 2e 20 20 49 |-way.through. I| 00001150 74 20 20 6f 70 65 72 61 74 65 73 20 6f 6e 20 70 |t operates on p| 00001160 61 73 73 20 31 2c 20 20 61 6e 64 20 6c 69 6b 65 |ass 1, and like| 00001170 20 44 49 53 50 31 2c 20 20 69 74 20 64 69 73 70 | DISP1, it disp| 00001180 6c 61 79 73 20 61 20 74 65 78 74 0d 6d 65 73 73 |lays a text.mess| 00001190 61 67 65 2e 20 20 41 66 74 65 72 77 61 72 64 73 |age. Afterwards| 000011a0 2c 20 74 68 6f 75 67 68 2c 20 69 74 20 61 62 6f |, though, it abo| 000011b0 72 74 73 20 74 68 65 20 61 73 73 65 6d 62 6c 79 |rts the assembly| 000011c0 20 20 77 69 74 68 20 20 74 68 65 20 20 65 72 72 | with the err| 000011d0 6f 72 0d 6d 65 73 73 61 67 65 20 22 53 74 6f 70 |or.message "Stop| 000011e0 70 65 64 22 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |ped"............| 000011f0 0d 0d 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |..... | 00001200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001210 20 20 20 20 20 20 33 38 0d 0d 0d 0d 0d 0d 1b 47 | 38.......G| 00001220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001230 20 20 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 | USING THE | 00001240 36 35 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b |65C02 ASSEMBLER.| 00001250 48 0d 0d 0d 0d 1b 2d 01 1b 47 39 2e 20 57 52 49 |H.....-..G9. WRI| 00001260 54 49 4e 47 20 53 49 4d 50 4c 45 20 4d 41 43 52 |TING SIMPLE MACR| 00001270 4f 53 1b 2d 00 1b 48 0d 0d 0d 20 20 20 54 68 65 |OS.-..H... The| 00001280 20 20 41 73 73 65 6d 62 6c 65 72 20 63 6f 6e 74 | Assembler cont| 00001290 61 69 6e 73 20 61 20 70 6f 77 65 72 66 75 6c 20 |ains a powerful | 000012a0 6d 61 63 72 6f 20 66 61 63 69 6c 69 74 79 2c 20 |macro facility, | 000012b0 20 61 6c 6c 6f 77 69 6e 67 20 79 6f 75 20 74 6f | allowing you to| 000012c0 0d 77 72 69 74 65 20 76 65 72 79 20 63 6f 6d 70 |.write very comp| 000012d0 6c 65 78 20 61 6e 64 20 73 6f 70 68 69 73 74 69 |lex and sophisti| 000012e0 63 61 74 65 64 20 6d 61 63 72 6f 73 2e 20 49 6e |cated macros. In| 000012f0 20 74 68 69 73 20 63 68 61 70 74 65 72 2c 20 77 | this chapter, w| 00001300 65 20 73 68 61 6c 6c 0d 65 78 61 6d 69 6e 65 20 |e shall.examine | 00001310 74 68 65 20 73 69 6d 70 6c 65 72 20 61 73 70 65 |the simpler aspe| 00001320 63 74 73 20 6f 66 20 6d 61 63 72 6f 73 2e 0d 0d |cts of macros...| 00001330 20 20 20 41 20 6d 61 63 72 6f 20 69 73 20 61 20 | A macro is a | 00001340 77 61 79 20 6f 66 20 70 72 6f 64 75 63 69 6e 67 |way of producing| 00001350 20 61 20 6e 75 6d 62 65 72 20 6f 66 20 20 41 73 | a number of As| 00001360 73 65 6d 62 6c 65 72 20 20 73 6f 75 72 63 65 20 |sembler source | 00001370 20 6c 69 6e 65 73 0d 6d 65 72 65 6c 79 20 20 62 | lines.merely b| 00001380 79 20 20 73 70 65 63 69 66 79 69 6e 67 20 20 69 |y specifying i| 00001390 74 73 20 20 6e 61 6d 65 20 20 69 6e 20 74 68 65 |ts name in the| 000013a0 20 6f 70 63 6f 64 65 20 66 69 65 6c 64 20 6f 66 | opcode field of| 000013b0 20 61 20 6c 69 6e 65 2e 20 20 46 6f 72 0d 65 78 | a line. For.ex| 000013c0 61 6d 70 6c 65 2c 20 79 6f 75 72 20 73 6f 75 72 |ample, your sour| 000013d0 63 65 20 6d 69 67 68 74 20 63 6f 6e 74 61 69 6e |ce might contain| 000013e0 20 6d 61 6e 79 20 6f 63 63 75 72 72 65 6e 63 65 | many occurrence| 000013f0 73 20 6f 66 20 74 68 65 20 6c 69 6e 65 73 3a 0d |s of the lines:.| 00001400 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00001410 20 20 20 20 20 20 20 20 4c 44 41 20 20 20 56 41 | LDA VA| 00001420 52 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |R. | 00001430 20 20 20 20 20 20 20 20 20 43 4c 43 0d 20 20 20 | CLC. | 00001440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001450 20 20 20 20 41 44 43 20 20 20 23 32 0d 20 20 20 | ADC #2. | 00001460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001470 20 20 20 20 53 54 41 20 20 20 56 41 52 0d 0d 20 | STA VAR.. | 00001480 20 20 59 6f 75 20 63 6f 75 6c 64 20 73 68 6f 72 | You could shor| 00001490 74 65 6e 20 74 68 65 20 73 6f 75 72 63 65 2c 20 |ten the source, | 000014a0 20 61 6e 64 20 6d 61 6b 65 20 69 74 20 20 65 61 | and make it ea| 000014b0 73 69 65 72 20 20 74 6f 20 20 66 6f 6c 6c 6f 77 |sier to follow| 000014c0 2c 20 20 62 79 0d 72 65 70 6c 61 63 69 6e 67 20 |, by.replacing | 000014d0 20 65 61 63 68 20 20 6f 63 63 75 72 72 65 6e 63 | each occurrenc| 000014e0 65 20 20 77 69 74 68 20 20 61 20 20 6d 61 63 72 |e with a macr| 000014f0 6f 20 20 63 61 6c 6c 3a 20 20 79 6f 75 20 6d 69 |o call: you mi| 00001500 67 68 74 20 73 65 74 20 75 70 20 61 0d 73 75 69 |ght set up a.sui| 00001510 74 61 62 6c 65 20 6d 61 63 72 6f 20 77 69 74 68 |table macro with| 00001520 20 74 68 65 20 73 74 61 74 65 6d 65 6e 74 73 0d | the statements.| 00001530 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00001540 41 44 44 54 57 4f 20 20 4d 41 43 52 4f 0d 20 20 |ADDTWO MACRO. | 00001550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001560 20 20 20 20 20 4c 44 41 20 20 20 56 41 52 0d 20 | LDA VAR. | 00001570 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001580 20 20 20 20 20 20 43 4c 43 0d 20 20 20 20 20 20 | CLC. | 00001590 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000015a0 20 41 44 43 20 20 20 23 32 0d 20 20 20 20 20 20 | ADC #2. | 000015b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000015c0 20 53 54 41 20 20 20 56 41 52 0d 20 20 20 20 20 | STA VAR. | 000015d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000015e0 20 20 45 4e 44 4d 0d 0d 0d 20 20 20 54 68 65 6e | ENDM... Then| 000015f0 2c 20 20 69 6e 73 74 65 61 64 20 6f 66 20 77 72 |, instead of wr| 00001600 69 74 69 6e 67 20 74 68 65 20 66 6f 75 72 20 6c |iting the four l| 00001610 69 6e 65 73 20 6f 66 20 63 6f 64 65 2c 20 20 73 |ines of code, s| 00001620 69 6d 70 6c 79 20 77 72 69 74 65 20 6f 6e 65 0d |imply write one.| 00001630 6c 69 6e 65 0d 0d 20 20 20 20 20 20 20 20 20 20 |line.. | 00001640 20 20 20 20 20 20 20 20 20 20 20 20 20 41 44 44 | ADD| 00001650 54 57 4f 0d 0d 20 20 20 54 68 65 20 20 41 73 73 |TWO.. The Ass| 00001660 65 6d 62 6c 65 72 20 20 77 69 6c 6c 20 20 65 78 |embler will ex| 00001670 70 61 6e 64 20 20 74 68 65 20 20 6d 61 63 72 6f |pand the macro| 00001680 20 20 20 64 65 66 69 6e 69 74 69 6f 6e 2c 20 20 | definition, | 00001690 20 61 6e 64 20 20 20 77 69 6c 6c 0d 61 75 74 6f | and will.auto| 000016a0 6d 61 74 69 63 61 6c 6c 79 20 67 65 6e 65 72 61 |matically genera| 000016b0 74 65 20 74 68 65 20 66 6f 75 72 20 6c 69 6e 65 |te the four line| 000016c0 73 20 66 6f 72 20 79 6f 75 2e 0d 0d 0d 0d 1b 2d |s for you......-| 000016d0 01 39 2e 31 20 55 73 69 6e 67 20 6d 61 63 72 6f |.9.1 Using macro| 000016e0 20 70 61 72 61 6d 65 74 65 72 73 1b 2d 00 0d 0d | parameters.-...| 000016f0 0d 20 20 20 41 6c 74 68 6f 75 67 68 20 20 74 68 |. Although th| 00001700 69 73 20 20 69 73 20 20 75 73 65 66 75 6c 20 20 |is is useful | 00001710 69 6e 20 69 74 73 65 6c 66 2c 20 20 74 68 65 20 |in itself, the | 00001720 6d 61 63 72 6f 20 61 73 20 73 68 6f 77 6e 20 61 |macro as shown a| 00001730 62 6f 76 65 20 69 73 0d 72 61 74 68 65 72 20 20 |bove is.rather | 00001740 6c 69 6d 69 74 65 64 2e 20 20 49 74 20 63 6f 75 |limited. It cou| 00001750 6c 64 6e 27 74 2c 20 20 66 6f 72 20 69 6e 73 74 |ldn't, for inst| 00001760 61 6e 63 65 2c 20 20 62 65 20 75 73 65 64 20 74 |ance, be used t| 00001770 6f 20 61 64 64 20 32 20 74 6f 20 74 68 65 0d 76 |o add 2 to the.v| 00001780 61 72 69 61 62 6c 65 20 43 4f 55 4e 54 20 69 6e |ariable COUNT in| 00001790 73 74 65 61 64 20 6f 66 20 56 41 52 2e 0d 0d 20 |stead of VAR... | 000017a0 20 20 49 6e 20 6f 72 64 65 72 20 20 74 6f 20 20 | In order to | 000017b0 70 72 6f 76 69 64 65 20 20 74 68 69 73 20 20 73 |provide this s| 000017c0 6f 72 74 20 20 6f 66 20 20 66 6c 65 78 69 62 69 |ort of flexibi| 000017d0 6c 69 74 79 2c 20 20 79 6f 75 20 20 63 61 6e 20 |lity, you can | 000017e0 20 70 61 73 73 0d 69 6e 66 6f 72 6d 61 74 69 6f | pass.informatio| 000017f0 6e 20 74 6f 20 6d 61 63 72 6f 73 20 61 73 20 22 |n to macros as "| 00001800 70 61 72 61 6d 65 74 65 72 73 22 2e 20 20 59 6f |parameters". Yo| 00001810 75 20 63 6f 75 6c 64 20 72 65 2d 77 72 69 74 65 |u could re-write| 00001820 20 20 74 68 65 20 20 6d 61 63 72 6f 0d 61 62 6f | the macro.abo| 00001830 76 65 20 74 6f 20 72 65 61 64 0d 0d 0d 0d 0d 0d |ve to read......| 00001840 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 00001850 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001860 20 20 20 20 33 39 0d 0d 0d 0d 0d 0d 1b 47 20 20 | 39.......G | 00001870 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001880 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 | USING THE 65| 00001890 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d |C02 ASSEMBLER.H.| 000018a0 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 000018b0 20 20 41 44 44 54 57 4f 20 20 4d 41 43 52 4f 0d | ADDTWO MACRO.| 000018c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000018d0 20 20 20 20 20 20 20 4c 44 41 20 20 20 40 50 31 | LDA @P1| 000018e0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000018f0 20 20 20 20 20 20 20 20 43 4c 43 0d 20 20 20 20 | CLC. | 00001900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001910 20 20 20 41 44 43 20 20 20 23 32 0d 20 20 20 20 | ADC #2. | 00001920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001930 20 20 20 53 54 41 20 20 20 40 50 31 0d 20 20 20 | STA @P1. | 00001940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001950 20 20 20 20 45 4e 44 4d 0d 0d 20 20 20 48 65 72 | ENDM.. Her| 00001960 65 20 20 77 65 20 20 68 61 76 65 20 72 65 70 6c |e we have repl| 00001970 61 63 65 64 20 74 68 65 20 6f 63 63 75 72 72 65 |aced the occurre| 00001980 6e 63 65 73 20 6f 66 20 56 41 52 20 62 79 20 74 |nces of VAR by t| 00001990 68 65 20 73 74 72 69 6e 67 20 22 40 50 31 22 2e |he string "@P1".| 000019a0 0d 4e 6f 77 2c 20 20 77 68 65 6e 20 74 68 65 20 |.Now, when the | 000019b0 41 73 73 65 6d 62 6c 65 72 20 20 65 78 70 61 6e |Assembler expan| 000019c0 64 73 20 20 74 68 65 20 20 6d 61 63 72 6f 2c 20 |ds the macro, | 000019d0 20 69 74 20 20 77 69 6c 6c 20 20 72 65 70 6c 61 | it will repla| 000019e0 63 65 20 20 61 6c 6c 0d 6f 63 63 75 72 72 65 6e |ce all.occurren| 000019f0 63 65 73 20 6f 66 20 22 40 50 31 22 20 77 69 74 |ces of "@P1" wit| 00001a00 68 20 70 61 72 61 6d 65 74 65 72 20 6e 75 6d 62 |h parameter numb| 00001a10 65 72 20 31 20 6f 66 20 74 68 65 20 6d 61 63 72 |er 1 of the macr| 00001a20 6f 20 63 61 6c 6c 2e 20 54 6f 20 61 64 64 0d 32 |o call. To add.2| 00001a30 20 74 6f 20 56 41 52 2c 20 79 6f 75 20 77 6f 75 | to VAR, you wou| 00001a40 6c 64 20 74 68 65 6e 20 77 72 69 74 65 0d 0d 20 |ld then write.. | 00001a50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001a60 20 20 20 20 20 20 41 44 44 54 57 4f 20 20 56 41 | ADDTWO VA| 00001a70 52 0d 0d 61 6e 64 20 74 6f 20 61 64 64 20 32 20 |R..and to add 2 | 00001a80 74 6f 20 43 4f 55 4e 54 2c 20 79 6f 75 20 77 6f |to COUNT, you wo| 00001a90 75 6c 64 20 77 72 69 74 65 0d 0d 20 20 20 20 20 |uld write.. | 00001aa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001ab0 20 20 41 44 44 54 57 4f 20 20 43 4f 55 4e 54 0d | ADDTWO COUNT.| 00001ac0 0d 0d 20 20 20 59 6f 75 20 20 63 61 6e 20 20 73 |.. You can s| 00001ad0 75 70 70 6c 79 20 75 70 20 74 6f 20 39 20 70 61 |upply up to 9 pa| 00001ae0 72 61 6d 65 74 65 72 73 20 77 68 65 6e 20 79 6f |rameters when yo| 00001af0 75 20 63 61 6c 6c 20 61 20 6d 61 63 72 6f 2c 20 |u call a macro, | 00001b00 61 6e 64 20 74 68 65 79 0d 61 72 65 20 69 6e 64 |and they.are ind| 00001b10 69 63 61 74 65 64 20 69 6e 20 74 68 65 20 62 6f |icated in the bo| 00001b20 64 79 20 6f 66 20 74 68 65 20 6d 61 63 72 6f 20 |dy of the macro | 00001b30 62 79 20 20 40 50 31 2c 20 40 50 32 2c 20 40 50 |by @P1, @P2, @P| 00001b40 33 20 20 61 6e 64 20 20 73 6f 20 20 6f 6e 2e 0d |3 and so on..| 00001b50 28 4e 6f 74 65 20 20 74 68 61 74 20 20 79 6f 75 |(Note that you| 00001b60 20 20 63 61 6e 20 61 6c 73 6f 20 73 70 65 63 69 | can also speci| 00001b70 66 79 20 74 68 65 20 70 61 72 61 6d 65 74 65 72 |fy the parameter| 00001b80 73 20 61 73 20 40 31 2c 20 40 32 2c 20 40 33 20 |s as @1, @2, @3 | 00001b90 61 6e 64 20 73 6f 0d 6f 6e 2c 20 6f 6d 69 74 74 |and so.on, omitt| 00001ba0 69 6e 67 20 74 68 65 20 22 50 22 2e 20 54 68 69 |ing the "P". Thi| 00001bb0 73 20 69 73 20 61 64 65 71 75 61 74 65 20 66 6f |s is adequate fo| 00001bc0 72 20 65 78 69 73 74 69 6e 67 20 63 6f 64 65 3b |r existing code;| 00001bd0 20 68 6f 77 65 76 65 72 2c 20 66 6f 72 0d 6e 65 | however, for.ne| 00001be0 77 20 70 72 6f 67 72 61 6d 73 20 79 6f 75 20 73 |w programs you s| 00001bf0 68 6f 75 6c 64 20 75 73 65 20 74 68 65 20 22 40 |hould use the "@| 00001c00 50 31 22 20 66 6f 72 6d 2c 20 61 73 20 74 68 69 |P1" form, as thi| 00001c10 73 20 69 73 20 6e 65 63 65 73 73 61 72 79 20 20 |s is necessary | 00001c20 77 68 65 6e 0d 79 6f 75 20 63 6f 6d 65 20 74 6f |when.you come to| 00001c30 20 75 73 65 20 74 68 65 20 4d 61 63 72 6f 20 50 | use the Macro P| 00001c40 72 6f 67 72 61 6d 6d 69 6e 67 20 4c 61 6e 67 75 |rogramming Langu| 00001c50 61 67 65 29 0d 0d 0d 1b 2d 01 39 2e 32 20 53 70 |age)....-.9.2 Sp| 00001c60 65 63 69 66 79 69 6e 67 20 6d 61 63 72 6f 20 70 |ecifying macro p| 00001c70 61 72 61 6d 65 74 65 72 73 1b 2d 00 0d 0d 0d 20 |arameters.-.... | 00001c80 20 20 59 6f 75 20 63 61 6e 20 73 70 65 63 69 66 | You can specif| 00001c90 79 20 61 6e 79 74 68 69 6e 67 20 79 6f 75 20 77 |y anything you w| 00001ca0 61 6e 74 20 61 73 20 70 61 72 61 6d 65 74 65 72 |ant as parameter| 00001cb0 73 20 74 6f 20 6d 61 63 72 6f 73 2e 20 20 41 20 |s to macros. A | 00001cc0 6d 61 63 72 6f 0d 63 61 6e 20 68 61 76 65 20 75 |macro.can have u| 00001cd0 70 20 74 6f 20 39 20 70 61 72 61 6d 65 74 65 72 |p to 9 parameter| 00001ce0 73 2c 20 73 65 70 61 72 61 74 65 64 20 62 79 20 |s, separated by | 00001cf0 61 20 63 6f 6d 6d 61 20 61 6e 64 20 6f 70 74 69 |a comma and opti| 00001d00 6f 6e 61 6c 20 73 70 61 63 65 73 2e 0d 0d 20 20 |onal spaces... | 00001d10 20 41 20 6d 61 63 72 6f 20 77 69 74 68 20 33 20 | A macro with 3 | 00001d20 70 61 72 61 6d 65 74 65 72 73 20 63 6f 75 6c 64 |parameters could| 00001d30 20 62 65 20 63 61 6c 6c 65 64 20 77 69 74 68 20 | be called with | 00001d40 6c 69 6e 65 73 20 6c 69 6b 65 0d 0d 20 20 20 20 |lines like.. | 00001d50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001d60 20 20 20 43 48 45 43 4b 20 20 31 2c 46 52 45 44 | CHECK 1,FRED| 00001d70 2c 32 37 0d 20 20 20 20 20 20 20 20 20 20 20 20 |,27. | 00001d80 20 20 20 20 20 20 20 20 20 20 20 43 48 45 43 4b | CHECK| 00001d90 20 20 31 20 2c 20 20 46 52 45 44 20 20 2c 20 32 | 1 , FRED , 2| 00001da0 37 0d 0d 61 6e 64 20 73 6f 20 6f 6e 2e 0d 0d 20 |7..and so on... | 00001db0 20 20 4e 6f 72 6d 61 6c 6c 79 2c 20 20 74 68 65 | Normally, the| 00001dc0 20 20 41 73 73 65 6d 62 6c 65 72 20 20 77 69 6c | Assembler wil| 00001dd0 6c 20 20 72 65 6d 6f 76 65 20 6c 65 61 64 69 6e |l remove leadin| 00001de0 67 20 61 6e 64 20 74 72 61 69 6c 69 6e 67 20 73 |g and trailing s| 00001df0 70 61 63 65 73 0d 66 72 6f 6d 20 65 61 63 68 20 |paces.from each | 00001e00 70 61 72 61 6d 65 74 65 72 2e 20 20 49 66 20 79 |parameter. If y| 00001e10 6f 75 20 72 65 71 75 69 72 65 20 6c 65 61 64 69 |ou require leadi| 00001e20 6e 67 20 6f 72 20 74 72 61 69 6c 69 6e 67 20 73 |ng or trailing s| 00001e30 70 61 63 65 73 2c 20 6f 72 20 69 66 0d 74 68 65 |paces, or if.the| 00001e40 20 70 61 72 61 6d 65 74 65 72 20 68 61 73 20 74 | parameter has t| 00001e50 6f 20 69 6e 63 6c 75 64 65 20 61 20 63 6f 6d 6d |o include a comm| 00001e60 61 2c 20 79 6f 75 20 77 69 6c 6c 20 6e 65 65 64 |a, you will need| 00001e70 20 74 6f 20 73 70 65 63 69 66 79 20 69 74 20 61 | to specify it a| 00001e80 73 20 61 0d 73 74 72 69 6e 67 2c 20 64 65 6c 69 |s a.string, deli| 00001e90 6d 69 74 65 64 20 62 79 20 73 69 6e 67 6c 65 2d |mited by single-| 00001ea0 20 6f 72 20 64 6f 75 62 6c 65 2d 71 75 6f 74 65 | or double-quote| 00001eb0 20 63 68 61 72 61 63 74 65 72 73 2e 20 54 68 75 | characters. Thu| 00001ec0 73 2c 20 61 20 6d 61 63 72 6f 0d 63 61 6c 6c 20 |s, a macro.call | 00001ed0 6d 69 67 68 74 20 6c 6f 6f 6b 20 6c 69 6b 65 0d |might look like.| 00001ee0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00001ef0 20 20 20 20 20 20 20 20 54 48 49 4e 47 20 20 27 | THING '| 00001f00 48 65 72 65 2c 20 69 73 20 61 20 63 6f 6d 6d 61 |Here, is a comma| 00001f10 27 0d 0d 61 6e 64 20 22 40 50 31 22 20 77 69 6c |'..and "@P1" wil| 00001f20 6c 20 62 65 20 72 65 70 6c 61 63 65 64 20 69 6e |l be replaced in| 00001f30 20 74 68 65 20 6d 61 63 72 6f 20 62 6f 64 79 20 | the macro body | 00001f40 77 69 74 68 20 74 68 65 20 63 68 61 72 61 63 74 |with the charact| 00001f50 65 72 73 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |ers.. | 00001f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001f70 48 65 72 65 2c 20 69 73 20 61 20 63 6f 6d 6d 61 |Here, is a comma| 00001f80 0d 0d 20 20 20 4e 6f 74 65 20 74 68 61 74 20 74 |.. Note that t| 00001f90 68 65 20 73 74 72 69 6e 67 20 64 65 6c 69 6d 69 |he string delimi| 00001fa0 74 65 72 73 20 20 61 72 65 20 20 6e 6f 74 20 20 |ters are not | 00001fb0 74 61 6b 65 6e 20 20 61 73 20 20 70 61 72 74 20 |taken as part | 00001fc0 20 6f 66 20 20 74 68 65 0d 70 61 72 61 6d 65 74 | of the.paramet| 00001fd0 65 72 20 70 72 6f 70 65 72 2e 0d 0d 0d 20 20 20 |er proper.... | 00001fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001ff0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 34 30 | 40| 00002000 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 |.......G | 00002010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 53 | US| 00002020 49 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 53 |ING THE 65C02 AS| 00002030 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 0d 0d 0d |SEMBLER.H.......| 00002040 1b 2d 01 39 2e 33 20 4e 65 73 74 69 6e 67 20 6d |.-.9.3 Nesting m| 00002050 61 63 72 6f 73 1b 2d 00 0d 0d 0d 20 20 20 59 6f |acros.-.... Yo| 00002060 75 20 63 61 6e 20 63 61 6c 6c 20 6d 61 63 72 6f |u can call macro| 00002070 73 20 66 72 6f 6d 20 77 69 74 68 69 6e 20 6d 61 |s from within ma| 00002080 63 72 6f 73 2c 20 75 70 20 74 6f 20 61 20 64 65 |cros, up to a de| 00002090 70 74 68 20 6f 66 20 35 2e 20 20 49 66 20 79 6f |pth of 5. If yo| 000020a0 75 0d 61 74 74 65 6d 70 74 20 74 6f 20 6e 65 73 |u.attempt to nes| 000020b0 74 20 64 65 65 70 65 72 20 74 68 61 6e 20 74 68 |t deeper than th| 000020c0 61 74 2c 20 74 68 65 20 41 73 73 65 6d 62 6c 65 |at, the Assemble| 000020d0 72 20 77 69 6c 6c 20 66 6c 61 67 20 61 6e 20 65 |r will flag an e| 000020e0 72 72 6f 72 2e 0d 0d 0d 0d 1b 2d 01 39 2e 34 20 |rror......-.9.4 | 000020f0 52 65 64 65 66 69 6e 69 6e 67 20 6f 70 63 6f 64 |Redefining opcod| 00002100 65 73 20 61 6e 64 20 64 69 72 65 63 74 69 76 65 |es and directive| 00002110 73 1b 2d 00 0d 0d 0d 20 20 20 54 68 65 20 41 73 |s.-.... The As| 00002120 73 65 6d 62 6c 65 72 20 61 6c 6c 6f 77 73 20 79 |sembler allows y| 00002130 6f 75 20 74 6f 20 73 65 74 20 75 70 20 6d 61 63 |ou to set up mac| 00002140 72 6f 73 20 74 6f 20 72 65 64 65 66 69 6e 65 20 |ros to redefine | 00002150 61 6e 79 20 6f 70 63 6f 64 65 20 6f 72 0d 64 69 |any opcode or.di| 00002160 72 65 63 74 69 76 65 2e 20 20 20 46 6f 72 20 20 |rective. For | 00002170 20 65 78 61 6d 70 6c 65 2c 20 20 20 79 6f 75 20 | example, you | 00002180 20 6d 69 67 68 74 20 20 77 61 6e 74 20 20 74 6f | might want to| 00002190 20 20 72 65 64 65 66 69 6e 65 20 20 74 68 65 20 | redefine the | 000021a0 20 4a 53 52 0d 28 4a 75 6d 70 2d 74 6f 2d 53 75 | JSR.(Jump-to-Su| 000021b0 62 72 6f 75 74 69 6e 65 29 20 6f 70 63 6f 64 65 |broutine) opcode| 000021c0 20 74 6f 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c | to automaticall| 000021d0 79 20 73 61 76 65 20 74 68 65 20 72 65 67 69 73 |y save the regis| 000021e0 74 65 72 73 20 62 65 66 6f 72 65 0d 65 6e 74 65 |ters before.ente| 000021f0 72 69 6e 67 20 74 68 65 20 73 75 62 72 6f 75 74 |ring the subrout| 00002200 69 6e 65 2e 20 59 6f 75 20 63 6f 75 6c 64 20 64 |ine. You could d| 00002210 6f 20 74 68 69 73 20 62 79 20 64 65 63 6c 61 72 |o this by declar| 00002220 69 6e 67 20 61 20 6d 61 63 72 6f 20 63 61 6c 6c |ing a macro call| 00002230 65 64 0d 4a 53 52 20 74 68 75 73 3a 0d 0d 20 20 |ed.JSR thus:.. | 00002240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002250 20 20 4a 53 52 20 20 20 4d 41 43 52 4f 0d 20 20 | JSR MACRO. | 00002260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002270 20 20 20 20 20 20 20 20 50 48 41 0d 20 20 20 20 | PHA. | 00002280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002290 20 20 20 20 20 20 54 58 41 0d 20 20 20 20 20 20 | TXA. | 000022a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000022b0 20 20 20 20 50 48 41 0d 20 20 20 20 20 20 20 20 | PHA. | 000022c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000022d0 20 20 54 59 41 0d 20 20 20 20 20 20 20 20 20 20 | TYA. | 000022e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000022f0 50 48 41 0d 20 20 20 20 20 20 20 20 20 20 20 20 |PHA. | 00002300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4a 53 | JS| 00002310 52 20 20 20 40 50 31 0d 20 20 20 20 20 20 20 20 |R @P1. | 00002320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002330 20 20 45 4e 44 4d 0d 0d 20 20 20 4e 6f 77 2c 20 | ENDM.. Now, | 00002340 77 68 65 6e 65 76 65 72 20 74 68 65 20 41 73 73 |whenever the Ass| 00002350 65 6d 62 6c 65 72 20 63 6f 6d 65 73 20 61 63 72 |embler comes acr| 00002360 6f 73 73 20 61 20 6c 69 6e 65 20 20 77 69 74 68 |oss a line with| 00002370 20 20 4a 53 52 20 20 69 6e 20 20 74 68 65 0d 6f | JSR in the.o| 00002380 70 63 6f 64 65 20 20 66 69 65 6c 64 2c 20 20 69 |pcode field, i| 00002390 74 20 20 77 69 6c 6c 20 20 65 78 70 61 6e 64 20 |t will expand | 000023a0 74 68 65 20 1b 2d 01 6d 61 63 72 6f 1b 2d 00 20 |the .-.macro.-. | 000023b0 4a 53 52 20 72 61 74 68 65 72 20 74 68 61 6e 20 |JSR rather than | 000023c0 6f 62 65 79 69 6e 67 20 74 68 65 0d 6f 70 63 6f |obeying the.opco| 000023d0 64 65 2e 20 20 49 74 20 77 69 6c 6c 20 70 6c 61 |de. It will pla| 000023e0 6e 74 20 74 68 65 20 63 6f 64 65 20 74 6f 20 73 |nt the code to s| 000023f0 61 76 65 20 74 68 65 20 72 65 67 69 73 74 65 72 |ave the register| 00002400 73 2c 20 20 61 6e 64 20 74 68 65 6e 20 20 77 69 |s, and then wi| 00002410 6c 6c 0d 63 6f 6d 65 20 74 6f 20 74 68 65 20 6c |ll.come to the l| 00002420 69 6e 65 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |ine.. | 00002430 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4a | J| 00002440 53 52 20 20 40 50 31 0d 0d 69 6e 20 74 68 65 20 |SR @P1..in the | 00002450 6d 61 63 72 6f 2e 0d 0d 20 20 20 48 65 72 65 2c |macro... Here,| 00002460 20 20 62 65 63 61 75 73 65 20 69 74 20 69 73 20 | because it is | 00002470 1b 2d 01 61 6c 72 65 61 64 79 1b 2d 00 20 69 6e |.-.already.-. in| 00002480 20 61 20 6d 61 63 72 6f 2c 20 74 68 65 20 41 73 | a macro, the As| 00002490 73 65 6d 62 6c 65 72 20 77 69 6c 6c 20 6e 6f 74 |sembler will not| 000024a0 20 75 73 65 0d 74 68 65 20 6d 61 63 72 6f 20 4a | use.the macro J| 000024b0 53 52 2e 20 49 6e 73 74 65 61 64 20 69 74 20 77 |SR. Instead it w| 000024c0 69 6c 6c 20 61 73 73 65 6d 62 6c 65 20 74 68 65 |ill assemble the| 000024d0 20 1b 2d 01 6f 70 63 6f 64 65 1b 2d 00 20 4a 53 | .-.opcode.-. JS| 000024e0 52 2c 20 20 70 6c 61 6e 74 69 6e 67 20 20 74 68 |R, planting th| 000024f0 65 0d 63 6f 64 65 20 74 6f 20 65 6e 74 65 72 20 |e.code to enter | 00002500 74 68 65 20 73 75 62 72 6f 75 74 69 6e 65 2e 0d |the subroutine..| 00002510 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 20 |............... | 00002520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002540 34 31 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 |41.......G | 00002550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002560 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 32 20 |USING THE 65C02 | 00002570 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 1b |ASSEMBLER.H.....| 00002580 2d 01 39 2e 35 20 4c 61 62 65 6c 73 20 77 69 74 |-.9.5 Labels wit| 00002590 68 69 6e 20 6d 61 63 72 6f 73 1b 2d 00 0d 0d 0d |hin macros.-....| 000025a0 20 20 20 53 75 70 70 6f 73 65 20 20 79 6f 75 20 | Suppose you | 000025b0 20 77 69 73 68 20 20 74 6f 20 77 72 69 74 65 20 | wish to write | 000025c0 61 20 6d 61 63 72 6f 20 74 68 61 74 20 69 6e 63 |a macro that inc| 000025d0 6c 75 64 65 73 20 61 20 62 72 61 6e 63 68 20 6f |ludes a branch o| 000025e0 66 20 73 6f 6d 65 0d 73 6f 72 74 2e 20 20 59 6f |f some.sort. Yo| 000025f0 75 20 6d 69 67 68 74 20 77 72 69 74 65 20 74 68 |u might write th| 00002600 65 20 6d 61 63 72 6f 20 64 65 66 69 6e 69 74 69 |e macro definiti| 00002610 6f 6e 20 61 73 3a 0d 0d 20 20 20 20 20 20 20 20 |on as:.. | 00002620 20 20 20 20 20 20 20 20 20 20 20 20 54 48 49 4e | THIN| 00002630 47 20 20 4d 41 43 52 4f 0d 20 20 20 20 20 20 20 |G MACRO. | 00002640 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002650 20 20 20 20 4c 44 41 20 20 20 20 40 50 31 0d 20 | LDA @P1. | 00002660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002670 20 20 20 20 20 20 20 20 20 20 42 45 51 20 20 20 | BEQ | 00002680 20 5a 45 52 4f 0d 20 20 20 20 20 20 20 20 20 20 | ZERO. | 00002690 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000026a0 20 45 4f 52 20 20 20 20 23 24 46 46 0d 20 20 20 | EOR #$FF. | 000026b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000026c0 20 5a 45 52 4f 20 20 20 53 54 41 20 20 20 20 40 | ZERO STA @| 000026d0 50 32 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |P2. | 000026e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 45 4e | EN| 000026f0 44 4d 0d 0d 20 20 20 54 68 65 20 66 69 72 73 74 |DM.. The first| 00002700 20 74 69 6d 65 20 74 68 65 20 6d 61 63 72 6f 20 | time the macro | 00002710 69 73 20 63 61 6c 6c 65 64 2c 20 20 69 74 20 70 |is called, it p| 00002720 6c 61 6e 74 73 20 74 68 65 20 63 6f 64 65 20 62 |lants the code b| 00002730 79 74 65 73 2c 20 20 61 6e 64 0d 64 65 66 69 6e |ytes, and.defin| 00002740 65 73 20 74 68 65 20 6c 61 62 65 6c 20 5a 45 52 |es the label ZER| 00002750 4f 20 61 73 20 74 68 65 20 64 65 73 74 69 6e 61 |O as the destina| 00002760 74 69 6f 6e 20 6f 66 20 74 68 65 20 42 45 51 20 |tion of the BEQ | 00002770 69 6e 73 74 72 75 63 74 69 6f 6e 2e 20 4f 6e 20 |instruction. On | 00002780 61 0d 73 75 62 73 65 71 75 65 6e 74 20 20 63 61 |a.subsequent ca| 00002790 6c 6c 2c 20 20 74 68 6f 75 67 68 2c 20 20 74 68 |ll, though, th| 000027a0 65 20 6d 61 63 72 6f 20 77 69 6c 6c 20 70 72 6f |e macro will pro| 000027b0 64 75 63 65 20 74 68 65 20 73 61 6d 65 20 63 6f |duce the same co| 000027c0 64 65 2c 20 20 61 6e 64 0d 77 69 6c 6c 20 61 74 |de, and.will at| 000027d0 74 65 6d 70 74 20 74 6f 20 64 65 66 69 6e 65 20 |tempt to define | 000027e0 74 68 65 20 76 61 6c 75 65 20 6f 66 20 5a 45 52 |the value of ZER| 000027f0 4f 20 61 67 61 69 6e 2e 20 20 54 68 69 73 2c 20 |O again. This, | 00002800 6f 66 20 63 6f 75 72 73 65 2c 20 77 69 6c 6c 0d |of course, will.| 00002810 66 61 69 6c 2c 20 73 69 6e 63 65 20 69 74 20 61 |fail, since it a| 00002820 6c 72 65 61 64 79 20 65 78 69 73 74 73 20 66 72 |lready exists fr| 00002830 6f 6d 20 74 68 65 20 66 69 72 73 74 20 6d 61 63 |om the first mac| 00002840 72 6f 20 63 61 6c 6c 2e 0d 0d 20 20 20 54 68 65 |ro call... The| 00002850 20 41 73 73 65 6d 62 6c 65 72 20 70 72 6f 76 69 | Assembler provi| 00002860 64 65 73 20 61 20 77 61 79 20 72 6f 75 6e 64 20 |des a way round | 00002870 74 68 69 73 20 70 72 6f 62 6c 65 6d 2c 20 20 62 |this problem, b| 00002880 79 20 67 69 76 69 6e 67 20 20 79 6f 75 20 20 61 |y giving you a| 00002890 0d 77 61 79 20 20 6f 66 20 20 67 65 6e 65 72 61 |.way of genera| 000028a0 74 69 6e 67 20 1b 2d 01 75 6e 69 71 75 65 1b 2d |ting .-.unique.-| 000028b0 00 20 6c 61 62 65 6c 73 2e 20 20 45 76 65 72 79 |. labels. Every| 000028c0 20 74 69 6d 65 20 61 20 6d 61 63 72 6f 20 69 73 | time a macro is| 000028d0 20 63 61 6c 6c 65 64 2c 20 20 74 68 65 0d 41 73 | called, the.As| 000028e0 73 65 6d 62 6c 65 72 20 73 65 74 73 20 75 70 20 |sembler sets up | 000028f0 77 68 61 74 20 79 6f 75 20 63 61 6e 20 72 65 67 |what you can reg| 00002900 61 72 64 20 61 73 20 61 20 73 70 65 63 69 61 6c |ard as a special| 00002910 20 70 61 72 61 6d 65 74 65 72 20 20 6f 6e 20 20 | parameter on | 00002920 79 6f 75 72 0d 62 65 68 61 6c 66 2c 20 20 77 68 |your.behalf, wh| 00002930 69 63 68 20 20 63 6f 6e 74 61 69 6e 73 20 20 61 |ich contains a| 00002940 20 20 73 74 72 69 6e 67 20 20 74 68 61 74 20 69 | string that i| 00002950 73 20 64 69 66 66 65 72 65 6e 74 20 66 6f 72 20 |s different for | 00002960 65 76 65 72 79 20 6d 61 63 72 6f 0d 63 61 6c 6c |every macro.call| 00002970 2e 20 20 54 68 69 73 20 73 74 72 69 6e 67 20 20 |. This string | 00002980 69 73 20 20 73 75 62 73 74 69 74 75 74 65 64 2c |is substituted,| 00002990 20 20 69 6e 20 20 74 68 65 20 20 73 61 6d 65 20 | in the same | 000029a0 20 77 61 79 20 20 61 73 20 20 6f 72 64 69 6e 61 | way as ordina| 000029b0 72 79 0d 70 61 72 61 6d 65 74 65 72 73 2c 20 62 |ry.parameters, b| 000029c0 79 20 77 72 69 74 69 6e 67 20 22 40 24 4d 43 22 |y writing "@$MC"| 000029d0 20 69 6e 20 74 68 65 20 6c 69 6e 65 2e 0d 0d 20 | in the line... | 000029e0 20 20 54 68 75 73 2c 20 74 68 65 20 61 62 6f 76 | Thus, the abov| 000029f0 65 20 6d 61 63 72 6f 20 63 6f 75 6c 64 20 62 65 |e macro could be| 00002a00 20 63 68 61 6e 67 65 64 20 74 6f 20 62 65 3a 0d | changed to be:.| 00002a10 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00002a20 20 20 20 20 20 54 48 49 4e 47 20 20 20 20 20 4d | THING M| 00002a30 41 43 52 4f 0d 20 20 20 20 20 20 20 20 20 20 20 |ACRO. | 00002a40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002a50 20 20 20 4c 44 41 20 20 20 20 40 50 31 0d 20 20 | LDA @P1. | 00002a60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002a70 20 20 20 20 20 20 20 20 20 20 20 20 42 45 51 20 | BEQ | 00002a80 20 20 20 5a 45 52 4f 40 24 4d 43 0d 20 20 20 20 | ZERO@$MC. | 00002a90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002aa0 20 20 20 20 20 20 20 20 20 20 45 4f 52 20 20 20 | EOR | 00002ab0 20 23 24 46 46 0d 20 20 20 20 20 20 20 20 20 20 | #$FF. | 00002ac0 20 20 20 20 20 20 20 20 20 20 5a 45 52 4f 40 24 | ZERO@$| 00002ad0 4d 43 20 20 53 54 41 20 20 20 20 40 50 31 0d 20 |MC STA @P1. | 00002ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002af0 20 20 20 20 20 20 20 20 20 20 20 20 20 45 4e 44 | END| 00002b00 4d 0d 0d 20 20 20 54 68 65 6e 2c 20 20 6f 6e 20 |M.. Then, on | 00002b10 74 68 65 20 66 69 72 73 74 20 6d 61 63 72 6f 20 |the first macro | 00002b20 63 61 6c 6c 2c 20 20 65 76 65 72 79 20 6f 63 63 |call, every occ| 00002b30 75 72 72 65 6e 63 65 20 6f 66 20 5a 45 52 4f 40 |urrence of ZERO@| 00002b40 24 4d 43 20 6d 69 67 68 74 0d 62 65 20 63 68 61 |$MC might.be cha| 00002b50 6e 67 65 64 20 74 6f 20 5a 45 52 4f 31 58 31 2e |nged to ZERO1X1.| 00002b60 20 20 4f 6e 20 74 68 65 20 6e 65 78 74 20 63 61 | On the next ca| 00002b70 6c 6c 2c 20 74 68 65 79 20 62 65 63 6f 6d 65 20 |ll, they become | 00002b80 5a 45 52 4f 32 58 31 2c 20 73 6f 20 74 68 61 74 |ZERO2X1, so that| 00002b90 0d 74 68 65 72 65 20 69 73 20 6e 6f 20 63 6c 61 |.there is no cla| 00002ba0 73 68 20 62 65 74 77 65 65 6e 20 74 68 65 20 6d |sh between the m| 00002bb0 61 63 72 6f 73 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |acros...........| 00002bc0 0d 0d 0d 0d 0d 0d 0d 0d 0d 20 20 20 20 20 20 20 |......... | 00002bd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002be0 20 20 20 20 20 20 20 20 20 20 34 32 0d 0d 0d 0d | 42....| 00002bf0 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 20 |...G | 00002c00 20 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 20 | USING | 00002c10 54 48 45 20 36 35 43 30 32 20 41 53 53 45 4d 42 |THE 65C02 ASSEMB| 00002c20 4c 45 52 1b 48 0d 0d 0d 0d 1b 47 1b 2d 01 31 30 |LER.H.....G.-.10| 00002c30 2e 20 54 48 45 20 4d 41 43 52 4f 20 50 52 4f 47 |. THE MACRO PROG| 00002c40 52 41 4d 4d 49 4e 47 20 4c 41 4e 47 55 41 47 45 |RAMMING LANGUAGE| 00002c50 1b 48 1b 2d 00 0d 0d 0d 20 20 20 41 20 76 65 72 |.H.-.... A ver| 00002c60 79 20 70 6f 77 65 72 66 75 6c 20 66 65 61 74 75 |y powerful featu| 00002c70 72 65 20 6f 66 20 74 68 65 20 41 73 73 65 6d 62 |re of the Assemb| 00002c80 6c 65 72 20 69 73 20 69 74 73 20 20 4d 61 63 72 |ler is its Macr| 00002c90 6f 20 20 50 72 6f 67 72 61 6d 6d 69 6e 67 0d 4c |o Programming.L| 00002ca0 61 6e 67 75 61 67 65 2e 20 20 54 68 69 73 20 20 |anguage. This | 00002cb0 61 6c 6c 6f 77 73 20 20 79 6f 75 20 20 63 6f 6e |allows you con| 00002cc0 73 69 64 65 72 61 62 6c 65 20 20 63 6f 6e 74 72 |siderable contr| 00002cd0 6f 6c 20 20 69 6e 20 68 6f 77 20 6d 61 63 72 6f |ol in how macro| 00002ce0 73 20 61 72 65 0d 65 78 70 61 6e 64 65 64 20 20 |s are.expanded | 00002cf0 2d 20 20 79 6f 75 20 63 61 6e 20 63 6f 6e 73 74 |- you can const| 00002d00 72 75 63 74 20 6c 6f 6f 70 73 2c 20 20 6d 61 6e |ruct loops, man| 00002d10 69 70 75 6c 61 74 65 20 6d 61 63 72 6f 20 70 61 |ipulate macro pa| 00002d20 72 61 6d 65 74 65 72 73 20 61 6e 64 0d 70 65 72 |rameters and.per| 00002d30 66 6f 72 6d 20 73 65 76 65 72 61 6c 20 6f 74 68 |form several oth| 00002d40 65 72 20 66 75 6e 63 74 69 6f 6e 73 20 74 68 61 |er functions tha| 00002d50 74 20 61 6c 6c 6f 77 20 20 79 6f 75 20 20 74 6f |t allow you to| 00002d60 20 20 62 75 69 6c 64 20 20 6d 61 63 72 6f 73 20 | build macros | 00002d70 20 6f 66 0d 67 72 65 61 74 20 70 6f 77 65 72 2e | of.great power.| 00002d80 0d 0d 20 20 20 41 6c 74 68 6f 75 67 68 20 20 74 |.. Although t| 00002d90 68 69 73 20 20 66 61 63 69 6c 69 74 79 20 20 69 |his facility i| 00002da0 73 20 6d 6f 73 74 6c 79 20 69 6e 74 65 6e 64 65 |s mostly intende| 00002db0 64 20 66 6f 72 20 75 73 65 20 77 69 74 68 69 6e |d for use within| 00002dc0 20 6d 61 63 72 6f 73 2c 0d 6d 61 6e 79 20 6f 66 | macros,.many of| 00002dd0 20 69 74 73 20 66 61 63 69 6c 69 74 69 65 73 20 | its facilities | 00002de0 63 61 6e 20 20 61 6c 73 6f 20 20 62 65 20 20 75 |can also be u| 00002df0 73 65 64 20 20 1b 2d 01 6f 75 74 73 69 64 65 1b |sed .-.outside.| 00002e00 2d 00 20 20 6d 61 63 72 6f 73 20 20 74 6f 20 20 |-. macros to | 00002e10 67 72 65 61 74 0d 65 66 66 65 63 74 2c 20 61 73 |great.effect, as| 00002e20 20 74 68 69 73 20 73 65 63 74 69 6f 6e 20 77 69 | this section wi| 00002e30 6c 6c 20 65 78 70 6c 61 69 6e 2e 0d 0d 20 20 20 |ll explain... | 00002e40 54 68 65 20 20 4d 61 63 72 6f 20 20 50 72 6f 67 |The Macro Prog| 00002e50 72 61 6d 6d 69 6e 67 20 20 4c 61 6e 67 75 61 67 |ramming Languag| 00002e60 65 27 73 20 20 66 61 63 69 6c 69 74 69 65 73 20 |e's facilities | 00002e70 62 75 69 6c 64 20 6f 6e 20 74 77 6f 20 73 6f 75 |build on two sou| 00002e80 72 63 65 0d 6c 61 6e 67 75 61 67 65 20 66 65 61 |rce.language fea| 00002e90 74 75 72 65 73 20 20 6b 6e 6f 77 6e 20 20 61 73 |tures known as| 00002ea0 20 20 41 73 73 65 6d 62 6c 79 20 20 54 69 6d 65 | Assembly Time| 00002eb0 20 20 56 61 72 69 61 62 6c 65 73 20 20 61 6e 64 | Variables and| 00002ec0 20 20 53 65 71 75 65 6e 63 65 0d 53 79 6d 62 6f | Sequence.Symbo| 00002ed0 6c 73 2e 0d 0d 0d 1b 2d 01 31 30 2e 31 20 53 65 |ls.....-.10.1 Se| 00002ee0 71 75 65 6e 63 65 20 53 79 6d 62 6f 6c 73 1b 2d |quence Symbols.-| 00002ef0 00 0d 0d 0d 20 20 20 54 68 65 73 65 20 61 72 65 |.... These are| 00002f00 20 22 70 6c 61 63 65 20 6d 61 72 6b 65 72 73 22 | "place markers"| 00002f10 20 77 69 74 68 69 6e 20 79 6f 75 72 20 73 6f 75 | within your sou| 00002f20 72 63 65 20 66 69 6c 65 73 20 6f 72 20 77 69 74 |rce files or wit| 00002f30 68 69 6e 20 6d 61 63 72 6f 73 0d 74 68 61 74 20 |hin macros.that | 00002f40 20 74 68 65 20 20 4d 61 63 72 6f 20 50 72 6f 67 | the Macro Prog| 00002f50 72 61 6d 6d 69 6e 67 20 4c 61 6e 67 75 61 67 65 |ramming Language| 00002f60 20 75 73 65 73 20 69 6e 20 6c 6f 6f 70 73 2e 20 | uses in loops. | 00002f70 20 55 73 69 6e 67 20 64 69 72 65 63 74 69 76 65 | Using directive| 00002f80 73 0d 73 75 63 68 20 61 73 20 41 47 4f 20 61 6e |s.such as AGO an| 00002f90 64 20 41 49 46 2c 20 79 6f 75 20 63 61 6e 20 6d |d AIF, you can m| 00002fa0 61 6b 65 20 74 68 65 20 41 73 73 65 6d 62 6c 65 |ake the Assemble| 00002fb0 72 20 6d 6f 76 65 20 75 70 20 6f 72 20 64 6f 77 |r move up or dow| 00002fc0 6e 20 77 69 74 68 69 6e 0d 61 20 66 69 6c 65 20 |n within.a file | 00002fd0 6f 72 20 61 20 6d 61 63 72 6f 2c 20 20 6c 65 74 |or a macro, let| 00002fe0 74 69 6e 67 20 79 6f 75 20 72 65 70 65 61 74 65 |ting you repeate| 00002ff0 64 6c 79 20 61 73 73 65 6d 62 6c 65 20 73 6f 6d |dly assemble som| 00003000 65 20 70 61 72 74 73 20 6f 66 20 20 74 68 65 0d |e parts of the.| 00003010 73 6f 75 72 63 65 20 6f 72 20 74 6f 74 61 6c 6c |source or totall| 00003020 79 20 6f 6d 69 74 20 6f 74 68 65 72 73 2e 0d 0d |y omit others...| 00003030 20 20 20 53 65 71 75 65 6e 63 65 20 53 79 6d 62 | Sequence Symb| 00003040 6f 6c 73 20 61 72 65 20 76 65 72 79 20 73 69 6d |ols are very sim| 00003050 69 6c 61 72 20 74 6f 20 74 68 65 20 6c 61 62 65 |ilar to the labe| 00003060 6c 73 20 74 68 61 74 20 20 61 72 65 20 20 70 61 |ls that are pa| 00003070 72 74 20 20 6f 66 0d 74 68 65 20 20 73 6f 75 72 |rt of.the sour| 00003080 63 65 20 20 70 72 6f 70 65 72 2c 20 20 61 6e 64 |ce proper, and| 00003090 20 20 74 68 65 79 20 20 63 61 6e 20 20 63 6f 6e | they can con| 000030a0 74 61 69 6e 20 20 74 68 65 20 73 61 6d 65 20 63 |tain the same c| 000030b0 68 61 72 61 63 74 65 72 73 2e 20 54 6f 0d 64 69 |haracters. To.di| 000030c0 73 74 69 6e 67 75 69 73 68 20 74 68 65 6d 2c 20 |stinguish them, | 000030d0 20 53 65 71 75 65 6e 63 65 20 53 79 6d 62 6f 6c | Sequence Symbol| 000030e0 73 20 61 6c 77 61 79 73 20 62 65 67 69 6e 20 77 |s always begin w| 000030f0 69 74 68 69 6e 20 61 20 22 25 22 20 73 69 67 6e |ithin a "%" sign| 00003100 20 20 69 6e 0d 74 68 65 20 20 66 69 72 73 74 20 | in.the first | 00003110 20 63 68 61 72 61 63 74 65 72 20 20 6f 66 20 74 | character of t| 00003120 68 65 20 6c 69 6e 65 2e 20 20 54 68 65 20 53 65 |he line. The Se| 00003130 71 75 65 6e 63 65 20 53 79 6d 62 6f 6c 20 73 68 |quence Symbol sh| 00003140 6f 75 6c 64 20 62 65 20 74 68 65 0d 1b 2d 01 6f |ould be the..-.o| 00003150 6e 6c 79 1b 2d 00 20 74 68 69 6e 67 20 6f 6e 20 |nly.-. thing on | 00003160 74 68 65 20 6c 69 6e 65 3a 20 20 69 66 20 20 79 |the line: if y| 00003170 6f 75 20 20 1b 2d 01 64 6f 1b 2d 00 20 20 70 75 |ou .-.do.-. pu| 00003180 74 20 20 61 6e 79 74 68 69 6e 67 20 20 65 6c 73 |t anything els| 00003190 65 20 20 74 68 65 72 65 2c 20 20 74 68 65 0d 41 |e there, the.A| 000031a0 73 73 65 6d 62 6c 65 72 20 77 69 6c 6c 20 69 67 |ssembler will ig| 000031b0 6e 6f 72 65 20 69 74 2e 0d 0d 20 20 20 54 6f 20 |nore it... To | 000031c0 20 74 61 6b 65 20 61 6e 20 65 78 61 6d 70 6c 65 | take an example| 000031d0 20 6f 66 20 68 6f 77 20 53 65 71 75 65 6e 63 65 | of how Sequence| 000031e0 20 53 79 6d 62 6f 6c 73 20 63 6f 75 6c 64 20 62 | Symbols could b| 000031f0 65 20 75 73 65 64 2c 20 20 73 75 70 70 6f 73 65 |e used, suppose| 00003200 0d 79 6f 75 72 20 73 6f 75 72 63 65 20 66 69 6c |.your source fil| 00003210 65 20 63 6f 6e 74 61 69 6e 65 64 20 74 68 65 20 |e contained the | 00003220 6c 69 6e 65 73 3a 0d 0d 0d 20 20 20 20 20 20 20 |lines:... | 00003230 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003240 20 20 20 41 47 4f 20 20 20 20 25 53 4b 49 50 0d | AGO %SKIP.| 00003250 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003260 20 20 20 20 20 20 20 20 20 20 41 53 43 20 20 20 | ASC | 00003270 20 27 54 68 65 73 65 20 6c 69 6e 65 73 20 77 69 | 'These lines wi| 00003280 6c 6c 20 6e 65 76 65 72 20 27 0d 20 20 20 20 20 |ll never '. | 00003290 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000032a0 20 20 20 20 20 41 53 43 20 20 20 20 27 67 65 74 | ASC 'get| 000032b0 20 61 73 73 65 6d 62 6c 65 64 27 0d 20 20 20 20 | assembled'. | 000032c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000032d0 25 53 4b 49 50 0d 20 20 20 20 20 20 20 20 20 20 |%SKIP. | 000032e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000032f0 41 53 43 20 20 20 20 27 42 75 74 20 74 68 69 73 |ASC 'But this| 00003300 20 6f 6e 65 20 77 69 6c 6c 27 0d 0d 0d 20 20 20 | one will'... | 00003310 54 68 65 20 41 73 73 65 6d 62 6c 65 72 20 77 69 |The Assembler wi| 00003320 6c 6c 20 65 6e 63 6f 75 6e 74 65 72 20 20 74 68 |ll encounter th| 00003330 65 20 20 41 47 4f 20 20 64 69 72 65 63 74 69 76 |e AGO directiv| 00003340 65 2c 20 20 61 6e 64 20 20 77 69 6c 6c 20 20 74 |e, and will t| 00003350 68 65 6e 0d 1b 2d 01 69 67 6e 6f 72 65 1b 2d 00 |hen..-.ignore.-.| 00003360 20 20 65 76 65 72 79 74 68 69 6e 67 20 20 69 6e | everything in| 00003370 20 20 74 68 65 20 20 73 6f 75 72 63 65 20 20 66 | the source f| 00003380 69 6c 65 20 20 75 6e 74 69 6c 20 69 74 20 66 69 |ile until it fi| 00003390 6e 64 73 20 74 68 65 20 53 65 71 75 65 6e 63 65 |nds the Sequence| 000033a0 0d 53 79 6d 62 6f 6c 20 25 53 4b 49 50 2e 20 20 |.Symbol %SKIP. | 000033b0 49 74 20 77 69 6c 6c 20 74 68 65 6e 20 72 65 73 |It will then res| 000033c0 75 6d 65 20 69 74 73 20 6e 6f 72 6d 61 6c 20 70 |ume its normal p| 000033d0 72 6f 63 65 73 73 69 6e 67 2e 0d 0d 20 20 20 41 |rocessing... A| 000033e0 6c 74 68 6f 75 67 68 20 74 68 69 73 20 65 78 61 |lthough this exa| 000033f0 6d 70 6c 65 20 20 77 69 6c 6c 20 20 61 63 74 75 |mple will actu| 00003400 61 6c 6c 79 20 20 77 6f 72 6b 2c 20 20 74 68 65 |ally work, the| 00003410 20 20 74 65 63 68 6e 69 71 75 65 20 20 69 73 6e | technique isn| 00003420 27 74 0d 67 72 65 61 74 6c 79 20 20 75 73 65 66 |'t.greatly usef| 00003430 75 6c 2c 20 20 61 73 20 20 69 67 6e 6f 72 69 6e |ul, as ignorin| 00003440 67 20 73 6f 75 72 63 65 20 6c 69 6e 65 73 20 63 |g source lines c| 00003450 61 6e 20 62 65 20 64 6f 6e 65 20 6a 75 73 74 20 |an be done just | 00003460 61 73 20 65 61 73 69 6c 79 0d 77 69 74 68 20 74 |as easily.with t| 00003470 68 65 20 20 49 46 2e 2e 45 4c 53 45 2e 2e 46 49 |he IF..ELSE..FI| 00003480 20 20 63 6f 6e 73 74 72 75 63 74 69 6f 6e 2e 20 | construction. | 00003490 20 48 6f 77 65 76 65 72 2c 20 20 41 47 4f 20 20 | However, AGO | 000034a0 28 61 6e 64 20 74 68 65 20 76 61 72 69 6f 75 73 |(and the various| 000034b0 0d 1b 2d 01 63 6f 6e 64 69 74 69 6f 6e 61 6c 1b |..-.conditional.| 000034c0 2d 00 20 20 73 6b 69 70 73 20 73 75 63 68 20 61 |-. skips such a| 000034d0 73 20 41 49 46 29 20 61 6c 73 6f 20 61 6c 6c 6f |s AIF) also allo| 000034e0 77 73 20 79 6f 75 20 74 6f 20 67 6f 20 1b 2d 01 |ws you to go .-.| 000034f0 62 61 63 6b 77 61 72 64 73 1b 2d 00 20 69 6e 20 |backwards.-. in | 00003500 74 68 65 0d 73 6f 75 72 63 65 20 6f 72 20 6d 61 |the.source or ma| 00003510 63 72 6f 20 2d 20 74 68 65 72 65 20 69 73 20 6e |cro - there is n| 00003520 6f 20 6f 74 68 65 72 20 77 61 79 20 6f 66 20 61 |o other way of a| 00003530 63 68 69 65 76 69 6e 67 20 74 68 69 73 2e 0d 0d |chieving this...| 00003540 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00003550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003560 20 20 34 33 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 | 43.......G | 00003570 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003580 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 | USING THE 65C0| 00003590 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d |2 ASSEMBLER.H...| 000035a0 0d 0d 20 20 20 54 68 65 20 20 53 65 71 75 65 6e |.. The Sequen| 000035b0 63 65 20 20 53 79 6d 62 6f 6c 73 20 20 75 73 65 |ce Symbols use| 000035c0 64 20 20 69 6e 20 20 61 6e 79 20 20 66 69 6c 65 |d in any file| 000035d0 20 20 6f 72 20 20 6d 61 63 72 6f 20 20 61 72 65 | or macro are| 000035e0 20 20 20 71 75 69 74 65 0d 69 6e 64 65 70 65 6e | quite.indepen| 000035f0 64 65 6e 74 20 6f 66 20 74 68 6f 73 65 20 69 6e |dent of those in| 00003600 20 61 6e 79 20 6f 74 68 65 72 3b 20 74 68 75 73 | any other; thus| 00003610 20 79 6f 75 20 63 61 6e 20 73 61 66 65 6c 79 20 | you can safely | 00003620 75 73 65 20 6f 6e 65 73 20 6f 66 20 74 68 65 0d |use ones of the.| 00003630 73 61 6d 65 20 6e 61 6d 65 20 69 6e 20 65 76 65 |same name in eve| 00003640 72 79 20 66 69 6c 65 20 61 6e 64 20 6d 61 63 72 |ry file and macr| 00003650 6f 2c 20 69 66 20 79 6f 75 20 77 69 73 68 2e 0d |o, if you wish..| 00003660 0d 0d 1b 2d 01 31 30 2e 32 20 41 73 73 65 6d 62 |...-.10.2 Assemb| 00003670 6c 79 20 54 69 6d 65 20 56 61 72 69 61 62 6c 65 |ly Time Variable| 00003680 73 1b 2d 00 0d 0d 0d 20 20 20 41 73 73 65 6d 62 |s.-.... Assemb| 00003690 6c 79 20 54 69 6d 65 20 56 61 72 69 61 62 6c 65 |ly Time Variable| 000036a0 73 2c 20 20 6f 72 20 20 41 54 56 73 2c 20 20 61 |s, or ATVs, a| 000036b0 72 65 20 20 73 74 72 69 6e 67 20 76 61 72 69 61 |re string varia| 000036c0 62 6c 65 73 20 74 68 61 74 20 74 68 65 0d 41 73 |bles that the.As| 000036d0 73 65 6d 62 6c 65 72 20 69 74 73 65 6c 66 20 75 |sembler itself u| 000036e0 73 65 73 20 77 68 69 6c 65 20 61 73 73 65 6d 62 |ses while assemb| 000036f0 6c 69 6e 67 20 79 6f 75 72 20 73 6f 75 72 63 65 |ling your source| 00003700 20 66 69 6c 65 73 2e 20 20 41 73 20 69 74 20 72 | files. As it r| 00003710 65 61 64 73 0d 74 68 65 20 70 72 6f 67 72 61 6d |eads.the program| 00003720 20 73 6f 75 72 63 65 20 20 28 65 69 74 68 65 72 | source (either| 00003730 20 66 72 6f 6d 20 61 20 66 69 6c 65 2c 20 20 6f | from a file, o| 00003740 72 20 66 72 6f 6d 20 74 68 65 20 64 65 66 69 6e |r from the defin| 00003750 69 74 69 6f 6e 20 6f 66 20 20 61 0d 6d 61 63 72 |ition of a.macr| 00003760 6f 29 20 20 74 68 65 20 41 73 73 65 6d 62 6c 65 |o) the Assemble| 00003770 72 20 63 6f 6e 74 69 6e 75 61 6c 6c 79 20 6c 6f |r continually lo| 00003780 6f 6b 73 20 66 6f 72 20 72 65 66 65 72 65 6e 63 |oks for referenc| 00003790 65 73 20 74 6f 20 41 54 56 73 2e 20 20 54 68 65 |es to ATVs. The| 000037a0 73 65 0d 61 72 65 20 72 65 70 6c 61 63 65 64 20 |se.are replaced | 000037b0 2d 20 1b 2d 01 62 65 66 6f 72 65 1b 2d 00 20 74 |- .-.before.-. t| 000037c0 68 65 20 6c 69 6e 65 20 69 73 20 61 73 73 65 6d |he line is assem| 000037d0 62 6c 65 64 20 2d 20 77 69 74 68 20 74 68 65 20 |bled - with the | 000037e0 63 6f 6e 74 65 6e 74 73 20 6f 66 20 74 68 65 0d |contents of the.| 000037f0 41 54 56 2c 20 74 68 75 73 20 61 6c 6c 6f 77 69 |ATV, thus allowi| 00003800 6e 67 20 79 6f 75 20 74 6f 20 76 61 72 79 20 74 |ng you to vary t| 00003810 68 65 20 73 6f 75 72 63 65 20 74 68 61 74 20 69 |he source that i| 00003820 73 20 61 63 74 75 61 6c 6c 79 20 70 72 6f 63 65 |s actually proce| 00003830 73 73 65 64 2e 0d 0d 20 20 20 59 6f 75 20 63 61 |ssed... You ca| 00003840 6e 20 75 73 65 20 41 54 56 73 20 69 6e 20 6d 61 |n use ATVs in ma| 00003850 6e 79 20 77 61 79 73 2e 20 20 46 6f 72 20 65 78 |ny ways. For ex| 00003860 61 6d 70 6c 65 2c 20 20 74 68 65 20 66 69 72 73 |ample, the firs| 00003870 74 20 6c 69 6e 65 20 20 6f 66 20 20 61 0d 73 6f |t line of a.so| 00003880 75 72 63 65 20 20 6d 69 67 68 74 20 20 73 65 74 |urce might set| 00003890 20 20 61 6e 20 20 41 54 56 20 20 73 74 72 69 6e | an ATV strin| 000038a0 67 20 20 74 6f 20 68 6f 6c 64 20 74 68 65 20 76 |g to hold the v| 000038b0 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 20 6f 66 |ersion number of| 000038c0 20 74 68 65 0d 70 72 6f 67 72 61 6d 20 79 6f 75 | the.program you| 000038d0 20 61 72 65 20 61 73 73 65 6d 62 6c 69 6e 67 3b | are assembling;| 000038e0 20 20 74 68 65 20 20 41 73 73 65 6d 62 6c 65 72 | the Assembler| 000038f0 20 20 77 69 6c 6c 20 20 74 68 65 6e 20 20 61 75 | will then au| 00003900 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 72 65 70 6c |tomatically.repl| 00003910 61 63 65 20 20 65 76 65 72 79 20 20 72 65 66 65 |ace every refe| 00003920 72 65 6e 63 65 20 74 6f 20 74 68 61 74 20 6e 61 |rence to that na| 00003930 6d 65 20 77 69 74 68 20 74 68 65 20 73 74 72 69 |me with the stri| 00003940 6e 67 2e 20 20 53 6f 6d 65 20 41 54 56 73 20 61 |ng. Some ATVs a| 00003950 72 65 0d 63 72 65 61 74 65 64 20 62 79 20 74 68 |re.created by th| 00003960 65 20 41 73 73 65 6d 62 6c 65 72 20 69 74 73 65 |e Assembler itse| 00003970 6c 66 2c 20 20 61 6e 64 20 6c 65 74 20 79 6f 75 |lf, and let you| 00003980 20 69 6e 63 6f 72 70 6f 72 61 74 65 20 73 75 63 | incorporate suc| 00003990 68 20 20 74 68 69 6e 67 73 0d 61 73 20 74 68 65 |h things.as the| 000039a0 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 73 6f 75 | name of the sou| 000039b0 72 63 65 20 66 69 6c 65 20 69 6e 74 6f 20 74 68 |rce file into th| 000039c0 65 20 73 6f 75 72 63 65 20 69 74 73 65 6c 66 2e |e source itself.| 000039d0 0d 0d 20 20 20 54 68 65 20 20 6d 61 69 6e 20 20 |.. The main | 000039e0 75 73 65 2c 20 20 74 68 6f 75 67 68 2c 20 20 69 |use, though, i| 000039f0 73 20 69 6e 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 |s in controlling| 00003a00 20 6c 6f 6f 70 73 20 77 69 74 68 69 6e 20 6d 61 | loops within ma| 00003a10 63 72 6f 73 20 61 6e 64 0d 77 69 74 68 69 6e 20 |cros and.within | 00003a20 73 6f 75 72 63 65 20 66 69 6c 65 73 2e 0d 0d 0d |source files....| 00003a30 1b 2d 01 31 30 2e 32 2e 31 20 43 72 65 61 74 69 |.-.10.2.1 Creati| 00003a40 6e 67 20 41 73 73 65 6d 62 6c 79 20 54 69 6d 65 |ng Assembly Time| 00003a50 20 56 61 72 69 61 62 6c 65 73 1b 2d 00 0d 0d 0d | Variables.-....| 00003a60 20 20 20 41 54 56 73 20 68 61 76 65 20 6e 61 6d | ATVs have nam| 00003a70 65 73 20 73 69 6d 69 6c 61 72 20 74 6f 20 74 68 |es similar to th| 00003a80 65 20 76 61 72 69 61 62 6c 65 73 20 20 74 68 61 |e variables tha| 00003a90 74 20 20 66 6f 72 6d 20 20 70 61 72 74 20 20 6f |t form part o| 00003aa0 66 20 20 74 68 65 0d 73 6f 75 72 63 65 20 70 72 |f the.source pr| 00003ab0 6f 70 65 72 2c 20 61 6e 64 20 79 6f 75 20 63 61 |oper, and you ca| 00003ac0 6e 20 6d 61 6e 69 70 75 6c 61 74 65 20 74 68 65 |n manipulate the| 00003ad0 6d 20 77 69 74 68 20 76 61 72 69 6f 75 73 20 64 |m with various d| 00003ae0 69 72 65 63 74 69 76 65 73 2e 0d 0d 0d 20 20 20 |irectives.... | 00003af0 20 20 1b 2d 01 31 30 2e 32 2e 31 2e 31 20 4c 6f | .-.10.2.1.1 Lo| 00003b00 63 61 6c 20 61 6e 64 20 47 6c 6f 62 61 6c 20 41 |cal and Global A| 00003b10 54 56 73 1b 2d 00 0d 0d 20 20 20 20 20 54 68 65 |TVs.-... The| 00003b20 72 65 20 61 72 65 20 74 77 6f 20 74 79 70 65 73 |re are two types| 00003b30 20 6f 66 20 41 54 56 3a 20 1b 2d 01 6c 6f 63 61 | of ATV: .-.loca| 00003b40 6c 1b 2d 00 20 61 6e 64 20 1b 2d 01 67 6c 6f 62 |l.-. and .-.glob| 00003b50 61 6c 1b 2d 00 20 6f 6e 65 73 2e 0d 0d 20 20 20 |al.-. ones... | 00003b60 20 20 20 20 61 2e 20 47 6c 6f 62 61 6c 20 41 54 | a. Global AT| 00003b70 56 73 20 65 78 69 73 74 20 66 6f 72 20 74 68 65 |Vs exist for the| 00003b80 20 77 68 6f 6c 65 20 6f 66 20 74 68 65 20 61 73 | whole of the as| 00003b90 73 65 6d 62 6c 79 2c 20 20 61 6e 64 20 63 61 6e |sembly, and can| 00003ba0 20 62 65 0d 20 20 20 20 20 20 20 20 20 20 75 73 | be. us| 00003bb0 65 64 20 20 61 6e 79 77 68 65 72 65 2e 20 20 54 |ed anywhere. T| 00003bc0 68 65 79 20 20 61 72 65 20 20 63 72 65 61 74 65 |hey are create| 00003bd0 64 20 61 6e 64 20 6d 61 6e 69 70 75 6c 61 74 65 |d and manipulate| 00003be0 64 20 77 69 74 68 20 74 68 65 0d 20 20 20 20 20 |d with the. | 00003bf0 20 20 20 20 20 41 53 54 52 2c 20 41 53 45 54 2c | ASTR, ASET,| 00003c00 20 41 53 54 52 49 50 20 61 6e 64 20 41 4c 45 4e | ASTRIP and ALEN| 00003c10 20 64 69 72 65 63 74 69 76 65 73 2c 20 20 77 68 | directives, wh| 00003c20 69 63 68 20 79 6f 75 20 20 63 61 6e 20 20 75 73 |ich you can us| 00003c30 65 0d 20 20 20 20 20 20 20 20 20 20 65 76 65 6e |e. even| 00003c40 20 20 69 6e 73 69 64 65 20 20 6d 61 63 72 6f 73 | inside macros| 00003c50 20 2d 20 74 68 65 20 41 54 56 73 20 74 68 65 79 | - the ATVs they| 00003c60 20 63 72 65 61 74 65 20 77 69 6c 6c 20 63 6f 6e | create will con| 00003c70 74 69 6e 75 65 20 74 6f 0d 20 20 20 20 20 20 20 |tinue to. | 00003c80 20 20 20 65 78 69 73 74 20 61 66 74 65 72 20 74 | exist after t| 00003c90 68 65 20 6d 61 63 72 6f 20 66 69 6e 69 73 68 65 |he macro finishe| 00003ca0 73 2e 0d 0d 20 20 20 20 20 20 20 62 2e 20 4c 6f |s... b. Lo| 00003cb0 63 61 6c 20 41 54 56 73 20 61 72 65 20 63 72 65 |cal ATVs are cre| 00003cc0 61 74 65 64 20 61 6e 64 20 6d 61 6e 69 70 75 6c |ated and manipul| 00003cd0 61 74 65 64 20 62 79 20 20 74 68 65 20 20 4d 53 |ated by the MS| 00003ce0 54 52 2c 20 20 4d 53 45 54 2c 0d 20 20 20 20 20 |TR, MSET,. | 00003cf0 20 20 20 20 20 4d 53 54 52 49 50 20 20 61 6e 64 | MSTRIP and| 00003d00 20 20 4d 4c 45 4e 20 20 64 69 72 65 63 74 69 76 | MLEN directiv| 00003d10 65 73 2e 20 20 54 68 65 73 65 20 64 69 72 65 63 |es. These direc| 00003d20 74 69 76 65 73 20 63 61 6e 20 6f 6e 6c 79 20 62 |tives can only b| 00003d30 65 0d 20 20 20 20 20 20 20 20 20 20 75 73 65 64 |e. used| 00003d40 20 69 6e 73 69 64 65 20 6d 61 63 72 6f 73 2c 20 | inside macros, | 00003d50 61 6e 64 20 74 68 65 20 41 54 56 73 20 74 68 79 |and the ATVs thy| 00003d60 20 63 72 65 61 74 65 20 63 61 6e 20 62 65 20 75 | create can be u| 00003d70 73 65 64 20 6f 6e 6c 79 0d 20 20 20 20 20 20 20 |sed only. | 00003d80 20 20 20 77 69 74 68 69 6e 20 74 68 65 20 1b 2d | within the .-| 00003d90 01 73 61 6d 65 1b 2d 00 20 6d 61 63 72 6f 20 2d |.same.-. macro -| 00003da0 20 74 68 65 79 20 63 65 61 73 65 20 74 6f 20 65 | they cease to e| 00003db0 78 69 73 74 20 61 74 20 20 74 68 65 20 20 65 6e |xist at the en| 00003dc0 64 20 20 6f 66 0d 20 20 20 20 20 20 20 20 20 20 |d of. | 00003dd0 74 68 65 20 20 6d 61 63 72 6f 20 20 65 78 70 61 |the macro expa| 00003de0 6e 73 69 6f 6e 2e 20 20 59 6f 75 20 77 6f 75 6c |nsion. You woul| 00003df0 64 20 75 73 65 20 74 68 65 73 65 2c 20 66 6f 72 |d use these, for| 00003e00 20 65 78 61 6d 70 6c 65 2c 20 69 6e 0d 20 20 20 | example, in. | 00003e10 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 6c 69 | controlli| 00003e20 6e 67 20 6c 6f 6f 70 73 20 77 69 74 68 69 6e 20 |ng loops within | 00003e30 61 20 6d 61 63 72 6f 2e 0d 0d 20 20 20 20 20 20 |a macro... | 00003e40 20 20 20 20 49 6e 20 66 61 63 74 2c 20 20 79 6f | In fact, yo| 00003e50 75 20 68 61 76 65 20 61 6c 72 65 61 64 79 20 73 |u have already s| 00003e60 65 65 6e 20 6c 6f 63 61 6c 20 41 54 56 73 20 69 |een local ATVs i| 00003e70 6e 20 75 73 65 20 69 6e 20 73 65 63 74 69 6f 6e |n use in section| 00003e80 0d 20 20 20 20 20 20 20 20 20 20 39 2e 31 20 6f |. 9.1 o| 00003e90 6e 20 20 22 53 69 6d 70 6c 65 20 4d 61 63 72 6f |n "Simple Macro| 00003ea0 73 22 2e 20 20 57 68 65 6e 65 76 65 72 20 79 6f |s". Whenever yo| 00003eb0 75 20 69 6e 76 6f 6b 65 20 61 20 20 6d 61 63 72 |u invoke a macr| 00003ec0 6f 2c 20 20 74 68 65 0d 20 20 20 20 20 20 20 20 |o, the. | 00003ed0 20 20 41 73 73 65 6d 62 6c 65 72 20 20 63 72 65 | Assembler cre| 00003ee0 61 74 65 73 20 20 6c 6f 63 61 6c 20 41 54 56 73 |ates local ATVs| 00003ef0 20 77 69 74 68 20 6e 61 6d 65 73 20 20 50 31 2c | with names P1,| 00003f00 20 50 32 2c 20 50 33 20 61 6e 64 20 73 6f 0d 0d | P2, P3 and so..| 00003f10 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00003f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003f30 20 20 34 34 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 | 44.......G | 00003f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003f50 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 | USING THE 65C0| 00003f60 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d |2 ASSEMBLER.H...| 00003f70 0d 20 20 20 20 20 20 20 20 20 20 6f 6e 2c 20 65 |. on, e| 00003f80 61 63 68 20 68 6f 6c 64 69 6e 67 20 6f 6e 65 20 |ach holding one | 00003f90 6f 66 20 74 68 65 20 70 61 72 61 6d 65 74 65 72 |of the parameter| 00003fa0 73 20 79 6f 75 20 73 75 70 70 6c 69 65 64 20 20 |s you supplied | 00003fb0 6f 6e 20 20 74 68 65 0d 20 20 20 20 20 20 20 20 |on the. | 00003fc0 20 20 6d 61 63 72 6f 20 63 61 6c 6c 2e 0d 0d 20 | macro call... | 00003fd0 20 20 20 20 20 20 20 20 20 46 6f 72 20 65 78 61 | For exa| 00003fe0 6d 70 6c 65 2c 20 74 68 65 20 73 6f 75 72 63 65 |mple, the source| 00003ff0 20 6c 69 6e 65 0d 0d 20 20 20 20 20 20 20 20 20 | line.. | 00004000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00004010 4e 41 4d 45 20 20 41 53 45 54 20 20 27 4f 53 57 |NAME ASET 'OSW| 00004020 52 43 48 27 0d 0d 20 20 20 20 20 20 20 20 20 20 |RCH'.. | 00004030 77 69 6c 6c 20 20 73 65 74 20 20 75 70 20 20 61 |will set up a| 00004040 6e 20 20 41 54 56 20 20 63 61 6c 6c 65 64 20 20 |n ATV called | 00004050 4e 41 4d 45 2c 20 77 68 6f 73 65 20 63 6f 6e 74 |NAME, whose cont| 00004060 65 6e 74 73 20 61 72 65 20 74 68 65 0d 20 20 20 |ents are the. | 00004070 20 20 20 20 20 20 20 73 74 72 69 6e 67 20 27 4f | string 'O| 00004080 53 57 52 43 48 27 2e 20 20 53 69 6e 63 65 20 74 |SWRCH'. Since t| 00004090 68 65 20 41 53 45 54 20 64 69 72 65 63 74 69 76 |he ASET directiv| 000040a0 65 20 20 68 61 73 20 20 62 65 65 6e 20 20 75 73 |e has been us| 000040b0 65 64 2c 0d 20 20 20 20 20 20 20 20 20 20 74 68 |ed,. th| 000040c0 65 20 41 54 56 20 69 73 20 67 6c 6f 62 61 6c 2c |e ATV is global,| 000040d0 20 61 6e 64 20 63 61 6e 20 62 65 20 75 73 65 64 | and can be used| 000040e0 20 61 6e 79 77 68 65 72 65 20 69 6e 20 74 68 65 | anywhere in the| 000040f0 20 61 73 73 65 6d 62 6c 79 2e 0d 0d 0d 20 20 20 | assembly.... | 00004100 20 20 59 6f 75 20 20 63 61 6e 20 20 63 72 65 61 | You can crea| 00004110 74 65 20 20 6c 6f 63 61 6c 20 20 61 6e 64 20 20 |te local and | 00004120 67 6c 6f 62 61 6c 20 41 54 56 73 20 6f 66 20 74 |global ATVs of t| 00004130 68 65 20 73 61 6d 65 20 6e 61 6d 65 20 69 66 20 |he same name if | 00004140 79 6f 75 0d 20 20 20 20 20 77 69 73 68 2e 20 20 |you. wish. | 00004150 48 6f 77 65 76 65 72 2c 20 69 66 20 79 6f 75 20 |However, if you | 00004160 77 69 73 68 20 74 6f 20 72 65 66 65 72 20 74 6f |wish to refer to| 00004170 20 74 68 65 20 6c 6f 63 61 6c 20 41 54 56 2c 20 | the local ATV, | 00004180 79 6f 75 20 73 68 6f 75 6c 64 0d 20 20 20 20 20 |you should. | 00004190 62 65 20 63 61 72 65 66 75 6c 20 74 6f 20 1b 2d |be careful to .-| 000041a0 01 61 6c 77 61 79 73 1b 2d 00 20 75 73 65 20 74 |.always.-. use t| 000041b0 68 65 20 22 4d 22 20 66 6f 72 6d 20 6f 66 20 74 |he "M" form of t| 000041c0 68 65 20 64 69 72 65 63 74 69 76 65 73 2e 20 20 |he directives. | 000041d0 54 68 65 20 22 41 22 0d 20 20 20 20 20 66 6f 72 |The "A". for| 000041e0 6d 73 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 63 |ms will always c| 000041f0 72 65 61 74 65 20 67 6c 6f 62 61 6c 20 41 54 56 |reate global ATV| 00004200 73 2c 20 20 65 76 65 6e 20 69 66 20 6c 6f 63 61 |s, even if loca| 00004210 6c 20 6f 6e 65 73 20 6f 66 20 20 74 68 65 0d 20 |l ones of the. | 00004220 20 20 20 20 73 61 6d 65 20 6e 61 6d 65 20 61 6c | same name al| 00004230 72 65 61 64 79 20 65 78 69 73 74 2e 0d 0d 0d 0d |ready exist.....| 00004240 20 20 20 20 20 1b 2d 01 31 30 2e 32 2e 31 2e 32 | .-.10.2.1.2| 00004250 20 53 74 72 69 6e 67 20 61 6e 64 20 4e 75 6d 65 | String and Nume| 00004260 72 69 63 20 56 61 6c 75 65 73 1b 2d 00 0d 0d 0d |ric Values.-....| 00004270 20 20 20 20 20 41 6c 6c 20 20 41 54 56 73 20 20 | All ATVs | 00004280 61 72 65 20 20 73 74 6f 72 65 64 20 20 62 79 20 |are stored by | 00004290 20 74 68 65 20 20 41 73 73 65 6d 62 6c 65 72 20 | the Assembler | 000042a0 61 73 20 70 72 69 6e 74 61 62 6c 65 20 63 68 61 |as printable cha| 000042b0 72 61 63 74 65 72 0d 20 20 20 20 20 73 74 72 69 |racter. stri| 000042c0 6e 67 73 2e 20 20 48 6f 77 65 76 65 72 2c 20 69 |ngs. However, i| 000042d0 6e 20 6d 61 6e 79 20 63 61 73 65 73 20 79 6f 75 |n many cases you| 000042e0 20 77 69 6c 6c 20 66 69 6e 64 20 79 6f 75 20 20 | will find you | 000042f0 75 73 65 20 20 74 68 65 6d 20 20 61 73 0d 20 20 |use them as. | 00004300 20 20 20 63 6f 75 6e 74 65 72 73 20 66 6f 72 20 | counters for | 00004310 63 6f 6e 74 72 6f 6c 6c 69 6e 67 20 6c 6f 6f 70 |controlling loop| 00004320 73 3a 20 20 74 6f 20 6d 61 6b 65 20 74 68 69 73 |s: to make this| 00004330 20 65 61 73 79 2c 20 74 68 65 20 41 73 73 65 6d | easy, the Assem| 00004340 62 6c 65 72 0d 20 20 20 20 20 77 69 6c 6c 20 20 |bler. will | 00004350 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 63 6f |automatically co| 00004360 6e 76 65 72 74 20 41 54 56 73 20 66 72 6f 6d 20 |nvert ATVs from | 00004370 6e 75 6d 62 65 72 73 20 74 6f 20 73 74 72 69 6e |numbers to strin| 00004380 67 73 20 77 68 65 6e 65 76 65 72 0d 20 20 20 20 |gs whenever. | 00004390 20 6e 65 63 65 73 73 61 72 79 2e 0d 0d 20 20 20 | necessary... | 000043a0 20 20 54 68 65 20 72 75 6c 65 20 75 73 65 64 20 | The rule used | 000043b0 69 73 20 71 75 69 74 65 20 20 73 69 6d 70 6c 65 |is quite simple| 000043c0 2e 20 20 57 68 65 6e 20 20 70 72 6f 63 65 73 73 |. When process| 000043d0 69 6e 67 20 20 41 53 45 54 20 20 6f 72 20 20 4d |ing ASET or M| 000043e0 53 45 54 0d 20 20 20 20 20 64 69 72 65 63 74 69 |SET. directi| 000043f0 76 65 73 2c 20 20 74 68 65 20 20 41 73 73 65 6d |ves, the Assem| 00004400 62 6c 65 72 20 20 65 78 61 6d 69 6e 65 73 20 20 |bler examines | 00004410 74 68 65 20 66 69 72 73 74 20 63 68 61 72 61 63 |the first charac| 00004420 74 65 72 20 6f 66 20 74 68 65 0d 20 20 20 20 20 |ter of the. | 00004430 6f 70 65 72 61 6e 64 20 66 69 65 6c 64 2e 20 20 |operand field. | 00004440 49 66 20 69 74 20 69 73 20 61 20 73 74 72 69 6e |If it is a strin| 00004450 67 20 64 65 6c 69 6d 69 74 65 72 2c 20 74 68 65 |g delimiter, the| 00004460 20 6f 70 65 72 61 6e 64 20 69 73 20 74 61 6b 65 | operand is take| 00004470 6e 0d 20 20 20 20 20 61 73 20 61 20 73 74 72 69 |n. as a stri| 00004480 6e 67 20 61 6e 64 20 69 73 20 6e 6f 74 20 65 76 |ng and is not ev| 00004490 61 6c 75 61 74 65 64 2e 20 20 49 66 20 69 74 20 |aluated. If it | 000044a0 69 73 20 61 6e 79 20 6f 74 68 65 72 20 20 63 68 |is any other ch| 000044b0 61 72 61 63 74 65 72 2c 0d 20 20 20 20 20 74 68 |aracter,. th| 000044c0 65 20 20 41 73 73 65 6d 62 6c 65 72 20 20 74 72 |e Assembler tr| 000044d0 65 61 74 73 20 20 74 68 65 20 20 6f 70 65 72 61 |eats the opera| 000044e0 6e 64 20 20 61 73 20 20 61 20 20 6e 75 6d 65 72 |nd as a numer| 000044f0 69 63 20 20 65 78 70 72 65 73 73 69 6f 6e 2c 0d |ic expression,.| 00004500 20 20 20 20 20 65 76 61 6c 75 61 74 65 73 20 69 | evaluates i| 00004510 74 2c 20 61 6e 64 20 63 6f 6e 76 65 72 74 73 20 |t, and converts | 00004520 74 68 65 20 72 65 73 75 6c 74 20 69 6e 74 6f 20 |the result into | 00004530 61 20 73 74 72 69 6e 67 20 66 6f 72 20 73 74 6f |a string for sto| 00004540 72 61 67 65 2e 0d 0d 20 20 20 20 20 54 68 75 73 |rage... Thus| 00004550 2c 20 74 68 65 20 6c 69 6e 65 0d 0d 20 20 20 20 |, the line.. | 00004560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00004570 20 20 20 20 20 43 4f 55 4e 54 20 20 41 53 45 54 | COUNT ASET| 00004580 20 20 31 35 2b 33 0d 0d 20 20 20 20 20 77 69 6c | 15+3.. wil| 00004590 6c 20 73 65 74 20 75 70 20 74 68 65 20 41 54 56 |l set up the ATV| 000045a0 20 43 4f 55 4e 54 2c 20 63 6f 6e 74 61 69 6e 69 | COUNT, containi| 000045b0 6e 67 20 74 68 65 20 73 74 72 69 6e 67 20 22 31 |ng the string "1| 000045c0 38 22 2c 20 62 75 74 0d 0d 20 20 20 20 20 20 20 |8", but.. | 000045d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000045e0 20 20 43 4f 55 4e 54 20 20 41 53 45 54 20 20 27 | COUNT ASET '| 000045f0 31 35 2b 33 27 0d 0d 20 20 20 20 20 73 65 74 73 |15+3'.. sets| 00004600 20 75 70 20 74 68 65 20 73 74 72 69 6e 67 20 22 | up the string "| 00004610 31 35 2b 33 22 2e 0d 0d 20 20 20 20 20 54 68 65 |15+3"... The| 00004620 20 6f 70 65 72 61 6e 64 20 63 61 6e 20 62 65 20 | operand can be | 00004630 61 6e 79 20 65 78 70 72 65 73 73 69 6f 6e 2c 20 |any expression, | 00004640 20 70 72 6f 76 69 64 65 64 20 69 74 20 64 6f 65 | provided it doe| 00004650 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 0d 20 20 |s not contain. | 00004660 20 20 20 61 6e 79 20 66 6f 72 77 61 72 64 20 72 | any forward r| 00004670 65 66 65 72 65 6e 63 65 73 3a 20 74 68 75 73 0d |eferences: thus.| 00004680 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00004690 20 20 20 20 20 20 20 20 43 4f 55 4e 54 20 20 41 | COUNT A| 000046a0 53 45 54 20 20 41 44 44 52 45 53 53 2b 31 30 0d |SET ADDRESS+10.| 000046b0 0d 20 20 20 20 20 73 65 74 73 20 43 4f 55 4e 54 |. sets COUNT| 000046c0 20 74 6f 20 68 6f 6c 64 20 74 68 65 20 73 74 72 | to hold the str| 000046d0 69 6e 67 20 66 6f 72 6d 20 6f 66 20 74 68 65 20 |ing form of the | 000046e0 72 65 73 75 6c 74 20 6f 66 20 61 64 64 69 6e 67 |result of adding| 000046f0 20 31 30 20 74 6f 0d 20 20 20 20 20 74 68 65 20 | 10 to. the | 00004700 61 64 64 72 65 73 73 20 6c 61 62 65 6c 20 41 44 |address label AD| 00004710 44 52 45 53 53 2e 0d 0d 0d 0d 20 20 20 20 20 20 |DRESS..... | 00004720 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00004730 20 20 20 20 20 20 20 20 20 20 20 34 35 0d 0d 0d | 45...| 00004740 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 |....G | 00004750 20 20 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 | USING| 00004760 20 54 48 45 20 36 35 43 30 32 20 41 53 53 45 4d | THE 65C02 ASSEM| 00004770 42 4c 45 52 1b 48 0d 0d 0d 0d 20 20 20 20 20 49 |BLER.H.... I| 00004780 66 20 79 6f 75 20 75 73 65 20 65 78 70 72 65 73 |f you use expres| 00004790 73 69 6f 6e 73 20 74 68 61 74 20 6d 69 78 20 20 |sions that mix | 000047a0 6e 75 6d 65 72 69 63 20 20 61 6e 64 20 20 63 68 |numeric and ch| 000047b0 61 72 61 63 74 65 72 20 20 6c 69 74 65 72 61 6c |aracter literal| 000047c0 0d 20 20 20 20 20 76 61 6c 75 65 73 2c 20 20 73 |. values, s| 000047d0 6f 6d 65 20 20 63 61 75 74 69 6f 6e 20 20 69 73 |ome caution is| 000047e0 20 6e 65 65 64 65 64 20 74 6f 20 6d 61 6b 65 20 | needed to make | 000047f0 73 75 72 65 20 74 68 61 74 20 74 68 65 20 41 73 |sure that the As| 00004800 73 65 6d 62 6c 65 72 0d 20 20 20 20 20 64 6f 65 |sembler. doe| 00004810 73 20 77 68 61 74 20 79 6f 75 20 77 61 6e 74 3a |s what you want:| 00004820 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 0d 0d 20 | for example,.. | 00004830 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00004840 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 20 20 | VALUE | 00004850 41 53 45 54 20 20 27 41 27 2b 33 0d 0d 20 20 20 |ASET 'A'+3.. | 00004860 20 20 77 6f 75 6c 64 20 70 72 6f 64 75 63 65 20 | would produce | 00004870 61 6e 20 65 72 72 6f 72 2c 20 20 72 61 74 68 65 |an error, rathe| 00004880 72 20 74 68 61 6e 20 61 64 64 69 6e 67 20 33 20 |r than adding 3 | 00004890 74 6f 20 74 68 65 20 63 6f 64 65 20 66 6f 72 20 |to the code for | 000048a0 74 68 65 0d 20 20 20 20 20 63 68 61 72 61 63 74 |the. charact| 000048b0 65 72 20 27 41 27 2e 20 20 54 68 69 73 20 69 73 |er 'A'. This is| 000048c0 20 62 65 63 61 75 73 65 20 74 68 65 20 41 73 73 | because the Ass| 000048d0 65 6d 62 6c 65 72 2c 20 73 65 65 69 6e 67 20 74 |embler, seeing t| 000048e0 68 65 20 6f 70 65 72 61 6e 64 0d 20 20 20 20 20 |he operand. | 000048f0 66 69 65 6c 64 20 62 65 67 69 6e 6e 69 6e 67 20 |field beginning | 00004900 77 69 74 68 20 61 20 20 22 27 22 20 20 63 68 61 |with a "'" cha| 00004910 72 61 63 74 65 72 2c 20 20 77 69 6c 6c 20 74 72 |racter, will tr| 00004920 65 61 74 20 20 74 68 65 20 20 6f 70 65 72 61 6e |eat the operan| 00004930 64 0d 20 20 20 20 20 66 69 65 6c 64 20 61 73 20 |d. field as | 00004940 61 20 1b 2d 01 73 74 72 69 6e 67 1b 2d 00 20 61 |a .-.string.-. a| 00004950 6e 64 20 66 69 6e 64 20 74 68 61 74 20 69 74 20 |nd find that it | 00004960 69 73 20 69 6e 76 61 6c 69 64 2e 20 20 54 6f 20 |is invalid. To | 00004970 6f 76 65 72 63 6f 6d 65 20 74 68 69 73 2c 0d 20 |overcome this,. | 00004980 20 20 20 20 79 6f 75 20 20 6d 61 79 20 20 62 65 | you may be| 00004990 20 20 61 62 6c 65 20 20 74 6f 20 20 72 65 2d 6f | able to re-o| 000049a0 72 64 65 72 20 74 68 65 20 6f 70 65 72 61 6e 64 |rder the operand| 000049b0 20 65 78 70 72 65 73 73 69 6f 6e 3a 20 74 68 75 | expression: thu| 000049c0 73 20 79 6f 75 0d 20 20 20 20 20 63 6f 75 6c 64 |s you. could| 000049d0 20 77 72 69 74 65 20 74 68 65 20 61 62 6f 76 65 | write the above| 000049e0 20 65 78 61 6d 70 6c 65 20 61 73 0d 0d 20 20 20 | example as.. | 000049f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00004a00 20 20 20 20 20 20 20 56 41 4c 55 45 20 20 41 53 | VALUE AS| 00004a10 45 54 20 20 33 2b 27 41 27 0d 0d 20 20 20 20 20 |ET 3+'A'.. | 00004a20 4e 6f 77 20 74 68 65 20 41 73 73 65 6d 62 6c 65 |Now the Assemble| 00004a30 72 20 77 69 6c 6c 20 74 72 65 61 74 20 20 74 68 |r will treat th| 00004a40 65 20 20 6f 70 65 72 61 6e 64 20 20 66 69 65 6c |e operand fiel| 00004a50 64 20 20 61 73 20 20 61 20 20 6e 75 6d 65 72 69 |d as a numeri| 00004a60 63 0d 20 20 20 20 20 65 78 70 72 65 73 73 69 6f |c. expressio| 00004a70 6e 2c 20 73 69 6e 63 65 20 69 74 20 64 6f 65 73 |n, since it does| 00004a80 20 6e 6f 74 20 62 65 67 69 6e 20 77 69 74 68 20 | not begin with | 00004a90 61 20 73 74 72 69 6e 67 20 64 65 6c 69 6d 69 74 |a string delimit| 00004aa0 65 72 2e 0d 0d 20 20 20 20 20 49 6e 20 20 73 6f |er... In so| 00004ab0 6d 65 20 63 61 73 65 73 2c 20 74 68 6f 75 67 68 |me cases, though| 00004ac0 20 20 28 70 61 72 74 69 63 75 6c 61 72 6c 79 20 | (particularly | 00004ad0 69 6e 20 6d 61 63 72 6f 73 20 77 68 65 72 65 20 |in macros where | 00004ae0 79 6f 75 20 6d 61 79 20 6e 6f 74 0d 20 20 20 20 |you may not. | 00004af0 20 6b 6e 6f 77 20 62 65 66 6f 72 65 68 61 6e 64 | know beforehand| 00004b00 20 77 68 61 74 20 74 68 65 20 65 78 70 72 65 73 | what the expres| 00004b10 73 69 6f 6e 20 6d 61 79 20 6c 6f 6f 6b 20 6c 69 |sion may look li| 00004b20 6b 65 29 20 20 69 74 20 6d 61 79 20 6e 6f 74 20 |ke) it may not | 00004b30 62 65 0d 20 20 20 20 20 70 6f 73 73 69 62 6c 65 |be. possible| 00004b40 20 74 6f 20 72 65 2d 6f 72 64 65 72 20 74 68 69 | to re-order thi| 00004b50 6e 67 73 20 73 61 66 65 6c 79 2e 20 20 48 65 72 |ngs safely. Her| 00004b60 65 20 79 6f 75 20 63 61 6e 20 20 73 69 6d 70 6c |e you can simpl| 00004b70 79 20 20 70 75 74 20 20 61 0d 20 20 20 20 20 64 |y put a. d| 00004b80 75 6d 6d 79 20 6e 75 6d 62 65 72 20 69 6e 20 66 |ummy number in f| 00004b90 72 6f 6e 74 20 6f 66 20 74 68 65 20 65 78 70 72 |ront of the expr| 00004ba0 65 73 73 69 6f 6e 3a 20 74 68 75 73 0d 0d 20 20 |ession: thus.. | 00004bb0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00004bc0 20 20 20 20 20 20 56 41 4c 55 45 20 20 41 53 45 | VALUE ASE| 00004bd0 54 20 20 30 2b 27 41 27 2b 27 42 27 0d 0d 20 20 |T 0+'A'+'B'.. | 00004be0 20 20 20 77 6f 75 6c 64 20 20 61 64 64 20 74 68 | would add th| 00004bf0 65 20 63 68 61 72 61 63 74 65 72 20 76 61 6c 75 |e character valu| 00004c00 65 73 20 20 27 41 27 20 20 61 6e 64 20 20 27 42 |es 'A' and 'B| 00004c10 27 2c 20 20 74 68 65 20 6c 65 61 64 69 6e 67 20 |', the leading | 00004c20 20 22 30 22 0d 20 20 20 20 20 63 68 61 72 61 63 | "0". charac| 00004c30 74 65 72 20 66 6f 72 63 69 6e 67 20 74 68 65 20 |ter forcing the | 00004c40 41 73 73 65 6d 62 6c 65 72 20 74 6f 20 74 72 65 |Assembler to tre| 00004c50 61 74 20 74 68 65 20 6f 70 65 72 61 6e 64 20 61 |at the operand a| 00004c60 73 20 61 20 6e 75 6d 65 72 69 63 0d 20 20 20 20 |s a numeric. | 00004c70 20 65 78 70 72 65 73 73 69 6f 6e 2e 0d 0d 20 20 | expression... | 00004c80 20 20 20 54 68 65 20 41 4c 45 4e 20 61 6e 64 20 | The ALEN and | 00004c90 4d 4c 45 4e 20 64 69 72 65 63 74 69 76 65 73 20 |MLEN directives | 00004ca0 73 69 6d 69 6c 61 72 6c 79 20 20 63 6f 6e 76 65 |similarly conve| 00004cb0 72 74 20 20 66 72 6f 6d 20 20 6e 75 6d 62 65 72 |rt from number| 00004cc0 20 20 74 6f 0d 20 20 20 20 20 73 74 72 69 6e 67 | to. string| 00004cd0 20 66 6f 72 20 79 6f 75 2e 20 20 48 65 72 65 20 | for you. Here | 00004ce0 74 68 65 20 6f 70 65 72 61 6e 64 20 1b 2d 01 6d |the operand .-.m| 00004cf0 75 73 74 1b 2d 00 20 62 65 20 61 20 73 74 72 69 |ust.-. be a stri| 00004d00 6e 67 3a 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c |ng: for example,| 00004d10 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 00004d20 20 20 20 20 20 20 20 53 49 5a 45 20 20 41 4c 45 | SIZE ALE| 00004d30 4e 20 20 27 41 20 73 68 6f 72 74 20 73 74 72 69 |N 'A short stri| 00004d40 6e 67 27 0d 0d 20 20 20 20 20 73 65 74 73 20 20 |ng'.. sets | 00004d50 53 49 5a 45 20 20 74 6f 20 68 6f 6c 64 20 74 68 |SIZE to hold th| 00004d60 65 20 73 74 72 69 6e 67 20 22 31 34 22 20 20 2d |e string "14" -| 00004d70 20 20 74 68 65 20 6c 65 6e 67 74 68 20 6f 66 20 | the length of | 00004d80 74 68 65 20 6f 70 65 72 61 6e 64 0d 20 20 20 20 |the operand. | 00004d90 20 73 74 72 69 6e 67 2c 20 63 6f 6e 76 65 72 74 | string, convert| 00004da0 65 64 20 66 72 6f 6d 20 61 20 6e 75 6d 62 65 72 |ed from a number| 00004db0 20 69 6e 74 6f 20 61 20 73 74 72 69 6e 67 2e 0d | into a string..| 00004dc0 0d 0d 20 20 20 20 20 1b 2d 01 31 30 2e 32 2e 31 |.. .-.10.2.1| 00004dd0 2e 33 20 53 74 72 69 6e 67 20 73 6c 69 63 69 6e |.3 String slicin| 00004de0 67 1b 2d 00 0d 0d 20 20 20 20 20 54 68 65 20 20 |g.-... The | 00004df0 41 53 45 54 20 20 61 6e 64 20 20 4d 53 45 54 20 |ASET and MSET | 00004e00 20 64 69 72 65 63 74 69 76 65 73 20 61 6c 73 6f | directives also| 00004e10 20 61 6c 6c 6f 77 20 20 74 6f 20 20 79 6f 75 20 | allow to you | 00004e20 20 74 6f 20 20 22 73 6c 69 63 65 22 0d 20 20 20 | to "slice". | 00004e30 20 20 73 74 72 69 6e 67 73 2c 20 6f 72 20 65 78 | strings, or ex| 00004e40 74 72 61 63 74 20 63 68 61 72 61 63 74 65 72 73 |tract characters| 00004e50 20 66 72 6f 6d 20 69 6e 73 69 64 65 20 74 68 65 | from inside the| 00004e60 6d 2e 20 59 6f 75 20 70 65 72 66 6f 72 6d 20 74 |m. You perform t| 00004e70 68 69 73 0d 20 20 20 20 20 62 79 20 61 64 64 69 |his. by addi| 00004e80 6e 67 20 73 6f 6d 65 20 70 61 72 61 6d 65 74 65 |ng some paramete| 00004e90 72 73 20 69 6e 20 74 68 65 20 6f 70 65 72 61 6e |rs in the operan| 00004ea0 64 20 66 69 65 6c 64 3a 20 66 6f 72 20 65 78 61 |d field: for exa| 00004eb0 6d 70 6c 65 0d 0d 20 20 20 20 20 20 20 20 20 20 |mple.. | 00004ec0 20 20 20 20 20 20 20 20 20 20 53 4c 49 43 45 20 | SLICE | 00004ed0 20 41 53 45 54 20 20 20 27 61 62 63 64 65 66 67 | ASET 'abcdefg| 00004ee0 68 69 6a 27 2c 33 2c 32 0d 0d 20 20 20 20 20 77 |hij',3,2.. w| 00004ef0 69 6c 6c 20 20 73 65 74 20 20 53 4c 49 43 45 20 |ill set SLICE | 00004f00 20 74 6f 20 20 68 6f 6c 64 20 20 74 68 65 20 20 | to hold the | 00004f10 73 74 72 69 6e 67 20 22 63 64 22 2e 20 20 54 68 |string "cd". Th| 00004f20 65 20 73 65 63 6f 6e 64 20 6f 70 65 72 61 6e 64 |e second operand| 00004f30 0d 20 20 20 20 20 70 61 72 61 6d 65 74 65 72 20 |. parameter | 00004f40 73 70 65 63 69 66 69 65 73 20 74 68 65 20 70 6f |specifies the po| 00004f50 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 20 66 |sition of the f| 00004f60 69 72 73 74 20 20 63 68 61 72 61 63 74 65 72 20 |irst character | 00004f70 20 74 6f 20 20 62 65 0d 20 20 20 20 20 73 6c 69 | to be. sli| 00004f80 63 65 64 20 20 6f 75 74 20 20 28 74 68 65 20 73 |ced out (the s| 00004f90 74 72 69 6e 67 20 73 74 61 72 74 73 20 61 74 20 |tring starts at | 00004fa0 63 68 61 72 61 63 74 65 72 20 31 29 2c 20 20 61 |character 1), a| 00004fb0 6e 64 20 20 74 68 65 20 20 74 68 69 72 64 0d 20 |nd the third. | 00004fc0 20 20 20 20 70 61 72 61 6d 65 74 65 72 20 73 70 | parameter sp| 00004fd0 65 63 69 66 69 65 73 20 74 68 65 20 6e 75 6d 62 |ecifies the numb| 00004fe0 65 72 20 6f 66 20 63 68 61 72 61 63 74 65 72 73 |er of characters| 00004ff0 20 74 6f 20 62 65 20 73 6c 69 63 65 64 2e 0d 0d | to be sliced...| 00005000 20 20 20 20 20 49 66 20 79 6f 75 20 6f 6d 69 74 | If you omit| 00005010 20 74 68 65 20 74 68 69 72 64 20 70 61 72 61 6d | the third param| 00005020 65 74 65 72 2c 20 65 78 61 63 74 6c 79 20 6f 6e |eter, exactly on| 00005030 65 20 63 68 61 72 61 63 74 65 72 20 69 73 20 73 |e character is s| 00005040 6c 69 63 65 64 3a 0d 20 20 20 20 20 74 68 75 73 |liced:. thus| 00005050 0d 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 00005060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00005070 20 20 20 20 20 34 36 0d 0d 0d 0d 0d 0d 1b 47 20 | 46.......G | 00005080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00005090 20 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 | USING THE 6| 000050a0 35 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 |5C02 ASSEMBLER.H| 000050b0 0d 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 000050c0 20 20 20 20 20 20 20 20 20 53 4c 49 43 45 20 20 | SLICE | 000050d0 41 53 45 54 20 20 20 27 61 62 63 64 65 66 67 68 |ASET 'abcdefgh| 000050e0 69 6a 27 2c 33 0d 0d 20 20 20 20 20 77 69 6c 6c |ij',3.. will| 000050f0 20 73 65 74 20 53 4c 49 43 45 20 74 6f 20 68 6f | set SLICE to ho| 00005100 6c 64 20 74 68 65 20 73 74 72 69 6e 67 20 22 63 |ld the string "c| 00005110 22 2e 0d 0d 20 20 20 20 20 4f 63 63 61 73 69 6f |"... Occasio| 00005120 6e 61 6c 6c 79 2c 20 20 73 74 72 69 6e 67 20 6d |nally, string m| 00005130 61 6e 69 70 75 6c 61 74 69 6f 6e 73 20 73 75 63 |anipulations suc| 00005140 68 20 61 73 20 73 6c 69 63 69 6e 67 20 6d 61 79 |h as slicing may| 00005150 20 72 65 73 75 6c 74 20 69 6e 0d 20 20 20 20 20 | result in. | 00005160 73 74 72 69 6e 67 73 20 74 68 61 74 20 68 61 76 |strings that hav| 00005170 65 20 6c 65 61 64 69 6e 67 20 6f 72 20 74 72 61 |e leading or tra| 00005180 69 6c 69 6e 67 20 73 70 61 63 65 73 2c 20 20 61 |iling spaces, a| 00005190 6e 64 20 79 6f 75 20 6d 61 79 20 6e 6f 74 20 62 |nd you may not b| 000051a0 65 0d 20 20 20 20 20 61 62 6c 65 20 20 74 6f 20 |e. able to | 000051b0 20 74 65 6c 6c 20 20 62 65 66 6f 72 65 68 61 6e | tell beforehan| 000051c0 64 20 20 68 6f 77 20 20 6d 61 6e 79 2e 20 20 20 |d how many. | 000051d0 54 68 65 20 20 41 53 54 52 49 50 20 20 61 6e 64 |The ASTRIP and| 000051e0 20 20 4d 53 54 52 49 50 0d 20 20 20 20 20 64 69 | MSTRIP. di| 000051f0 72 65 63 74 69 76 65 73 20 72 65 6d 6f 76 65 20 |rectives remove | 00005200 61 6c 6c 20 6c 65 61 64 69 6e 67 20 61 6e 64 20 |all leading and | 00005210 74 72 61 69 6c 69 6e 67 20 73 70 61 63 65 73 2c |trailing spaces,| 00005220 20 73 6f 20 74 68 61 74 0d 0d 20 20 20 20 20 20 | so that.. | 00005230 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e | N| 00005240 45 57 20 20 20 41 53 54 52 49 50 20 20 20 27 20 |EW ASTRIP ' | 00005250 20 61 62 63 64 20 20 20 20 27 0d 0d 20 20 20 20 | abcd '.. | 00005260 20 77 6f 75 6c 64 20 73 65 74 20 74 68 65 20 73 | would set the s| 00005270 74 72 69 6e 67 20 4e 45 57 20 74 6f 20 62 65 20 |tring NEW to be | 00005280 22 61 62 63 64 22 2e 0d 0d 0d 20 20 20 20 20 1b |"abcd".... .| 00005290 2d 01 31 30 2e 32 2e 31 2e 34 20 45 66 66 69 63 |-.10.2.1.4 Effic| 000052a0 69 65 6e 74 20 75 73 65 20 6f 66 20 6d 65 6d 6f |ient use of memo| 000052b0 72 79 1b 2d 00 0d 0d 20 20 20 20 20 54 68 65 20 |ry.-... The | 000052c0 20 73 74 72 69 6e 67 73 20 20 63 6f 6e 74 61 69 | strings contai| 000052d0 6e 65 64 20 20 62 79 20 41 54 56 73 20 61 72 65 |ned by ATVs are| 000052e0 20 68 65 6c 64 20 62 79 20 74 68 65 20 41 73 73 | held by the Ass| 000052f0 65 6d 62 6c 65 72 20 69 6e 20 74 68 65 0d 20 20 |embler in the. | 00005300 20 20 20 73 79 6d 62 6f 6c 20 74 61 62 6c 65 2c | symbol table,| 00005310 20 20 61 6e 64 20 73 6f 20 63 6f 6d 70 65 74 65 | and so compete| 00005320 20 66 6f 72 20 6d 65 6d 6f 72 79 20 77 69 74 68 | for memory with| 00005330 20 6f 74 68 65 72 20 73 79 6d 62 6f 6c 73 2e 20 | other symbols. | 00005340 20 59 6f 75 0d 20 20 20 20 20 63 61 6e 20 63 68 | You. can ch| 00005350 61 6e 67 65 20 74 68 65 20 63 6f 6e 74 65 6e 74 |ange the content| 00005360 73 20 6f 66 20 61 6e 20 41 54 56 20 74 6f 20 61 |s of an ATV to a| 00005370 20 73 74 72 69 6e 67 20 6f 66 20 64 69 66 66 65 | string of diffe| 00005380 72 65 6e 74 20 6c 65 6e 67 74 68 0d 20 20 20 20 |rent length. | 00005390 20 61 73 20 6f 66 74 65 6e 20 61 73 20 79 6f 75 | as often as you| 000053a0 20 77 69 73 68 3a 20 20 68 6f 77 65 76 65 72 2c | wish: however,| 000053b0 20 65 76 65 72 79 20 20 74 69 6d 65 20 20 74 68 | every time th| 000053c0 65 20 20 73 74 72 69 6e 67 20 20 62 65 63 6f 6d |e string becom| 000053d0 65 73 0d 20 20 20 20 20 6c 6f 6e 67 65 72 2c 20 |es. longer, | 000053e0 74 68 65 20 41 73 73 65 6d 62 6c 65 72 20 77 69 |the Assembler wi| 000053f0 6c 6c 20 61 6c 6c 6f 63 61 74 65 20 61 20 6e 65 |ll allocate a ne| 00005400 77 20 62 6c 6f 63 6b 20 6f 66 20 6d 65 6d 6f 72 |w block of memor| 00005410 79 20 66 6f 72 20 69 74 2e 0d 20 20 20 20 20 54 |y for it.. T| 00005420 68 65 20 20 20 70 72 65 76 69 6f 75 73 20 20 20 |he previous | 00005430 62 6c 6f 63 6b 20 20 63 61 6e 6e 6f 74 20 20 62 |block cannot b| 00005440 65 20 20 75 73 65 64 20 20 61 67 61 69 6e 2c 20 |e used again, | 00005450 20 73 6f 20 20 63 6f 6e 74 69 6e 75 61 6c 6c 79 | so continually| 00005460 0d 20 20 20 20 20 69 6e 63 72 65 61 73 69 6e 67 |. increasing| 00005470 20 74 68 65 20 73 69 7a 65 20 6f 66 20 20 61 6e | the size of an| 00005480 20 20 41 54 56 20 20 63 61 6e 20 20 62 65 20 20 | ATV can be | 00005490 65 78 74 72 65 6d 65 6c 79 20 20 77 61 73 74 65 |extremely waste| 000054a0 66 75 6c 20 20 6f 66 0d 20 20 20 20 20 6d 65 6d |ful of. mem| 000054b0 6f 72 79 2e 0d 0d 20 20 20 20 20 54 6f 20 20 20 |ory... To | 000054c0 6f 76 65 72 63 6f 6d 65 20 20 20 74 68 69 73 2c |overcome this,| 000054d0 20 20 74 68 65 20 20 41 53 54 52 20 20 61 6e 64 | the ASTR and| 000054e0 20 20 4d 53 54 52 20 20 64 69 72 65 63 74 69 76 | MSTR directiv| 000054f0 65 73 20 20 6c 65 74 20 20 79 6f 75 0d 20 20 20 |es let you. | 00005500 20 20 70 72 65 2d 64 65 63 6c 61 72 65 20 61 20 | pre-declare a | 00005510 62 6c 6f 63 6b 20 6f 66 20 6d 65 6d 6f 72 79 20 |block of memory | 00005520 62 69 67 20 65 6e 6f 75 67 68 20 74 6f 20 68 6f |big enough to ho| 00005530 6c 64 20 74 68 65 20 6d 61 78 69 6d 75 6d 20 73 |ld the maximum s| 00005540 69 7a 65 0d 20 20 20 20 20 73 74 72 69 6e 67 20 |ize. string | 00005550 79 6f 75 20 77 69 6c 6c 20 75 73 65 2e 20 20 46 |you will use. F| 00005560 6f 72 20 65 78 61 6d 70 6c 65 2c 0d 0d 20 20 20 |or example,.. | 00005570 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00005580 20 20 20 20 20 20 20 20 20 4e 41 4d 45 20 20 41 | NAME A| 00005590 53 54 52 20 20 35 30 0d 0d 20 20 20 20 20 73 65 |STR 50.. se| 000055a0 74 73 20 75 70 20 61 20 62 6c 6f 63 6b 20 6c 6f |ts up a block lo| 000055b0 6e 67 20 65 6e 6f 75 67 68 20 74 6f 20 68 6f 6c |ng enough to hol| 000055c0 64 20 61 20 35 30 2d 62 79 74 65 20 73 74 72 69 |d a 50-byte stri| 000055d0 6e 67 20 77 69 74 68 6f 75 74 20 20 74 68 65 0d |ng without the.| 000055e0 20 20 20 20 20 6e 65 65 64 20 74 6f 20 67 65 74 | need to get| 000055f0 20 6d 6f 72 65 20 6d 65 6d 6f 72 79 2e 0d 0d 20 | more memory... | 00005600 20 20 20 20 54 68 65 20 1b 2d 01 6d 69 6e 69 6d | The .-.minim| 00005610 75 6d 1b 2d 00 20 20 61 6d 6f 75 6e 74 20 20 6f |um.-. amount o| 00005620 66 20 20 6d 65 6d 6f 72 79 20 20 74 68 65 20 41 |f memory the A| 00005630 73 73 65 6d 62 6c 65 72 20 77 69 6c 6c 20 61 6c |ssembler will al| 00005640 6c 6f 63 61 74 65 20 69 73 20 35 0d 20 20 20 20 |locate is 5. | 00005650 20 62 79 74 65 73 3a 20 74 68 69 73 20 69 73 20 | bytes: this is | 00005660 65 6e 6f 75 67 68 20 74 6f 20 68 6f 6c 64 20 74 |enough to hold t| 00005670 68 65 20 6c 61 72 67 65 73 74 20 70 6f 73 73 69 |he largest possi| 00005680 62 6c 65 20 6e 75 6d 65 72 69 63 20 76 61 6c 75 |ble numeric valu| 00005690 65 2c 0d 20 20 20 20 20 73 6f 20 74 68 61 74 20 |e,. so that | 000056a0 6c 6f 6f 70 20 63 6f 75 6e 74 65 72 73 20 77 69 |loop counters wi| 000056b0 6c 6c 20 6e 6f 74 20 20 63 61 75 73 65 20 20 6d |ll not cause m| 000056c0 65 6d 6f 72 79 20 20 77 61 73 74 61 67 65 20 20 |emory wastage | 000056d0 61 73 20 20 74 68 65 69 72 0d 20 20 20 20 20 76 |as their. v| 000056e0 61 6c 75 65 73 20 67 72 6f 77 20 2d 20 79 6f 75 |alues grow - you| 000056f0 20 6e 65 65 64 20 6e 6f 74 20 75 73 65 20 41 53 | need not use AS| 00005700 54 52 20 61 6e 64 20 4d 53 54 52 20 66 6f 72 20 |TR and MSTR for | 00005710 74 68 65 6d 2e 0d 0d 0d 1b 2d 01 31 30 2e 32 2e |them.....-.10.2.| 00005720 32 20 53 69 6d 70 6c 65 20 53 75 62 73 74 69 74 |2 Simple Substit| 00005730 75 74 69 6f 6e 20 6f 66 20 41 73 73 65 6d 62 6c |ution of Assembl| 00005740 79 20 54 69 6d 65 20 56 61 72 69 61 62 6c 65 73 |y Time Variables| 00005750 1b 2d 00 0d 0d 0d 20 20 20 4f 6e 63 65 20 20 79 |.-.... Once y| 00005760 6f 75 20 20 68 61 76 65 20 20 73 65 74 20 20 75 |ou have set u| 00005770 70 20 20 41 54 56 73 2c 20 79 6f 75 20 63 61 6e |p ATVs, you can| 00005780 20 75 73 65 20 74 68 65 6d 20 74 6f 20 63 72 65 | use them to cre| 00005790 61 74 65 20 1b 2d 01 76 61 72 69 61 62 6c 65 1b |ate .-.variable.| 000057a0 2d 00 0d 73 6f 75 72 63 65 20 6c 69 6e 65 73 2e |-..source lines.| 000057b0 20 20 57 65 20 68 61 76 65 20 61 6c 72 65 61 64 | We have alread| 000057c0 79 20 63 6f 6d 65 20 61 63 72 6f 73 73 20 74 68 |y come across th| 000057d0 69 73 20 63 6f 6e 63 65 70 74 20 69 6e 20 73 65 |is concept in se| 000057e0 63 74 69 6f 6e 20 39 2e 31 0d 6f 6e 20 22 53 69 |ction 9.1.on "Si| 000057f0 6d 70 6c 65 20 4d 61 63 72 6f 73 22 2c 20 69 6e |mple Macros", in| 00005800 20 74 68 65 20 64 69 73 63 75 73 73 69 6f 6e 20 | the discussion | 00005810 6f 66 20 6d 61 63 72 6f 20 70 61 72 61 6d 65 74 |of macro paramet| 00005820 65 72 20 73 75 62 73 74 69 74 75 74 69 6f 6e 2e |er substitution.| 00005830 0d 54 68 65 72 65 2c 20 77 65 20 73 61 77 20 74 |.There, we saw t| 00005840 68 61 74 20 69 66 20 74 68 65 20 73 6f 75 72 63 |hat if the sourc| 00005850 65 20 6f 66 20 74 68 65 20 6d 61 63 72 6f 20 63 |e of the macro c| 00005860 6f 6e 74 61 69 6e 65 64 20 74 68 65 20 6c 69 6e |ontained the lin| 00005870 65 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |e... | 00005880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00005890 20 20 4c 44 41 20 20 23 40 50 31 0d 0d 0d 74 68 | LDA #@P1...th| 000058a0 65 20 41 73 73 65 6d 62 6c 65 72 20 77 6f 75 6c |e Assembler woul| 000058b0 64 20 72 65 70 6c 61 63 65 20 22 40 50 31 22 20 |d replace "@P1" | 000058c0 77 69 74 68 20 77 68 61 74 65 76 65 72 20 79 6f |with whatever yo| 000058d0 75 20 68 61 64 20 20 73 70 65 63 69 66 69 65 64 |u had specified| 000058e0 20 20 61 73 0d 74 68 65 20 66 69 72 73 74 20 70 | as.the first p| 000058f0 61 72 61 6d 65 74 65 72 20 6f 66 20 74 68 65 20 |arameter of the | 00005900 6d 61 63 72 6f 20 77 68 65 6e 20 79 6f 75 20 63 |macro when you c| 00005910 61 6c 6c 65 64 20 69 74 2e 0d 0d 0d 20 20 20 20 |alled it.... | 00005920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00005930 20 20 20 20 20 20 20 20 20 20 20 20 20 34 37 0d | 47.| 00005940 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 |......G | 00005950 20 20 20 20 20 20 20 20 20 20 20 20 20 55 53 49 | USI| 00005960 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 53 53 |NG THE 65C02 ASS| 00005970 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 0d 20 20 20 |EMBLER.H..... | 00005980 41 54 56 73 20 61 72 65 20 73 75 62 73 74 69 74 |ATVs are substit| 00005990 75 74 65 64 20 69 6e 74 6f 20 73 6f 75 72 63 65 |uted into source| 000059a0 20 6c 69 6e 65 73 20 69 6e 20 65 78 61 63 74 6c | lines in exactl| 000059b0 79 20 74 68 65 20 73 61 6d 65 20 77 61 79 2c 20 |y the same way, | 000059c0 61 6e 64 0d 61 73 20 77 65 20 73 61 77 2c 20 6d |and.as we saw, m| 000059d0 61 63 72 6f 20 70 61 72 61 6d 65 74 65 72 73 20 |acro parameters | 000059e0 1b 2d 01 61 72 65 1b 2d 00 20 69 6e 20 66 61 63 |.-.are.-. in fac| 000059f0 74 20 6c 6f 63 61 6c 20 41 54 56 73 2e 0d 0d 20 |t local ATVs... | 00005a00 20 20 54 68 65 20 72 75 6c 65 20 74 68 65 20 41 | The rule the A| 00005a10 73 73 65 6d 62 6c 65 72 20 75 73 65 73 20 69 73 |ssembler uses is| 00005a20 20 71 75 69 74 65 20 73 69 6d 70 6c 65 3a 20 77 | quite simple: w| 00005a30 68 65 6e 65 76 65 72 20 69 74 20 64 65 74 65 63 |henever it detec| 00005a40 74 73 20 61 6e 0d 22 40 22 20 20 73 69 67 6e 20 |ts an."@" sign | 00005a50 69 6e 20 74 68 65 20 73 6f 75 72 63 65 20 20 28 |in the source (| 00005a60 6f 74 68 65 72 20 74 68 61 6e 20 69 6e 20 61 20 |other than in a | 00005a70 63 6f 6d 6d 65 6e 74 20 6c 69 6e 65 29 20 20 69 |comment line) i| 00005a80 74 20 65 78 70 65 63 74 73 20 61 6e 0d 41 54 56 |t expects an.ATV| 00005a90 20 6e 61 6d 65 20 74 6f 20 66 6f 6c 6c 6f 77 2e | name to follow.| 00005aa0 20 20 54 68 65 20 22 40 22 20 61 6e 64 20 74 68 | The "@" and th| 00005ab0 65 20 6e 61 6d 65 20 69 74 73 65 6c 66 20 61 72 |e name itself ar| 00005ac0 65 20 72 65 70 6c 61 63 65 64 20 20 62 79 20 20 |e replaced by | 00005ad0 74 68 65 0d 63 6f 6e 74 65 6e 74 73 20 6f 66 20 |the.contents of | 00005ae0 74 68 65 20 41 54 56 20 62 65 66 6f 72 65 20 74 |the ATV before t| 00005af0 68 65 20 6c 69 6e 65 20 69 73 20 61 73 73 65 6d |he line is assem| 00005b00 62 6c 65 64 2e 0d 0d 20 20 20 46 6f 72 20 20 65 |bled... For e| 00005b10 78 61 6d 70 6c 65 2c 20 20 79 6f 75 20 20 6d 69 |xample, you mi| 00005b20 67 68 74 20 6b 65 65 70 20 74 68 65 20 76 65 72 |ght keep the ver| 00005b30 73 69 6f 6e 20 6e 75 6d 62 65 72 20 6f 66 20 61 |sion number of a| 00005b40 20 70 72 6f 67 72 61 6d 20 69 6e 20 61 0d 73 6d | program in a.sm| 00005b50 61 6c 6c 2c 20 71 75 69 63 6b 6c 79 2d 65 64 69 |all, quickly-edi| 00005b60 74 61 62 6c 65 20 66 69 6c 65 20 74 68 61 74 20 |table file that | 00005b70 69 73 20 49 4e 43 4c 55 44 45 64 20 69 6e 74 6f |is INCLUDEd into| 00005b80 20 74 68 65 20 73 6f 75 72 63 65 20 20 61 74 20 | the source at | 00005b90 20 74 68 65 0d 73 74 61 72 74 20 6f 66 20 61 6e | the.start of an| 00005ba0 20 61 73 73 65 6d 62 6c 79 2e 20 20 54 68 69 73 | assembly. This| 00005bb0 20 6d 69 67 68 74 20 63 6f 6e 74 61 69 6e 20 74 | might contain t| 00005bc0 68 65 20 6c 69 6e 65 0d 0d 20 20 20 20 20 20 20 |he line.. | 00005bd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00005be0 20 56 45 52 53 49 4f 4e 20 20 41 53 45 54 20 20 | VERSION ASET | 00005bf0 22 33 2e 34 35 22 0d 0d 77 68 69 63 68 20 20 73 |"3.45"..which s| 00005c00 65 74 73 20 20 74 68 65 20 20 41 54 56 20 56 45 |ets the ATV VE| 00005c10 52 53 49 4f 4e 20 74 6f 20 68 6f 6c 64 20 74 68 |RSION to hold th| 00005c20 65 20 73 74 72 69 6e 67 20 22 33 2e 34 35 22 2e |e string "3.45".| 00005c30 20 20 54 68 65 6e 2c 20 61 74 20 61 6e 79 0d 70 | Then, at any.p| 00005c40 6f 69 6e 74 20 69 6e 20 74 68 65 20 73 6f 75 72 |oint in the sour| 00005c50 63 65 20 77 68 65 72 65 20 79 6f 75 20 6e 65 65 |ce where you nee| 00005c60 64 65 64 20 20 74 6f 20 20 69 6e 73 65 72 74 20 |ded to insert | 00005c70 20 74 68 65 20 20 76 65 72 73 69 6f 6e 20 20 6e | the version n| 00005c80 75 6d 62 65 72 0d 28 73 75 63 68 20 61 73 20 69 |umber.(such as i| 00005c90 6e 20 61 20 73 63 72 65 65 6e 20 6d 65 73 73 61 |n a screen messa| 00005ca0 67 65 29 20 79 6f 75 20 63 6f 75 6c 64 20 77 72 |ge) you could wr| 00005cb0 69 74 65 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 |ite, for example| 00005cc0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 00005cd0 20 20 20 20 20 54 49 54 4c 45 20 20 41 53 43 20 | TITLE ASC | 00005ce0 20 22 53 75 70 65 72 47 61 6d 65 20 40 56 45 52 | "SuperGame @VER| 00005cf0 53 49 4f 4e 22 0d 0d 20 20 20 54 68 65 20 20 41 |SION".. The A| 00005d00 73 73 65 6d 62 6c 65 72 20 20 77 6f 75 6c 64 20 |ssembler would | 00005d10 20 72 65 70 6c 61 63 65 20 20 22 40 56 45 52 53 | replace "@VERS| 00005d20 49 4f 4e 22 20 20 77 69 74 68 20 20 22 33 2e 34 |ION" with "3.4| 00005d30 35 22 20 20 62 65 66 6f 72 65 20 69 74 0d 61 73 |5" before it.as| 00005d40 73 65 6d 62 6c 65 64 20 74 68 65 20 6c 69 6e 65 |sembled the line| 00005d50 2c 20 73 6f 20 74 68 65 20 73 74 72 69 6e 67 20 |, so the string | 00005d60 61 63 74 75 61 6c 6c 79 20 70 6c 61 6e 74 65 64 |actually planted| 00005d70 20 77 6f 75 6c 64 20 62 65 0d 0d 20 20 20 20 20 | would be.. | 00005d80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00005d90 20 20 20 20 20 20 22 53 75 70 65 72 47 61 6d 65 | "SuperGame| 00005da0 20 33 2e 34 35 22 0d 0d 20 20 20 54 68 69 73 20 | 3.45".. This | 00005db0 74 65 63 68 6e 69 71 75 65 20 6c 65 74 73 20 79 |technique lets y| 00005dc0 6f 75 20 6b 65 65 70 20 20 74 68 65 20 20 76 65 |ou keep the ve| 00005dd0 72 73 69 6f 6e 20 20 6e 75 6d 62 65 72 20 20 69 |rsion number i| 00005de0 6e 20 20 6f 6e 65 20 20 65 61 73 69 6c 79 0d 61 |n one easily.a| 00005df0 6c 74 65 72 61 62 6c 65 20 20 70 6c 61 63 65 2c |lterable place,| 00005e00 20 20 61 6e 64 20 20 6c 65 74 73 20 20 74 68 65 | and lets the| 00005e10 20 20 41 73 73 65 6d 62 6c 65 72 20 20 74 61 6b | Assembler tak| 00005e20 65 20 63 61 72 65 20 6f 66 20 70 75 74 74 69 6e |e care of puttin| 00005e30 67 20 74 68 65 0d 75 70 2d 74 6f 2d 64 61 74 65 |g the.up-to-date| 00005e40 20 20 76 61 6c 75 65 20 20 28 6f 72 20 70 61 72 | value (or par| 00005e50 74 73 20 6f 66 20 74 68 65 20 76 61 6c 75 65 29 |ts of the value)| 00005e60 20 20 69 6e 74 6f 20 20 74 68 65 20 20 73 6f 75 | into the sou| 00005e70 72 63 65 20 20 61 74 20 20 74 68 65 0d 61 70 70 |rce at the.app| 00005e80 72 6f 70 72 69 61 74 65 20 70 6c 61 63 65 73 2e |ropriate places.| 00005e90 0d 0d 0d 20 20 20 54 68 65 72 65 20 61 72 65 20 |... There are | 00005ea0 73 6f 6d 65 20 6d 6f 72 65 20 63 6f 6d 70 6c 65 |some more comple| 00005eb0 78 20 75 73 65 73 20 6f 66 20 41 54 56 20 73 75 |x uses of ATV su| 00005ec0 62 73 74 69 74 75 74 69 6f 6e 2c 20 20 61 6e 64 |bstitution, and| 00005ed0 20 77 65 20 73 68 61 6c 6c 0d 64 69 73 63 75 73 | we shall.discus| 00005ee0 73 20 74 68 65 73 65 20 6c 61 74 65 72 20 69 6e |s these later in| 00005ef0 20 73 65 63 74 69 6f 6e 20 31 30 2e 33 20 6f 6e | section 10.3 on| 00005f00 20 22 57 72 69 74 69 6e 67 20 43 6f 6d 70 6c 65 | "Writing Comple| 00005f10 78 20 4d 61 63 72 6f 73 22 2e 0d 0d 0d 20 20 20 |x Macros".... | 00005f20 53 6f 6d 65 20 75 73 65 66 75 6c 20 70 6f 69 6e |Some useful poin| 00005f30 74 73 20 74 6f 20 6e 6f 74 65 20 6f 6e 20 73 75 |ts to note on su| 00005f40 62 73 74 69 74 75 74 69 6f 6e 20 61 72 65 3a 0d |bstitution are:.| 00005f50 0d 20 20 61 2e 20 49 66 20 79 6f 75 20 77 61 6e |. a. If you wan| 00005f60 74 20 74 68 65 20 22 40 22 20 63 68 61 72 61 63 |t the "@" charac| 00005f70 74 65 72 20 74 6f 20 61 70 70 65 61 72 20 69 6e |ter to appear in| 00005f80 20 74 68 65 20 6c 69 6e 65 20 74 68 65 20 41 73 | the line the As| 00005f90 73 65 6d 62 6c 65 72 0d 20 20 20 20 20 70 72 6f |sembler. pro| 00005fa0 63 65 73 73 65 73 2c 20 20 79 6f 75 72 20 20 73 |cesses, your s| 00005fb0 6f 75 72 63 65 20 20 6d 75 73 74 20 63 6f 6e 74 |ource must cont| 00005fc0 61 69 6e 20 74 77 6f 20 6f 66 20 74 68 65 6d 2e |ain two of them.| 00005fd0 20 20 54 68 75 73 2c 20 69 66 20 74 68 65 0d 20 | Thus, if the. | 00005fe0 20 20 20 20 6c 69 6e 65 20 79 6f 75 20 1b 2d 01 | line you .-.| 00005ff0 72 65 61 6c 6c 79 1b 2d 00 20 77 61 6e 74 20 74 |really.-. want t| 00006000 6f 20 61 73 73 65 6d 62 6c 65 20 69 73 0d 0d 20 |o assemble is.. | 00006010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006020 20 20 20 20 20 20 20 20 20 41 53 43 20 20 27 56 | ASC 'V| 00006030 41 54 20 40 20 31 35 25 27 0d 0d 20 20 20 20 20 |AT @ 15%'.. | 00006040 77 72 69 74 65 20 69 74 20 69 6e 20 74 68 65 20 |write it in the | 00006050 73 6f 75 72 63 65 20 66 69 6c 65 20 61 73 0d 0d |source file as..| 00006060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006070 20 20 20 20 20 20 20 20 20 20 41 53 43 20 20 27 | ASC '| 00006080 56 41 54 20 40 40 20 31 35 25 27 0d 0d 0d 20 20 |VAT @@ 15%'... | 00006090 62 2e 20 4f 6e 63 65 20 74 68 65 20 41 73 73 65 |b. Once the Asse| 000060a0 6d 62 6c 65 72 20 66 69 6e 64 73 20 61 6e 20 20 |mbler finds an | 000060b0 22 40 22 20 20 63 68 61 72 61 63 74 65 72 20 20 |"@" character | 000060c0 69 6e 20 20 74 68 65 20 20 73 6f 75 72 63 65 2c |in the source,| 000060d0 20 20 69 74 0d 20 20 20 20 20 61 73 73 75 6d 65 | it. assume| 000060e0 73 20 74 68 61 74 20 77 68 61 74 20 66 6f 6c 6c |s that what foll| 000060f0 6f 77 73 20 69 73 20 61 6e 20 41 54 56 20 6e 61 |ows is an ATV na| 00006100 6d 65 2e 20 54 68 65 20 65 6e 64 20 6f 66 20 74 |me. The end of t| 00006110 68 69 73 20 6e 61 6d 65 20 69 73 0d 20 20 20 20 |his name is. | 00006120 20 61 73 73 75 6d 65 64 20 74 6f 20 62 65 20 74 | assumed to be t| 00006130 68 65 20 66 69 72 73 74 20 6e 6f 6e 2d 61 6c 70 |he first non-alp| 00006140 68 61 6e 75 6d 65 72 69 63 20 63 68 61 72 61 63 |hanumeric charac| 00006150 74 65 72 20 74 68 61 74 20 69 74 20 6d 65 65 74 |ter that it meet| 00006160 73 2c 0d 20 20 20 20 20 6f 72 20 20 74 68 65 20 |s,. or the | 00006170 65 6e 64 20 6f 66 20 74 68 65 20 6c 69 6e 65 2e |end of the line.| 00006180 20 20 49 6e 20 61 6c 6d 6f 73 74 20 61 6c 6c 20 | In almost all | 00006190 63 61 73 65 73 2c 20 74 68 69 73 20 77 69 6c 6c |cases, this will| 000061a0 20 63 61 75 73 65 20 6e 6f 0d 20 20 20 20 20 64 | cause no. d| 000061b0 69 66 66 69 63 75 6c 74 79 2c 20 62 75 74 20 6f |ifficulty, but o| 000061c0 63 63 61 73 69 6f 6e 61 6c 6c 79 20 77 69 6c 6c |ccasionally will| 000061d0 2c 20 75 73 75 61 6c 6c 79 20 69 6e 20 63 6f 6d |, usually in com| 000061e0 70 6c 65 78 20 6d 61 63 72 6f 73 2e 0d 0d 0d 20 |plex macros.... | 000061f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00006210 34 38 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 |48.......G | 00006220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006230 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 32 20 |USING THE 65C02 | 00006240 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 0d |ASSEMBLER.H.....| 00006250 20 20 20 20 20 41 73 20 61 6e 20 65 78 61 6d 70 | As an examp| 00006260 6c 65 2c 20 20 73 75 70 70 6f 73 65 20 79 6f 75 |le, suppose you| 00006270 20 68 61 64 20 20 64 65 63 6c 61 72 65 64 20 20 | had declared | 00006280 61 74 20 20 41 54 56 20 20 63 61 6c 6c 65 64 20 |at ATV called | 00006290 20 45 58 50 52 2c 0d 20 20 20 20 20 68 6f 6c 64 | EXPR,. hold| 000062a0 69 6e 67 20 20 74 68 65 20 20 73 74 72 69 6e 67 |ing the string| 000062b0 20 20 22 31 30 2b 22 2e 20 20 41 20 73 75 62 73 | "10+". A subs| 000062c0 65 71 75 65 6e 74 20 73 6f 75 72 63 65 20 6c 69 |equent source li| 000062d0 6e 65 20 6d 69 67 68 74 20 74 68 65 6e 0d 20 20 |ne might then. | 000062e0 20 20 20 72 65 61 64 0d 0d 20 20 20 20 20 20 20 | read.. | 000062f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006300 20 20 20 20 20 20 4c 44 41 20 20 23 40 45 58 50 | LDA #@EXP| 00006310 52 33 0d 0d 20 20 20 20 20 61 6e 64 20 74 68 65 |R3.. and the| 00006320 20 69 6e 74 65 6e 74 69 6f 6e 20 69 73 20 66 6f | intention is fo| 00006330 72 20 74 68 69 73 20 74 6f 20 62 65 20 74 72 61 |r this to be tra| 00006340 6e 73 66 6f 72 6d 65 64 20 69 6e 74 6f 0d 0d 20 |nsformed into.. | 00006350 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006360 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 44 41 | LDA| 00006370 20 20 23 31 30 2b 33 0d 0d 20 20 20 20 20 49 6e | #10+3.. In| 00006380 20 20 74 68 69 73 20 20 63 61 73 65 2c 20 20 74 | this case, t| 00006390 68 6f 75 67 68 2c 20 20 74 68 65 20 20 73 75 62 |hough, the sub| 000063a0 73 74 69 74 75 74 69 6f 6e 20 20 77 69 6c 6c 20 |stitution will | 000063b0 20 66 61 69 6c 2c 20 20 61 73 20 20 74 68 65 0d | fail, as the.| 000063c0 20 20 20 20 20 41 73 73 65 6d 62 6c 65 72 20 77 | Assembler w| 000063d0 69 6c 6c 20 6c 6f 6f 6b 20 66 6f 72 20 61 6e 20 |ill look for an | 000063e0 41 54 56 20 63 61 6c 6c 65 64 20 45 58 50 52 33 |ATV called EXPR3| 000063f0 2e 20 54 6f 20 66 6f 72 63 65 20 69 74 20 74 6f |. To force it to| 00006400 20 64 6f 20 61 73 0d 20 20 20 20 20 79 6f 75 20 | do as. you | 00006410 77 61 6e 74 2c 20 77 72 69 74 65 20 74 68 65 20 |want, write the | 00006420 73 6f 75 72 63 65 20 6c 69 6e 65 20 61 73 0d 0d |source line as..| 00006430 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006440 20 20 20 20 20 20 20 20 20 20 20 20 4c 44 41 20 | LDA | 00006450 20 23 40 45 58 50 52 2f 33 0d 0d 20 20 20 20 20 | #@EXPR/3.. | 00006460 54 68 65 20 22 2f 22 20 63 68 61 72 61 63 74 65 |The "/" characte| 00006470 72 20 20 65 6e 61 62 6c 65 73 20 74 68 65 20 41 |r enables the A| 00006480 73 73 65 6d 62 6c 65 72 20 74 6f 20 64 65 74 65 |ssembler to dete| 00006490 63 74 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 |ct the end of th| 000064a0 65 0d 20 20 20 20 20 41 54 56 20 6e 61 6d 65 2c |e. ATV name,| 000064b0 20 73 6f 20 69 74 20 77 69 6c 6c 20 6c 6f 6f 6b | so it will look| 000064c0 20 66 6f 72 20 45 58 50 52 20 61 73 20 69 74 20 | for EXPR as it | 000064d0 73 68 6f 75 6c 64 2e 20 20 54 68 65 20 22 2f 22 |should. The "/"| 000064e0 20 77 69 6c 6c 20 62 65 0d 20 20 20 20 20 64 69 | will be. di| 000064f0 73 63 61 72 64 65 64 2c 20 73 6f 20 74 68 61 74 |scarded, so that| 00006500 20 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 6c | the resulting l| 00006510 69 6e 65 20 77 69 6c 6c 20 62 65 0d 0d 20 20 20 |ine will be.. | 00006520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006530 20 20 20 20 20 20 20 20 20 20 20 4c 44 41 20 20 | LDA | 00006540 23 31 30 2b 33 0d 0d 20 20 20 20 20 61 73 20 20 |#10+3.. as | 00006550 69 6e 74 65 6e 64 65 64 2e 20 20 49 66 20 79 6f |intended. If yo| 00006560 75 20 1b 2d 01 6e 65 65 64 1b 2d 00 20 61 20 22 |u .-.need.-. a "| 00006570 2f 22 20 63 68 61 72 61 63 74 65 72 20 69 6e 20 |/" character in | 00006580 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 6c 69 |the resulting li| 00006590 6e 65 2c 0d 20 20 20 20 20 77 72 69 74 65 20 69 |ne,. write i| 000065a0 74 20 61 73 20 22 2f 2f 22 2e 0d 0d 20 20 20 20 |t as "//"... | 000065b0 20 54 68 65 72 65 20 69 73 20 61 6e 6f 74 68 65 | There is anothe| 000065c0 72 20 74 65 63 68 6e 69 71 75 65 20 79 6f 75 20 |r technique you | 000065d0 6d 69 67 68 74 20 75 73 65 20 69 6e 20 74 68 65 |might use in the| 000065e0 73 65 20 20 63 69 72 63 75 6d 73 74 61 6e 63 65 |se circumstance| 000065f0 73 2e 0d 20 20 20 20 20 54 68 65 20 20 41 73 73 |s.. The Ass| 00006600 65 6d 62 6c 65 72 20 20 64 6f 65 73 20 20 6e 6f |embler does no| 00006610 74 20 72 65 67 61 72 64 20 73 70 61 63 65 73 20 |t regard spaces | 00006620 61 73 20 73 69 67 6e 69 66 69 63 61 6e 74 20 69 |as significant i| 00006630 6e 20 6e 75 6d 65 72 69 63 0d 20 20 20 20 20 65 |n numeric. e| 00006640 78 70 72 65 73 73 69 6f 6e 73 2c 20 73 6f 20 74 |xpressions, so t| 00006650 68 61 74 20 79 6f 75 20 63 6f 75 6c 64 20 77 72 |hat you could wr| 00006660 69 74 65 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |ite.. | 00006670 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006680 20 4c 44 41 20 20 23 40 45 58 50 52 20 33 0d 0d | LDA #@EXPR 3..| 00006690 20 20 20 20 20 74 6f 20 61 63 68 69 65 76 65 20 | to achieve | 000066a0 74 68 65 20 73 61 6d 65 20 72 65 73 75 6c 74 2e |the same result.| 000066b0 0d 0d 20 20 63 2e 20 4e 6f 20 41 54 56 20 73 75 |.. c. No ATV su| 000066c0 62 73 74 69 74 75 74 69 6f 6e 20 69 73 20 20 70 |bstitution is p| 000066d0 65 72 66 6f 72 6d 65 64 20 20 69 6e 20 20 63 6f |erformed in co| 000066e0 6d 6d 65 6e 74 20 20 6c 69 6e 65 73 2c 20 20 69 |mment lines, i| 000066f0 6e 20 20 6c 69 6e 65 73 0d 20 20 20 20 20 63 6f |n lines. co| 00006700 6e 74 61 69 6e 69 6e 67 20 53 65 71 75 65 6e 63 |ntaining Sequenc| 00006710 65 20 53 79 6d 62 6f 6c 73 2c 20 6f 72 20 69 6e |e Symbols, or in| 00006720 20 74 68 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 | the definition | 00006730 6f 66 20 6d 61 63 72 6f 73 20 28 69 2e 65 2e 0d |of macros (i.e..| 00006740 20 20 20 20 20 62 65 74 77 65 65 6e 20 74 68 65 | between the| 00006750 20 4d 41 43 52 4f 20 61 6e 64 20 45 4e 44 4d 20 | MACRO and ENDM | 00006760 64 69 72 65 63 74 69 76 65 73 29 2e 20 41 70 61 |directives). Apa| 00006770 72 74 20 66 72 6f 6d 20 74 68 65 73 65 2c 20 74 |rt from these, t| 00006780 68 6f 75 67 68 2c 0d 20 20 20 20 20 73 75 62 73 |hough,. subs| 00006790 74 69 74 75 74 69 6f 6e 73 20 20 63 61 6e 20 20 |titutions can | 000067a0 62 65 20 20 6d 61 64 65 20 20 61 74 20 1b 2d 01 |be made at .-.| 000067b0 61 6e 79 1b 2d 00 20 20 70 6c 61 63 65 20 69 6e |any.-. place in| 000067c0 20 61 20 6c 69 6e 65 20 20 2d 20 20 79 6f 75 20 | a line - you | 000067d0 63 61 6e 0d 20 20 20 20 20 73 75 62 73 74 69 74 |can. substit| 000067e0 75 74 65 20 66 6f 72 20 6c 61 62 65 6c 73 2c 20 |ute for labels, | 000067f0 6f 70 63 6f 64 65 73 2c 20 6f 70 65 72 61 6e 64 |opcodes, operand| 00006800 73 20 6f 72 20 61 6e 79 20 70 61 72 74 73 20 6f |s or any parts o| 00006810 66 20 74 68 65 6d 2e 0d 0d 0d 0d 1b 2d 01 31 30 |f them......-.10| 00006820 2e 33 20 57 72 69 74 69 6e 67 20 43 6f 6d 70 6c |.3 Writing Compl| 00006830 65 78 20 4d 61 63 72 6f 73 1b 2d 00 0d 0d 0d 1b |ex Macros.-.....| 00006840 2d 01 31 30 2e 33 2e 31 20 50 72 6f 67 72 61 6d |-.10.3.1 Program| 00006850 6d 69 6e 67 20 6d 61 63 72 6f 20 6c 6f 6f 70 73 |ming macro loops| 00006860 1b 2d 00 0d 0d 20 20 20 4d 6f 73 74 6c 79 2c 20 |.-... Mostly, | 00006870 79 6f 75 20 77 69 6c 6c 20 75 73 65 20 74 68 65 |you will use the| 00006880 20 20 4d 61 63 72 6f 20 20 50 72 6f 67 72 61 6d | Macro Program| 00006890 6d 69 6e 67 20 20 4c 61 6e 67 75 61 67 65 20 20 |ming Language | 000068a0 74 6f 20 20 70 72 6f 67 72 61 6d 0d 6d 61 63 72 |to program.macr| 000068b0 6f 20 6c 6f 6f 70 73 2c 20 63 6f 6e 74 72 6f 6c |o loops, control| 000068c0 6c 65 64 20 62 79 20 76 61 72 69 6f 75 73 20 63 |led by various c| 000068d0 6f 6e 64 69 74 69 6f 6e 73 2e 0d 0d 0d 0d 0d 0d |onditions.......| 000068e0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 000068f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006900 20 20 20 34 39 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 | 49.......G | 00006910 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006920 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 | USING THE 65C| 00006930 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d |02 ASSEMBLER.H..| 00006940 0d 0d 20 20 20 20 20 1b 2d 01 31 30 2e 33 2e 31 |.. .-.10.3.1| 00006950 2e 31 20 53 69 6d 70 6c 65 20 6c 6f 6f 70 73 20 |.1 Simple loops | 00006960 63 6f 6e 74 72 6f 6c 6c 65 64 20 62 79 20 63 6f |controlled by co| 00006970 75 6e 74 65 72 1b 2d 00 0d 0d 0d 20 20 20 20 20 |unter.-.... | 00006980 54 68 65 20 73 69 6d 70 6c 65 73 74 20 66 6f 72 |The simplest for| 00006990 6d 20 6f 66 20 6c 6f 6f 70 20 69 73 20 6f 6e 65 |m of loop is one| 000069a0 20 77 68 69 63 68 20 69 73 20 65 78 65 63 75 74 | which is execut| 000069b0 65 64 20 61 20 66 69 78 65 64 20 6e 75 6d 62 65 |ed a fixed numbe| 000069c0 72 0d 20 20 20 20 20 6f 66 20 74 69 6d 65 73 2c |r. of times,| 000069d0 20 61 6e 64 20 6e 65 65 64 73 20 6f 6e 6c 79 20 | and needs only | 000069e0 61 20 63 6f 75 6e 74 65 72 20 74 6f 20 63 6f 6e |a counter to con| 000069f0 74 72 6f 6c 20 69 74 2e 0d 0d 20 20 20 20 20 41 |trol it... A| 00006a00 73 20 61 6e 20 65 78 61 6d 70 6c 65 2c 20 20 73 |s an example, s| 00006a10 75 70 70 6f 73 65 20 74 68 61 74 20 77 65 20 6e |uppose that we n| 00006a20 65 65 64 20 61 20 6d 61 63 72 6f 20 74 6f 20 70 |eed a macro to p| 00006a30 6c 61 6e 74 20 61 20 6e 75 6d 62 65 72 20 6f 66 |lant a number of| 00006a40 0d 20 20 20 20 20 62 79 74 65 73 20 20 63 6f 6e |. bytes con| 00006a50 74 61 69 6e 69 6e 67 20 20 24 46 46 20 20 77 69 |taining $FF wi| 00006a60 74 68 20 74 68 65 20 44 46 42 20 64 69 72 65 63 |th the DFB direc| 00006a70 74 69 76 65 2c 20 20 74 68 65 20 6e 75 6d 62 65 |tive, the numbe| 00006a80 72 20 62 65 69 6e 67 0d 20 20 20 20 20 73 70 65 |r being. spe| 00006a90 63 69 66 69 65 64 20 62 79 20 74 68 65 20 66 69 |cified by the fi| 00006aa0 72 73 74 20 70 61 72 61 6d 65 74 65 72 2e 20 20 |rst parameter. | 00006ab0 28 54 68 65 72 65 20 61 72 65 20 6d 75 63 68 20 |(There are much | 00006ac0 65 61 73 69 65 72 20 77 61 79 73 20 6f 66 0d 20 |easier ways of. | 00006ad0 20 20 20 20 64 6f 69 6e 67 20 74 68 69 73 20 74 | doing this t| 00006ae0 68 61 6e 20 77 69 74 68 20 61 20 6d 61 63 72 6f |han with a macro| 00006af0 2c 20 20 6f 66 20 63 6f 75 72 73 65 20 20 2d 20 |, of course - | 00006b00 20 74 68 69 73 20 20 6f 6e 6c 79 20 20 73 68 6f | this only sho| 00006b10 77 73 20 20 61 0d 20 20 20 20 20 67 65 6e 65 72 |ws a. gener| 00006b20 61 6c 20 74 65 63 68 6e 69 71 75 65 29 2e 0d 0d |al technique)...| 00006b30 20 20 20 20 20 54 68 65 20 6d 61 63 72 6f 20 64 | The macro d| 00006b40 65 66 69 6e 69 74 69 6f 6e 20 6d 69 67 68 74 20 |efinition might | 00006b50 74 68 65 6e 20 62 65 3a 0d 0d 20 20 20 20 20 20 |then be:.. | 00006b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 4c | PL| 00006b70 41 4e 54 20 20 4d 41 43 52 4f 0d 20 20 20 20 20 |ANT MACRO. | 00006b80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 | C| 00006b90 4f 55 4e 54 20 20 4d 53 45 54 20 20 20 20 30 0d |OUNT MSET 0.| 00006ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006bb0 20 20 20 20 25 4c 4f 4f 50 0d 20 20 20 20 20 20 | %LOOP. | 00006bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006bd0 20 20 20 20 20 44 46 42 20 20 20 20 20 24 46 46 | DFB $FF| 00006be0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00006bf0 20 20 20 20 20 43 4f 55 4e 54 20 20 4d 53 45 54 | COUNT MSET| 00006c00 20 20 20 20 40 43 4f 55 4e 54 2b 31 0d 20 20 20 | @COUNT+1. | 00006c10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006c20 20 20 20 20 20 20 20 20 41 49 46 20 20 20 20 20 | AIF | 00006c30 40 43 4f 55 4e 54 3c 40 50 31 2c 25 4c 4f 4f 50 |@COUNT<@P1,%LOOP| 00006c40 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00006c50 20 20 20 20 20 20 20 20 20 20 20 20 45 4e 44 4d | ENDM| 00006c60 0d 0d 20 20 20 20 20 54 6f 20 73 65 65 20 68 6f |.. To see ho| 00006c70 77 20 74 68 69 73 20 77 6f 72 6b 73 2c 20 77 65 |w this works, we| 00006c80 20 63 61 6e 20 65 78 61 6d 69 6e 65 20 65 61 63 | can examine eac| 00006c90 68 20 6c 69 6e 65 20 69 6e 20 74 75 72 6e 2c 20 |h line in turn, | 00006ca0 61 73 73 75 6d 69 6e 67 0d 20 20 20 20 20 74 68 |assuming. th| 00006cb0 61 74 20 74 68 65 20 6d 61 63 72 6f 20 77 61 73 |at the macro was| 00006cc0 20 63 61 6c 6c 65 64 20 77 69 74 68 20 61 20 6c | called with a l| 00006cd0 69 6e 65 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |ine.. | 00006ce0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00006cf0 20 20 20 20 50 4c 41 4e 54 20 20 37 0d 0d 0d 20 | PLANT 7... | 00006d00 20 20 20 20 4c 69 6e 65 20 31 20 3a 20 54 68 69 | Line 1 : Thi| 00006d10 73 20 69 73 20 74 68 65 20 6d 61 63 72 6f 20 64 |s is the macro d| 00006d20 65 66 69 6e 69 74 69 6f 6e 20 6c 69 6e 65 2e 0d |efinition line..| 00006d30 0d 20 20 20 20 20 4c 69 6e 65 20 32 20 3a 20 54 |. Line 2 : T| 00006d40 68 69 73 20 6c 69 6e 65 20 73 65 74 73 20 75 70 |his line sets up| 00006d50 20 61 20 6c 6f 63 61 6c 20 41 54 56 20 63 61 6c | a local ATV cal| 00006d60 6c 65 64 20 43 4f 55 4e 54 2c 20 61 6e 64 20 67 |led COUNT, and g| 00006d70 69 76 65 73 20 69 74 0d 20 20 20 20 20 20 20 20 |ives it. | 00006d80 20 20 20 20 20 20 61 20 73 74 72 69 6e 67 20 76 | a string v| 00006d90 61 6c 75 65 20 6f 66 20 22 30 22 2e 0d 0d 20 20 |alue of "0"... | 00006da0 20 20 20 4c 69 6e 65 20 33 20 3a 20 54 68 69 73 | Line 3 : This| 00006db0 20 69 73 20 61 20 53 65 71 75 65 6e 63 65 20 53 | is a Sequence S| 00006dc0 79 6d 62 6f 6c 20 6d 61 72 6b 69 6e 67 20 74 68 |ymbol marking th| 00006dd0 65 20 74 6f 70 20 6f 66 20 74 68 65 20 6c 6f 6f |e top of the loo| 00006de0 70 2e 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |p.. | 00006df0 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 72 65 | Note that there| 00006e00 20 69 73 20 6e 6f 74 68 69 6e 67 20 65 6c 73 65 | is nothing else| 00006e10 20 6f 6e 20 74 68 65 20 6c 69 6e 65 20 77 69 74 | on the line wit| 00006e20 68 20 69 74 2e 0d 0d 20 20 20 20 20 4c 69 6e 65 |h it... Line| 00006e30 20 34 20 3a 20 54 68 69 73 20 69 73 20 74 68 65 | 4 : This is the| 00006e40 20 44 46 42 20 6c 69 6e 65 20 74 68 61 74 20 70 | DFB line that p| 00006e50 6c 61 6e 74 73 20 74 68 65 20 24 46 46 20 62 79 |lants the $FF by| 00006e60 74 65 20 72 65 71 75 69 72 65 64 2e 0d 0d 20 20 |te required... | 00006e70 20 20 20 4c 69 6e 65 20 35 20 3a 20 54 68 69 73 | Line 5 : This| 00006e80 20 20 6c 69 6e 65 20 20 69 6e 63 72 65 6d 65 6e | line incremen| 00006e90 74 73 20 20 74 68 65 20 20 76 61 6c 75 65 20 20 |ts the value | 00006ea0 6f 66 20 20 43 4f 55 4e 54 2e 20 20 20 41 73 20 |of COUNT. As | 00006eb0 20 74 68 65 0d 20 20 20 20 20 20 20 20 20 20 20 | the. | 00006ec0 20 20 20 41 73 73 65 6d 62 6c 65 72 20 72 65 61 | Assembler rea| 00006ed0 64 73 20 74 68 65 20 6c 69 6e 65 2c 20 20 69 74 |ds the line, it| 00006ee0 20 65 6e 63 6f 75 6e 74 65 72 73 20 22 40 43 4f | encounters "@CO| 00006ef0 55 4e 54 22 2c 20 77 68 69 63 68 0d 20 20 20 20 |UNT", which. | 00006f00 20 20 20 20 20 20 20 20 20 20 69 74 20 72 65 70 | it rep| 00006f10 6c 61 63 65 73 20 77 69 74 68 20 74 68 65 20 63 |laces with the c| 00006f20 75 72 72 65 6e 74 20 73 74 72 69 6e 67 20 76 61 |urrent string va| 00006f30 6c 75 65 20 20 6f 66 20 20 74 68 65 20 20 41 54 |lue of the AT| 00006f40 56 2e 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |V.. | 00006f50 20 54 68 75 73 20 20 74 68 65 20 20 66 69 72 73 | Thus the firs| 00006f60 74 20 20 74 69 6d 65 20 20 74 68 69 73 20 20 6c |t time this l| 00006f70 69 6e 65 20 20 69 73 20 20 65 6e 63 6f 75 6e 74 |ine is encount| 00006f80 65 72 65 64 2c 20 74 68 65 0d 20 20 20 20 20 20 |ered, the. | 00006f90 20 20 20 20 20 20 20 20 41 73 73 65 6d 62 6c 65 | Assemble| 00006fa0 72 20 77 69 6c 6c 20 67 65 6e 65 72 61 74 65 0d |r will generate.| 00006fb0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00006fc0 20 20 20 20 20 20 20 20 20 20 20 20 43 4f 55 4e | COUN| 00006fd0 54 20 20 4d 53 45 54 20 20 30 2b 31 0d 0d 20 20 |T MSET 0+1.. | 00006fe0 20 20 20 20 20 20 20 20 20 20 20 20 54 68 65 20 | The | 00006ff0 73 65 63 6f 6e 64 20 74 69 6d 65 2c 20 69 74 20 |second time, it | 00007000 67 65 6e 65 72 61 74 65 73 0d 0d 20 20 20 20 20 |generates.. | 00007010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007020 20 20 20 20 20 20 43 4f 55 4e 54 20 20 4d 53 45 | COUNT MSE| 00007030 54 20 20 31 2b 31 0d 0d 20 20 20 20 20 20 20 20 |T 1+1.. | 00007040 20 20 20 20 20 20 61 6e 64 20 73 6f 20 6f 6e 2e | and so on.| 00007050 0d 0d 20 20 20 20 20 4c 69 6e 65 20 36 20 3a 20 |.. Line 6 : | 00007060 54 68 69 73 20 20 74 65 73 74 73 20 20 77 68 65 |This tests whe| 00007070 74 68 65 72 20 74 68 65 20 41 73 73 65 6d 62 6c |ther the Assembl| 00007080 65 72 20 69 73 20 74 6f 20 6c 6f 6f 70 20 72 6f |er is to loop ro| 00007090 75 6e 64 20 6f 6e 63 65 0d 20 20 20 20 20 20 20 |und once. | 000070a0 20 20 20 20 20 20 20 6d 6f 72 65 2e 20 20 41 73 | more. As| 000070b0 20 20 77 69 74 68 20 20 6c 69 6e 65 20 20 35 2c | with line 5,| 000070c0 20 20 74 68 65 20 20 41 73 73 65 6d 62 6c 65 72 | the Assembler| 000070d0 20 20 77 69 6c 6c 20 20 72 65 70 6c 61 63 65 0d | will replace.| 000070e0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 000070f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007100 20 20 20 35 30 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 | 50.......G | 00007110 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007120 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 | USING THE 65C| 00007130 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d |02 ASSEMBLER.H..| 00007140 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 00007150 22 40 43 4f 55 4e 54 22 20 77 69 74 68 20 74 68 |"@COUNT" with th| 00007160 65 20 63 75 72 72 65 6e 74 20 76 61 6c 75 65 20 |e current value | 00007170 6f 66 20 74 68 65 20 41 54 56 2e 20 22 40 50 31 |of the ATV. "@P1| 00007180 22 20 69 73 2c 20 6f 66 0d 20 20 20 20 20 20 20 |" is, of. | 00007190 20 20 20 20 20 20 20 63 6f 75 72 73 65 2c 20 20 | course, | 000071a0 72 65 70 6c 61 63 65 64 20 20 62 79 20 20 74 68 |replaced by th| 000071b0 65 20 66 69 72 73 74 20 70 61 72 61 6d 65 74 65 |e first paramete| 000071c0 72 20 6f 66 20 74 68 65 20 6d 61 63 72 6f 2e 0d |r of the macro..| 000071d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 68 | Th| 000071e0 65 20 66 69 72 73 74 20 74 69 6d 65 20 72 6f 75 |e first time rou| 000071f0 6e 64 2c 20 74 68 65 20 6c 69 6e 65 20 70 72 6f |nd, the line pro| 00007200 63 65 73 73 65 64 20 69 73 0d 0d 20 20 20 20 20 |cessed is.. | 00007210 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007220 20 20 20 20 20 20 41 49 46 20 20 20 30 3c 37 2c | AIF 0<7,| 00007230 25 4c 4f 4f 50 0d 0d 20 20 20 20 20 20 20 20 20 |%LOOP.. | 00007240 20 20 20 20 20 77 68 69 63 68 20 69 73 20 74 72 | which is tr| 00007250 75 65 2c 20 20 73 6f 20 74 68 65 20 41 73 73 65 |ue, so the Asse| 00007260 6d 62 6c 65 72 20 73 6b 69 70 73 20 62 61 63 6b |mbler skips back| 00007270 77 61 72 64 73 20 69 6e 20 20 74 68 65 0d 20 20 |wards in the. | 00007280 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 63 72 | macr| 00007290 6f 20 74 6f 20 6c 69 6e 65 20 34 20 61 6e 64 20 |o to line 4 and | 000072a0 72 65 73 75 6d 65 73 20 70 72 6f 63 65 73 73 69 |resumes processi| 000072b0 6e 67 20 66 72 6f 6d 20 74 68 65 72 65 2e 0d 0d |ng from there...| 000072c0 0d 0d 20 20 20 20 20 1b 2d 01 31 30 2e 33 2e 31 |.. .-.10.3.1| 000072d0 2e 32 20 4c 6f 6f 70 73 20 61 63 63 65 73 73 69 |.2 Loops accessi| 000072e0 6e 67 20 6d 61 63 72 6f 20 70 61 72 61 6d 65 74 |ng macro paramet| 000072f0 65 72 73 1b 2d 00 0d 0d 0d 20 20 20 20 20 41 6e |ers.-.... An| 00007300 6f 74 68 65 72 20 20 66 72 65 71 75 65 6e 74 6c |other frequentl| 00007310 79 2d 6e 65 65 64 65 64 20 20 66 6f 72 6d 20 20 |y-needed form | 00007320 6f 66 20 6c 6f 6f 70 20 69 73 20 6f 6e 65 20 69 |of loop is one i| 00007330 6e 20 77 68 69 63 68 20 61 6c 6c 20 74 68 65 0d |n which all the.| 00007340 20 20 20 20 20 70 61 72 61 6d 65 74 65 72 73 20 | parameters | 00007350 6f 66 20 74 68 65 20 20 6d 61 63 72 6f 20 20 61 |of the macro a| 00007360 72 65 20 20 61 63 63 65 73 73 65 64 20 20 69 6e |re accessed in| 00007370 20 20 74 75 72 6e 2e 20 20 53 75 70 70 6f 73 65 | turn. Suppose| 00007380 2c 20 20 66 6f 72 0d 20 20 20 20 20 65 78 61 6d |, for. exam| 00007390 70 6c 65 2c 20 20 79 6f 75 20 6e 65 65 64 20 74 |ple, you need t| 000073a0 6f 20 77 72 69 74 65 20 61 20 6d 61 63 72 6f 20 |o write a macro | 000073b0 54 48 49 4e 47 53 2c 20 20 77 68 6f 73 65 20 70 |THINGS, whose p| 000073c0 61 72 61 6d 65 74 65 72 73 20 61 72 65 0d 20 20 |arameters are. | 000073d0 20 20 20 61 6c 6c 20 6e 75 6d 62 65 72 73 2e 20 | all numbers. | 000073e0 45 61 63 68 20 6e 75 6d 62 65 72 20 69 73 20 74 |Each number is t| 000073f0 6f 20 62 65 20 70 6c 61 6e 74 65 64 20 69 6e 20 |o be planted in | 00007400 61 20 62 79 74 65 20 69 6e 20 74 68 65 20 6f 62 |a byte in the ob| 00007410 6a 65 63 74 0d 20 20 20 20 20 66 69 6c 65 20 77 |ject. file w| 00007420 69 74 68 20 61 20 44 46 42 20 64 69 72 65 63 74 |ith a DFB direct| 00007430 69 76 65 3a 20 74 6f 20 6d 61 6b 65 20 54 48 49 |ive: to make THI| 00007440 4e 47 53 20 69 6e 74 65 72 65 73 74 69 6e 67 2c |NGS interesting,| 00007450 20 74 68 65 20 6e 75 6d 62 65 72 0d 20 20 20 20 | the number. | 00007460 20 6f 66 20 70 61 72 61 6d 65 74 65 72 73 20 6d | of parameters m| 00007470 75 73 74 20 62 65 20 76 61 72 69 61 62 6c 65 2e |ust be variable.| 00007480 0d 0d 20 20 20 20 20 53 75 63 68 20 61 20 20 6d |.. Such a m| 00007490 61 63 72 6f 20 20 69 73 20 20 66 61 69 72 6c 79 |acro is fairly| 000074a0 20 20 73 69 6d 70 6c 65 20 20 74 6f 20 20 77 72 | simple to wr| 000074b0 69 74 65 2c 20 20 62 75 74 20 20 75 73 65 73 20 |ite, but uses | 000074c0 20 61 6e 20 20 41 54 56 0d 20 20 20 20 20 73 75 | an ATV. su| 000074d0 62 73 74 69 74 75 74 69 6f 6e 20 20 74 65 63 68 |bstitution tech| 000074e0 6e 69 71 75 65 20 20 74 68 61 74 20 20 63 61 6e |nique that can| 000074f0 2c 20 20 61 74 20 66 69 72 73 74 20 73 69 67 68 |, at first sigh| 00007500 74 2c 20 20 62 65 20 73 6f 6d 65 77 68 61 74 0d |t, be somewhat.| 00007510 20 20 20 20 20 64 61 75 6e 74 69 6e 67 2e 20 20 | daunting. | 00007520 49 66 20 74 68 65 20 6a 6f 62 20 77 65 72 65 20 |If the job were | 00007530 73 69 6d 70 6c 79 20 74 6f 20 70 6c 61 6e 74 20 |simply to plant | 00007540 74 68 65 20 76 61 6c 75 65 20 6f 66 20 70 61 72 |the value of par| 00007550 61 6d 65 74 65 72 0d 20 20 20 20 20 31 2c 20 74 |ameter. 1, t| 00007560 68 65 20 6c 69 6e 65 20 69 6e 20 74 68 65 20 6d |he line in the m| 00007570 61 63 72 6f 20 74 68 61 74 20 64 6f 65 73 20 69 |acro that does i| 00007580 74 20 77 6f 75 6c 64 20 73 69 6d 70 6c 79 20 62 |t would simply b| 00007590 65 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |e.. | 000075a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000075b0 20 44 46 42 20 20 20 40 50 31 0d 0d 20 20 20 20 | DFB @P1.. | 000075c0 20 48 6f 77 65 76 65 72 2c 20 77 65 20 6e 65 65 | However, we nee| 000075d0 64 20 74 6f 20 61 63 63 65 73 73 20 65 61 63 68 |d to access each| 000075e0 20 70 61 72 61 6d 65 74 65 72 20 69 6e 20 74 75 | parameter in tu| 000075f0 72 6e 3a 20 20 74 68 65 20 41 73 73 65 6d 62 6c |rn: the Assembl| 00007600 65 72 0d 20 20 20 20 20 6d 75 73 74 20 73 6f 6d |er. must som| 00007610 65 68 6f 77 20 62 65 20 6d 61 64 65 20 74 6f 20 |ehow be made to | 00007620 73 65 65 20 22 40 50 31 22 20 74 68 65 20 66 69 |see "@P1" the fi| 00007630 72 73 74 20 74 69 6d 65 20 72 6f 75 6e 64 20 74 |rst time round t| 00007640 68 65 20 20 6c 6f 6f 70 2c 0d 20 20 20 20 20 22 |he loop,. "| 00007650 40 50 32 22 20 20 69 6e 20 20 74 68 65 20 73 65 |@P2" in the se| 00007660 63 6f 6e 64 2c 20 61 6e 64 20 73 6f 20 6f 6e 2e |cond, and so on.| 00007670 20 20 45 66 66 65 63 74 69 76 65 6c 79 2c 20 20 | Effectively, | 00007680 74 68 65 6e 2c 20 20 77 65 20 6e 65 65 64 20 61 |then, we need a| 00007690 0d 20 20 20 20 20 73 75 62 73 74 69 74 75 74 69 |. substituti| 000076a0 6f 6e 20 74 65 63 68 6e 69 71 75 65 20 74 68 61 |on technique tha| 000076b0 74 20 6c 65 74 73 20 75 73 20 20 68 61 76 65 20 |t lets us have | 000076c0 20 61 20 1b 2d 01 76 61 72 69 61 62 6c 65 1b 2d | a .-.variable.-| 000076d0 00 20 20 41 54 56 20 20 6e 61 6d 65 3a 0d 20 20 |. ATV name:. | 000076e0 20 20 20 69 2e 65 2e 20 20 6f 6e 65 20 20 74 68 | i.e. one th| 000076f0 61 74 20 1b 2d 01 66 69 72 73 74 1b 2d 00 20 20 |at .-.first.-. | 00007700 73 75 62 73 74 69 74 75 74 65 73 20 74 68 65 20 |substitutes the | 00007710 6e 75 6d 62 65 72 20 28 22 31 22 2c 20 22 32 22 |number ("1", "2"| 00007720 2c 20 22 33 22 20 65 74 63 29 0d 20 20 20 20 20 |, "3" etc). | 00007730 1b 2d 01 74 68 65 6e 1b 2d 00 20 73 75 62 73 74 |.-.then.-. subst| 00007740 69 74 75 74 65 73 20 66 6f 72 20 74 68 65 20 41 |itutes for the A| 00007750 54 56 20 6e 61 6d 65 20 73 6f 20 66 6f 72 6d 65 |TV name so forme| 00007760 64 2e 0d 0d 20 20 20 20 20 54 68 65 20 41 73 73 |d... The Ass| 00007770 65 6d 62 6c 65 72 20 63 61 6e 20 64 6f 20 74 68 |embler can do th| 00007780 69 73 20 65 61 73 69 6c 79 2c 20 73 69 6e 63 65 |is easily, since| 00007790 20 41 54 56 20 73 75 62 73 74 69 74 75 74 69 6f | ATV substitutio| 000077a0 6e 20 6f 70 65 72 61 74 65 73 0d 20 20 20 20 20 |n operates. | 000077b0 69 6e 20 61 20 68 69 65 72 61 72 63 68 69 63 20 |in a hierarchic | 000077c0 66 61 73 68 69 6f 6e 2e 20 20 46 6f 72 20 65 78 |fashion. For ex| 000077d0 61 6d 70 6c 65 2c 20 73 75 70 70 6f 73 65 20 74 |ample, suppose t| 000077e0 68 61 74 20 61 20 73 6f 75 72 63 65 20 6c 69 6e |hat a source lin| 000077f0 65 0d 20 20 20 20 20 63 6f 6e 74 61 69 6e 73 0d |e. contains.| 00007800 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00007810 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 40 | @| 00007820 28 50 40 43 4f 55 4e 54 29 0d 0d 20 20 20 20 20 |(P@COUNT).. | 00007830 73 6f 6d 65 77 68 65 72 65 2e 0d 0d 20 20 20 20 |somewhere... | 00007840 20 4f 6e 20 73 65 65 69 6e 67 20 74 68 65 20 66 | On seeing the f| 00007850 69 72 73 74 20 22 40 22 20 20 63 68 61 72 61 63 |irst "@" charac| 00007860 74 65 72 2c 20 20 74 68 65 20 20 41 73 73 65 6d |ter, the Assem| 00007870 62 6c 65 72 20 20 70 72 65 70 61 72 65 73 20 20 |bler prepares | 00007880 74 6f 0d 20 20 20 20 20 73 75 62 73 74 69 74 75 |to. substitu| 00007890 74 65 20 61 6e 20 41 54 56 2e 20 49 74 20 66 69 |te an ATV. It fi| 000078a0 6e 64 73 2c 20 74 68 6f 75 67 68 2c 20 74 68 61 |nds, though, tha| 000078b0 74 20 74 68 65 20 6e 65 78 74 20 63 68 61 72 61 |t the next chara| 000078c0 63 74 65 72 20 69 73 20 61 0d 20 20 20 20 20 22 |cter is a. "| 000078d0 28 22 2c 20 73 6f 20 74 68 61 74 20 69 74 20 6e |(", so that it n| 000078e0 6f 77 20 65 78 70 65 63 74 73 20 61 20 62 72 61 |ow expects a bra| 000078f0 63 6b 65 74 65 64 20 65 78 70 72 65 73 73 69 6f |cketed expressio| 00007900 6e 20 72 61 74 68 65 72 20 74 68 61 6e 20 61 6e |n rather than an| 00007910 0d 20 20 20 20 20 41 54 56 20 20 6e 61 6d 65 2e |. ATV name.| 00007920 20 20 49 74 20 6e 6f 74 65 73 20 77 68 65 72 65 | It notes where| 00007930 20 69 74 20 68 61 73 20 67 6f 74 20 74 6f 20 69 | it has got to i| 00007940 6e 20 74 68 65 20 73 6f 75 72 63 65 20 6c 69 6e |n the source lin| 00007950 65 2c 20 20 61 6e 64 0d 20 20 20 20 20 65 78 70 |e, and. exp| 00007960 6c 6f 72 65 73 20 77 69 74 68 69 6e 20 74 68 65 |lores within the| 00007970 20 62 72 61 63 6b 65 74 73 2e 0d 0d 20 20 20 20 | brackets... | 00007980 20 4e 6f 77 2c 20 74 68 6f 75 67 68 2c 20 69 74 | Now, though, it| 00007990 20 73 74 6f 72 65 73 20 20 74 68 65 20 20 63 68 | stores the ch| 000079a0 61 72 61 63 74 65 72 73 20 20 69 74 20 20 66 69 |aracters it fi| 000079b0 6e 64 73 20 20 28 72 61 74 68 65 72 20 20 74 68 |nds (rather th| 000079c0 61 6e 0d 20 20 20 20 20 70 61 73 73 69 6e 67 20 |an. passing | 000079d0 20 74 68 65 6d 20 20 6f 6e 20 20 74 6f 20 62 65 | them on to be| 000079e0 20 61 73 73 65 6d 62 6c 65 64 29 2c 20 61 6e 64 | assembled), and| 000079f0 20 65 78 70 65 63 74 73 20 74 6f 20 65 6e 64 20 | expects to end | 00007a00 75 70 20 77 69 74 68 20 61 0d 20 20 20 20 20 76 |up with a. v| 00007a10 61 6c 69 64 20 41 54 56 20 6e 61 6d 65 20 62 79 |alid ATV name by| 00007a20 20 74 68 65 20 74 69 6d 65 20 69 74 20 67 65 74 | the time it get| 00007a30 73 20 74 6f 20 74 68 65 20 22 29 22 20 63 68 61 |s to the ")" cha| 00007a40 72 61 63 74 65 72 2e 20 49 74 20 6e 6f 74 65 73 |racter. It notes| 00007a50 0d 20 20 20 20 20 74 68 65 20 22 50 22 2c 20 74 |. the "P", t| 00007a60 68 65 6e 20 66 69 6e 64 73 20 74 68 65 20 73 65 |hen finds the se| 00007a70 63 6f 6e 64 20 22 40 22 2e 20 20 54 68 69 73 20 |cond "@". This | 00007a80 6d 61 6b 65 73 20 69 74 20 74 72 79 20 20 61 67 |makes it try ag| 00007a90 61 69 6e 20 20 74 6f 0d 20 20 20 20 20 73 75 62 |ain to. sub| 00007aa0 73 74 69 74 75 74 65 20 20 61 6e 20 20 41 54 56 |stitute an ATV| 00007ab0 2c 20 20 61 6e 64 20 20 74 68 69 73 20 20 74 69 |, and this ti| 00007ac0 6d 65 20 20 69 74 20 66 69 6e 64 73 20 61 20 72 |me it finds a r| 00007ad0 65 61 6c 20 41 54 56 20 63 61 6c 6c 65 64 0d 0d |eal ATV called..| 00007ae0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00007af0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007b00 20 20 35 31 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 | 51.......G | 00007b10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007b20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 | USING THE 65C0| 00007b30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d |2 ASSEMBLER.H...| 00007b40 0d 20 20 20 20 20 43 4f 55 4e 54 2c 20 20 77 68 |. COUNT, wh| 00007b50 69 63 68 20 77 65 20 73 68 61 6c 6c 20 73 75 70 |ich we shall sup| 00007b60 70 6f 73 65 20 63 6f 6e 74 61 69 6e 73 20 20 74 |pose contains t| 00007b70 68 65 20 20 73 74 72 69 6e 67 20 20 22 31 22 2e |he string "1".| 00007b80 20 20 41 66 74 65 72 0d 20 20 20 20 20 22 43 4f | After. "CO| 00007b90 55 4e 54 22 20 20 69 74 20 20 66 69 6e 64 73 20 |UNT" it finds | 00007ba0 74 68 65 20 22 29 22 20 65 6e 64 69 6e 67 20 74 |the ")" ending t| 00007bb0 68 65 20 62 72 61 63 6b 65 74 65 64 20 65 78 70 |he bracketed exp| 00007bc0 72 65 73 73 69 6f 6e 3b 20 74 68 75 73 2c 0d 20 |ression; thus,. | 00007bd0 20 20 20 20 77 69 74 68 69 6e 20 74 68 65 20 62 | within the b| 00007be0 72 61 63 6b 65 74 73 20 74 68 65 20 73 74 72 69 |rackets the stri| 00007bf0 6e 67 20 69 74 20 68 61 73 20 62 75 69 6c 74 20 |ng it has built | 00007c00 69 73 20 6e 6f 77 20 22 50 31 22 2e 0d 0d 20 20 |is now "P1"... | 00007c10 20 20 20 48 61 76 69 6e 67 20 65 6e 64 65 64 20 | Having ended | 00007c20 74 68 65 20 62 72 61 63 6b 65 74 65 64 20 65 78 |the bracketed ex| 00007c30 70 72 65 73 73 69 6f 6e 2c 20 74 68 65 20 41 73 |pression, the As| 00007c40 73 65 6d 62 6c 65 72 20 67 6f 65 73 20 62 61 63 |sembler goes bac| 00007c50 6b 20 74 6f 0d 20 20 20 20 20 77 68 65 72 65 20 |k to. where | 00007c60 69 74 20 77 61 73 2e 20 20 54 68 65 20 22 28 50 |it was. The "(P| 00007c70 40 43 4f 55 4e 54 29 22 20 68 61 73 20 70 72 6f |@COUNT)" has pro| 00007c80 76 69 64 65 64 20 74 68 65 20 73 74 72 69 6e 67 |vided the string| 00007c90 20 22 50 31 22 2c 20 20 61 6e 64 0d 20 20 20 20 | "P1", and. | 00007ca0 20 1b 2d 01 74 68 69 73 1b 2d 00 20 20 6e 6f 77 | .-.this.-. now| 00007cb0 20 20 69 73 20 61 20 76 61 6c 69 64 20 41 54 56 | is a valid ATV| 00007cc0 20 6e 61 6d 65 2e 20 20 53 6f 20 69 74 20 70 72 | name. So it pr| 00007cd0 6f 63 65 65 64 73 20 74 6f 20 73 75 62 73 74 69 |oceeds to substi| 00007ce0 74 75 74 65 20 74 68 65 0d 20 20 20 20 20 76 61 |tute the. va| 00007cf0 6c 75 65 20 6f 66 20 41 54 56 20 50 31 2c 20 74 |lue of ATV P1, t| 00007d00 68 65 20 66 69 72 73 74 20 6d 61 63 72 6f 20 70 |he first macro p| 00007d10 61 72 61 6d 65 74 65 72 2c 20 61 73 20 77 65 20 |arameter, as we | 00007d20 69 6e 74 65 6e 64 65 64 2e 0d 0d 0d 20 20 20 20 |intended.... | 00007d30 20 54 6f 20 73 65 65 20 68 6f 77 20 77 65 20 20 | To see how we | 00007d40 6d 69 67 68 74 20 20 75 73 65 20 20 74 68 69 73 |might use this| 00007d50 20 20 74 65 63 68 6e 69 71 75 65 2c 20 20 77 65 | technique, we| 00007d60 20 20 63 61 6e 20 20 63 6f 6e 73 69 64 65 72 20 | can consider | 00007d70 20 61 0d 20 20 20 20 20 64 65 66 69 6e 69 74 69 | a. definiti| 00007d80 6f 6e 20 6f 66 20 54 48 49 4e 47 53 3a 0d 0d 0d |on of THINGS:...| 00007d90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007da0 20 20 20 20 54 48 49 4e 47 53 20 20 4d 41 43 52 | THINGS MACR| 00007db0 4f 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |O. | 00007dc0 20 20 20 20 20 20 43 4f 55 4e 54 20 20 20 4d 53 | COUNT MS| 00007dd0 45 54 20 20 20 31 0d 20 20 20 20 20 20 20 20 20 |ET 1. | 00007de0 20 20 20 20 20 20 20 20 20 20 20 25 4c 4f 4f 50 | %LOOP| 00007df0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00007e00 20 20 20 20 20 20 20 20 20 20 20 20 20 41 49 46 | AIF| 00007e10 20 20 20 20 27 40 28 50 40 43 4f 55 4e 54 29 27 | '@(P@COUNT)'| 00007e20 3d 27 27 2c 25 41 4c 4c 2e 44 4f 4e 45 0d 20 20 |='',%ALL.DONE. | 00007e30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007e40 20 20 20 20 20 20 20 20 20 20 44 46 42 20 20 20 | DFB | 00007e50 20 40 28 50 40 43 4f 55 4e 54 29 0d 20 20 20 20 | @(P@COUNT). | 00007e60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007e70 43 4f 55 4e 54 20 20 20 4d 53 45 54 20 20 20 40 |COUNT MSET @| 00007e80 43 4f 55 4e 54 2b 31 0d 20 20 20 20 20 20 20 20 |COUNT+1. | 00007e90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007ea0 20 20 20 20 41 49 46 20 20 20 20 40 43 4f 55 4e | AIF @COUN| 00007eb0 54 3c 31 30 2c 25 4c 4f 4f 50 0d 20 20 20 20 20 |T<10,%LOOP. | 00007ec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 25 | %| 00007ed0 41 4c 4c 2e 44 4f 4e 45 0d 20 20 20 20 20 20 20 |ALL.DONE. | 00007ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00007ef0 20 20 20 20 20 45 4e 44 4d 0d 0d 20 20 20 20 20 | ENDM.. | 00007f00 54 6f 20 73 65 65 20 68 6f 77 20 74 68 69 73 20 |To see how this | 00007f10 77 6f 72 6b 73 2c 20 77 65 20 63 61 6e 20 65 78 |works, we can ex| 00007f20 61 6d 69 6e 65 20 65 61 63 68 20 6c 69 6e 65 20 |amine each line | 00007f30 69 6e 20 74 75 72 6e 2e 0d 0d 20 20 20 20 20 4c |in turn... L| 00007f40 69 6e 65 20 31 20 3a 20 54 68 69 73 20 69 73 20 |ine 1 : This is | 00007f50 74 68 65 20 6d 61 63 72 6f 20 64 65 66 69 6e 69 |the macro defini| 00007f60 74 69 6f 6e 20 6c 69 6e 65 2e 0d 0d 20 20 20 20 |tion line... | 00007f70 20 4c 69 6e 65 20 32 20 3a 20 54 68 69 73 20 6c | Line 2 : This l| 00007f80 69 6e 65 20 73 65 74 73 20 75 70 20 61 20 6c 6f |ine sets up a lo| 00007f90 63 61 6c 20 41 54 56 20 63 61 6c 6c 65 64 20 43 |cal ATV called C| 00007fa0 4f 55 4e 54 2c 20 61 6e 64 20 67 69 76 65 73 20 |OUNT, and gives | 00007fb0 69 74 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |it. | 00007fc0 20 61 20 73 74 72 69 6e 67 20 76 61 6c 75 65 20 | a string value | 00007fd0 6f 66 20 22 31 22 2e 0d 0d 20 20 20 20 20 4c 69 |of "1"... Li| 00007fe0 6e 65 20 33 20 3a 20 54 68 69 73 20 69 73 20 61 |ne 3 : This is a| 00007ff0 20 53 65 71 75 65 6e 63 65 20 53 79 6d 62 6f 6c | Sequence Symbol| 00008000 20 6d 61 72 6b 69 6e 67 20 74 68 65 20 74 6f 70 | marking the top| 00008010 20 6f 66 20 74 68 65 20 6c 6f 6f 70 2e 0d 0d 20 | of the loop... | 00008020 20 20 20 20 4c 69 6e 65 20 34 20 3a 20 53 69 6e | Line 4 : Sin| 00008030 63 65 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 |ce the number of| 00008040 20 70 61 72 61 6d 65 74 65 72 73 20 6d 75 73 74 | parameters must| 00008050 20 62 65 20 76 61 72 69 61 62 6c 65 2c 20 77 65 | be variable, we| 00008060 20 6e 65 65 64 0d 20 20 20 20 20 20 20 20 20 20 | need. | 00008070 20 20 20 20 74 6f 20 20 74 65 73 74 20 20 77 68 | to test wh| 00008080 65 74 68 65 72 20 77 65 27 76 65 20 70 72 6f 63 |ether we've proc| 00008090 65 73 73 65 64 20 74 68 65 6d 20 61 6c 6c 2e 20 |essed them all. | 000080a0 20 59 6f 75 20 63 61 6e 20 73 65 65 0d 20 20 20 | You can see. | 000080b0 20 20 20 20 20 20 20 20 20 20 20 74 68 65 20 73 | the s| 000080c0 75 62 73 74 69 74 75 74 69 6f 6e 20 74 65 63 68 |ubstitution tech| 000080d0 6e 69 71 75 65 20 64 69 73 63 75 73 73 65 64 20 |nique discussed | 000080e0 61 62 6f 76 65 20 69 6e 20 20 75 73 65 20 20 68 |above in use h| 000080f0 65 72 65 0d 20 20 20 20 20 20 20 20 20 20 20 20 |ere. | 00008100 20 20 74 6f 20 20 63 68 65 63 6b 20 69 66 20 74 | to check if t| 00008110 68 65 20 6e 65 78 74 20 70 61 72 61 6d 65 74 65 |he next paramete| 00008120 72 20 69 73 20 6e 75 6c 6c 20 2d 20 61 6e 79 20 |r is null - any | 00008130 70 61 72 61 6d 65 74 65 72 73 0d 20 20 20 20 20 |parameters. | 00008140 20 20 20 20 20 20 20 20 20 74 68 61 74 20 79 6f | that yo| 00008150 75 20 64 6f 6e 27 74 20 73 75 70 70 6c 79 20 69 |u don't supply i| 00008160 6e 20 61 20 6d 61 63 72 6f 20 20 63 61 6c 6c 20 |n a macro call | 00008170 20 61 72 65 20 20 73 74 72 69 6e 67 73 20 20 6f | are strings o| 00008180 66 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |f. | 00008190 7a 65 72 6f 20 73 69 7a 65 2e 20 49 66 20 74 68 |zero size. If th| 000081a0 65 20 70 61 72 61 6d 65 74 65 72 20 1b 2d 01 69 |e parameter .-.i| 000081b0 73 1b 2d 00 20 6e 75 6c 6c 2c 20 74 68 65 20 41 |s.-. null, the A| 000081c0 73 73 65 6d 62 6c 65 72 20 73 6b 69 70 73 0d 20 |ssembler skips. | 000081d0 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 | for| 000081e0 77 61 72 64 73 20 20 69 6e 20 20 74 68 65 20 20 |wards in the | 000081f0 6d 61 63 72 6f 20 20 75 6e 74 69 6c 20 20 69 74 |macro until it| 00008200 20 67 65 74 73 20 74 6f 20 74 68 65 20 53 65 71 | gets to the Seq| 00008210 75 65 6e 63 65 0d 20 20 20 20 20 20 20 20 20 20 |uence. | 00008220 20 20 20 20 53 79 6d 62 6f 6c 20 25 41 4c 4c 2e | Symbol %ALL.| 00008230 44 4f 4e 45 2e 0d 0d 20 20 20 20 20 4c 69 6e 65 |DONE... Line| 00008240 20 35 20 3a 20 54 68 69 73 20 69 73 20 74 68 65 | 5 : This is the| 00008250 20 44 46 42 20 20 6c 69 6e 65 20 20 74 68 61 74 | DFB line that| 00008260 20 20 70 6c 61 6e 74 73 20 20 74 68 65 20 20 63 | plants the c| 00008270 75 72 72 65 6e 74 20 20 6d 61 63 72 6f 0d 20 20 |urrent macro. | 00008280 20 20 20 20 20 20 20 20 20 20 20 20 70 61 72 61 | para| 00008290 6d 65 74 65 72 20 61 73 20 61 20 62 79 74 65 2e |meter as a byte.| 000082a0 0d 0d 20 20 20 20 20 4c 69 6e 65 20 36 20 3a 20 |.. Line 6 : | 000082b0 54 68 69 73 20 20 6c 69 6e 65 20 20 69 6e 63 72 |This line incr| 000082c0 65 6d 65 6e 74 73 20 20 74 68 65 20 20 76 61 6c |ements the val| 000082d0 75 65 20 20 6f 66 20 43 4f 55 4e 54 2c 20 20 61 |ue of COUNT, a| 000082e0 73 20 69 6e 20 74 68 65 0d 20 20 20 20 20 20 20 |s in the. | 000082f0 20 20 20 20 20 20 20 70 72 65 76 69 6f 75 73 20 | previous | 00008300 65 78 61 6d 70 6c 65 2e 0d 0d 20 20 20 20 20 4c |example... L| 00008310 69 6e 65 20 37 20 3a 20 54 68 69 73 20 74 65 73 |ine 7 : This tes| 00008320 74 73 20 77 68 65 74 68 65 72 20 74 68 65 20 41 |ts whether the A| 00008330 73 73 65 6d 62 6c 65 72 20 69 73 20 74 6f 20 6c |ssembler is to l| 00008340 6f 6f 70 20 20 72 6f 75 6e 64 20 20 6f 6e 63 65 |oop round once| 00008350 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d |. m| 00008360 6f 72 65 2e 20 20 54 68 65 20 20 66 69 6e 61 6c |ore. The final| 00008370 20 20 6d 61 63 72 6f 20 70 61 72 61 6d 65 74 65 | macro paramete| 00008380 72 20 69 73 20 50 39 2c 20 20 73 6f 20 6f 6e 63 |r is P9, so onc| 00008390 65 20 43 4f 55 4e 54 0d 20 20 20 20 20 20 20 20 |e COUNT. | 000083a0 20 20 20 20 20 20 72 65 61 63 68 65 73 20 31 30 | reaches 10| 000083b0 20 74 68 65 20 6d 61 63 72 6f 20 69 73 20 66 69 | the macro is fi| 000083c0 6e 69 73 68 65 64 2e 0d 0d 20 20 20 20 20 4c 69 |nished... Li| 000083d0 6e 65 20 38 20 3a 20 54 68 69 73 20 69 73 20 74 |ne 8 : This is t| 000083e0 68 65 20 53 65 71 75 65 6e 63 65 20 53 79 6d 62 |he Sequence Symb| 000083f0 6f 6c 20 74 68 61 74 20 20 6c 69 6e 65 20 34 20 |ol that line 4 | 00008400 20 73 6b 69 70 73 20 74 6f 20 69 66 20 69 74 0d | skips to if it.| 00008410 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 | fi| 00008420 6e 64 73 20 61 20 6e 75 6c 6c 20 70 61 72 61 6d |nds a null param| 00008430 65 74 65 72 2e 0d 0d 0d 20 20 20 20 20 20 20 20 |eter.... | 00008440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008450 20 20 20 20 20 20 20 20 20 35 32 0d 0d 0d 0d 0d | 52.....| 00008460 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 20 20 |..G | 00008470 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 20 54 | USING T| 00008480 48 45 20 36 35 43 30 32 20 41 53 53 45 4d 42 4c |HE 65C02 ASSEMBL| 00008490 45 52 1b 48 0d 0d 0d 0d 0d 20 20 20 20 20 54 68 |ER.H..... Th| 000084a0 75 73 2c 20 69 66 20 74 68 65 20 6d 61 63 72 6f |us, if the macro| 000084b0 20 77 61 73 20 63 61 6c 6c 65 64 20 77 69 74 68 | was called with| 000084c0 20 61 20 6c 69 6e 65 0d 0d 20 20 20 20 20 20 20 | a line.. | 000084d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000084e0 20 20 54 48 49 4e 47 53 20 20 31 2c 24 46 45 2c | THINGS 1,$FE,| 000084f0 46 52 45 44 2d 31 0d 0d 20 20 20 20 20 74 68 65 |FRED-1.. the| 00008500 20 6c 6f 6f 70 20 77 6f 75 6c 64 20 62 65 20 74 | loop would be t| 00008510 72 61 76 65 72 73 65 64 20 74 68 72 65 65 20 74 |raversed three t| 00008520 69 6d 65 73 2c 20 20 61 6e 64 20 74 68 65 20 6c |imes, and the l| 00008530 69 6e 65 73 20 20 61 63 74 75 61 6c 6c 79 0d 20 |ines actually. | 00008540 20 20 20 20 61 73 73 65 6d 62 6c 65 64 20 77 6f | assembled wo| 00008550 75 6c 64 20 62 65 0d 0d 20 20 20 20 20 20 20 20 |uld be.. | 00008560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008570 20 20 20 20 44 46 42 20 20 20 31 0d 20 20 20 20 | DFB 1. | 00008580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008590 20 20 20 20 20 20 20 20 44 46 42 20 20 20 24 46 | DFB $F| 000085a0 45 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |E. | 000085b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 46 | DF| 000085c0 42 20 20 20 46 52 45 44 2d 31 0d 0d 0d 0d 20 20 |B FRED-1.... | 000085d0 20 20 20 54 68 65 20 20 74 65 63 68 6e 69 71 75 | The techniqu| 000085e0 65 20 20 6f 66 20 20 68 69 65 72 61 72 63 68 69 |e of hierarchi| 000085f0 63 61 6c 20 73 75 62 73 74 69 74 75 74 69 6f 6e |cal substitution| 00008600 2c 20 20 74 68 6f 75 67 68 20 6d 6f 73 74 20 6f |, though most o| 00008610 66 74 65 6e 0d 20 20 20 20 20 75 73 65 64 20 74 |ften. used t| 00008620 6f 20 61 63 63 65 73 73 20 6d 61 63 72 6f 20 70 |o access macro p| 00008630 61 72 61 6d 65 74 65 72 73 20 69 6e 20 74 75 72 |arameters in tur| 00008640 6e 2c 20 20 63 61 6e 20 20 62 65 20 20 75 73 65 |n, can be use| 00008650 64 20 20 69 6e 20 20 6d 61 6e 79 0d 20 20 20 20 |d in many. | 00008660 20 6f 74 68 65 72 20 61 70 70 6c 69 63 61 74 69 | other applicati| 00008670 6f 6e 73 3a 20 20 79 6f 75 20 63 61 6e 20 6e 65 |ons: you can ne| 00008680 73 74 20 73 75 62 73 74 69 74 75 74 69 6f 6e 73 |st substitutions| 00008690 20 74 6f 20 61 73 20 64 65 65 70 20 61 73 20 79 | to as deep as y| 000086a0 6f 75 0d 20 20 20 20 20 61 72 65 20 20 6c 69 6b |ou. are lik| 000086b0 65 6c 79 20 20 74 6f 20 20 6e 65 65 64 2c 20 20 |ely to need, | 000086c0 73 6f 20 20 74 68 61 74 20 20 79 6f 75 20 20 6d |so that you m| 000086d0 69 67 68 74 20 20 77 72 69 74 65 20 20 73 6f 6d |ight write som| 000086e0 65 74 68 69 6e 67 20 61 73 0d 20 20 20 20 20 68 |ething as. h| 000086f0 6f 72 72 65 6e 64 6f 75 73 20 6c 6f 6f 6b 69 6e |orrendous lookin| 00008700 67 20 61 73 0d 0d 20 20 20 20 20 20 20 20 20 20 |g as.. | 00008710 20 20 20 20 20 20 20 20 20 20 20 20 4c 44 41 20 | LDA | 00008720 20 20 23 40 28 58 58 40 28 43 4f 55 4e 54 40 50 | #@(XX@(COUNT@P| 00008730 54 52 29 42 29 0d 0d 20 20 20 20 20 69 66 20 79 |TR)B).. if y| 00008740 6f 75 20 72 65 61 6c 6c 79 20 6e 65 65 64 65 64 |ou really needed| 00008750 20 74 6f 2e 0d 0d 0d 0d 1b 2d 01 31 30 2e 33 2e | to......-.10.3.| 00008760 32 20 43 68 61 6e 67 69 6e 67 20 6d 61 63 72 6f |2 Changing macro| 00008770 20 70 61 72 61 6d 65 74 65 72 73 1b 2d 00 0d 0d | parameters.-...| 00008780 0d 20 20 20 4d 61 63 72 6f 20 70 61 72 61 6d 65 |. Macro parame| 00008790 74 65 72 73 20 61 72 65 20 69 6e 20 66 61 63 74 |ters are in fact| 000087a0 20 6c 6f 63 61 6c 20 41 54 56 73 20 77 69 74 68 | local ATVs with| 000087b0 20 6e 61 6d 65 73 20 20 50 31 2c 20 50 32 2c 20 | names P1, P2, | 000087c0 50 33 20 20 61 6e 64 0d 73 6f 20 6f 6e 2e 20 54 |P3 and.so on. T| 000087d0 68 69 73 20 6d 65 61 6e 73 20 74 68 61 74 20 79 |his means that y| 000087e0 6f 75 20 63 61 6e 20 1b 2d 01 63 68 61 6e 67 65 |ou can .-.change| 000087f0 1b 2d 00 20 74 68 65 6d 20 77 69 74 68 69 6e 20 |.-. them within | 00008800 61 20 6d 61 63 72 6f 20 61 73 20 79 6f 75 20 77 |a macro as you w| 00008810 69 73 68 2e 0d 0d 20 20 20 4f 6e 65 20 20 65 78 |ish... One ex| 00008820 61 6d 70 6c 65 20 20 6f 66 20 20 74 68 69 73 20 |ample of this | 00008830 20 6d 69 67 68 74 20 20 62 65 20 74 6f 20 61 6c | might be to al| 00008840 6c 6f 77 20 74 68 65 20 75 73 65 20 6f 66 20 64 |low the use of d| 00008850 65 66 61 75 6c 74 20 6d 61 63 72 6f 0d 70 61 72 |efault macro.par| 00008860 61 6d 65 74 65 72 73 20 28 61 6c 74 68 6f 75 67 |ameters (althoug| 00008870 68 20 73 65 63 74 69 6f 6e 20 31 30 2e 33 2e 33 |h section 10.3.3| 00008880 20 62 65 6c 6f 77 20 73 68 6f 77 73 20 61 6e 20 | below shows an | 00008890 61 75 74 6f 6d 61 74 69 63 20 77 61 79 20 74 6f |automatic way to| 000088a0 20 64 6f 0d 74 68 69 73 29 2e 20 20 53 75 70 70 | do.this). Supp| 000088b0 6f 73 65 20 74 68 61 74 20 61 20 6d 61 63 72 6f |ose that a macro| 000088c0 20 20 70 61 72 61 6d 65 74 65 72 20 20 73 68 6f | parameter sho| 000088d0 75 6c 64 20 20 62 65 20 20 61 20 20 6e 75 6d 62 |uld be a numb| 000088e0 65 72 2c 20 20 77 68 6f 73 65 0d 64 65 66 61 75 |er, whose.defau| 000088f0 6c 74 20 76 61 6c 75 65 20 69 73 20 31 2e 20 59 |lt value is 1. Y| 00008900 6f 75 20 63 6f 75 6c 64 20 64 65 66 69 6e 65 20 |ou could define | 00008910 69 74 20 61 73 3a 0d 0d 0d 20 20 20 20 20 20 20 |it as:... | 00008920 20 20 20 20 20 20 20 20 20 20 20 20 20 54 45 53 | TES| 00008930 54 20 20 4d 41 43 52 4f 0d 20 20 20 20 20 20 20 |T MACRO. | 00008940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008950 20 20 20 41 49 46 20 20 20 20 27 40 50 31 27 23 | AIF '@P1'#| 00008960 27 27 2c 25 4e 45 58 54 0d 20 20 20 20 20 20 20 |'',%NEXT. | 00008970 20 20 20 20 20 20 20 20 20 20 20 20 20 50 31 20 | P1 | 00008980 20 20 20 4d 53 45 54 20 20 20 31 0d 20 20 20 20 | MSET 1. | 00008990 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000089a0 25 4e 45 58 54 0d 20 20 20 20 20 20 20 20 20 20 |%NEXT. | 000089b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000089c0 4c 44 41 20 20 20 20 23 40 50 31 0d 20 20 20 20 |LDA #@P1. | 000089d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000089e0 20 20 20 20 20 20 45 4e 44 4d 0d 0d 20 20 20 20 | ENDM.. | 000089f0 20 57 69 74 68 69 6e 20 74 68 69 73 20 65 78 61 | Within this exa| 00008a00 6d 70 6c 65 2c 20 77 65 20 68 61 76 65 3a 0d 0d |mple, we have:..| 00008a10 20 20 20 20 20 4c 69 6e 65 20 31 20 3a 20 54 68 | Line 1 : Th| 00008a20 65 20 6d 61 63 72 6f 20 64 65 66 69 6e 69 74 69 |e macro definiti| 00008a30 6f 6e 20 6c 69 6e 65 2e 0d 0d 20 20 20 20 20 4c |on line... L| 00008a40 69 6e 65 20 32 20 3a 20 54 68 69 73 20 20 74 65 |ine 2 : This te| 00008a50 73 74 73 20 69 66 20 70 61 72 61 6d 65 74 65 72 |sts if parameter| 00008a60 20 31 20 68 61 73 20 62 65 65 6e 20 73 75 70 70 | 1 has been supp| 00008a70 6c 69 65 64 2e 20 20 49 66 20 73 6f 2c 20 69 74 |lied. If so, it| 00008a80 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 |. w| 00008a90 69 6c 6c 20 6e 6f 74 20 62 65 20 61 20 6e 75 6c |ill not be a nul| 00008aa0 6c 20 73 74 72 69 6e 67 2c 20 20 73 6f 20 74 68 |l string, so th| 00008ab0 65 20 20 41 73 73 65 6d 62 6c 65 72 20 20 73 6b |e Assembler sk| 00008ac0 69 70 73 20 20 74 6f 0d 20 20 20 20 20 20 20 20 |ips to. | 00008ad0 20 20 20 20 20 20 25 4e 45 58 54 2e 0d 0d 20 20 | %NEXT... | 00008ae0 20 20 20 4c 69 6e 65 20 33 20 3a 20 54 68 69 73 | Line 3 : This| 00008af0 20 6c 69 6e 65 20 73 65 74 73 20 70 61 72 61 6d | line sets param| 00008b00 65 74 65 72 20 31 20 74 6f 20 74 68 65 20 64 65 |eter 1 to the de| 00008b10 66 61 75 6c 74 20 76 61 6c 75 65 2e 0d 0d 0d 20 |fault value.... | 00008b20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00008b40 35 33 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 |53.......G | 00008b50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008b60 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 32 20 |USING THE 65C02 | 00008b70 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 0d |ASSEMBLER.H.....| 00008b80 20 20 20 20 20 4c 69 6e 65 20 34 20 3a 20 54 68 | Line 4 : Th| 00008b90 69 73 20 69 73 20 74 68 65 20 20 53 65 71 75 65 |is is the Seque| 00008ba0 6e 63 65 20 53 79 6d 62 6f 6c 20 73 6b 69 70 70 |nce Symbol skipp| 00008bb0 65 64 20 74 6f 20 69 66 20 74 68 65 20 70 61 72 |ed to if the par| 00008bc0 61 6d 65 74 65 72 0d 20 20 20 20 20 20 20 20 20 |ameter. | 00008bd0 20 20 20 20 20 69 73 20 6e 6f 74 20 64 65 66 61 | is not defa| 00008be0 75 6c 74 65 64 2e 0d 0d 20 20 20 20 20 4c 69 6e |ulted... Lin| 00008bf0 65 20 35 20 3a 20 54 68 69 73 20 6c 69 6e 65 20 |e 5 : This line | 00008c00 61 63 74 75 61 6c 6c 79 20 75 73 65 73 20 74 68 |actually uses th| 00008c10 65 20 70 61 72 61 6d 65 74 65 72 2e 20 20 49 74 |e parameter. It| 00008c20 20 77 69 6c 6c 20 61 73 73 65 6d 62 6c 65 0d 20 | will assemble. | 00008c30 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 72 | cor| 00008c40 72 65 63 74 6c 79 20 65 76 65 6e 20 69 66 20 74 |rectly even if t| 00008c50 68 65 20 70 61 72 61 6d 65 74 65 72 20 77 61 73 |he parameter was| 00008c60 20 6e 6f 74 20 67 69 76 65 6e 2c 20 20 73 69 6e | not given, sin| 00008c70 63 65 20 69 6e 0d 20 20 20 20 20 20 20 20 20 20 |ce in. | 00008c80 20 20 20 20 74 68 61 74 20 63 61 73 65 20 6c 69 | that case li| 00008c90 6e 65 20 33 20 77 69 6c 6c 20 68 61 76 65 20 73 |ne 3 will have s| 00008ca0 65 74 20 69 74 20 75 70 20 74 6f 20 62 65 20 20 |et it up to be | 00008cb0 74 68 65 20 20 64 65 66 61 75 6c 74 0d 20 20 20 |the default. | 00008cc0 20 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 | value| 00008cd0 2e 0d 0d 0d 1b 2d 01 31 30 2e 33 2e 33 20 53 65 |.....-.10.3.3 Se| 00008ce0 74 74 69 6e 67 20 64 65 66 61 75 6c 74 20 6d 61 |tting default ma| 00008cf0 63 72 6f 20 70 61 72 61 6d 65 74 65 72 73 1b 2d |cro parameters.-| 00008d00 00 0d 0d 0d 20 20 20 54 68 65 20 65 78 61 6d 70 |.... The examp| 00008d10 6c 65 20 61 62 6f 76 65 20 73 68 6f 77 65 64 20 |le above showed | 00008d20 6f 6e 65 20 77 61 79 20 6f 66 20 65 73 74 61 62 |one way of estab| 00008d30 6c 69 73 68 69 6e 67 20 61 20 64 65 66 61 75 6c |lishing a defaul| 00008d40 74 20 76 61 6c 75 65 20 6f 66 0d 61 20 20 6d 61 |t value of.a ma| 00008d50 63 72 6f 20 20 70 61 72 61 6d 65 74 65 72 2c 20 |cro parameter, | 00008d60 20 62 75 74 20 69 6e 20 66 61 63 74 20 74 68 65 | but in fact the| 00008d70 20 41 73 73 65 6d 62 6c 65 72 20 67 69 76 65 73 | Assembler gives| 00008d80 20 79 6f 75 20 61 6e 20 61 75 74 6f 6d 61 74 69 | you an automati| 00008d90 63 0d 61 6e 64 20 65 61 73 79 20 77 61 79 20 6f |c.and easy way o| 00008da0 66 20 64 6f 69 6e 67 20 74 68 69 73 20 77 69 74 |f doing this wit| 00008db0 68 20 74 68 65 20 44 45 46 50 41 52 53 20 64 69 |h the DEFPARS di| 00008dc0 72 65 63 74 69 76 65 2e 0d 0d 20 20 20 54 68 65 |rective... The| 00008dd0 20 65 66 66 65 63 74 20 6f 66 20 74 68 69 73 20 | effect of this | 00008de0 64 69 72 65 63 74 69 76 65 2c 20 20 77 68 69 63 |directive, whic| 00008df0 68 20 79 6f 75 20 20 63 61 6e 20 20 69 73 73 75 |h you can issu| 00008e00 65 20 20 61 74 20 20 61 6e 79 20 20 74 69 6d 65 |e at any time| 00008e10 0d 69 6e 73 69 64 65 20 20 61 20 20 6d 61 63 72 |.inside a macr| 00008e20 6f 2c 20 20 69 73 20 74 6f 20 73 65 74 20 74 68 |o, is to set th| 00008e30 65 20 76 61 6c 75 65 73 20 6f 66 20 61 6e 79 20 |e values of any | 00008e40 6f 66 20 74 68 65 20 6d 61 63 72 6f 20 70 61 72 |of the macro par| 00008e50 61 6d 65 74 65 72 73 0d 50 31 2c 20 50 32 2c 20 |ameters.P1, P2, | 00008e60 50 33 20 61 6e 64 20 73 6f 20 6f 6e 2c 20 1b 2d |P3 and so on, .-| 00008e70 01 75 6e 6c 65 73 73 1b 2d 00 20 74 68 65 79 20 |.unless.-. they | 00008e80 61 72 65 20 1b 2d 01 61 6c 72 65 61 64 79 1b 2d |are .-.already.-| 00008e90 00 20 64 65 66 69 6e 65 64 2e 0d 0d 20 20 20 46 |. defined... F| 00008ea0 6f 72 20 65 78 61 6d 70 6c 65 2c 20 79 6f 75 20 |or example, you | 00008eb0 6d 69 67 68 74 20 63 61 6c 6c 20 61 20 6d 61 63 |might call a mac| 00008ec0 72 6f 20 77 69 74 68 20 61 20 6c 69 6e 65 0d 0d |ro with a line..| 00008ed0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 46 52 45 | FRE| 00008ef0 44 20 20 20 20 31 2c 2c 33 0d 0d 77 68 65 72 65 |D 1,,3..where| 00008f00 20 79 6f 75 20 68 61 76 65 20 64 65 66 69 6e 65 | you have define| 00008f10 64 20 70 61 72 61 6d 65 74 65 72 73 20 31 20 61 |d parameters 1 a| 00008f20 6e 64 20 33 2c 20 62 75 74 20 6e 6f 74 20 70 61 |nd 3, but not pa| 00008f30 72 61 6d 65 74 65 72 20 32 2e 20 49 66 20 74 68 |rameter 2. If th| 00008f40 65 0d 6d 61 63 72 6f 20 6e 6f 77 20 65 78 65 63 |e.macro now exec| 00008f50 75 74 65 73 2c 20 73 61 79 2c 0d 0d 20 20 20 20 |utes, say,.. | 00008f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00008f70 20 20 20 20 20 44 45 46 50 41 52 53 20 20 31 30 | DEFPARS 10| 00008f80 30 2c 32 30 30 2c 33 30 30 0d 0d 74 68 65 20 20 |0,200,300..the | 00008f90 41 73 73 65 6d 62 6c 65 72 20 77 69 6c 6c 20 63 |Assembler will c| 00008fa0 68 65 63 6b 20 74 68 65 20 70 61 72 61 6d 65 74 |heck the paramet| 00008fb0 65 72 73 20 69 6e 20 74 75 72 6e 2e 20 20 50 61 |ers in turn. Pa| 00008fc0 72 61 6d 65 74 65 72 73 20 20 31 20 61 6e 64 20 |rameters 1 and | 00008fd0 33 0d 61 72 65 20 61 6c 72 65 61 64 79 20 64 65 |3.are already de| 00008fe0 66 69 6e 65 64 2c 20 20 73 6f 20 74 68 65 20 20 |fined, so the | 00008ff0 22 31 30 30 22 20 20 61 6e 64 20 20 22 33 30 30 |"100" and "300| 00009000 22 20 20 76 61 6c 75 65 73 20 61 72 65 20 6e 6f |" values are no| 00009010 74 20 20 75 73 65 64 2e 0d 50 61 72 61 6d 65 74 |t used..Paramet| 00009020 65 72 20 20 32 2c 20 20 74 68 6f 75 67 68 2c 20 |er 2, though, | 00009030 20 69 73 20 6e 6f 74 20 79 65 74 20 64 65 66 69 | is not yet defi| 00009040 6e 65 64 2c 20 73 6f 20 69 74 20 69 73 20 73 65 |ned, so it is se| 00009050 74 20 74 6f 20 22 32 30 30 22 20 66 72 6f 6d 0d |t to "200" from.| 00009060 74 68 69 73 20 70 6f 69 6e 74 20 6f 6e 2e 0d 0d |this point on...| 00009070 20 20 20 49 66 20 79 6f 75 20 77 69 73 68 65 64 | If you wished| 00009080 2c 20 73 61 79 2c 20 74 6f 20 65 73 74 61 62 6c |, say, to establ| 00009090 69 73 68 20 61 20 64 65 66 61 75 6c 74 20 20 66 |ish a default f| 000090a0 6f 72 20 20 6f 6e 6c 79 20 1b 2d 01 73 6f 6d 65 |or only .-.some| 000090b0 1b 2d 00 20 20 6f 66 20 20 74 68 65 0d 70 61 72 |.-. of the.par| 000090c0 61 6d 65 74 65 72 73 20 20 6f 66 20 20 61 20 20 |ameters of a | 000090d0 6d 61 63 72 6f 2c 20 20 73 69 6d 70 6c 79 20 73 |macro, simply s| 000090e0 70 65 63 69 66 79 20 6f 6e 6c 79 20 74 68 6f 73 |pecify only thos| 000090f0 65 20 70 61 72 61 6d 65 74 65 72 73 20 69 6e 20 |e parameters in | 00009100 74 68 65 0d 44 45 46 50 41 52 53 20 64 69 72 65 |the.DEFPARS dire| 00009110 63 74 69 76 65 20 61 6e 64 20 64 65 66 61 75 6c |ctive and defaul| 00009120 74 20 74 68 65 20 6f 74 68 65 72 73 2e 20 20 54 |t the others. T| 00009130 68 75 73 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |hus.. | 00009140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009150 20 44 45 46 50 41 52 53 20 2c 2c 2c 34 34 0d 0d | DEFPARS ,,,44..| 00009160 73 65 74 73 20 61 20 64 65 66 61 75 6c 74 20 66 |sets a default f| 00009170 6f 72 20 20 70 61 72 61 6d 65 74 65 72 20 34 2c |or parameter 4,| 00009180 20 20 62 75 74 20 20 68 61 73 20 20 6e 6f 20 20 | but has no | 00009190 65 66 66 65 63 74 20 20 77 68 61 74 73 6f 65 76 |effect whatsoev| 000091a0 65 72 20 20 6f 6e 0d 70 61 72 61 6d 65 74 65 72 |er on.parameter| 000091b0 73 20 20 31 2c 20 32 2c 20 33 2c 20 35 2c 20 36 |s 1, 2, 3, 5, 6| 000091c0 2c 20 37 2c 20 38 20 61 6e 64 20 39 2e 0d 0d 0d |, 7, 8 and 9....| 000091d0 0d 1b 2d 01 31 30 2e 33 2e 34 20 4c 69 73 74 69 |..-.10.3.4 Listi| 000091e0 6e 67 20 63 6f 6e 74 72 6f 6c 20 66 6f 72 20 6d |ng control for m| 000091f0 61 63 72 6f 73 1b 2d 00 0d 0d 0d 20 20 20 49 66 |acros.-.... If| 00009200 20 79 6f 75 20 77 72 69 74 65 20 63 6f 6d 70 6c | you write compl| 00009210 65 78 20 6d 61 63 72 6f 73 20 77 69 74 68 20 6c |ex macros with l| 00009220 6f 74 73 20 6f 66 20 6c 6f 6f 70 73 2c 20 20 79 |ots of loops, y| 00009230 6f 75 20 77 69 6c 6c 20 66 69 6e 64 20 74 68 61 |ou will find tha| 00009240 74 0d 74 68 65 20 20 41 73 73 65 6d 62 6c 65 72 |t.the Assembler| 00009250 20 20 61 63 74 75 61 6c 6c 79 20 20 65 78 65 63 | actually exec| 00009260 75 74 65 73 20 20 61 20 20 6c 61 72 67 65 20 6e |utes a large n| 00009270 75 6d 62 65 72 20 6f 66 20 6c 69 6e 65 73 20 74 |umber of lines t| 00009280 68 61 74 20 6a 75 73 74 0d 63 6f 6e 74 61 69 6e |hat just.contain| 00009290 20 74 68 65 20 41 49 46 2c 20 4d 53 45 54 20 64 | the AIF, MSET d| 000092a0 69 72 65 63 74 69 76 65 73 2c 20 65 74 63 2e 20 |irectives, etc. | 000092b0 54 68 69 73 20 63 61 6e 20 73 77 61 6d 70 20 74 |This can swamp t| 000092c0 68 65 20 6c 69 73 74 69 6e 67 2c 20 61 6e 64 0d |he listing, and.| 000092d0 6d 61 6b 65 20 69 74 20 68 61 72 64 20 74 6f 20 |make it hard to | 000092e0 73 65 65 20 74 68 65 20 61 63 74 75 61 6c 20 64 |see the actual d| 000092f0 69 72 65 63 74 69 76 65 73 20 74 68 61 74 20 70 |irectives that p| 00009300 6c 61 6e 74 20 64 61 74 61 20 6f 72 20 63 6f 64 |lant data or cod| 00009310 65 20 20 28 61 73 0d 77 65 6c 6c 20 61 73 20 75 |e (as.well as u| 00009320 73 69 6e 67 20 75 70 20 61 20 6c 61 72 67 65 20 |sing up a large | 00009330 61 6d 6f 75 6e 74 20 6f 66 20 70 61 70 65 72 29 |amount of paper)| 00009340 2e 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 00009350 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009360 20 20 20 20 20 35 34 0d 0d 0d 0d 0d 0d 1b 47 20 | 54.......G | 00009370 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009380 20 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 | USING THE 6| 00009390 35 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 |5C02 ASSEMBLER.H| 000093a0 0d 0d 0d 0d 0d 20 20 20 54 6f 20 6f 76 65 72 63 |..... To overc| 000093b0 6f 6d 65 20 74 68 69 73 2c 20 20 6c 69 73 74 20 |ome this, list | 000093c0 6c 65 76 65 6c 20 32 20 77 69 6c 6c 20 6e 6f 74 |level 2 will not| 000093d0 20 6c 69 73 74 20 20 64 69 72 65 63 74 69 76 65 | list directive| 000093e0 73 20 20 73 75 63 68 20 20 61 73 0d 4d 53 45 54 |s such as.MSET| 000093f0 2c 20 20 41 49 46 2c 20 20 65 74 63 2c 20 75 6e |, AIF, etc, un| 00009400 6c 65 73 73 20 74 68 65 79 20 63 6f 6e 74 61 69 |less they contai| 00009410 6e 20 65 72 72 6f 72 73 2e 20 20 49 6e 20 6f 72 |n errors. In or| 00009420 64 65 72 20 74 6f 20 73 65 65 20 1b 2d 01 61 6c |der to see .-.al| 00009430 6c 1b 2d 00 20 74 68 65 0d 6c 69 6e 65 73 20 6f |l.-. the.lines o| 00009440 66 20 61 20 6d 61 63 72 6f 20 65 78 70 61 6e 73 |f a macro expans| 00009450 69 6f 6e 2c 20 20 75 73 65 20 20 6c 69 73 74 20 |ion, use list | 00009460 20 6c 65 76 65 6c 20 33 2e 20 20 28 4e 6f 74 65 | level 3. (Note| 00009470 20 20 74 68 61 74 20 20 6f 75 74 73 69 64 65 0d | that outside.| 00009480 6d 61 63 72 6f 73 2c 20 41 53 45 54 20 61 6e 64 |macros, ASET and| 00009490 20 6f 74 68 65 72 20 73 69 6d 69 6c 61 72 20 64 | other similar d| 000094a0 69 72 65 63 74 69 76 65 73 20 77 69 6c 6c 20 6c |irectives will l| 000094b0 69 73 74 20 61 74 20 6c 65 76 65 6c 20 32 29 2e |ist at level 2).| 000094c0 0d 0d 0d 0d 1b 2d 01 31 30 2e 33 2e 35 20 45 78 |.....-.10.3.5 Ex| 000094d0 69 74 69 6e 67 20 61 20 6d 61 63 72 6f 20 70 72 |iting a macro pr| 000094e0 65 6d 61 74 75 72 65 6c 79 1b 2d 00 0d 0d 0d 20 |ematurely.-.... | 000094f0 20 20 59 6f 75 20 20 6d 61 79 20 20 73 6f 6d 65 | You may some| 00009500 74 69 6d 65 73 20 20 6e 65 65 64 20 20 74 6f 20 |times need to | 00009510 20 65 78 69 74 20 20 61 20 6d 61 63 72 6f 20 61 | exit a macro a| 00009520 73 20 61 20 72 65 73 75 6c 74 20 6f 66 20 61 20 |s a result of a | 00009530 74 65 73 74 2e 0d 44 65 70 65 6e 64 69 6e 67 20 |test..Depending | 00009540 6f 6e 20 63 69 72 63 75 6d 73 74 61 6e 63 65 73 |on circumstances| 00009550 2c 20 20 79 6f 75 20 6d 61 79 20 62 65 20 61 62 |, you may be ab| 00009560 6c 65 20 74 6f 20 75 73 65 20 41 49 46 20 6f 72 |le to use AIF or| 00009570 20 41 47 4f 20 74 6f 20 73 6b 69 70 0d 74 6f 20 | AGO to skip.to | 00009580 74 68 65 20 70 68 79 73 69 63 61 6c 20 65 6e 64 |the physical end| 00009590 20 6f 66 20 74 68 65 20 6d 61 63 72 6f 3b 20 20 | of the macro; | 000095a0 68 6f 77 65 76 65 72 2c 20 79 6f 75 20 63 61 6e |however, you can| 000095b0 20 61 6c 73 6f 20 75 73 65 20 74 68 65 20 4d 45 | also use the ME| 000095c0 58 49 54 0d 64 69 72 65 63 74 69 76 65 2e 20 20 |XIT.directive. | 000095d0 54 68 69 73 20 65 78 69 74 73 20 74 68 65 20 6d |This exits the m| 000095e0 61 63 72 6f 20 69 6d 6d 65 64 69 61 74 65 6c 79 |acro immediately| 000095f0 2c 20 20 77 68 65 72 65 76 65 72 20 69 6e 20 20 |, wherever in | 00009600 74 68 65 20 20 6d 61 63 72 6f 0d 62 6f 64 79 20 |the macro.body | 00009610 69 74 20 69 73 20 65 6e 63 6f 75 6e 74 65 72 65 |it is encountere| 00009620 64 2e 0d 0d 0d 0d 1b 2d 01 31 30 2e 33 2e 36 20 |d......-.10.3.6 | 00009630 43 6f 6d 6d 65 6e 74 20 6c 69 6e 65 73 20 77 69 |Comment lines wi| 00009640 74 68 69 6e 20 6d 61 63 72 6f 73 1b 2d 00 0d 0d |thin macros.-...| 00009650 0d 20 20 20 59 6f 75 20 20 63 61 6e 20 20 69 6e |. You can in| 00009660 63 6c 75 64 65 20 20 63 6f 6d 6d 65 6e 74 20 20 |clude comment | 00009670 6c 69 6e 65 73 20 77 69 74 68 69 6e 20 74 68 65 |lines within the| 00009680 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 6f 66 20 | definitions of | 00009690 6d 61 63 72 6f 73 2c 0d 6a 75 73 74 20 61 73 20 |macros,.just as | 000096a0 69 6e 20 6e 6f 72 6d 61 6c 20 63 6f 64 65 2e 20 |in normal code. | 000096b0 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 61 20 73 |For example, a s| 000096c0 68 6f 72 74 20 6d 61 63 72 6f 20 6d 69 67 68 74 |hort macro might| 000096d0 20 62 65 20 64 65 66 69 6e 65 64 20 61 73 0d 0d | be defined as..| 000096e0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000096f0 20 20 20 20 20 54 45 53 54 20 20 20 4d 41 43 52 | TEST MACR| 00009700 4f 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |O. | 00009710 20 20 20 20 20 20 2a 0d 20 20 20 20 20 20 20 20 | *. | 00009720 20 20 20 20 20 20 20 20 20 20 20 20 2a 20 41 64 | * Ad| 00009730 6a 75 73 74 20 76 61 6c 75 65 20 69 6e 20 50 54 |just value in PT| 00009740 52 30 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |R0. | 00009750 20 20 20 20 20 20 20 2a 0d 20 20 20 20 20 20 20 | *. | 00009760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009770 20 20 20 20 49 4e 43 20 20 20 20 50 54 52 30 0d | INC PTR0.| 00009780 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009790 20 20 20 20 20 20 20 20 20 20 20 45 4e 44 4d 0d | ENDM.| 000097a0 0d 20 20 20 54 68 65 20 74 68 72 65 65 20 63 6f |. The three co| 000097b0 6d 6d 65 6e 74 20 6c 69 6e 65 73 20 77 69 6c 6c |mment lines will| 000097c0 20 62 65 20 73 74 6f 72 65 64 20 69 6e 20 74 68 | be stored in th| 000097d0 65 20 6d 61 63 72 6f 20 64 65 66 69 6e 69 74 69 |e macro definiti| 000097e0 6f 6e 2c 20 61 6e 64 0d 28 69 66 20 74 68 65 20 |on, and.(if the | 000097f0 6c 69 73 74 69 6e 67 20 6c 65 76 65 6c 20 69 73 |listing level is| 00009800 20 73 65 74 20 74 6f 20 32 20 6f 72 20 68 69 67 | set to 2 or hig| 00009810 68 65 72 29 20 20 77 69 6c 6c 20 62 65 20 6c 69 |her) will be li| 00009820 73 74 65 64 20 20 77 68 65 6e 65 76 65 72 0d 79 |sted whenever.y| 00009830 6f 75 20 20 63 61 6c 6c 20 20 74 68 65 20 20 6d |ou call the m| 00009840 61 63 72 6f 2e 20 20 20 54 68 69 73 20 6c 65 74 |acro. This let| 00009850 73 20 79 6f 75 20 6f 75 74 70 75 74 20 63 6f 6d |s you output com| 00009860 6d 65 6e 74 73 20 74 6f 20 64 65 73 63 72 69 62 |ments to describ| 00009870 65 20 74 68 65 0d 61 63 74 69 6f 6e 73 20 6f 66 |e the.actions of| 00009880 20 74 68 65 20 6d 61 63 72 6f 2e 0d 0d 20 20 20 | the macro... | 00009890 54 68 65 20 64 69 73 61 64 76 61 6e 74 61 67 65 |The disadvantage| 000098a0 20 6f 66 20 74 68 69 73 20 74 65 63 68 6e 69 71 | of this techniq| 000098b0 75 65 20 69 73 20 74 68 61 74 20 74 68 65 20 20 |ue is that the | 000098c0 63 6f 6d 6d 65 6e 74 20 20 6c 69 6e 65 73 20 20 |comment lines | 000098d0 61 72 65 0d 73 74 6f 72 65 64 20 20 69 6e 20 20 |are.stored in | 000098e0 74 68 65 69 72 20 65 6e 74 69 72 65 74 79 20 69 |their entirety i| 000098f0 6e 20 6d 65 6d 6f 72 79 20 77 68 65 6e 20 74 68 |n memory when th| 00009900 65 20 6d 61 63 72 6f 20 69 73 20 64 65 66 69 6e |e macro is defin| 00009910 65 64 2c 20 67 69 76 69 6e 67 0d 79 6f 75 20 63 |ed, giving.you c| 00009920 6f 72 72 65 73 70 6f 6e 64 69 6e 67 6c 79 20 6c |orrespondingly l| 00009930 65 73 73 20 73 70 61 63 65 20 66 6f 72 20 74 68 |ess space for th| 00009940 65 20 73 79 6d 62 6f 6c 20 74 61 62 6c 65 2e 0d |e symbol table..| 00009950 0d 20 20 20 57 68 65 6e 20 79 6f 75 20 63 6f 6d |. When you com| 00009960 65 20 74 6f 20 77 72 69 74 69 6e 67 20 63 6f 6d |e to writing com| 00009970 70 6c 65 78 20 6d 61 63 72 6f 73 20 6d 61 6b 69 |plex macros maki| 00009980 6e 67 20 67 72 65 61 74 20 20 75 73 65 20 20 6f |ng great use o| 00009990 66 20 20 41 54 56 73 0d 61 6e 64 20 20 6c 6f 6f |f ATVs.and loo| 000099a0 70 73 2c 20 20 79 6f 75 20 20 77 69 6c 6c 20 20 |ps, you will | 000099b0 66 69 6e 64 20 20 69 74 20 20 6d 6f 73 74 20 61 |find it most a| 000099c0 64 76 61 6e 74 61 67 65 6f 75 73 20 74 6f 20 69 |dvantageous to i| 000099d0 6e 63 6c 75 64 65 20 6c 69 62 65 72 61 6c 0d 61 |nclude liberal.a| 000099e0 6d 6f 75 6e 74 73 20 6f 66 20 20 63 6f 6d 6d 65 |mounts of comme| 000099f0 6e 74 2e 20 20 49 6e 20 20 6f 72 64 65 72 20 20 |nt. In order | 00009a00 74 68 61 74 20 20 74 68 65 73 65 20 20 63 6f 6d |that these com| 00009a10 6d 65 6e 74 73 2c 20 20 77 68 69 63 68 20 20 70 |ments, which p| 00009a20 75 72 65 6c 79 0d 64 6f 63 75 6d 65 6e 74 20 20 |urely.document | 00009a30 68 6f 77 20 20 74 68 65 20 20 6d 61 63 72 6f 20 |how the macro | 00009a40 20 77 6f 72 6b 73 20 20 72 61 74 68 65 72 20 20 | works rather | 00009a50 74 68 61 6e 20 20 74 68 65 20 63 6f 64 65 20 69 |than the code i| 00009a60 74 20 67 65 6e 65 72 61 74 65 73 2c 0d 73 68 6f |t generates,.sho| 00009a70 75 6c 64 6e 27 74 20 75 73 65 20 6d 65 6d 6f 72 |uldn't use memor| 00009a80 79 2c 20 63 6f 6d 6d 65 6e 74 20 6c 69 6e 65 73 |y, comment lines| 00009a90 20 62 65 67 69 6e 6e 69 6e 67 20 77 69 74 68 20 | beginning with | 00009aa0 22 21 22 20 61 72 65 20 1b 2d 01 6e 6f 74 1b 2d |"!" are .-.not.-| 00009ab0 00 20 73 74 6f 72 65 64 2e 0d 54 68 75 73 2c 20 |. stored..Thus, | 00009ac0 79 6f 75 20 63 6f 75 6c 64 20 77 72 69 74 65 20 |you could write | 00009ad0 61 20 6d 61 63 72 6f 20 61 73 0d 0d 20 20 20 20 |a macro as.. | 00009ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009af0 54 45 53 54 20 20 4d 41 43 52 4f 0d 20 20 20 20 |TEST MACRO. | 00009b00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009b10 21 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |!. | 00009b20 20 20 20 20 20 20 21 20 53 65 65 20 69 66 20 66 | ! See if f| 00009b30 69 72 73 74 20 70 61 72 61 6d 65 74 65 72 20 69 |irst parameter i| 00009b40 73 20 6e 75 6c 6c 0d 20 20 20 20 20 20 20 20 20 |s null. | 00009b50 20 20 20 20 20 20 20 20 20 20 20 21 0d 20 20 20 | !. | 00009b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009b70 20 20 20 20 20 20 20 41 49 46 20 20 20 20 27 40 | AIF '@| 00009b80 50 31 27 23 27 27 2c 25 4e 45 58 54 0d 0d 0d 20 |P1'#'',%NEXT... | 00009b90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00009bb0 35 35 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 |55.......G | 00009bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009bd0 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 32 20 |USING THE 65C02 | 00009be0 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 20 |ASSEMBLER.H.... | 00009bf0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009c00 20 20 20 21 0d 20 20 20 20 20 20 20 20 20 20 20 | !. | 00009c10 20 20 20 20 20 20 20 20 20 21 20 49 74 20 69 73 | ! It is| 00009c20 20 6e 75 6c 6c 2c 20 73 6f 20 72 65 73 65 74 20 | null, so reset | 00009c30 69 74 20 74 6f 20 22 31 22 0d 20 20 20 20 20 20 |it to "1". | 00009c40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 21 0d | !.| 00009c50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009c60 20 20 20 20 50 31 20 20 20 20 4d 53 45 54 20 20 | P1 MSET | 00009c70 20 31 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 | 1. | 00009c80 20 20 20 20 20 20 20 25 4e 45 58 54 0d 20 20 20 | %NEXT. | 00009c90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009ca0 20 21 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 | !. | 00009cb0 20 20 20 20 20 20 20 21 20 50 61 72 61 6d 65 74 | ! Paramet| 00009cc0 65 72 20 31 20 6e 6f 77 20 64 65 66 69 6e 69 74 |er 1 now definit| 00009cd0 65 6c 79 20 68 61 73 20 61 20 76 61 6c 75 65 2c |ely has a value,| 00009ce0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00009cf0 20 20 20 20 20 21 20 73 6f 20 77 65 20 63 61 6e | ! so we can| 00009d00 20 75 73 65 20 69 74 0d 20 20 20 20 20 20 20 20 | use it. | 00009d10 20 20 20 20 20 20 20 20 20 20 20 20 21 0d 20 20 | !. | 00009d20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00009d30 20 20 20 20 20 20 20 20 4c 44 41 20 20 20 20 23 | LDA #| 00009d40 40 50 31 0d 20 20 20 20 20 20 20 20 20 20 20 20 |@P1. | 00009d50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 45 4e | EN| 00009d60 44 4d 0d 0d 20 20 20 54 68 65 20 6c 69 6e 65 73 |DM.. The lines| 00009d70 20 62 65 67 69 6e 6e 69 6e 67 20 22 21 22 20 77 | beginning "!" w| 00009d80 69 6c 6c 20 61 70 70 65 61 72 20 69 6e 20 74 68 |ill appear in th| 00009d90 65 20 6c 69 73 74 69 6e 67 20 77 68 65 6e 20 79 |e listing when y| 00009da0 6f 75 20 20 64 65 66 69 6e 65 0d 74 68 65 20 20 |ou define.the | 00009db0 6d 61 63 72 6f 2c 20 20 62 75 74 20 77 69 6c 6c |macro, but will| 00009dc0 20 6e 6f 74 20 62 65 20 73 74 6f 72 65 64 20 61 | not be stored a| 00009dd0 6e 64 20 77 69 6c 6c 20 6e 6f 74 20 61 70 70 65 |nd will not appe| 00009de0 61 72 20 77 68 65 6e 20 74 68 65 20 6d 61 63 72 |ar when the macr| 00009df0 6f 0d 69 73 20 63 61 6c 6c 65 64 2e 0d 0d 0d 0d |o.is called.....| 00009e00 1b 2d 01 31 30 2e 34 20 53 79 73 74 65 6d 20 41 |.-.10.4 System A| 00009e10 54 56 73 1b 2d 00 0d 0d 0d 20 20 20 54 68 65 20 |TVs.-.... The | 00009e20 41 73 73 65 6d 62 6c 65 72 20 70 72 6f 76 69 64 |Assembler provid| 00009e30 65 73 20 61 20 6e 75 6d 62 65 72 20 6f 66 20 20 |es a number of | 00009e40 72 65 61 64 2d 6f 6e 6c 79 20 20 41 54 56 73 20 |read-only ATVs | 00009e50 20 74 68 61 74 20 20 79 6f 75 20 20 63 61 6e 0d | that you can.| 00009e60 73 75 62 73 74 69 74 75 74 65 2e 20 20 20 54 68 |substitute. Th| 00009e70 65 79 20 20 70 72 6f 76 69 64 65 20 20 69 6e 66 |ey provide inf| 00009e80 6f 72 6d 61 74 69 6f 6e 20 20 6f 6e 20 20 74 68 |ormation on th| 00009e90 65 20 20 41 73 73 65 6d 62 6c 65 72 20 20 61 6e |e Assembler an| 00009ea0 64 20 20 74 68 65 0d 65 6e 76 69 72 6f 6e 6d 65 |d the.environme| 00009eb0 6e 74 20 74 68 61 74 20 79 6f 75 20 63 61 6e 20 |nt that you can | 00009ec0 75 73 65 20 74 6f 20 63 6f 6e 74 72 6f 6c 20 61 |use to control a| 00009ed0 73 73 65 6d 62 6c 79 2e 20 45 61 63 68 20 73 79 |ssembly. Each sy| 00009ee0 73 74 65 6d 20 41 54 56 20 6e 61 6d 65 0d 73 74 |stem ATV name.st| 00009ef0 61 72 74 73 20 77 69 74 68 20 61 20 22 24 22 20 |arts with a "$" | 00009f00 63 68 61 72 61 63 74 65 72 3a 20 74 68 65 79 20 |character: they | 00009f10 61 72 65 0d 0d 0d 0d 20 20 20 20 20 24 43 4c 53 |are.... $CLS| 00009f20 54 20 20 20 20 20 54 68 65 20 63 75 72 72 65 6e |T The curren| 00009f30 74 20 63 6f 64 65 20 6c 69 73 74 69 6e 67 20 6c |t code listing l| 00009f40 65 76 65 6c 2e 0d 0d 20 20 20 20 20 24 44 45 46 |evel... $DEF| 00009f50 43 4c 53 54 20 20 54 68 65 20 64 65 66 61 75 6c |CLST The defaul| 00009f60 74 20 63 6f 64 65 20 6c 69 73 74 69 6e 67 20 6c |t code listing l| 00009f70 65 76 65 6c 2e 0d 0d 20 20 20 20 20 24 44 45 46 |evel... $DEF| 00009f80 4c 53 54 20 20 20 54 68 65 20 64 65 66 61 75 6c |LST The defaul| 00009f90 74 20 6c 69 73 74 69 6e 67 20 6c 65 76 65 6c 2e |t listing level.| 00009fa0 0d 0d 20 20 20 20 20 24 46 4c 45 56 45 4c 20 20 |.. $FLEVEL | 00009fb0 20 22 31 22 20 69 66 20 74 68 65 20 63 75 72 72 | "1" if the curr| 00009fc0 65 6e 74 20 66 69 6c 65 20 69 73 20 61 6e 20 49 |ent file is an I| 00009fd0 4e 43 4c 55 44 45 20 66 69 6c 65 3b 20 20 22 30 |NCLUDE file; "0| 00009fe0 22 20 69 66 20 20 69 74 0d 20 20 20 20 20 20 20 |" if it. | 00009ff0 20 20 20 20 20 20 20 20 69 73 20 6e 6f 74 2e 0d | is not..| 0000a000 0d 20 20 20 20 20 24 46 53 20 20 20 20 20 20 20 |. $FS | 0000a010 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 |The number of th| 0000a020 65 20 66 69 6c 69 6e 67 20 73 79 73 74 65 6d 20 |e filing system | 0000a030 69 6e 20 75 73 65 2c 20 20 61 73 20 72 65 74 75 |in use, as retu| 0000a040 72 6e 65 64 20 62 79 0d 20 20 20 20 20 20 20 20 |rned by. | 0000a050 20 20 20 20 20 20 20 4f 53 41 52 47 53 20 77 69 | OSARGS wi| 0000a060 74 68 20 41 3d 30 2c 20 59 3d 30 2e 20 54 68 65 |th A=0, Y=0. The| 0000a070 20 41 63 6f 72 6e 20 44 46 53 20 72 65 74 75 72 | Acorn DFS retur| 0000a080 6e 73 20 22 34 22 2c 20 45 63 6f 6e 65 74 0d 20 |ns "4", Econet. | 0000a090 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 | re| 0000a0a0 74 75 72 6e 73 20 22 35 22 20 61 6e 64 20 41 44 |turns "5" and AD| 0000a0b0 46 53 20 72 65 74 75 72 6e 73 20 22 38 22 2e 0d |FS returns "8"..| 0000a0c0 0d 20 20 20 20 20 24 4c 49 4e 45 20 20 20 20 20 |. $LINE | 0000a0d0 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 |The number of th| 0000a0e0 65 20 63 75 72 72 65 6e 74 20 73 6f 75 72 63 65 |e current source| 0000a0f0 20 6c 69 6e 65 2e 0d 0d 20 20 20 20 20 24 4c 53 | line... $LS| 0000a100 54 20 20 20 20 20 20 54 68 65 20 63 75 72 72 65 |T The curre| 0000a110 6e 74 20 6c 69 73 74 69 6e 67 20 6c 65 76 65 6c |nt listing level| 0000a120 2e 0d 0d 20 20 20 20 20 24 4d 43 20 20 20 20 20 |... $MC | 0000a130 20 20 54 68 65 20 6d 61 63 72 6f 20 63 61 6c 6c | The macro call| 0000a140 20 63 6f 75 6e 74 65 72 2c 20 20 75 73 65 64 20 | counter, used | 0000a150 74 6f 20 67 65 6e 65 72 61 74 65 20 75 6e 69 71 |to generate uniq| 0000a160 75 65 20 6c 61 62 65 6c 73 0d 20 20 20 20 20 20 |ue labels. | 0000a170 20 20 20 20 20 20 20 20 20 77 69 74 68 69 6e 20 | within | 0000a180 6d 61 63 72 6f 73 20 28 73 65 65 20 73 65 63 74 |macros (see sect| 0000a190 69 6f 6e 20 39 2e 35 29 0d 0d 20 20 20 20 20 24 |ion 9.5).. $| 0000a1a0 4d 4c 45 56 45 4c 20 20 20 54 68 65 20 63 75 72 |MLEVEL The cur| 0000a1b0 72 65 6e 74 20 6d 61 63 72 6f 20 6e 65 73 74 69 |rent macro nesti| 0000a1c0 6e 67 20 6c 65 76 65 6c 2e 20 49 66 20 6e 6f 74 |ng level. If not| 0000a1d0 20 69 6e 20 61 20 6d 61 63 72 6f 2c 20 74 68 65 | in a macro, the| 0000a1e0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000a1f0 76 61 6c 75 65 20 69 73 20 22 30 22 2e 0d 0d 20 |value is "0"... | 0000a200 20 20 20 20 24 4f 42 4a 45 43 54 20 20 20 54 68 | $OBJECT Th| 0000a210 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 63 75 |e name of the cu| 0000a220 72 72 65 6e 74 20 6f 62 6a 65 63 74 20 66 69 6c |rrent object fil| 0000a230 65 2c 20 20 77 68 69 63 68 20 6d 61 79 20 69 6e |e, which may in| 0000a240 63 6c 75 64 65 0d 20 20 20 20 20 20 20 20 20 20 |clude. | 0000a250 20 20 20 20 20 6c 65 61 64 69 6e 67 20 6f 72 20 | leading or | 0000a260 74 72 61 69 6c 69 6e 67 20 73 70 61 63 65 73 2e |trailing spaces.| 0000a270 0d 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 0000a280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000a290 20 20 20 20 20 35 36 0d 0d 0d 0d 0d 0d 1b 47 20 | 56.......G | 0000a2a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000a2b0 20 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 | USING THE 6| 0000a2c0 35 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 |5C02 ASSEMBLER.H| 0000a2d0 0d 0d 0d 0d 20 20 20 20 20 24 4f 53 20 20 20 20 |.... $OS | 0000a2e0 20 20 20 54 68 65 20 76 65 72 73 69 6f 6e 20 20 | The version | 0000a2f0 6f 66 20 74 68 65 20 4d 4f 53 20 69 6e 20 75 73 |of the MOS in us| 0000a300 65 2c 20 20 61 73 20 72 65 74 75 72 6e 65 64 20 |e, as returned | 0000a310 62 79 20 20 4f 53 42 59 54 45 0d 20 20 20 20 20 |by OSBYTE. | 0000a320 20 20 20 20 20 20 20 20 20 20 77 69 74 68 20 41 | with A| 0000a330 3d 30 2e 0d 0d 20 20 20 20 20 24 4f 53 48 57 4d |=0... $OSHWM| 0000a340 20 20 20 20 54 68 65 20 70 72 69 6d 61 72 79 20 | The primary | 0000a350 20 4f 53 48 57 4d 20 20 76 61 6c 75 65 20 6f 66 | OSHWM value of| 0000a360 20 74 68 65 20 20 6d 61 63 68 69 6e 65 20 20 72 | the machine r| 0000a370 75 6e 6e 69 6e 67 20 20 74 68 65 0d 20 20 20 20 |unning the. | 0000a380 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 6d | Assem| 0000a390 62 6c 65 72 2e 0d 0d 20 20 20 20 20 24 50 4c 45 |bler... $PLE| 0000a3a0 4e 47 54 48 20 20 54 68 65 20 63 75 72 72 65 6e |NGTH The curren| 0000a3b0 74 20 70 61 67 65 20 64 65 70 74 68 20 75 73 65 |t page depth use| 0000a3c0 64 20 69 6e 20 74 68 65 20 61 73 73 65 6d 62 6c |d in the assembl| 0000a3d0 79 20 6c 69 73 74 69 6e 67 2c 20 61 73 0d 20 20 |y listing, as. | 0000a3e0 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 | set| 0000a3f0 20 62 79 20 74 68 65 20 50 41 47 45 20 64 69 72 | by the PAGE dir| 0000a400 65 63 74 69 76 65 2e 0d 0d 20 20 20 20 20 24 50 |ective... $P| 0000a410 57 49 44 54 48 20 20 20 54 68 65 20 63 75 72 72 |WIDTH The curr| 0000a420 65 6e 74 20 6c 69 6e 65 20 77 69 64 74 68 20 6f |ent line width o| 0000a430 66 20 74 68 65 20 61 73 73 65 6d 62 6c 79 20 6c |f the assembly l| 0000a440 69 73 74 69 6e 67 2c 20 20 61 73 20 73 65 74 0d |isting, as set.| 0000a450 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 | b| 0000a460 79 20 74 68 65 20 50 41 47 45 20 64 69 72 65 63 |y the PAGE direc| 0000a470 74 69 76 65 2e 0d 0d 20 20 20 20 20 24 50 52 49 |tive... $PRI| 0000a480 4e 54 49 4e 47 20 49 6e 64 69 63 61 74 65 73 20 |NTING Indicates | 0000a490 77 68 65 74 68 65 72 20 74 68 65 20 61 73 73 65 |whether the asse| 0000a4a0 6d 62 6c 79 20 6c 69 73 74 69 6e 67 20 69 73 20 |mbly listing is | 0000a4b0 62 65 69 6e 67 20 73 65 6e 74 20 74 6f 0d 20 20 |being sent to. | 0000a4c0 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 65 | the| 0000a4d0 20 73 63 72 65 65 6e 20 6f 72 20 74 6f 20 61 20 | screen or to a | 0000a4e0 70 72 69 6e 74 65 72 20 6f 72 20 66 69 6c 65 2e |printer or file.| 0000a4f0 20 20 54 68 65 20 76 61 6c 75 65 20 72 65 74 75 | The value retu| 0000a500 72 6e 65 64 0d 20 20 20 20 20 20 20 20 20 20 20 |rned. | 0000a510 20 20 20 20 69 73 20 22 30 22 20 69 66 20 74 68 | is "0" if th| 0000a520 65 20 6c 69 73 74 69 6e 67 20 69 73 20 62 65 69 |e listing is bei| 0000a530 6e 67 20 73 65 6e 74 20 74 6f 20 74 68 65 20 73 |ng sent to the s| 0000a540 63 72 65 65 6e 2c 20 20 61 6e 64 0d 20 20 20 20 |creen, and. | 0000a550 20 20 20 20 20 20 20 20 20 20 20 22 2d 31 22 20 | "-1" | 0000a560 69 66 20 69 74 20 69 73 20 62 65 69 6e 67 20 73 |if it is being s| 0000a570 65 6e 74 20 74 6f 20 61 20 70 72 69 6e 74 65 72 |ent to a printer| 0000a580 20 6f 72 20 61 20 66 69 6c 65 2e 0d 0d 20 20 20 | or a file... | 0000a590 20 20 24 53 4f 55 52 43 45 20 20 20 54 68 65 20 | $SOURCE The | 0000a5a0 6e 61 6d 65 20 6f 66 20 74 68 65 20 63 75 72 72 |name of the curr| 0000a5b0 65 6e 74 20 73 6f 75 72 63 65 20 66 69 6c 65 2c |ent source file,| 0000a5c0 20 20 77 68 69 63 68 20 6d 61 79 20 69 6e 63 6c | which may incl| 0000a5d0 75 64 65 0d 20 20 20 20 20 20 20 20 20 20 20 20 |ude. | 0000a5e0 20 20 20 6c 65 61 64 69 6e 67 20 6f 72 20 74 72 | leading or tr| 0000a5f0 61 69 6c 69 6e 67 20 73 70 61 63 65 73 2e 0d 0d |ailing spaces...| 0000a600 20 20 20 20 20 24 54 49 4d 45 20 20 20 20 20 54 | $TIME T| 0000a610 68 65 20 63 75 72 72 65 6e 74 6c 79 2d 73 65 74 |he currently-set| 0000a620 20 74 69 6d 65 73 74 61 6d 70 20 20 73 74 72 69 | timestamp stri| 0000a630 6e 67 2c 20 20 77 68 69 63 68 20 6d 61 79 20 69 |ng, which may i| 0000a640 6e 63 6c 75 64 65 0d 20 20 20 20 20 20 20 20 20 |nclude. | 0000a650 20 20 20 20 20 20 6c 65 61 64 69 6e 67 20 6f 72 | leading or| 0000a660 20 74 72 61 69 6c 69 6e 67 20 73 70 61 63 65 73 | trailing spaces| 0000a670 2e 0d 0d 20 20 20 20 20 24 54 54 4c 20 20 20 20 |... $TTL | 0000a680 20 20 54 68 65 20 63 75 72 72 65 6e 74 6c 79 2d | The currently-| 0000a690 73 65 74 20 70 61 67 65 20 74 69 74 6c 65 20 73 |set page title s| 0000a6a0 74 72 69 6e 67 2c 20 20 77 68 69 63 68 20 6d 61 |tring, which ma| 0000a6b0 79 20 69 6e 63 6c 75 64 65 0d 20 20 20 20 20 20 |y include. | 0000a6c0 20 20 20 20 20 20 20 20 20 6c 65 61 64 69 6e 67 | leading| 0000a6d0 20 6f 72 20 74 72 61 69 6c 69 6e 67 20 73 70 61 | or trailing spa| 0000a6e0 63 65 73 2e 0d 0d 20 20 20 20 20 24 56 45 52 53 |ces... $VERS| 0000a6f0 49 4f 4e 20 20 54 68 65 20 76 65 72 73 69 6f 6e |ION The version| 0000a700 20 6f 66 20 74 68 65 20 41 73 73 65 6d 62 6c 65 | of the Assemble| 0000a710 72 20 69 6e 20 75 73 65 2e 20 20 54 68 69 73 20 |r in use. This | 0000a720 69 73 20 20 72 65 74 75 72 6e 65 64 0d 20 20 20 |is returned. | 0000a730 20 20 20 20 20 20 20 20 20 20 20 20 61 73 20 20 | as | 0000a740 61 20 20 6e 75 6d 65 72 69 63 20 20 73 74 72 69 |a numeric stri| 0000a750 6e 67 2c 20 20 73 6f 20 20 74 68 61 74 20 76 65 |ng, so that ve| 0000a760 72 73 69 6f 6e 20 31 2e 36 30 20 73 65 74 73 20 |rsion 1.60 sets | 0000a770 74 68 65 0d 20 20 20 20 20 20 20 20 20 20 20 20 |the. | 0000a780 20 20 20 73 74 72 69 6e 67 20 74 6f 20 62 65 20 | string to be | 0000a790 22 31 36 30 22 2e 0d 0d 0d 20 20 20 46 6f 72 20 |"160".... For | 0000a7a0 65 78 61 6d 70 6c 65 2c 20 74 68 65 20 6c 69 6e |example, the lin| 0000a7b0 65 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |e. | 0000a7c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f | O| 0000a7d0 52 47 20 20 40 24 4f 53 48 57 4d 0d 0d 63 6f 75 |RG @$OSHWM..cou| 0000a7e0 6c 64 20 62 65 20 75 73 65 64 20 74 6f 20 73 65 |ld be used to se| 0000a7f0 74 20 74 68 65 20 62 61 73 65 20 61 64 64 72 65 |t the base addre| 0000a800 73 73 20 6f 66 20 74 68 65 20 63 6f 64 65 20 74 |ss of the code t| 0000a810 6f 20 74 68 65 20 20 4f 53 48 57 4d 20 20 76 61 |o the OSHWM va| 0000a820 6c 75 65 0d 6f 66 20 20 74 68 65 20 20 6d 61 63 |lue.of the mac| 0000a830 68 69 6e 65 20 62 65 69 6e 67 20 75 73 65 64 2c |hine being used,| 0000a840 20 20 77 69 74 68 6f 75 74 20 74 68 65 20 6e 65 | without the ne| 0000a850 65 64 20 74 6f 20 6b 6e 6f 77 20 77 68 61 74 20 |ed to know what | 0000a860 74 68 61 74 20 76 61 6c 75 65 0d 77 61 73 2e 0d |that value.was..| 0000a870 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |................| 0000a880 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 0000a890 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000a8a0 20 20 20 20 35 37 0d 0d 0d 0d 0d 0d 1b 47 20 20 | 57.......G | 0000a8b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000a8c0 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 | USING THE 65| 0000a8d0 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d |C02 ASSEMBLER.H.| 0000a8e0 0d 0d 0d 1b 2d 01 1b 47 41 70 70 65 6e 64 69 78 |....-..GAppendix| 0000a8f0 20 31 20 3a 20 4f 50 43 4f 44 45 53 20 41 4e 44 | 1 : OPCODES AND| 0000a900 20 41 44 44 52 45 53 53 49 4e 47 20 4d 4f 44 45 | ADDRESSING MODE| 0000a910 53 1b 2d 00 1b 48 0d 0d 0d 20 20 20 54 68 65 20 |S.-..H... The | 0000a920 41 73 73 65 6d 62 6c 65 72 20 73 75 70 70 6f 72 |Assembler suppor| 0000a930 74 73 20 61 6c 6c 20 20 74 68 65 20 20 6f 70 63 |ts all the opc| 0000a940 6f 64 65 73 20 20 6f 66 20 20 74 68 65 20 20 36 |odes of the 6| 0000a950 35 30 32 20 20 61 6e 64 20 20 36 35 43 30 32 0d |502 and 65C02.| 0000a960 70 72 6f 63 65 73 73 6f 72 20 66 61 6d 69 6c 69 |processor famili| 0000a970 65 73 2c 20 75 73 69 6e 67 20 73 74 61 6e 64 61 |es, using standa| 0000a980 72 64 20 4d 4f 53 54 45 4b 20 6d 6e 65 6d 6f 6e |rd MOSTEK mnemon| 0000a990 69 63 73 2e 20 20 46 6f 72 20 64 65 73 63 72 69 |ics. For descri| 0000a9a0 70 74 69 6f 6e 73 0d 6f 66 20 74 68 65 20 6f 70 |ptions.of the op| 0000a9b0 63 6f 64 65 73 2c 20 20 73 65 65 20 66 6f 72 20 |codes, see for | 0000a9c0 65 78 61 6d 70 6c 65 20 20 22 54 68 65 20 41 64 |example "The Ad| 0000a9d0 76 61 6e 63 65 64 20 55 73 65 72 20 47 75 69 64 |vanced User Guid| 0000a9e0 65 20 66 6f 72 20 74 68 65 20 42 42 43 0d 4d 69 |e for the BBC.Mi| 0000a9f0 63 72 6f 22 20 28 66 6f 72 20 36 35 30 32 2d 63 |cro" (for 6502-c| 0000aa00 6f 6d 70 61 74 69 62 6c 65 20 6f 70 63 6f 64 65 |ompatible opcode| 0000aa10 73 29 20 61 6e 64 20 74 68 65 20 20 22 4d 61 73 |s) and the "Mas| 0000aa20 74 65 72 20 52 65 66 65 72 65 6e 63 65 20 4d 61 |ter Reference Ma| 0000aa30 6e 75 61 6c 0d 50 61 72 74 20 32 22 20 20 20 28 |nual.Part 2" (| 0000aa40 62 6f 74 68 20 20 20 36 35 30 32 2d 20 20 61 6e |both 6502- an| 0000aa50 64 20 20 36 35 43 30 32 2d 63 6f 6d 70 61 74 69 |d 65C02-compati| 0000aa60 62 6c 65 20 20 6f 70 63 6f 64 65 73 2c 20 20 61 |ble opcodes, a| 0000aa70 6c 74 68 6f 75 67 68 20 20 69 74 0d 64 65 73 63 |lthough it.desc| 0000aa80 72 69 62 65 73 20 74 68 65 20 42 42 43 20 42 41 |ribes the BBC BA| 0000aa90 53 49 43 20 41 73 73 65 6d 62 6c 65 72 20 73 79 |SIC Assembler sy| 0000aaa0 6e 74 61 78 20 77 68 69 63 68 20 20 63 61 6e 6e |ntax which cann| 0000aab0 6f 74 20 20 62 65 20 20 75 73 65 64 20 20 77 69 |ot be used wi| 0000aac0 74 68 0d 74 68 69 73 20 41 73 73 65 6d 62 6c 65 |th.this Assemble| 0000aad0 72 2e 29 0d 0d 20 20 20 54 68 65 20 36 35 30 32 |r.).. The 6502| 0000aae0 2d 63 6f 6d 70 61 74 69 62 6c 65 20 6f 70 63 6f |-compatible opco| 0000aaf0 64 65 20 6d 6e 65 6d 6f 6e 69 63 73 20 61 76 61 |de mnemonics ava| 0000ab00 69 6c 61 62 6c 65 20 61 72 65 3a 0d 0d 20 41 44 |ilable are:.. AD| 0000ab10 43 20 20 41 4e 44 20 20 41 53 4c 20 20 42 43 43 |C AND ASL BCC| 0000ab20 20 20 42 43 53 20 20 42 45 51 20 20 42 49 54 20 | BCS BEQ BIT | 0000ab30 20 42 4d 49 20 20 42 4e 45 20 20 42 50 4c 20 20 | BMI BNE BPL | 0000ab40 42 52 4b 20 20 42 56 43 20 20 42 56 53 20 20 43 |BRK BVC BVS C| 0000ab50 4c 43 0d 20 43 4c 44 20 20 43 4c 49 20 20 43 4c |LC. CLD CLI CL| 0000ab60 56 20 20 43 4d 50 20 20 43 50 58 20 20 43 50 59 |V CMP CPX CPY| 0000ab70 20 20 44 45 43 20 20 44 45 58 20 20 44 45 59 20 | DEC DEX DEY | 0000ab80 20 45 4f 52 20 20 49 4e 43 20 20 49 4e 58 20 20 | EOR INC INX | 0000ab90 49 4e 59 20 20 4a 4d 50 0d 20 4a 53 52 20 20 4c |INY JMP. JSR L| 0000aba0 44 41 20 20 4c 44 58 20 20 4c 44 59 20 20 4c 53 |DA LDX LDY LS| 0000abb0 52 20 20 4e 4f 50 20 20 4f 52 41 20 20 50 48 41 |R NOP ORA PHA| 0000abc0 20 20 50 48 50 20 20 50 4c 41 20 20 50 4c 50 20 | PHP PLA PLP | 0000abd0 20 52 4f 4c 20 20 52 4f 52 20 20 52 54 49 0d 20 | ROL ROR RTI. | 0000abe0 52 54 53 20 20 53 42 43 20 20 53 45 43 20 20 53 |RTS SBC SEC S| 0000abf0 45 44 20 20 53 45 49 20 20 53 54 41 20 20 53 54 |ED SEI STA ST| 0000ac00 58 20 20 53 54 59 20 20 54 41 58 20 20 54 41 59 |X STY TAX TAY| 0000ac10 20 20 54 53 58 20 20 54 58 53 20 20 54 59 41 0d | TSX TXS TYA.| 0000ac20 0d 20 20 20 54 68 65 20 36 35 43 30 32 2d 6f 6e |. The 65C02-on| 0000ac30 6c 79 20 6d 6e 65 6d 6f 6e 69 63 73 20 61 72 65 |ly mnemonics are| 0000ac40 3a 0d 0d 20 42 52 41 20 20 44 45 41 20 20 49 4e |:.. BRA DEA IN| 0000ac50 41 20 20 50 48 58 20 20 50 48 59 20 20 50 4c 58 |A PHX PHY PLX| 0000ac60 20 20 50 4c 59 20 20 53 54 5a 20 20 54 52 42 20 | PLY STZ TRB | 0000ac70 20 54 53 42 0d 0d 20 20 20 54 68 65 20 6f 70 63 | TSB.. The opc| 0000ac80 6f 64 65 20 43 4c 52 20 63 61 6e 20 62 65 20 75 |ode CLR can be u| 0000ac90 73 65 64 20 61 73 20 61 20 73 79 6e 6f 6e 79 6d |sed as a synonym| 0000aca0 20 66 6f 72 20 53 54 5a 2e 0d 0d 20 20 20 54 68 | for STZ... Th| 0000acb0 65 20 20 61 64 64 72 65 73 73 69 6e 67 20 20 6d |e addressing m| 0000acc0 6f 64 65 73 20 63 6f 6d 6d 6f 6e 20 74 6f 20 62 |odes common to b| 0000acd0 6f 74 68 20 74 68 65 20 36 35 30 32 20 61 6e 64 |oth the 6502 and| 0000ace0 20 36 35 43 30 32 20 70 72 6f 63 65 73 73 6f 72 | 65C02 processor| 0000acf0 73 0d 61 72 65 3a 0d 0d 20 20 20 20 20 20 20 20 |s.are:.. | 0000ad00 20 20 20 20 20 1b 2d 01 4d 6f 64 65 1b 2d 00 20 | .-.Mode.-. | 0000ad10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ad20 20 20 20 20 20 20 20 20 20 20 20 1b 2d 01 53 79 | .-.Sy| 0000ad30 6e 74 61 78 1b 2d 00 0d 0d 20 20 20 20 20 20 20 |ntax.-... | 0000ad40 20 20 20 49 6d 70 6c 69 65 64 20 20 20 20 20 20 | Implied | 0000ad50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ad60 20 20 20 20 20 20 6f 70 0d 20 20 20 20 20 20 20 | op. | 0000ad70 20 20 20 41 63 63 75 6d 75 6c 61 74 6f 72 20 20 | Accumulator | 0000ad80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ad90 20 20 20 20 20 20 6f 70 20 41 20 20 6f 72 20 20 | op A or | 0000ada0 6f 70 0d 20 20 20 20 20 20 20 20 20 20 49 6d 6d |op. Imm| 0000adb0 65 64 69 61 74 65 20 20 20 20 20 20 20 20 20 20 |ediate | 0000adc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000add0 6f 70 20 23 65 78 70 72 38 0d 20 20 20 20 20 20 |op #expr8. | 0000ade0 20 20 20 20 20 20 4c 6f 77 20 62 79 74 65 20 20 | Low byte | 0000adf0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ae00 20 20 20 20 20 20 20 6f 70 20 23 3e 65 78 70 72 | op #>expr| 0000ae10 0d 20 20 20 20 20 20 20 20 20 20 20 20 48 69 67 |. Hig| 0000ae20 68 20 62 79 74 65 20 20 20 20 20 20 20 20 20 20 |h byte | 0000ae30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 70 | op| 0000ae40 20 23 3c 65 78 70 72 0d 20 20 20 20 20 20 20 20 | #<expr. | 0000ae50 20 20 5a 65 72 6f 20 70 61 67 65 20 20 20 20 20 | Zero page | 0000ae60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ae70 20 20 20 20 20 6f 70 20 65 78 70 72 38 0d 20 20 | op expr8. | 0000ae80 20 20 20 20 20 20 20 20 20 20 49 6e 64 65 78 65 | Indexe| 0000ae90 64 20 62 79 20 58 20 20 20 20 20 20 20 20 20 20 |d by X | 0000aea0 20 20 20 20 20 20 20 20 20 20 20 6f 70 20 65 78 | op ex| 0000aeb0 70 72 38 2c 58 0d 20 20 20 20 20 20 20 20 20 20 |pr8,X. | 0000aec0 20 20 49 6e 64 65 78 65 64 20 62 79 20 59 20 20 | Indexed by Y | 0000aed0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000aee0 20 20 20 6f 70 20 65 78 70 72 38 2c 59 0d 20 20 | op expr8,Y. | 0000aef0 20 20 20 20 20 20 20 20 41 62 73 6f 6c 75 74 65 | Absolute| 0000af00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000af10 20 20 20 20 20 20 20 20 20 20 20 6f 70 20 65 78 | op ex| 0000af20 70 72 31 36 0d 20 20 20 20 20 20 20 20 20 20 20 |pr16. | 0000af30 20 49 6e 64 65 78 65 64 20 62 79 20 58 20 20 20 | Indexed by X | 0000af40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000af50 20 20 6f 70 20 65 78 70 72 31 36 2c 58 0d 20 20 | op expr16,X. | 0000af60 20 20 20 20 20 20 20 20 20 20 49 6e 64 65 78 65 | Indexe| 0000af70 64 20 62 79 20 59 20 20 20 20 20 20 20 20 20 20 |d by Y | 0000af80 20 20 20 20 20 20 20 20 20 20 20 6f 70 20 65 78 | op ex| 0000af90 70 72 31 36 2c 59 0d 20 20 20 20 20 20 20 20 20 |pr16,Y. | 0000afa0 20 49 6e 64 69 72 65 63 74 20 70 72 65 2d 69 6e | Indirect pre-in| 0000afb0 64 65 78 65 64 20 20 20 20 20 20 20 20 20 20 20 |dexed | 0000afc0 20 20 20 20 6f 70 20 28 65 78 70 72 38 2c 58 29 | op (expr8,X)| 0000afd0 0d 20 20 20 20 20 20 20 20 20 20 49 6e 64 69 72 |. Indir| 0000afe0 65 63 74 20 70 6f 73 74 2d 69 6e 64 65 78 65 64 |ect post-indexed| 0000aff0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 70 | op| 0000b000 20 28 65 78 70 72 38 29 2c 59 0d 20 20 20 20 20 | (expr8),Y. | 0000b010 20 20 20 20 20 41 62 73 6f 6c 75 74 65 20 69 6e | Absolute in| 0000b020 64 69 72 65 63 74 20 20 20 20 20 20 20 20 20 20 |direct | 0000b030 20 20 20 20 20 20 20 20 6f 70 20 28 65 78 70 72 | op (expr| 0000b040 29 0d 0d 0d 20 20 20 54 68 65 20 61 64 64 72 65 |)... The addre| 0000b050 73 73 69 6e 67 20 6d 6f 64 65 73 20 75 73 61 62 |ssing modes usab| 0000b060 6c 65 20 77 69 74 68 20 74 68 65 20 36 35 43 30 |le with the 65C0| 0000b070 32 20 70 72 6f 63 65 73 73 6f 72 20 6f 6e 6c 79 |2 processor only| 0000b080 20 61 72 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 | are:.. | 0000b090 20 20 20 20 1b 2d 01 4d 6f 64 65 1b 2d 00 20 20 | .-.Mode.-. | 0000b0a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b0b0 20 20 20 20 20 20 20 20 20 20 1b 2d 01 53 79 6e | .-.Syn| 0000b0c0 74 61 78 1b 2d 00 0d 0d 20 20 20 20 20 20 20 20 |tax.-... | 0000b0d0 20 20 5a 65 72 6f 2d 70 61 67 65 20 69 6e 64 65 | Zero-page inde| 0000b0e0 78 65 64 20 20 20 20 20 20 20 20 20 20 20 20 20 |xed | 0000b0f0 20 20 20 20 20 6f 70 20 28 65 78 70 72 38 29 0d | op (expr8).| 0000b100 20 20 20 20 20 20 20 20 20 20 41 62 73 6f 6c 75 | Absolu| 0000b110 74 65 20 69 6e 64 69 72 65 63 74 20 70 72 65 2d |te indirect pre-| 0000b120 69 6e 64 65 78 65 64 20 20 20 20 20 20 6f 70 20 |indexed op | 0000b130 28 65 78 70 72 31 36 2c 58 29 0d 0d 20 20 20 49 |(expr16,X).. I| 0000b140 6e 20 74 68 65 73 65 20 64 65 66 69 6e 69 74 69 |n these definiti| 0000b150 6f 6e 73 2c 20 22 65 78 70 72 38 22 20 72 65 70 |ons, "expr8" rep| 0000b160 72 65 73 65 6e 74 73 20 61 6e 20 38 20 62 69 74 |resents an 8 bit| 0000b170 20 6e 75 6d 62 65 72 3b 20 20 22 65 78 70 72 31 | number; "expr1| 0000b180 36 22 0d 61 20 31 36 20 62 69 74 20 6e 75 6d 62 |6".a 16 bit numb| 0000b190 65 72 3b 20 20 61 6e 64 20 22 65 78 70 72 22 20 |er; and "expr" | 0000b1a0 61 20 76 61 6c 75 65 20 74 68 61 74 20 69 73 20 |a value that is | 0000b1b0 65 69 74 68 65 72 20 38 20 6f 72 20 31 36 20 62 |either 8 or 16 b| 0000b1c0 69 74 73 20 6c 6f 6e 67 2e 0d 0d 0d 20 20 20 20 |its long.... | 0000b1d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b1e0 20 20 20 20 20 20 20 20 20 20 20 20 20 35 38 0d | 58.| 0000b1f0 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 |......G | 0000b200 20 20 20 20 20 20 20 20 20 20 20 20 20 55 53 49 | USI| 0000b210 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 53 53 |NG THE 65C02 ASS| 0000b220 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 1b 2d 01 1b |EMBLER.H.....-..| 0000b230 47 41 70 70 65 6e 64 69 78 20 32 3a 20 41 53 53 |GAppendix 2: ASS| 0000b240 45 4d 42 4c 45 52 20 44 49 52 45 43 54 49 56 45 |EMBLER DIRECTIVE| 0000b250 53 1b 2d 00 1b 48 0d 0d 0d 20 20 20 54 68 65 20 |S.-..H... The | 0000b260 41 73 73 65 6d 62 6c 65 72 20 73 75 70 70 6f 72 |Assembler suppor| 0000b270 74 73 20 61 20 6c 61 72 67 65 20 6e 75 6d 62 65 |ts a large numbe| 0000b280 72 20 6f 66 20 64 69 72 65 63 74 69 76 65 73 2c |r of directives,| 0000b290 20 6f 72 20 70 73 65 75 64 6f 2d 6f 70 73 2e 0d | or pseudo-ops..| 0000b2a0 54 68 69 73 20 20 73 65 63 74 69 6f 6e 20 20 67 |This section g| 0000b2b0 69 76 65 73 20 20 61 20 20 64 65 74 61 69 6c 65 |ives a detaile| 0000b2c0 64 20 20 64 65 66 69 6e 69 74 69 6f 6e 20 20 6f |d definition o| 0000b2d0 66 20 20 65 61 63 68 2c 20 20 61 72 72 61 6e 67 |f each, arrang| 0000b2e0 65 64 20 20 69 6e 0d 61 6c 70 68 61 62 65 74 69 |ed in.alphabeti| 0000b2f0 63 61 6c 20 6f 72 64 65 72 2e 0d 0d 20 20 20 44 |cal order... D| 0000b300 69 72 65 63 74 69 76 65 73 20 66 6f 6c 6c 6f 77 |irectives follow| 0000b310 20 74 68 65 20 6e 6f 72 6d 61 6c 20 73 79 6e 74 | the normal synt| 0000b320 61 78 20 6f 66 20 6f 70 63 6f 64 65 73 2e 20 41 |ax of opcodes. A| 0000b330 6c 6c 20 63 61 6e 20 62 65 20 66 6f 6c 6c 6f 77 |ll can be follow| 0000b340 65 64 0d 62 79 20 20 63 6f 6d 6d 65 6e 74 20 20 |ed.by comment | 0000b350 66 69 65 6c 64 73 20 20 73 74 61 72 74 65 64 20 |fields started | 0000b360 20 77 69 74 68 20 61 20 22 3b 22 20 63 68 61 72 | with a ";" char| 0000b370 61 63 74 65 72 3b 20 20 68 6f 77 65 76 65 72 2c |acter; however,| 0000b380 20 20 6e 6f 74 20 61 6c 6c 0d 64 69 72 65 63 74 | not all.direct| 0000b390 69 76 65 73 20 6d 61 79 20 68 61 76 65 20 6c 61 |ives may have la| 0000b3a0 62 65 6c 73 2e 0d 0d 20 20 20 49 6e 20 74 68 65 |bels... In the| 0000b3b0 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 2c 20 | specification, | 0000b3c0 69 74 65 6d 73 20 65 6e 63 6c 6f 73 65 64 20 69 |items enclosed i| 0000b3d0 6e 20 22 5b 5d 22 20 62 72 61 63 6b 65 74 73 20 |n "[]" brackets | 0000b3e0 61 72 65 20 6f 70 74 69 6f 6e 61 6c 2c 0d 61 6e |are optional,.an| 0000b3f0 64 20 63 61 6e 20 62 65 20 6f 6d 69 74 74 65 64 |d can be omitted| 0000b400 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |................| 0000b410 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |................| 0000b420 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 20 20 20 |............. | 0000b430 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 35 39 | 59| 0000b450 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 |.......G | 0000b460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 53 | US| 0000b470 49 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 53 |ING THE 65C02 AS| 0000b480 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 1b 47 41 |SEMBLER.H.....GA| 0000b490 47 4f 20 20 20 20 1b 48 20 53 6b 69 70 73 20 74 |GO .H Skips t| 0000b4a0 6f 20 61 20 53 65 71 75 65 6e 63 65 20 53 79 6d |o a Sequence Sym| 0000b4b0 62 6f 6c 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 |bol... Sy| 0000b4c0 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 |ntax:.. | 0000b4d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b4e0 20 20 41 47 4f 20 20 3c 73 65 71 75 65 6e 63 65 | AGO <sequence| 0000b4f0 3e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 |>.. Examp| 0000b500 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |le:.. | 0000b510 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b520 20 20 20 41 47 4f 20 20 25 4c 4f 4f 50 0d 0d 0d | AGO %LOOP...| 0000b530 1b 47 41 49 46 20 20 20 20 1b 48 20 53 6b 69 70 |.GAIF .H Skip| 0000b540 73 20 74 6f 20 61 20 53 65 71 75 65 6e 63 65 20 |s to a Sequence | 0000b550 53 79 6d 62 6f 6c 20 69 66 20 61 20 63 6f 6e 64 |Symbol if a cond| 0000b560 69 74 69 6f 6e 20 69 73 20 74 72 75 65 2e 0d 0d |ition is true...| 0000b570 20 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d | Syntax:.| 0000b580 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000b590 20 20 20 20 20 20 41 49 46 20 20 3c 65 78 70 72 | AIF <expr| 0000b5a0 3e 2c 3c 73 65 71 75 65 6e 63 65 3e 0d 20 20 20 |>,<sequence>. | 0000b5b0 20 20 20 20 20 20 20 20 6f 72 0d 20 20 20 20 20 | or. | 0000b5c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b5d0 41 49 46 20 20 3c 73 74 72 69 6e 67 65 78 70 72 |AIF <stringexpr| 0000b5e0 3e 2c 3c 73 65 71 75 65 6e 63 65 3e 0d 0d 20 20 |>,<sequence>.. | 0000b5f0 20 20 20 20 20 20 49 66 20 3c 63 6f 6e 64 69 74 | If <condit| 0000b600 69 6f 6e 3e 20 69 73 20 66 61 6c 73 65 20 61 73 |ion> is false as| 0000b610 73 65 6d 62 6c 79 20 63 6f 6e 74 69 6e 75 65 73 |sembly continues| 0000b620 20 69 6e 20 74 68 65 20 6e 65 78 74 20 6c 69 6e | in the next lin| 0000b630 65 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d |e... Exam| 0000b640 70 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 |ple:.. | 0000b650 20 20 20 20 20 20 20 20 20 20 20 20 41 49 46 20 | AIF | 0000b660 20 27 46 52 45 44 41 27 3e 27 46 52 45 44 27 2c | 'FREDA'>'FRED',| 0000b670 25 4c 4f 4f 50 0d 0d 0d 1b 47 41 49 46 44 45 46 |%LOOP....GAIFDEF| 0000b680 20 1b 48 20 53 6b 69 70 73 20 74 6f 20 61 20 53 | .H Skips to a S| 0000b690 65 71 75 65 6e 63 65 20 53 79 6d 62 6f 6c 20 69 |equence Symbol i| 0000b6a0 66 20 61 20 73 79 6d 62 6f 6c 20 68 61 73 20 62 |f a symbol has b| 0000b6b0 65 65 6e 20 64 65 66 69 6e 65 64 2e 0d 0d 20 20 |een defined... | 0000b6c0 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 | Syntax:.. | 0000b6d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b6e0 20 20 20 20 41 49 46 44 45 46 20 20 3c 73 79 6d | AIFDEF <sym| 0000b6f0 62 6f 6c 3e 2c 3c 73 65 71 75 65 6e 63 65 3e 0d |bol>,<sequence>.| 0000b700 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 6c 65 |. Example| 0000b710 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |:.. | 0000b720 20 20 20 20 20 20 20 20 41 49 46 44 45 46 20 20 | AIFDEF | 0000b730 52 41 4d 2e 43 4f 44 45 2c 25 44 4f 49 4e 47 2e |RAM.CODE,%DOING.| 0000b740 52 41 4d 0d 0d 0d 1b 47 41 49 46 4e 44 45 46 1b |RAM....GAIFNDEF.| 0000b750 48 20 53 6b 69 70 73 20 74 6f 20 61 20 53 65 71 |H Skips to a Seq| 0000b760 75 65 6e 63 65 20 53 79 6d 62 6f 6c 20 69 66 20 |uence Symbol if | 0000b770 61 20 73 79 6d 62 6f 6c 20 68 61 73 20 6e 6f 74 |a symbol has not| 0000b780 20 20 62 65 65 6e 20 20 64 65 66 69 6e 65 64 2e | been defined.| 0000b790 0d 20 20 20 20 20 20 20 20 54 68 65 20 73 79 6e |. The syn| 0000b7a0 74 61 78 20 69 73 20 61 73 20 66 6f 72 20 41 49 |tax is as for AI| 0000b7b0 46 44 45 46 2e 0d 0d 0d 1b 47 41 4c 45 4e 20 20 |FDEF.....GALEN | 0000b7c0 20 1b 48 20 53 65 74 73 20 61 20 67 6c 6f 62 61 | .H Sets a globa| 0000b7d0 6c 20 41 54 56 20 74 6f 20 74 68 65 20 6c 65 6e |l ATV to the len| 0000b7e0 67 74 68 20 6f 66 20 74 68 65 20 6f 70 65 72 61 |gth of the opera| 0000b7f0 6e 64 20 73 74 72 69 6e 67 2e 0d 0d 20 20 20 20 |nd string... | 0000b800 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 | Syntax:.. | 0000b810 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b820 20 20 20 20 3c 6c 61 62 65 6c 3e 20 20 41 4c 45 | <label> ALE| 0000b830 4e 20 20 3c 73 74 72 69 6e 67 3e 0d 0d 20 20 20 |N <string>.. | 0000b840 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 | Example:.. | 0000b850 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b860 20 20 20 53 49 5a 45 20 20 41 4c 45 4e 20 20 27 | SIZE ALEN '| 0000b870 54 68 69 73 20 69 73 20 61 20 73 74 72 69 6e 67 |This is a string| 0000b880 27 0d 0d 0d 0d 0d 0d 0d 20 20 20 20 20 20 20 20 |'....... | 0000b890 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b8a0 20 20 20 20 20 20 20 20 20 36 30 0d 0d 0d 0d 0d | 60.....| 0000b8b0 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 20 20 |..G | 0000b8c0 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 20 54 | USING T| 0000b8d0 48 45 20 36 35 43 30 32 20 41 53 53 45 4d 42 4c |HE 65C02 ASSEMBL| 0000b8e0 45 52 1b 48 0d 0d 0d 0d 1b 47 41 53 43 20 20 20 |ER.H.....GASC | 0000b8f0 20 1b 48 20 44 65 66 69 6e 65 73 20 61 6e 20 41 | .H Defines an A| 0000b900 53 43 49 49 20 73 74 72 69 6e 67 2e 0d 0d 20 20 |SCII string... | 0000b910 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 | Syntax:.. | 0000b920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000b930 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 | [<label>] | 0000b940 20 41 53 43 20 20 3c 73 74 72 69 6e 67 3e 0d 0d | ASC <string>..| 0000b950 20 20 20 20 20 20 20 20 57 69 74 68 69 6e 20 3c | Within <| 0000b960 73 74 72 69 6e 67 3e 20 79 6f 75 20 63 61 6e 20 |string> you can | 0000b970 75 73 65 20 74 68 65 20 74 65 63 68 6e 69 71 75 |use the techniqu| 0000b980 65 73 20 6f 66 20 73 65 63 74 69 6f 6e 20 34 2e |es of section 4.| 0000b990 33 2e 33 20 74 6f 0d 20 20 20 20 20 20 20 20 70 |3.3 to. p| 0000b9a0 6c 61 6e 74 20 20 63 6f 6e 74 72 6f 6c 20 20 63 |lant control c| 0000b9b0 68 61 72 61 63 74 65 72 73 20 6f 72 20 63 68 61 |haracters or cha| 0000b9c0 72 61 63 74 65 72 73 20 77 69 74 68 20 62 69 74 |racters with bit| 0000b9d0 20 37 20 73 65 74 2e 20 20 49 66 20 61 0d 20 20 | 7 set. If a. | 0000b9e0 20 20 20 20 20 20 6c 61 62 65 6c 20 69 73 20 73 | label is s| 0000b9f0 70 65 63 69 66 69 65 64 2c 20 69 74 20 69 73 20 |pecified, it is | 0000ba00 73 65 74 20 74 6f 20 74 68 65 20 61 64 64 72 65 |set to the addre| 0000ba10 73 73 20 6f 66 20 74 68 65 20 66 69 72 73 74 20 |ss of the first | 0000ba20 62 79 74 65 0d 20 20 20 20 20 20 20 20 6f 66 20 |byte. of | 0000ba30 74 68 65 20 73 74 72 69 6e 67 2e 0d 0d 20 20 20 |the string... | 0000ba40 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 | Example:.. | 0000ba50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ba60 20 20 20 20 54 49 54 4c 45 20 20 41 53 43 20 20 | TITLE ASC | 0000ba70 27 53 75 70 65 72 47 61 6d 65 20 33 2e 34 35 27 |'SuperGame 3.45'| 0000ba80 0d 0d 0d 1b 47 41 53 45 54 20 20 20 1b 48 20 53 |....GASET .H S| 0000ba90 65 74 73 20 61 20 67 6c 6f 62 61 6c 20 41 54 56 |ets a global ATV| 0000baa0 20 74 6f 20 63 6f 6e 74 61 69 6e 20 61 20 73 74 | to contain a st| 0000bab0 72 69 6e 67 2e 0d 0d 20 20 20 20 20 20 20 20 53 |ring... S| 0000bac0 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 |yntax:.. | 0000bad0 20 20 20 20 20 3c 6c 61 62 65 6c 3e 20 20 41 53 | <label> AS| 0000bae0 45 54 20 20 3c 73 74 72 69 6e 67 3e 5b 2c 3c 65 |ET <string>[,<e| 0000baf0 78 70 72 31 3e 5b 2c 3c 65 78 70 72 32 3e 5d 5d |xpr1>[,<expr2>]]| 0000bb00 0d 20 20 20 20 20 20 20 20 20 20 20 6f 72 0d 20 |. or. | 0000bb10 20 20 20 20 20 20 20 20 20 20 20 20 3c 6c 61 62 | <lab| 0000bb20 65 6c 3e 20 20 41 53 45 54 20 20 3c 65 78 70 72 |el> ASET <expr| 0000bb30 3e 0d 0d 20 20 20 20 20 20 20 20 54 68 65 20 66 |>.. The f| 0000bb40 69 6e 61 6c 20 74 77 6f 20 70 61 72 61 6d 65 74 |inal two paramet| 0000bb50 65 72 73 20 69 6e 20 74 68 65 20 6f 70 65 72 61 |ers in the opera| 0000bb60 6e 64 20 66 69 65 6c 64 20 61 6c 6c 6f 77 20 74 |nd field allow t| 0000bb70 68 65 20 73 74 72 69 6e 67 0d 20 20 20 20 20 20 |he string. | 0000bb80 20 20 70 61 72 61 6d 65 74 65 72 20 74 6f 20 62 | parameter to b| 0000bb90 65 20 73 6c 69 63 65 64 2e 20 20 42 6f 74 68 20 |e sliced. Both | 0000bba0 61 72 65 20 65 78 70 72 65 73 73 69 6f 6e 73 20 |are expressions | 0000bbb0 20 74 68 61 74 20 20 6d 75 73 74 20 20 6e 6f 74 | that must not| 0000bbc0 0d 20 20 20 20 20 20 20 20 69 6e 76 6f 6c 76 65 |. involve| 0000bbd0 20 66 6f 72 77 61 72 64 20 72 65 66 65 72 65 6e | forward referen| 0000bbe0 63 65 73 2e 20 20 3c 65 78 70 72 31 3e 20 20 73 |ces. <expr1> s| 0000bbf0 70 65 63 69 66 69 65 73 20 74 68 65 20 66 69 72 |pecifies the fir| 0000bc00 73 74 20 62 79 74 65 0d 20 20 20 20 20 20 20 20 |st byte. | 0000bc10 74 6f 20 62 65 20 73 6c 69 63 65 64 20 66 72 6f |to be sliced fro| 0000bc20 6d 20 74 68 65 20 73 74 72 69 6e 67 20 20 28 74 |m the string (t| 0000bc30 68 65 20 66 69 72 73 74 20 62 79 74 65 20 69 6e |he first byte in| 0000bc40 20 74 68 65 20 73 74 72 69 6e 67 20 69 73 0d 20 | the string is. | 0000bc50 20 20 20 20 20 20 20 62 79 74 65 20 31 29 2e 20 | byte 1). | 0000bc60 20 20 3c 65 78 70 72 32 3e 20 20 64 65 66 69 6e | <expr2> defin| 0000bc70 65 73 20 74 68 65 20 73 69 7a 65 20 6f 66 20 74 |es the size of t| 0000bc80 68 65 20 73 6c 69 63 65 3b 20 69 66 20 6f 6d 69 |he slice; if omi| 0000bc90 74 74 65 64 2c 0d 20 20 20 20 20 20 20 20 6f 6e |tted,. on| 0000bca0 65 20 62 79 74 65 20 69 73 20 65 78 74 72 61 63 |e byte is extrac| 0000bcb0 74 65 64 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 |ted... Ex| 0000bcc0 61 6d 70 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 |ample:.. | 0000bcd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000bce0 20 20 20 43 4f 55 4e 54 20 20 41 53 45 54 20 20 | COUNT ASET | 0000bcf0 31 30 30 0d 0d 0d 1b 47 41 53 54 52 20 20 20 1b |100....GASTR .| 0000bd00 48 20 41 6c 6c 6f 63 61 74 65 73 20 73 70 61 63 |H Allocates spac| 0000bd10 65 20 66 6f 72 20 61 20 67 6c 6f 62 61 6c 20 41 |e for a global A| 0000bd20 54 56 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 6e |TV... Syn| 0000bd30 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 |tax:.. | 0000bd40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 6c | <l| 0000bd50 61 62 65 6c 3e 20 20 41 53 54 52 20 20 3c 65 78 |abel> ASTR <ex| 0000bd60 70 72 3e 0d 0d 20 20 20 20 20 20 20 20 3c 65 78 |pr>.. <ex| 0000bd70 70 72 3e 2c 20 77 68 69 63 68 20 6d 75 73 74 20 |pr>, which must | 0000bd80 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 66 6f 72 77 |not contain forw| 0000bd90 61 72 64 20 72 65 66 65 72 65 6e 63 65 73 2c 20 |ard references, | 0000bda0 64 65 66 69 6e 65 73 20 74 68 65 0d 20 20 20 20 |defines the. | 0000bdb0 20 20 20 20 73 70 61 63 65 20 6e 65 65 64 65 64 | space needed| 0000bdc0 2e 20 54 68 65 20 76 61 6c 75 65 20 63 61 6e 20 |. The value can | 0000bdd0 62 65 20 75 70 20 74 6f 20 32 35 35 20 62 79 74 |be up to 255 byt| 0000bde0 65 73 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 |es... Exa| 0000bdf0 6d 70 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 |mple:.. | 0000be00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000be10 20 20 4e 41 4d 45 20 20 41 53 54 52 20 20 31 35 | NAME ASTR 15| 0000be20 30 0d 0d 0d 1b 47 41 53 54 52 49 50 20 1b 48 20 |0....GASTRIP .H | 0000be30 53 65 74 73 20 61 20 67 6c 6f 62 61 6c 20 41 54 |Sets a global AT| 0000be40 56 20 74 6f 20 61 20 20 73 74 72 69 6e 67 20 20 |V to a string | 0000be50 76 61 6c 75 65 2c 20 20 72 65 6d 6f 76 69 6e 67 |value, removing| 0000be60 20 20 6c 65 61 64 69 6e 67 20 20 61 6e 64 0d 20 | leading and. | 0000be70 20 20 20 20 20 20 20 74 72 61 69 6c 69 6e 67 20 | trailing | 0000be80 73 70 61 63 65 73 20 69 6e 20 74 68 65 20 70 72 |spaces in the pr| 0000be90 6f 63 65 73 73 2e 0d 0d 0d 0d 0d 20 20 20 20 20 |ocess...... | 0000bea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000beb0 20 20 20 20 20 20 20 20 20 20 20 20 36 31 0d 0d | 61..| 0000bec0 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 |.....G | 0000bed0 20 20 20 20 20 20 20 20 20 20 20 20 55 53 49 4e | USIN| 0000bee0 47 20 54 48 45 20 36 35 43 30 32 20 41 53 53 45 |G THE 65C02 ASSE| 0000bef0 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 20 20 20 20 20 |MBLER.H.... | 0000bf00 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 | Syntax:.. | 0000bf10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000bf20 20 20 3c 6c 61 62 65 6c 3e 20 20 41 53 54 52 49 | <label> ASTRI| 0000bf30 50 20 20 3c 73 74 72 69 6e 67 3e 0d 0d 20 20 20 |P <string>.. | 0000bf40 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 | Example:.. | 0000bf50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000bf60 20 20 4d 49 44 44 4c 45 20 20 41 53 54 52 49 50 | MIDDLE ASTRIP| 0000bf70 20 20 27 20 20 20 61 61 72 64 76 61 72 6b 20 20 | ' aardvark | 0000bf80 20 27 0d 0d 0d 1b 47 43 41 53 43 20 20 20 1b 48 | '....GCASC .H| 0000bf90 20 54 68 69 73 20 20 69 73 20 20 73 69 6d 69 6c | This is simil| 0000bfa0 61 72 20 20 69 6e 20 20 61 63 74 69 6f 6e 20 20 |ar in action | 0000bfb0 74 6f 20 20 41 53 43 2c 20 20 62 75 74 20 77 69 |to ASC, but wi| 0000bfc0 6c 6c 20 70 6c 61 6e 74 20 61 20 62 79 74 65 0d |ll plant a byte.| 0000bfd0 20 20 20 20 20 20 20 20 63 6f 6e 74 61 69 6e 69 | containi| 0000bfe0 6e 67 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 |ng the number of| 0000bff0 20 63 68 61 72 61 63 74 65 72 73 20 77 69 74 68 | characters with| 0000c000 69 6e 20 74 68 65 20 20 73 74 72 69 6e 67 20 20 |in the string | 0000c010 62 65 66 6f 72 65 0d 20 20 20 20 20 20 20 20 74 |before. t| 0000c020 68 65 20 73 74 72 69 6e 67 20 69 74 73 65 6c 66 |he string itself| 0000c030 2e 0d 0d 0d 0d 1b 47 43 48 4e 20 20 20 20 1b 48 |......GCHN .H| 0000c040 20 43 6c 6f 73 65 73 20 74 68 65 20 63 75 72 72 | Closes the curr| 0000c050 65 6e 74 20 73 6f 75 72 63 65 20 66 69 6c 65 20 |ent source file | 0000c060 61 6e 64 20 73 74 61 72 74 73 20 61 6e 6f 74 68 |and starts anoth| 0000c070 65 72 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 6e |er... Syn| 0000c080 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 |tax:.. | 0000c090 20 20 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 | [<la| 0000c0a0 62 65 6c 3e 5d 20 20 43 48 4e 20 20 3c 66 69 6c |bel>] CHN <fil| 0000c0b0 65 6e 61 6d 65 3e 0d 0d 20 20 20 20 20 20 20 20 |ename>.. | 0000c0c0 54 68 65 20 64 69 72 65 63 74 69 76 65 20 69 73 |The directive is| 0000c0d0 20 6e 6f 74 20 61 6c 6c 6f 77 65 64 20 69 6e 20 | not allowed in | 0000c0e0 61 6e 20 49 4e 43 4c 55 44 45 20 66 69 6c 65 2e |an INCLUDE file.| 0000c0f0 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 6c |.. Exampl| 0000c100 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |e:.. | 0000c110 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 | C| 0000c120 48 4e 20 20 3a 32 2e 4e 45 58 54 42 49 54 0d 0d |HN :2.NEXTBIT..| 0000c130 0d 1b 47 43 48 52 20 20 20 20 1b 48 20 44 65 66 |..GCHR .H Def| 0000c140 69 6e 65 73 20 74 68 65 20 63 68 61 72 61 63 74 |ines the charact| 0000c150 65 72 20 75 73 65 64 20 62 79 20 74 68 65 20 52 |er used by the R| 0000c160 45 50 20 64 69 72 65 63 74 69 76 65 2e 0d 0d 20 |EP directive... | 0000c170 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d | Syntax:..| 0000c180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c190 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 | [<label>] | 0000c1a0 20 43 48 52 20 20 63 68 61 72 61 63 74 65 72 0d | CHR character.| 0000c1b0 0d 20 20 20 20 20 20 20 20 54 68 65 20 20 63 68 |. The ch| 0000c1c0 61 72 61 63 74 65 72 20 69 73 20 73 70 65 63 69 |aracter is speci| 0000c1d0 66 69 65 64 20 6c 69 74 65 72 61 6c 6c 79 2c 20 |fied literally, | 0000c1e0 20 61 6e 64 20 6e 6f 74 20 61 73 20 61 20 63 68 | and not as a ch| 0000c1f0 61 72 61 63 74 65 72 0d 20 20 20 20 20 20 20 20 |aracter. | 0000c200 63 6f 6e 73 74 61 6e 74 2e 0d 0d 20 20 20 20 20 |constant... | 0000c210 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 | Example:.. | 0000c220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c230 20 20 20 20 20 20 20 20 20 20 20 20 20 43 48 52 | CHR| 0000c240 20 20 23 0d 0d 0d 1b 47 43 4c 53 54 20 20 20 1b | #....GCLST .| 0000c250 48 20 53 65 74 73 20 74 68 65 20 63 6f 64 65 20 |H Sets the code | 0000c260 6c 69 73 74 69 6e 67 20 6c 65 76 65 6c 2e 0d 0d |listing level...| 0000c270 20 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d | Syntax:.| 0000c280 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000c290 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d | [<label>]| 0000c2a0 20 20 43 4c 53 54 20 20 5b 3c 65 78 70 72 3e 5d | CLST [<expr>]| 0000c2b0 0d 0d 20 20 20 20 20 20 20 20 3c 65 78 70 72 3e |.. <expr>| 0000c2c0 2c 20 20 77 68 69 63 68 20 6d 75 73 74 20 6e 6f |, which must no| 0000c2d0 74 20 63 6f 6e 74 61 69 6e 20 66 6f 72 77 61 72 |t contain forwar| 0000c2e0 64 20 72 65 66 65 72 65 6e 63 65 73 2c 20 20 67 |d references, g| 0000c2f0 69 76 65 73 20 74 68 65 0d 20 20 20 20 20 20 20 |ives the. | 0000c300 20 6e 65 77 20 20 6c 69 73 74 69 6e 67 20 20 6c | new listing l| 0000c310 65 76 65 6c 2e 20 20 49 66 20 20 6f 6d 69 74 74 |evel. If omitt| 0000c320 65 64 2c 20 20 74 68 65 20 20 6c 65 76 65 6c 20 |ed, the level | 0000c330 69 73 20 72 65 73 65 74 20 74 6f 20 74 68 65 0d |is reset to the.| 0000c340 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 20 | default | 0000c350 66 72 6f 6d 20 74 68 65 20 63 6f 6d 6d 61 6e 64 |from the command| 0000c360 20 6c 69 6e 65 2e 20 54 68 65 20 76 61 6c 75 65 | line. The value| 0000c370 73 20 61 6c 6c 6f 77 65 64 20 61 72 65 3a 0d 0d |s allowed are:..| 0000c380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c390 20 20 20 20 30 20 20 4c 69 73 74 20 6f 6e 6c 79 | 0 List only| 0000c3a0 20 74 68 65 20 66 69 72 73 74 20 33 20 62 79 74 | the first 3 byt| 0000c3b0 65 73 20 70 72 6f 64 75 63 65 64 20 62 79 20 61 |es produced by a| 0000c3c0 6e 79 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |ny. | 0000c3d0 20 20 20 20 20 20 20 20 20 20 6c 69 6e 65 2e 0d | line..| 0000c3e0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 0000c3f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c400 20 20 20 36 32 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 | 62.......G | 0000c410 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c420 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 | USING THE 65C| 0000c430 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d |02 ASSEMBLER.H..| 0000c440 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 0000c450 20 20 20 20 20 20 20 31 20 20 4c 69 73 74 20 61 | 1 List a| 0000c460 6c 6c 20 74 68 65 20 62 79 74 65 73 20 70 6c 61 |ll the bytes pla| 0000c470 6e 74 65 64 20 62 79 20 61 6e 79 20 6c 69 6e 65 |nted by any line| 0000c480 20 65 78 63 65 70 74 20 61 0d 20 20 20 20 20 20 | except a. | 0000c490 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c4a0 20 43 4f 44 45 20 64 69 72 65 63 74 69 76 65 2e | CODE directive.| 0000c4b0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 0000c4c0 20 20 20 20 20 20 32 20 20 4c 69 73 74 20 61 6c | 2 List al| 0000c4d0 6c 20 74 68 65 20 62 79 74 65 73 20 70 6c 61 6e |l the bytes plan| 0000c4e0 74 65 64 20 62 79 20 61 6c 6c 20 6c 69 6e 65 73 |ted by all lines| 0000c4f0 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 |... Examp| 0000c500 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |le:.. | 0000c510 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c520 20 20 20 20 43 4c 53 54 20 20 32 0d 0d 0d 1b 47 | CLST 2....G| 0000c530 43 4f 44 45 20 20 20 1b 48 20 49 6e 63 6c 75 64 |CODE .H Includ| 0000c540 65 73 20 61 20 66 69 6c 65 20 28 73 75 63 68 20 |es a file (such | 0000c550 61 73 20 61 20 20 73 63 72 65 65 6e 20 20 64 75 |as a screen du| 0000c560 6d 70 29 20 20 64 69 72 65 63 74 6c 79 20 20 69 |mp) directly i| 0000c570 6e 74 6f 20 20 74 68 65 0d 20 20 20 20 20 20 20 |nto the. | 0000c580 20 6f 62 6a 65 63 74 20 66 69 6c 65 2e 0d 0d 20 | object file... | 0000c590 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d | Syntax:..| 0000c5a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c5b0 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 | [<label>] | 0000c5c0 43 4f 44 45 20 20 3c 66 69 6c 65 6e 61 6d 65 3e |CODE <filename>| 0000c5d0 0d 0d 20 20 20 20 20 20 20 20 54 68 65 20 73 70 |.. The sp| 0000c5e0 65 63 69 66 69 65 64 20 66 69 6c 65 20 69 73 20 |ecified file is | 0000c5f0 63 6f 70 69 65 64 2c 20 77 69 74 68 20 6e 6f 20 |copied, with no | 0000c600 69 6e 74 65 72 70 72 65 74 61 74 69 6f 6e 2c 20 |interpretation, | 0000c610 64 69 72 65 63 74 6c 79 0d 20 20 20 20 20 20 20 |directly. | 0000c620 20 74 6f 20 20 74 68 65 20 6f 62 6a 65 63 74 20 | to the object | 0000c630 66 69 6c 65 2e 20 20 49 66 20 3c 6c 61 62 65 6c |file. If <label| 0000c640 3e 20 69 73 20 73 70 65 63 69 66 69 65 64 20 69 |> is specified i| 0000c650 74 20 69 73 20 73 65 74 20 74 6f 20 74 68 65 0d |t is set to the.| 0000c660 20 20 20 20 20 20 20 20 61 64 64 72 65 73 73 20 | address | 0000c670 6f 66 20 20 74 68 65 20 20 66 69 72 73 74 20 20 |of the first | 0000c680 62 79 74 65 20 20 63 6f 70 69 65 64 2e 20 20 54 |byte copied. T| 0000c690 68 65 20 20 61 64 64 72 65 73 73 20 20 63 6f 75 |he address cou| 0000c6a0 6e 74 20 20 69 73 0d 20 20 20 20 20 20 20 20 69 |nt is. i| 0000c6b0 6e 63 72 65 61 73 65 64 20 62 79 20 74 68 65 20 |ncreased by the | 0000c6c0 73 69 7a 65 20 6f 66 20 74 68 65 20 66 69 6c 65 |size of the file| 0000c6d0 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 |... Examp| 0000c6e0 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |le:.. | 0000c6f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000c700 20 43 4f 44 45 20 20 53 43 52 44 55 4d 50 0d 0d | CODE SCRDUMP..| 0000c710 0d 1b 47 43 53 54 52 20 20 20 1b 48 20 53 69 6d |..GCSTR .H Sim| 0000c720 69 6c 61 72 20 20 74 6f 20 20 53 54 52 2c 20 20 |ilar to STR, | 0000c730 62 75 74 20 74 68 69 73 20 64 69 72 65 63 74 69 |but this directi| 0000c740 76 65 20 70 6c 61 6e 74 73 20 61 20 62 79 74 65 |ve plants a byte| 0000c750 20 63 6f 6e 74 61 69 6e 69 6e 67 0d 20 20 20 20 | containing. | 0000c760 20 20 20 20 74 68 65 20 6e 75 6d 62 65 72 20 6f | the number o| 0000c770 66 20 63 68 61 72 61 63 74 65 72 73 20 20 69 6e |f characters in| 0000c780 20 20 74 68 65 20 20 73 74 72 69 6e 67 20 20 62 | the string b| 0000c790 65 66 6f 72 65 20 20 74 68 65 20 20 73 74 72 69 |efore the stri| 0000c7a0 6e 67 0d 20 20 20 20 20 20 20 20 69 74 73 65 6c |ng. itsel| 0000c7b0 66 2e 20 20 54 68 65 20 63 6f 75 6e 74 20 69 6e |f. The count in| 0000c7c0 63 6c 75 64 65 73 20 74 68 65 20 24 30 44 20 62 |cludes the $0D b| 0000c7d0 79 74 65 20 74 68 61 74 20 69 73 20 61 75 74 6f |yte that is auto| 0000c7e0 6d 61 74 69 63 61 6c 6c 79 0d 20 20 20 20 20 20 |matically. | 0000c7f0 20 20 61 64 64 65 64 20 61 74 20 74 68 65 20 65 | added at the e| 0000c800 6e 64 20 6f 66 20 74 68 65 20 73 74 72 69 6e 67 |nd of the string| 0000c810 2e 0d 0d 0d 1b 47 44 42 20 20 20 20 20 1b 48 20 |.....GDB .H | 0000c820 54 68 69 73 20 69 73 20 69 64 65 6e 74 69 63 61 |This is identica| 0000c830 6c 20 74 6f 20 44 46 42 2e 0d 0d 1b 47 44 44 42 |l to DFB....GDDB| 0000c840 20 20 20 20 1b 48 20 44 65 66 69 6e 65 73 20 61 | .H Defines a| 0000c850 20 6e 75 6d 62 65 72 20 6f 66 20 74 77 6f 2d 62 | number of two-b| 0000c860 79 74 65 20 76 61 6c 75 65 73 2c 20 6f 75 74 70 |yte values, outp| 0000c870 75 74 20 69 6e 20 68 69 67 68 2d 6c 6f 77 20 6f |ut in high-low o| 0000c880 72 64 65 72 2e 0d 0d 20 20 20 20 20 20 20 20 53 |rder... S| 0000c890 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 |yntax:.. | 0000c8a0 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 | [<labe| 0000c8b0 6c 3e 5d 20 20 44 44 42 20 20 3c 65 78 70 72 3e |l>] DDB <expr>| 0000c8c0 5b 2c 3c 65 78 70 72 3e 2e 2e 2e 5d 0d 0d 20 20 |[,<expr>...].. | 0000c8d0 20 20 20 20 20 20 45 61 63 68 20 65 78 70 72 65 | Each expre| 0000c8e0 73 73 69 6f 6e 20 69 6e 20 74 68 65 20 6f 70 65 |ssion in the ope| 0000c8f0 72 61 6e 64 20 66 69 65 6c 64 20 69 73 20 65 76 |rand field is ev| 0000c900 61 6c 75 61 74 65 64 20 20 61 6e 64 20 20 73 74 |aluated and st| 0000c910 6f 72 65 64 0d 20 20 20 20 20 20 20 20 61 73 20 |ored. as | 0000c920 61 20 20 74 77 6f 2d 62 79 74 65 20 76 61 6c 75 |a two-byte valu| 0000c930 65 2e 20 20 49 66 20 3c 6c 61 62 65 6c 3e 20 69 |e. If <label> i| 0000c940 73 20 70 72 65 73 65 6e 74 2c 20 69 74 20 69 73 |s present, it is| 0000c950 20 73 65 74 20 74 6f 20 74 68 65 0d 20 20 20 20 | set to the. | 0000c960 20 20 20 20 61 64 64 72 65 73 73 20 6f 66 20 74 | address of t| 0000c970 68 65 20 68 69 67 68 2d 6f 72 64 65 72 20 62 79 |he high-order by| 0000c980 74 65 20 6f 66 20 74 68 65 20 66 69 72 73 74 20 |te of the first | 0000c990 65 78 70 72 65 73 73 69 6f 6e 2e 0d 0d 20 20 20 |expression... | 0000c9a0 20 20 20 20 20 45 61 63 68 20 65 78 70 72 65 73 | Each expres| 0000c9b0 73 69 6f 6e 20 63 61 6e 20 62 65 20 70 72 65 63 |sion can be prec| 0000c9c0 65 64 65 64 20 62 79 20 61 20 72 65 70 65 61 74 |eded by a repeat| 0000c9d0 20 63 6f 75 6e 74 20 61 73 20 64 65 73 63 72 69 | count as descri| 0000c9e0 62 65 64 0d 20 20 20 20 20 20 20 20 69 6e 20 73 |bed. in s| 0000c9f0 65 63 74 69 6f 6e 20 34 2e 32 2e 33 2e 0d 0d 20 |ection 4.2.3... | 0000ca00 20 20 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d | Example:.| 0000ca10 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000ca20 20 20 20 20 20 54 41 42 4c 45 20 20 44 44 42 20 | TABLE DDB | 0000ca30 20 32 38 2c 33 32 31 30 35 2c 5b 31 30 5d 24 46 | 28,32105,[10]$F| 0000ca40 46 46 46 0d 0d 0d 0d 0d 20 20 20 20 20 20 20 20 |FFF..... | 0000ca50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ca60 20 20 20 20 20 20 20 20 20 36 33 0d 0d 0d 0d 0d | 63.....| 0000ca70 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 20 20 |..G | 0000ca80 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 20 54 | USING T| 0000ca90 48 45 20 36 35 43 30 32 20 41 53 53 45 4d 42 4c |HE 65C02 ASSEMBL| 0000caa0 45 52 1b 48 0d 0d 0d 0d 1b 47 44 45 46 50 41 52 |ER.H.....GDEFPAR| 0000cab0 53 1b 48 20 53 65 74 73 20 75 70 20 64 65 66 61 |S.H Sets up defa| 0000cac0 75 6c 74 20 70 61 72 61 6d 65 74 65 72 73 20 66 |ult parameters f| 0000cad0 6f 72 20 61 20 6d 61 63 72 6f 2e 20 53 65 65 20 |or a macro. See | 0000cae0 73 65 63 74 69 6f 6e 20 31 30 2e 33 2e 33 20 66 |section 10.3.3 f| 0000caf0 6f 72 0d 20 20 20 20 20 20 20 20 66 75 6c 6c 20 |or. full | 0000cb00 64 65 74 61 69 6c 73 20 6f 66 20 74 68 69 73 20 |details of this | 0000cb10 64 69 72 65 63 74 69 76 65 2e 0d 0d 0d 1b 47 44 |directive.....GD| 0000cb20 45 4e 44 20 20 20 1b 48 20 54 65 72 6d 69 6e 61 |END .H Termina| 0000cb30 74 65 73 20 61 20 44 53 45 43 54 2e 0d 0d 20 20 |tes a DSECT... | 0000cb40 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 20 20 | Syntax:. | 0000cb50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000cb60 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c | [<label| 0000cb70 3e 5d 20 20 44 45 4e 44 0d 0d 20 20 20 20 20 20 |>] DEND.. | 0000cb80 20 20 54 68 65 20 61 64 64 72 65 73 73 20 74 68 | The address th| 0000cb90 61 74 20 20 77 61 73 20 20 73 61 76 65 64 20 20 |at was saved | 0000cba0 77 68 65 6e 20 20 74 68 65 20 20 44 53 45 43 54 |when the DSECT| 0000cbb0 20 20 64 69 72 65 63 74 69 76 65 20 20 77 61 73 | directive was| 0000cbc0 0d 20 20 20 20 20 20 20 20 65 6e 63 6f 75 6e 74 |. encount| 0000cbd0 65 72 65 64 20 69 73 20 72 65 73 65 74 2e 0d 0d |ered is reset...| 0000cbe0 20 20 20 20 20 20 20 20 45 78 61 6d 70 6c 65 3a | Example:| 0000cbf0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 0000cc00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000cc10 20 20 20 44 45 4e 44 0d 0d 0d 1b 47 44 46 42 20 | DEND....GDFB | 0000cc20 20 20 20 1b 48 20 44 65 66 69 6e 65 73 20 61 20 | .H Defines a | 0000cc30 6e 75 6d 62 65 72 20 6f 66 20 73 69 6e 67 6c 65 |number of single| 0000cc40 2d 62 79 74 65 20 76 61 6c 75 65 73 2e 0d 0d 20 |-byte values... | 0000cc50 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d | Syntax:..| 0000cc60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000cc70 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 44 46 42 | [<label>] DFB| 0000cc80 20 20 3c 65 78 70 72 3e 5b 2c 3c 65 78 70 72 3e | <expr>[,<expr>| 0000cc90 2e 2e 2e 5d 0d 0d 20 20 20 20 20 20 20 20 45 61 |...].. Ea| 0000cca0 63 68 20 20 65 78 70 72 65 73 73 69 6f 6e 20 20 |ch expression | 0000ccb0 69 6e 20 74 68 65 20 6f 70 65 72 61 6e 64 20 66 |in the operand f| 0000ccc0 69 65 6c 64 20 69 73 20 65 76 61 6c 75 61 74 65 |ield is evaluate| 0000ccd0 64 20 61 6e 64 20 73 74 6f 72 65 64 0d 20 20 20 |d and stored. | 0000cce0 20 20 20 20 20 61 73 20 61 20 62 79 74 65 20 76 | as a byte v| 0000ccf0 61 6c 75 65 2e 20 20 49 66 20 3c 6c 61 62 65 6c |alue. If <label| 0000cd00 3e 20 69 73 20 70 72 65 73 65 6e 74 2c 20 20 69 |> is present, i| 0000cd10 74 20 20 69 73 20 20 73 65 74 20 20 74 6f 20 20 |t is set to | 0000cd20 74 68 65 0d 20 20 20 20 20 20 20 20 61 64 64 72 |the. addr| 0000cd30 65 73 73 20 6f 66 20 74 68 65 20 66 69 72 73 74 |ess of the first| 0000cd40 20 65 78 70 72 65 73 73 69 6f 6e 2e 0d 0d 20 20 | expression... | 0000cd50 20 20 20 20 20 20 45 61 63 68 20 65 78 70 72 65 | Each expre| 0000cd60 73 73 69 6f 6e 20 63 61 6e 20 62 65 20 70 72 65 |ssion can be pre| 0000cd70 63 65 64 65 64 20 62 79 20 61 20 72 65 70 65 61 |ceded by a repea| 0000cd80 74 20 63 6f 75 6e 74 20 61 73 20 64 65 73 63 72 |t count as descr| 0000cd90 69 62 65 64 0d 20 20 20 20 20 20 20 20 69 6e 20 |ibed. in | 0000cda0 73 65 63 74 69 6f 6e 20 34 2e 32 2e 33 2e 0d 0d |section 4.2.3...| 0000cdb0 20 20 20 20 20 20 20 20 45 78 61 6d 70 6c 65 3a | Example:| 0000cdc0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 0000cdd0 20 20 20 20 20 20 20 20 54 41 42 4c 45 20 20 44 | TABLE D| 0000cde0 46 42 20 20 30 2c 5b 32 37 5d 31 2c 46 52 45 44 |FB 0,[27]1,FRED| 0000cdf0 2b 32 0d 0d 0d 1b 47 44 46 44 42 20 20 20 1b 48 |+2....GDFDB .H| 0000ce00 20 54 68 69 73 20 69 73 20 69 64 65 6e 74 69 63 | This is identic| 0000ce10 61 6c 20 74 6f 20 44 44 42 2e 0d 0d 1b 47 44 46 |al to DDB....GDF| 0000ce20 53 20 20 20 20 1b 48 20 54 68 69 73 20 69 73 20 |S .H This is | 0000ce30 69 64 65 6e 74 69 63 61 6c 20 74 6f 20 44 53 2e |identical to DS.| 0000ce40 0d 0d 1b 47 44 46 57 20 20 20 20 1b 48 20 54 68 |...GDFW .H Th| 0000ce50 69 73 20 69 73 20 69 64 65 6e 74 69 63 61 6c 20 |is is identical | 0000ce60 74 6f 20 44 57 2e 0d 0d 0d 1b 47 44 49 53 50 20 |to DW.....GDISP | 0000ce70 20 20 1b 48 20 44 69 73 70 6c 61 79 73 20 61 20 | .H Displays a | 0000ce80 6d 65 73 73 61 67 65 20 6f 6e 20 62 6f 74 68 20 |message on both | 0000ce90 70 61 73 73 20 31 20 61 6e 64 20 70 61 73 73 20 |pass 1 and pass | 0000cea0 32 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 6e 74 |2... Synt| 0000ceb0 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |ax:.. | 0000cec0 20 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 | [<lab| 0000ced0 65 6c 3e 5d 20 20 44 49 53 50 20 20 3c 73 74 72 |el>] DISP <str| 0000cee0 69 6e 67 3e 0d 0d 20 20 20 20 20 20 20 20 3c 73 |ing>.. <s| 0000cef0 74 72 69 6e 67 3e 20 20 6d 61 79 20 63 6f 6e 74 |tring> may cont| 0000cf00 61 69 6e 20 72 65 66 65 72 65 6e 63 65 73 20 74 |ain references t| 0000cf10 6f 20 76 61 72 69 61 62 6c 65 73 3a 20 66 6f 72 |o variables: for| 0000cf20 20 64 65 74 61 69 6c 73 20 73 65 65 0d 20 20 20 | details see. | 0000cf30 20 20 20 20 20 73 65 63 74 69 6f 6e 20 38 2e 31 | section 8.1| 0000cf40 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 |... Examp| 0000cf50 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |le:.. | 0000cf60 20 20 20 20 20 20 44 49 53 50 20 20 27 50 72 6f | DISP 'Pro| 0000cf70 67 72 61 6d 20 73 69 7a 65 20 69 73 20 25 44 28 |gram size is %D(| 0000cf80 2a 2d 24 38 30 30 30 29 27 0d 0d 0d 20 20 20 20 |*-$8000)'... | 0000cf90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000cfa0 20 20 20 20 20 20 20 20 20 20 20 20 20 36 34 0d | 64.| 0000cfb0 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 |......G | 0000cfc0 20 20 20 20 20 20 20 20 20 20 20 20 20 55 53 49 | USI| 0000cfd0 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 53 53 |NG THE 65C02 ASS| 0000cfe0 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 0d 0d 1b 47 |EMBLER.H.......G| 0000cff0 44 49 53 50 31 20 20 1b 48 20 41 73 20 66 6f 72 |DISP1 .H As for| 0000d000 20 44 49 53 50 2c 20 20 65 78 63 65 70 74 20 74 | DISP, except t| 0000d010 68 61 74 20 74 68 65 20 6d 65 73 73 61 67 65 20 |hat the message | 0000d020 20 69 73 20 20 64 69 73 70 6c 61 79 65 64 20 20 | is displayed | 0000d030 6f 6e 6c 79 20 20 6f 6e 0d 20 20 20 20 20 20 20 |only on. | 0000d040 20 70 61 73 73 20 31 2e 0d 0d 0d 1b 47 44 49 53 | pass 1.....GDIS| 0000d050 50 32 20 20 1b 48 20 41 73 20 66 6f 72 20 44 49 |P2 .H As for DI| 0000d060 53 50 2c 20 20 65 78 63 65 70 74 20 74 68 61 74 |SP, except that| 0000d070 20 74 68 65 20 6d 65 73 73 61 67 65 20 20 69 73 | the message is| 0000d080 20 20 64 69 73 70 6c 61 79 65 64 20 20 6f 6e 6c | displayed onl| 0000d090 79 20 20 6f 6e 0d 20 20 20 20 20 20 20 20 70 61 |y on. pa| 0000d0a0 73 73 20 32 2e 0d 0d 0d 1b 47 44 4f 20 20 20 20 |ss 2.....GDO | 0000d0b0 20 1b 48 20 41 20 73 79 6e 6f 6e 79 6d 20 66 6f | .H A synonym fo| 0000d0c0 72 20 49 46 2e 0d 0d 0d 1b 47 44 53 20 20 20 20 |r IF.....GDS | 0000d0d0 20 1b 48 20 52 65 73 65 72 76 65 73 20 73 70 61 | .H Reserves spa| 0000d0e0 63 65 20 69 6e 20 20 74 68 65 20 20 6f 62 6a 65 |ce in the obje| 0000d0f0 63 74 20 20 66 69 6c 65 2c 20 20 73 65 74 74 69 |ct file, setti| 0000d100 6e 67 20 20 74 68 65 20 20 62 79 74 65 73 20 20 |ng the bytes | 0000d110 73 6f 0d 20 20 20 20 20 20 20 20 61 66 66 65 63 |so. affec| 0000d120 74 65 64 20 74 6f 20 7a 65 72 6f 2e 0d 0d 20 20 |ted to zero... | 0000d130 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 | Syntax:.. | 0000d140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000d150 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d | [<label>]| 0000d160 20 20 44 53 20 20 3c 65 78 70 72 3e 0d 0d 20 20 | DS <expr>.. | 0000d170 20 20 20 20 20 20 3c 65 78 70 72 3e 2c 20 77 68 | <expr>, wh| 0000d180 69 63 68 20 6d 75 73 74 20 6e 6f 74 20 69 6e 63 |ich must not inc| 0000d190 6c 75 64 65 20 66 6f 72 77 61 72 64 20 72 65 66 |lude forward ref| 0000d1a0 65 72 65 6e 63 65 73 2c 20 64 65 66 69 6e 65 73 |erences, defines| 0000d1b0 20 74 68 65 0d 20 20 20 20 20 20 20 20 61 6d 6f | the. amo| 0000d1c0 75 6e 74 20 20 6f 66 20 20 73 70 61 63 65 20 74 |unt of space t| 0000d1d0 6f 20 62 65 20 72 65 73 65 72 76 65 64 2e 20 20 |o be reserved. | 0000d1e0 49 66 20 3c 6c 61 62 65 6c 3e 20 69 73 20 70 72 |If <label> is pr| 0000d1f0 65 73 65 6e 74 20 69 74 20 69 73 0d 20 20 20 20 |esent it is. | 0000d200 20 20 20 20 73 65 74 20 74 6f 20 74 68 65 20 61 | set to the a| 0000d210 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 66 69 |ddress of the fi| 0000d220 72 73 74 20 62 79 74 65 20 72 65 73 65 72 76 65 |rst byte reserve| 0000d230 64 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d |d... Exam| 0000d240 70 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 |ple:.. | 0000d250 20 20 20 20 20 20 20 20 20 20 20 20 44 53 20 20 | DS | 0000d260 24 43 30 30 30 2d 50 52 4f 47 2e 54 4f 50 2e 41 |$C000-PROG.TOP.A| 0000d270 44 44 52 45 53 53 0d 0d 0d 0d 1b 47 44 53 45 43 |DDRESS.....GDSEC| 0000d280 54 20 20 1b 48 20 4f 70 65 6e 73 20 61 20 20 22 |T .H Opens a "| 0000d290 64 75 6d 6d 79 20 73 65 63 74 69 6f 6e 22 20 20 |dummy section" | 0000d2a0 74 68 61 74 20 61 6c 6c 6f 77 73 20 61 6e 20 61 |that allows an a| 0000d2b0 72 65 61 20 6f 66 20 6d 65 6d 6f 72 79 20 74 6f |rea of memory to| 0000d2c0 20 20 62 65 0d 20 20 20 20 20 20 20 20 64 65 66 | be. def| 0000d2d0 69 6e 65 64 20 77 69 74 68 6f 75 74 20 67 65 6e |ined without gen| 0000d2e0 65 72 61 74 69 6e 67 20 61 6e 79 20 6f 62 6a 65 |erating any obje| 0000d2f0 63 74 20 63 6f 64 65 2e 0d 0d 20 20 20 20 20 20 |ct code... | 0000d300 20 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 | Syntax:.. | 0000d310 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000d320 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 | [<label>] | 0000d330 20 44 53 45 43 54 0d 0d 0d 20 20 20 20 20 20 20 | DSECT... | 0000d340 20 57 68 65 6e 20 74 68 65 20 44 53 45 43 54 20 | When the DSECT | 0000d350 64 69 72 65 63 74 69 76 65 20 69 73 20 70 72 6f |directive is pro| 0000d360 63 65 73 73 65 64 2c 20 20 74 68 65 20 63 75 72 |cessed, the cur| 0000d370 72 65 6e 74 20 61 64 64 72 65 73 73 20 69 73 0d |rent address is.| 0000d380 20 20 20 20 20 20 20 20 6e 6f 74 65 64 20 62 79 | noted by| 0000d390 20 74 68 65 20 41 73 73 65 6d 62 6c 65 72 2c 20 | the Assembler, | 0000d3a0 20 61 6e 64 20 74 68 65 20 76 61 6c 75 65 20 69 | and the value i| 0000d3b0 73 20 72 65 73 65 74 20 74 6f 20 74 68 61 74 20 |s reset to that | 0000d3c0 61 74 20 74 68 65 0d 20 20 20 20 20 20 20 20 65 |at the. e| 0000d3d0 6e 64 20 20 6f 66 20 20 74 68 65 20 20 70 72 65 |nd of the pre| 0000d3e0 76 69 6f 75 73 20 20 64 75 6d 6d 79 20 20 73 65 |vious dummy se| 0000d3f0 63 74 69 6f 6e 20 20 28 6f 72 20 30 2c 20 20 69 |ction (or 0, i| 0000d400 66 20 74 68 69 73 20 69 73 20 74 68 65 0d 20 20 |f this is the. | 0000d410 20 20 20 20 20 20 66 69 72 73 74 29 2e 20 20 41 | first). A| 0000d420 6e 20 4f 52 47 20 64 69 72 65 63 74 69 76 65 20 |n ORG directive | 0000d430 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 63 |can be used to c| 0000d440 68 61 6e 67 65 20 74 68 65 20 20 76 61 6c 75 65 |hange the value| 0000d450 20 20 69 66 0d 20 20 20 20 20 20 20 20 72 65 71 | if. req| 0000d460 75 69 72 65 64 2e 0d 0d 0d 20 20 20 20 20 20 20 |uired.... | 0000d470 20 57 68 65 6e 20 20 74 68 65 20 64 75 6d 6d 79 | When the dummy| 0000d480 20 73 65 63 74 69 6f 6e 20 69 73 20 74 65 72 6d | section is term| 0000d490 69 6e 61 74 65 64 20 62 79 20 61 20 44 45 4e 44 |inated by a DEND| 0000d4a0 20 64 69 72 65 63 74 69 76 65 2c 20 74 68 65 0d | directive, the.| 0000d4b0 20 20 20 20 20 20 20 20 6f 6c 64 20 76 61 6c 75 | old valu| 0000d4c0 65 20 6f 66 20 74 68 65 20 61 64 64 72 65 73 73 |e of the address| 0000d4d0 20 69 73 20 72 65 73 74 6f 72 65 64 2e 0d 0d 20 | is restored... | 0000d4e0 20 20 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d | Example:.| 0000d4f0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000d500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000d510 20 44 53 45 43 54 0d 0d 0d 0d 0d 0d 20 20 20 20 | DSECT...... | 0000d520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000d530 20 20 20 20 20 20 20 20 20 20 20 20 20 36 35 0d | 65.| 0000d540 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 |......G | 0000d550 20 20 20 20 20 20 20 20 20 20 20 20 20 55 53 49 | USI| 0000d560 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 53 53 |NG THE 65C02 ASS| 0000d570 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 1b 47 44 57 |EMBLER.H.....GDW| 0000d580 20 20 20 20 20 1b 48 20 44 65 66 69 6e 65 73 20 | .H Defines | 0000d590 61 20 6e 75 6d 62 65 72 20 6f 66 20 74 77 6f 2d |a number of two-| 0000d5a0 62 79 74 65 20 76 61 6c 75 65 73 20 6f 75 74 70 |byte values outp| 0000d5b0 75 74 20 69 6e 20 6c 6f 77 2d 68 69 67 68 20 6f |ut in low-high o| 0000d5c0 72 64 65 72 2e 0d 0d 20 20 20 20 20 20 20 20 53 |rder... S| 0000d5d0 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 |yntax:.. | 0000d5e0 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 | [<labe| 0000d5f0 6c 3e 5d 20 20 44 57 20 20 3c 65 78 70 72 3e 5b |l>] DW <expr>[| 0000d600 2c 3c 65 78 70 72 3e 2e 2e 2e 5d 0d 0d 20 20 20 |,<expr>...].. | 0000d610 20 20 20 20 20 45 61 63 68 20 65 78 70 72 65 73 | Each expres| 0000d620 73 69 6f 6e 20 69 6e 20 74 68 65 20 6f 70 65 72 |sion in the oper| 0000d630 61 6e 64 20 66 69 65 6c 64 20 69 73 20 65 76 61 |and field is eva| 0000d640 6c 75 61 74 65 64 20 20 61 6e 64 20 20 73 74 6f |luated and sto| 0000d650 72 65 64 0d 20 20 20 20 20 20 20 20 61 73 20 61 |red. as a| 0000d660 20 20 74 77 6f 2d 62 79 74 65 20 76 61 6c 75 65 | two-byte value| 0000d670 2e 20 20 49 66 20 3c 6c 61 62 65 6c 3e 20 69 73 |. If <label> is| 0000d680 20 70 72 65 73 65 6e 74 2c 20 69 74 20 69 73 20 | present, it is | 0000d690 73 65 74 20 74 6f 20 74 68 65 0d 20 20 20 20 20 |set to the. | 0000d6a0 20 20 20 61 64 64 72 65 73 73 20 6f 66 20 74 68 | address of th| 0000d6b0 65 20 6c 6f 77 2d 6f 72 64 65 72 20 62 79 74 65 |e low-order byte| 0000d6c0 20 6f 66 20 74 68 65 20 66 69 72 73 74 20 65 78 | of the first ex| 0000d6d0 70 72 65 73 73 69 6f 6e 2e 0d 0d 20 20 20 20 20 |pression... | 0000d6e0 20 20 20 45 61 63 68 20 65 78 70 72 65 73 73 69 | Each expressi| 0000d6f0 6f 6e 20 63 61 6e 20 62 65 20 70 72 65 63 65 64 |on can be preced| 0000d700 65 64 20 62 79 20 61 20 72 65 70 65 61 74 20 63 |ed by a repeat c| 0000d710 6f 75 6e 74 20 61 73 20 64 65 73 63 72 69 62 65 |ount as describe| 0000d720 64 0d 20 20 20 20 20 20 20 20 69 6e 20 73 65 63 |d. in sec| 0000d730 74 69 6f 6e 20 34 2e 32 2e 33 2e 0d 0d 20 20 20 |tion 4.2.3... | 0000d740 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 | Example:.. | 0000d750 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000d760 20 20 20 20 20 20 20 20 54 41 42 4c 45 20 20 44 | TABLE D| 0000d770 57 20 46 52 45 44 2c 42 45 52 54 0d 0d 0d 1b 47 |W FRED,BERT....G| 0000d780 45 4c 53 45 20 20 20 1b 48 20 4d 61 72 6b 73 20 |ELSE .H Marks | 0000d790 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 54 |the end of the T| 0000d7a0 52 55 45 20 62 72 61 6e 63 68 20 20 6f 66 20 20 |RUE branch of | 0000d7b0 61 20 20 63 6f 6e 64 69 74 69 6f 6e 61 6c 20 20 |a conditional | 0000d7c0 61 73 73 65 6d 62 6c 79 0d 20 20 20 20 20 20 20 |assembly. | 0000d7d0 20 62 6c 6f 63 6b 20 62 65 67 75 6e 20 62 79 20 | block begun by | 0000d7e0 49 46 2c 20 49 46 44 45 46 20 61 6e 64 20 49 46 |IF, IFDEF and IF| 0000d7f0 4e 44 45 46 2e 20 46 6f 72 20 64 65 74 61 69 6c |NDEF. For detail| 0000d800 73 20 73 65 65 20 73 65 63 74 69 6f 6e 20 37 0d |s see section 7.| 0000d810 0d 0d 1b 47 45 4e 44 4d 20 20 20 1b 48 20 54 65 |...GENDM .H Te| 0000d820 72 6d 69 6e 61 74 65 73 20 20 74 68 65 20 20 64 |rminates the d| 0000d830 65 66 69 6e 69 74 69 6f 6e 20 20 6f 66 20 20 61 |efinition of a| 0000d840 20 20 6d 61 63 72 6f 20 20 62 65 67 75 6e 20 62 | macro begun b| 0000d850 79 20 74 68 65 20 20 4d 41 43 52 4f 0d 20 20 20 |y the MACRO. | 0000d860 20 20 20 20 20 64 69 72 65 63 74 69 76 65 2e 0d | directive..| 0000d870 0d 20 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a |. Syntax:| 0000d880 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 0000d890 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000d8a0 20 20 20 45 4e 44 4d 0d 0d 0d 1b 47 45 51 55 20 | ENDM....GEQU | 0000d8b0 20 20 20 1b 48 20 41 73 73 69 67 6e 73 20 61 20 | .H Assigns a | 0000d8c0 76 61 6c 75 65 20 74 6f 20 61 20 73 79 6d 62 6f |value to a symbo| 0000d8d0 6c 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 6e 74 |l... Synt| 0000d8e0 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |ax:.. | 0000d8f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 6c | <l| 0000d900 61 62 65 6c 3e 20 20 45 51 55 20 20 3c 65 78 70 |abel> EQU <exp| 0000d910 72 3e 0d 0d 20 20 20 20 20 20 20 20 3c 65 78 70 |r>.. <exp| 0000d920 72 3e 20 6d 75 73 74 20 6e 6f 74 20 63 6f 6e 74 |r> must not cont| 0000d930 61 69 6e 20 66 6f 72 77 61 72 64 20 72 65 66 65 |ain forward refe| 0000d940 72 65 6e 63 65 73 2e 0d 0d 20 20 20 20 20 20 20 |rences... | 0000d950 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 20 20 | Example:.. | 0000d960 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000d970 20 20 20 20 20 4f 53 57 52 43 48 20 20 45 51 55 | OSWRCH EQU| 0000d980 20 20 24 46 46 45 45 0d 0d 0d 1b 47 45 58 45 43 | $FFEE....GEXEC| 0000d990 20 20 20 1b 48 20 53 70 65 63 69 66 69 65 73 20 | .H Specifies | 0000d9a0 74 68 65 20 62 6f 74 74 6f 6d 20 31 36 20 62 69 |the bottom 16 bi| 0000d9b0 74 73 20 6f 66 20 74 68 65 20 20 33 32 20 62 69 |ts of the 32 bi| 0000d9c0 74 20 20 65 78 65 63 75 74 69 6f 6e 20 61 64 64 |t execution add| 0000d9d0 72 65 73 73 0d 20 20 20 20 20 20 20 20 6f 66 20 |ress. of | 0000d9e0 74 68 65 20 6f 62 6a 65 63 74 20 63 6f 64 65 2e |the object code.| 0000d9f0 0d 0d 20 20 20 20 20 20 20 20 53 79 6e 74 61 78 |.. Syntax| 0000da00 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |:.. | 0000da10 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 | [<labe| 0000da20 6c 3e 5d 20 20 45 58 45 43 20 20 3c 65 78 70 72 |l>] EXEC <expr| 0000da30 3e 0d 0d 20 20 20 20 20 20 20 20 54 68 65 20 63 |>.. The c| 0000da40 61 74 61 6c 6f 67 75 65 20 65 6e 74 72 79 20 6f |atalogue entry o| 0000da50 66 20 74 68 65 20 6f 62 6a 65 63 74 20 66 69 6c |f the object fil| 0000da60 65 20 77 69 6c 6c 20 62 65 20 75 70 64 61 74 65 |e will be update| 0000da70 64 20 74 6f 20 73 68 6f 77 0d 20 20 20 20 20 20 |d to show. | 0000da80 20 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 | the specified | 0000da90 65 78 65 63 75 74 69 6f 6e 20 61 64 64 72 65 73 |execution addres| 0000daa0 73 2e 20 20 3c 65 78 70 72 3e 20 63 61 6e 20 6f |s. <expr> can o| 0000dab0 6e 6c 79 20 62 65 20 61 20 20 31 36 2d 62 69 74 |nly be a 16-bit| 0000dac0 0d 20 20 20 20 20 20 20 20 71 75 61 6e 74 69 74 |. quantit| 0000dad0 79 3a 20 20 74 68 65 20 20 76 61 6c 75 65 20 20 |y: the value | 0000dae0 6f 66 20 74 68 65 20 74 77 6f 20 74 6f 70 20 62 |of the two top b| 0000daf0 79 74 65 73 20 6f 66 20 74 68 65 20 61 64 64 72 |ytes of the addr| 0000db00 65 73 73 20 61 72 65 0d 20 20 20 20 20 20 20 20 |ess are. | 0000db10 73 65 74 20 62 79 20 74 68 65 20 4d 53 57 20 64 |set by the MSW d| 0000db20 69 72 65 63 74 69 76 65 2e 0d 0d 0d 20 20 20 20 |irective.... | 0000db30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000db40 20 20 20 20 20 20 20 20 20 20 20 20 20 36 36 0d | 66.| 0000db50 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 |......G | 0000db60 20 20 20 20 20 20 20 20 20 20 20 20 20 55 53 49 | USI| 0000db70 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 53 53 |NG THE 65C02 ASS| 0000db80 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 0d 20 20 20 |EMBLER.H..... | 0000db90 20 20 20 20 20 49 66 20 74 68 69 73 20 64 69 72 | If this dir| 0000dba0 65 63 74 69 76 65 20 69 73 20 6e 6f 74 20 75 73 |ective is not us| 0000dbb0 65 64 2c 20 74 68 65 20 65 78 65 63 75 74 69 6f |ed, the executio| 0000dbc0 6e 20 61 64 64 72 65 73 73 20 69 73 20 73 65 74 |n address is set| 0000dbd0 20 74 6f 0d 20 20 20 20 20 20 20 20 74 68 65 20 | to. the | 0000dbe0 61 64 64 72 65 73 73 20 64 65 66 69 6e 65 64 20 |address defined | 0000dbf0 62 79 20 74 68 65 20 66 69 72 73 74 20 20 4f 52 |by the first OR| 0000dc00 47 20 20 74 68 61 74 20 69 73 20 6e 6f 74 20 69 |G that is not i| 0000dc10 6e 20 61 20 20 64 75 6d 6d 79 0d 20 20 20 20 20 |n a dummy. | 0000dc20 20 20 20 73 65 63 74 69 6f 6e 2e 0d 0d 20 20 20 | section... | 0000dc30 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 | Example:.. | 0000dc40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000dc50 20 20 20 20 20 20 20 20 20 20 20 45 58 45 43 20 | EXEC | 0000dc60 20 53 54 41 52 54 2b 33 0d 0d 0d 1b 47 46 49 20 | START+3....GFI | 0000dc70 20 20 20 20 1b 48 20 54 65 72 6d 69 6e 61 74 65 | .H Terminate| 0000dc80 73 20 20 61 20 63 6f 6e 64 69 74 69 6f 6e 61 6c |s a conditional| 0000dc90 20 61 73 73 65 6d 62 6c 79 20 62 6c 6f 63 6b 20 | assembly block | 0000dca0 62 65 67 75 6e 20 62 79 20 49 46 2c 20 49 46 44 |begun by IF, IFD| 0000dcb0 45 46 20 6f 72 0d 20 20 20 20 20 20 20 20 49 46 |EF or. IF| 0000dcc0 4e 44 45 46 2e 20 20 46 6f 72 20 64 65 74 61 69 |NDEF. For detai| 0000dcd0 6c 73 2c 20 73 65 65 20 73 65 63 74 69 6f 6e 20 |ls, see section | 0000dce0 37 2e 0d 0d 0d 1b 47 46 49 4e 20 20 20 20 1b 48 |7.....GFIN .H| 0000dcf0 20 54 68 69 73 20 69 73 20 69 64 65 6e 74 69 63 | This is identic| 0000dd00 61 6c 20 74 6f 20 46 49 2e 0d 0d 0d 1b 47 48 45 |al to FI.....GHE| 0000dd10 58 20 20 20 20 1b 48 20 44 65 66 69 6e 65 73 20 |X .H Defines | 0000dd20 61 20 73 65 72 69 65 73 20 6f 66 20 62 79 74 65 |a series of byte| 0000dd30 73 20 69 6e 20 74 68 65 20 20 6f 62 6a 65 63 74 |s in the object| 0000dd40 20 20 70 72 6f 67 72 61 6d 2c 20 20 74 68 65 20 | program, the | 0000dd50 20 62 79 74 65 73 0d 20 20 20 20 20 20 20 20 62 | bytes. b| 0000dd60 65 69 6e 67 20 73 70 65 63 69 66 69 65 64 20 61 |eing specified a| 0000dd70 73 20 61 20 68 65 78 61 64 65 63 69 6d 61 6c 20 |s a hexadecimal | 0000dd80 73 74 72 69 6e 67 2e 0d 0d 20 20 20 20 20 20 20 |string... | 0000dd90 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 | Syntax:.. | 0000dda0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ddb0 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 48 45 58 20 | [<label>] HEX | 0000ddc0 20 3c 73 74 72 69 6e 67 3e 0d 0d 20 20 20 20 20 | <string>.. | 0000ddd0 20 20 20 3c 73 74 72 69 6e 67 3e 20 20 6d 75 73 | <string> mus| 0000dde0 74 20 20 63 6f 6e 74 61 69 6e 20 20 68 65 78 61 |t contain hexa| 0000ddf0 64 65 63 69 6d 61 6c 20 20 64 69 67 69 74 73 20 |decimal digits | 0000de00 28 69 2e 65 2e 20 27 30 27 2e 2e 27 39 27 20 6f |(i.e. '0'..'9' o| 0000de10 72 0d 20 20 20 20 20 20 20 20 27 41 27 2e 2e 27 |r. 'A'..'| 0000de20 46 27 29 2c 20 61 6e 64 20 65 61 63 68 20 70 61 |F'), and each pa| 0000de30 69 72 20 6f 66 20 64 69 67 69 74 73 20 69 73 20 |ir of digits is | 0000de40 6f 75 74 70 75 74 20 61 73 20 6f 6e 65 20 62 79 |output as one by| 0000de50 74 65 2e 0d 0d 20 20 20 20 20 20 20 20 49 66 20 |te... If | 0000de60 20 3c 6c 61 62 65 6c 3e 20 20 69 73 20 70 72 65 | <label> is pre| 0000de70 73 65 6e 74 20 69 74 20 69 73 20 73 65 74 20 74 |sent it is set t| 0000de80 6f 20 74 68 65 20 61 64 64 72 65 73 73 20 6f 66 |o the address of| 0000de90 20 74 68 65 20 20 66 69 72 73 74 0d 20 20 20 20 | the first. | 0000dea0 20 20 20 20 62 79 74 65 20 66 72 6f 6d 20 74 68 | byte from th| 0000deb0 65 20 73 74 72 69 6e 67 2e 0d 0d 20 20 20 20 20 |e string... | 0000dec0 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 | Example:.. | 0000ded0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000dee0 20 20 42 59 54 45 2e 4c 49 53 54 20 20 48 45 58 | BYTE.LIST HEX| 0000def0 20 20 27 41 42 33 34 46 46 32 45 37 45 27 0d 0d | 'AB34FF2E7E'..| 0000df00 0d 1b 47 49 46 20 20 20 20 20 1b 48 20 42 65 67 |..GIF .H Beg| 0000df10 69 6e 73 20 61 20 63 6f 6e 64 69 74 69 6f 6e 61 |ins a conditiona| 0000df20 6c 20 61 73 73 65 6d 62 6c 79 20 62 6c 6f 63 6b |l assembly block| 0000df30 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 6e 74 61 |... Synta| 0000df40 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |x:.. | 0000df50 20 20 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 | [<la| 0000df60 62 65 6c 3e 5d 20 20 49 46 20 20 3c 65 78 70 72 |bel>] IF <expr| 0000df70 3e 0d 0d 20 20 20 20 20 20 20 20 49 66 20 20 20 |>.. If | 0000df80 3c 65 78 70 72 3e 2c 20 20 77 68 69 63 68 20 20 |<expr>, which | 0000df90 63 61 6e 6e 6f 74 20 20 63 6f 6e 74 61 69 6e 20 |cannot contain | 0000dfa0 20 66 6f 72 77 61 72 64 20 20 72 65 66 65 72 65 | forward refere| 0000dfb0 6e 63 65 73 2c 20 20 69 73 0d 20 20 20 20 20 20 |nces, is. | 0000dfc0 20 20 6e 6f 6e 2d 7a 65 72 6f 2c 20 20 74 68 65 | non-zero, the| 0000dfd0 20 63 6f 6e 64 69 74 69 6f 6e 20 69 73 20 54 52 | condition is TR| 0000dfe0 55 45 2c 20 20 6f 74 68 65 72 77 69 73 65 20 69 |UE, otherwise i| 0000dff0 74 20 69 73 20 46 41 4c 53 45 2e 20 20 46 6f 72 |t is FALSE. For| 0000e000 0d 20 20 20 20 20 20 20 20 64 65 74 61 69 6c 73 |. details| 0000e010 2c 20 73 65 65 20 73 65 63 74 69 6f 6e 20 37 2e |, see section 7.| 0000e020 31 2e 0d 0d 0d 1b 47 49 46 44 45 46 20 20 1b 48 |1.....GIFDEF .H| 0000e030 20 42 65 67 69 6e 73 20 61 20 63 6f 6e 64 69 74 | Begins a condit| 0000e040 69 6f 6e 61 6c 20 61 73 73 65 6d 62 6c 79 20 62 |ional assembly b| 0000e050 6c 6f 63 6b 2e 0d 0d 20 20 20 20 20 20 20 20 53 |lock... S| 0000e060 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 |yntax:.. | 0000e070 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 3c | [<| 0000e080 6c 61 62 65 6c 3e 5d 20 20 49 46 44 45 46 20 20 |label>] IFDEF | 0000e090 3c 73 79 6d 62 6f 6c 3e 0d 0d 20 20 20 20 20 20 |<symbol>.. | 0000e0a0 20 20 49 66 20 3c 73 79 6d 62 6f 6c 3e 20 68 61 | If <symbol> ha| 0000e0b0 73 20 62 65 65 6e 20 64 65 66 69 6e 65 64 2c 20 |s been defined, | 0000e0c0 74 68 65 20 63 6f 6e 64 69 74 69 6f 6e 20 69 73 |the condition is| 0000e0d0 20 54 52 55 45 2c 20 6f 74 68 65 72 77 69 73 65 | TRUE, otherwise| 0000e0e0 0d 20 20 20 20 20 20 20 20 69 74 20 69 73 20 46 |. it is F| 0000e0f0 41 4c 53 45 2e 20 20 46 6f 72 20 64 65 74 61 69 |ALSE. For detai| 0000e100 6c 73 2c 20 73 65 65 20 73 65 63 74 69 6f 6e 20 |ls, see section | 0000e110 37 2e 32 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 |7.2... | 0000e120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000e130 20 20 20 20 20 20 20 36 37 0d 0d 0d 0d 0d 0d 1b | 67.......| 0000e140 47 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |G | 0000e150 20 20 20 20 20 20 20 55 53 49 4e 47 20 54 48 45 | USING THE| 0000e160 20 36 35 43 30 32 20 41 53 53 45 4d 42 4c 45 52 | 65C02 ASSEMBLER| 0000e170 1b 48 0d 0d 0d 0d 1b 47 49 46 4e 44 45 46 20 1b |.H.....GIFNDEF .| 0000e180 48 20 42 65 67 69 6e 73 20 61 20 63 6f 6e 64 69 |H Begins a condi| 0000e190 74 69 6f 6e 61 6c 20 61 73 73 65 6d 62 6c 79 20 |tional assembly | 0000e1a0 62 6c 6f 63 6b 2e 0d 0d 20 20 20 20 20 20 20 20 |block... | 0000e1b0 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 |Syntax:.. | 0000e1c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 3c | [<| 0000e1d0 6c 61 62 65 6c 3e 5d 20 20 49 46 4e 44 45 46 20 |label>] IFNDEF | 0000e1e0 20 3c 73 79 6d 62 6f 6c 3e 0d 0d 20 20 20 20 20 | <symbol>.. | 0000e1f0 20 20 20 49 66 20 20 3c 73 79 6d 62 6f 6c 3e 20 | If <symbol> | 0000e200 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 64 65 | has not been de| 0000e210 66 69 6e 65 64 2c 20 20 74 68 65 20 20 63 6f 6e |fined, the con| 0000e220 64 69 74 69 6f 6e 20 20 69 73 20 20 54 52 55 45 |dition is TRUE| 0000e230 2c 0d 20 20 20 20 20 20 20 20 6f 74 68 65 72 77 |,. otherw| 0000e240 69 73 65 20 69 74 20 69 73 20 46 41 4c 53 45 2e |ise it is FALSE.| 0000e250 20 20 46 6f 72 20 64 65 74 61 69 6c 73 2c 20 73 | For details, s| 0000e260 65 65 20 73 65 63 74 69 6f 6e 20 37 2e 32 2e 0d |ee section 7.2..| 0000e270 0d 0d 1b 47 49 4e 43 4c 55 44 45 1b 48 20 42 65 |...GINCLUDE.H Be| 0000e280 67 69 6e 73 20 20 61 73 73 65 6d 62 6c 79 20 20 |gins assembly | 0000e290 66 72 6f 6d 20 61 20 6e 65 77 20 73 6f 75 72 63 |from a new sourc| 0000e2a0 65 20 66 69 6c 65 2c 20 20 61 66 74 65 72 77 61 |e file, afterwa| 0000e2b0 72 64 73 20 72 65 73 75 6d 69 6e 67 0d 20 20 20 |rds resuming. | 0000e2c0 20 20 20 20 20 77 69 74 68 20 74 68 65 20 63 75 | with the cu| 0000e2d0 72 72 65 6e 74 20 66 69 6c 65 2e 0d 0d 20 20 20 |rrent file... | 0000e2e0 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 20 | Syntax:.. | 0000e2f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000e300 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 49 4e 43 | [<label>] INC| 0000e310 4c 55 44 45 20 20 3c 66 69 6c 65 6e 61 6d 65 3e |LUDE <filename>| 0000e320 0d 0d 20 20 20 20 20 20 20 20 54 68 65 20 41 73 |.. The As| 0000e330 73 65 6d 62 6c 65 72 20 77 69 6c 6c 20 70 72 6f |sembler will pro| 0000e340 63 65 73 73 20 20 6c 69 6e 65 73 20 20 66 72 6f |cess lines fro| 0000e350 6d 20 20 74 68 65 20 20 73 70 65 63 69 66 69 65 |m the specifie| 0000e360 64 20 20 66 69 6c 65 2e 0d 20 20 20 20 20 20 20 |d file.. | 0000e370 20 4c 69 6e 65 73 20 20 69 6e 20 20 74 68 65 20 | Lines in the | 0000e380 6c 69 73 74 69 6e 67 20 66 69 6c 65 20 77 69 6c |listing file wil| 0000e390 6c 20 62 65 67 69 6e 20 77 69 74 68 20 61 6e 20 |l begin with an | 0000e3a0 22 49 22 20 74 6f 20 69 6e 64 69 63 61 74 65 0d |"I" to indicate.| 0000e3b0 20 20 20 20 20 20 20 20 74 68 65 69 72 20 6f 72 | their or| 0000e3c0 69 67 69 6e 2e 20 20 41 74 20 65 6e 64 2d 6f 66 |igin. At end-of| 0000e3d0 2d 66 69 6c 65 2c 20 20 69 74 20 72 65 73 75 6d |-file, it resum| 0000e3e0 65 73 20 61 66 74 65 72 20 20 74 68 65 20 20 49 |es after the I| 0000e3f0 4e 43 4c 55 44 45 0d 20 20 20 20 20 20 20 20 64 |NCLUDE. d| 0000e400 69 72 65 63 74 69 76 65 2e 0d 0d 20 20 20 20 20 |irective... | 0000e410 20 20 20 54 68 65 20 20 64 69 72 65 63 74 69 76 | The directiv| 0000e420 65 20 20 6d 61 79 20 20 6e 6f 74 20 62 65 20 75 |e may not be u| 0000e430 73 65 64 20 77 69 74 68 69 6e 20 61 6e 20 20 49 |sed within an I| 0000e440 4e 43 4c 55 44 45 20 20 66 69 6c 65 20 6f 72 20 |NCLUDE file or | 0000e450 61 0d 20 20 20 20 20 20 20 20 6d 61 63 72 6f 2e |a. macro.| 0000e460 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 6c |.. Exampl| 0000e470 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |e:.. | 0000e480 20 20 20 20 20 20 20 20 20 20 20 20 20 49 4e 43 | INC| 0000e490 4c 55 44 45 20 20 3a 33 2e 44 45 46 49 4e 45 53 |LUDE :3.DEFINES| 0000e4a0 0d 0d 0d 1b 47 49 4e 46 4f 20 20 20 1b 48 20 54 |....GINFO .H T| 0000e4b0 68 69 73 20 69 73 20 69 64 65 6e 74 69 63 61 6c |his is identical| 0000e4c0 20 74 6f 20 44 49 53 50 32 2e 0d 0d 0d 1b 47 4c | to DISP2.....GL| 0000e4d0 46 43 4f 4e 44 20 1b 48 20 53 70 65 63 69 66 69 |FCOND .H Specifi| 0000e4e0 65 73 20 74 68 61 74 20 6c 69 6e 65 73 20 20 73 |es that lines s| 0000e4f0 6b 69 70 70 65 64 20 20 69 6e 20 20 61 20 20 63 |kipped in a c| 0000e500 6f 6e 64 69 74 69 6f 6e 61 6c 20 20 61 72 65 20 |onditional are | 0000e510 20 74 6f 20 20 62 65 0d 20 20 20 20 20 20 20 20 | to be. | 0000e520 6c 69 73 74 65 64 2e 0d 0d 20 20 20 20 20 20 20 |listed... | 0000e530 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 | Syntax:.. | 0000e540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000e550 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 4c | [<label>] L| 0000e560 46 43 4f 4e 44 0d 0d 20 20 20 20 20 20 20 20 46 |FCOND.. F| 0000e570 6f 72 20 64 65 74 61 69 6c 73 2c 20 73 65 65 20 |or details, see | 0000e580 73 65 63 74 69 6f 6e 20 37 2e 34 2e 0d 0d 0d 1b |section 7.4.....| 0000e590 47 4c 4f 41 44 20 20 20 1b 48 20 53 70 65 63 69 |GLOAD .H Speci| 0000e5a0 66 69 65 73 20 74 68 65 20 62 6f 74 74 6f 6d 20 |fies the bottom | 0000e5b0 31 36 20 62 69 74 73 20 6f 66 20 74 68 65 20 33 |16 bits of the 3| 0000e5c0 32 20 62 69 74 20 6c 6f 61 64 20 61 64 64 72 65 |2 bit load addre| 0000e5d0 73 73 20 6f 66 20 74 68 65 0d 20 20 20 20 20 20 |ss of the. | 0000e5e0 20 20 6f 62 6a 65 63 74 20 63 6f 64 65 2e 0d 0d | object code...| 0000e5f0 20 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d | Syntax:.| 0000e600 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000e610 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e | [<label>| 0000e620 5d 20 20 4c 4f 41 44 20 20 3c 65 78 70 72 3e 0d |] LOAD <expr>.| 0000e630 0d 20 20 20 20 20 20 20 20 54 68 65 20 63 61 74 |. The cat| 0000e640 61 6c 6f 67 75 65 20 65 6e 74 72 79 20 6f 66 20 |alogue entry of | 0000e650 74 68 65 20 6f 62 6a 65 63 74 20 66 69 6c 65 20 |the object file | 0000e660 77 69 6c 6c 20 62 65 20 75 70 64 61 74 65 64 20 |will be updated | 0000e670 74 6f 20 73 68 6f 77 0d 20 20 20 20 20 20 20 20 |to show. | 0000e680 74 68 65 20 20 73 70 65 63 69 66 69 65 64 20 20 |the specified | 0000e690 6c 6f 61 64 20 20 61 64 64 72 65 73 73 2e 20 20 |load address. | 0000e6a0 3c 65 78 70 72 3e 20 20 63 61 6e 20 20 6f 6e 6c |<expr> can onl| 0000e6b0 79 20 20 62 65 20 61 20 31 36 2d 62 69 74 0d 20 |y be a 16-bit. | 0000e6c0 20 20 20 20 20 20 20 71 75 61 6e 74 69 74 79 3a | quantity:| 0000e6d0 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 74 68 | the value of th| 0000e6e0 65 20 74 77 6f 20 74 6f 70 20 62 79 74 65 73 20 |e two top bytes | 0000e6f0 6f 66 20 20 74 68 65 20 20 61 64 64 72 65 73 73 |of the address| 0000e700 20 20 61 72 65 0d 20 20 20 20 20 20 20 20 73 65 | are. se| 0000e710 74 20 62 79 20 74 68 65 20 4d 53 57 20 64 69 72 |t by the MSW dir| 0000e720 65 63 74 69 76 65 2e 0d 0d 0d 20 20 20 20 20 20 |ective.... | 0000e730 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000e740 20 20 20 20 20 20 20 20 20 20 20 36 38 0d 0d 0d | 68...| 0000e750 0d 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 |....G | 0000e760 20 20 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 | USING| 0000e770 20 54 48 45 20 36 35 43 30 32 20 41 53 53 45 4d | THE 65C02 ASSEM| 0000e780 42 4c 45 52 1b 48 0d 0d 0d 0d 0d 20 20 20 20 20 |BLER.H..... | 0000e790 20 20 20 49 66 20 74 68 69 73 20 64 69 72 65 63 | If this direc| 0000e7a0 74 69 76 65 20 69 73 20 6e 6f 74 20 75 73 65 64 |tive is not used| 0000e7b0 2c 20 20 74 68 65 20 6c 6f 61 64 20 61 64 64 72 |, the load addr| 0000e7c0 65 73 73 20 69 73 20 73 65 74 20 74 6f 20 74 68 |ess is set to th| 0000e7d0 65 0d 20 20 20 20 20 20 20 20 61 64 64 72 65 73 |e. addres| 0000e7e0 73 20 20 64 65 66 69 6e 65 64 20 20 62 79 20 20 |s defined by | 0000e7f0 74 68 65 20 20 66 69 72 73 74 20 20 4f 52 47 20 |the first ORG | 0000e800 20 74 68 61 74 20 20 69 73 20 6e 6f 74 20 69 6e | that is not in| 0000e810 20 61 20 64 75 6d 6d 79 0d 20 20 20 20 20 20 20 | a dummy. | 0000e820 20 73 65 63 74 69 6f 6e 2e 0d 0d 20 20 20 20 20 | section... | 0000e830 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 | Example:.. | 0000e840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000e850 20 20 20 20 20 20 20 20 20 20 4c 4f 41 44 20 20 | LOAD | 0000e860 24 31 39 30 32 0d 0d 0d 1b 47 4c 53 54 20 20 20 |$1902....GLST | 0000e870 20 1b 48 20 53 65 74 73 20 74 68 65 20 73 6f 75 | .H Sets the sou| 0000e880 72 63 65 20 6c 69 73 74 69 6e 67 20 6c 65 76 65 |rce listing leve| 0000e890 6c 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 6e 74 |l... Synt| 0000e8a0 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |ax:.. | 0000e8b0 20 20 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 | [<la| 0000e8c0 62 65 6c 3e 5d 20 20 4c 53 54 20 20 5b 3c 65 78 |bel>] LST [<ex| 0000e8d0 70 72 3e 5d 0d 0d 20 20 20 20 20 20 20 20 3c 65 |pr>].. <e| 0000e8e0 78 70 72 3e 2c 20 20 77 68 69 63 68 20 6d 75 73 |xpr>, which mus| 0000e8f0 74 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 66 6f |t not contain fo| 0000e900 72 77 61 72 64 20 72 65 66 65 72 65 6e 63 65 73 |rward references| 0000e910 2c 20 20 67 69 76 65 73 20 74 68 65 0d 20 20 20 |, gives the. | 0000e920 20 20 20 20 20 6e 65 77 20 6c 65 76 65 6c 2e 20 | new level. | 0000e930 20 49 66 20 6f 6d 69 74 74 65 64 2c 20 20 74 68 | If omitted, th| 0000e940 65 20 6c 65 76 65 6c 20 69 73 20 20 72 65 73 65 |e level is rese| 0000e950 74 20 20 74 6f 20 20 74 68 65 20 20 64 65 66 61 |t to the defa| 0000e960 75 6c 74 0d 20 20 20 20 20 20 20 20 73 70 65 63 |ult. spec| 0000e970 69 66 69 65 64 20 69 6e 20 74 68 65 20 63 6f 6d |ified in the com| 0000e980 6d 61 6e 64 20 6c 69 6e 65 2e 0d 0d 20 20 20 20 |mand line... | 0000e990 20 20 20 20 54 68 65 20 61 6c 6c 6f 77 65 64 20 | The allowed | 0000e9a0 76 61 6c 75 65 73 20 61 72 65 3a 0d 0d 20 20 20 |values are:.. | 0000e9b0 20 20 20 20 20 20 20 20 20 20 20 30 20 20 4e 6f | 0 No| 0000e9c0 20 6c 69 6e 65 73 20 61 72 65 20 6c 69 73 74 65 | lines are liste| 0000e9d0 64 2e 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |d... | 0000e9e0 20 20 31 20 20 4c 69 73 74 20 6c 69 6e 65 73 20 | 1 List lines | 0000e9f0 66 72 6f 6d 20 66 69 6c 65 73 2c 20 62 75 74 20 |from files, but | 0000ea00 6e 6f 74 20 66 72 6f 6d 20 6d 61 63 72 6f 73 2e |not from macros.| 0000ea10 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 0000ea20 32 20 20 4c 69 73 74 20 61 6c 6c 20 6c 69 6e 65 |2 List all line| 0000ea30 73 2c 20 62 75 74 20 6e 6f 74 20 64 69 72 65 63 |s, but not direc| 0000ea40 74 69 76 65 73 20 73 75 63 68 20 61 73 20 41 49 |tives such as AI| 0000ea50 46 20 77 69 74 68 69 6e 0d 20 20 20 20 20 20 20 |F within. | 0000ea60 20 20 20 20 20 20 20 20 20 20 6d 61 63 72 6f 73 | macros| 0000ea70 2e 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 0000ea80 20 33 20 20 4c 69 73 74 20 61 6c 6c 20 6c 69 6e | 3 List all lin| 0000ea90 65 73 2e 0d 0d 20 20 20 20 20 20 20 20 4c 69 6e |es... Lin| 0000eaa0 65 73 20 63 6f 6e 74 61 69 6e 69 6e 67 20 65 72 |es containing er| 0000eab0 72 6f 72 73 20 61 72 65 20 61 6c 77 61 79 73 20 |rors are always | 0000eac0 6c 69 73 74 65 64 2e 0d 0d 0d 1b 47 4d 41 43 52 |listed.....GMACR| 0000ead0 4f 20 20 1b 48 20 44 65 66 69 6e 65 73 20 61 20 |O .H Defines a | 0000eae0 6d 61 63 72 6f 2e 0d 0d 20 20 20 20 20 20 20 20 |macro... | 0000eaf0 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 |Syntax:.. | 0000eb00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000eb10 20 20 20 20 20 3c 6c 61 62 65 6c 3e 20 20 4d 41 | <label> MA| 0000eb20 43 52 4f 0d 0d 20 20 20 20 20 20 20 20 54 68 65 |CRO.. The| 0000eb30 20 66 6f 6c 6c 6f 77 69 6e 67 20 6c 69 6e 65 73 | following lines| 0000eb40 20 61 72 65 20 73 74 6f 72 65 64 20 61 73 20 74 | are stored as t| 0000eb50 68 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 6f 66 |he definition of| 0000eb60 20 74 68 65 20 6d 61 63 72 6f 2e 0d 20 20 20 20 | the macro.. | 0000eb70 20 20 20 20 4e 6f 20 41 54 56 20 73 75 62 73 74 | No ATV subst| 0000eb80 69 74 75 74 69 6f 6e 20 69 73 20 70 65 72 66 6f |itution is perfo| 0000eb90 72 6d 65 64 20 6f 6e 20 74 68 65 20 6c 69 6e 65 |rmed on the line| 0000eba0 73 2e 20 20 54 68 65 20 64 65 66 69 6e 69 74 69 |s. The definiti| 0000ebb0 6f 6e 0d 20 20 20 20 20 20 20 20 69 73 20 20 74 |on. is t| 0000ebc0 65 72 6d 69 6e 61 74 65 64 20 62 79 20 61 6e 20 |erminated by an | 0000ebd0 20 45 4e 44 4d 20 20 64 69 72 65 63 74 69 76 65 | ENDM directive| 0000ebe0 2e 20 20 57 69 74 68 69 6e 20 74 68 65 20 64 65 |. Within the de| 0000ebf0 66 69 6e 69 74 69 6f 6e 2c 0d 20 20 20 20 20 20 |finition,. | 0000ec00 20 20 63 6f 6d 6d 65 6e 74 20 6c 69 6e 65 73 20 | comment lines | 0000ec10 73 74 61 72 74 69 6e 67 20 77 69 74 68 20 22 21 |starting with "!| 0000ec20 22 20 77 69 6c 6c 20 62 65 20 6c 69 73 74 65 64 |" will be listed| 0000ec30 20 62 75 74 20 6e 6f 74 20 20 73 74 6f 72 65 64 | but not stored| 0000ec40 0d 20 20 20 20 20 20 20 20 69 6e 20 6d 65 6d 6f |. in memo| 0000ec50 72 79 2e 0d 0d 20 20 20 20 20 20 20 20 54 68 65 |ry... The| 0000ec60 20 6d 61 63 72 6f 20 6e 61 6d 65 20 6d 61 79 20 | macro name may | 0000ec70 6e 6f 74 20 62 65 20 6d 6f 72 65 20 74 68 61 6e |not be more than| 0000ec80 20 38 20 63 68 61 72 61 63 74 65 72 73 20 6c 6f | 8 characters lo| 0000ec90 6e 67 2e 0d 0d 20 20 20 20 20 20 20 20 54 68 65 |ng... The| 0000eca0 20 4d 41 43 52 4f 20 64 69 72 65 63 74 69 76 65 | MACRO directive| 0000ecb0 20 6d 61 79 20 6e 6f 74 20 62 65 20 75 73 65 64 | may not be used| 0000ecc0 20 77 69 74 68 69 6e 20 61 20 6d 61 63 72 6f 2e | within a macro.| 0000ecd0 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 6c |.. Exampl| 0000ece0 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 |e:.. | 0000ecf0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ed00 20 54 48 49 4e 47 20 20 4d 41 43 52 4f 0d 0d 0d | THING MACRO...| 0000ed10 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000ed20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ed30 20 20 36 39 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 | 69.......G | 0000ed40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000ed50 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 | USING THE 65C0| 0000ed60 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d |2 ASSEMBLER.H...| 0000ed70 0d 0d 1b 47 4d 45 58 49 54 20 20 1b 48 20 43 61 |...GMEXIT .H Ca| 0000ed80 75 73 65 73 20 61 20 6d 61 63 72 6f 20 74 6f 20 |uses a macro to | 0000ed90 74 65 72 6d 69 6e 61 74 65 20 69 6d 6d 65 64 69 |terminate immedi| 0000eda0 61 74 65 6c 79 2e 0d 0d 20 20 20 20 20 20 20 20 |ately... | 0000edb0 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 |Syntax:.. | 0000edc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000edd0 20 20 20 20 20 20 20 20 20 4d 45 58 49 54 0d 0d | MEXIT..| 0000ede0 0d 0d 1b 47 4d 4c 45 4e 20 20 20 1b 48 20 41 73 |...GMLEN .H As| 0000edf0 20 20 66 6f 72 20 20 41 4c 45 4e 2c 20 20 62 75 | for ALEN, bu| 0000ee00 74 20 74 68 69 73 20 63 61 6e 20 62 65 20 75 73 |t this can be us| 0000ee10 65 64 20 6f 6e 6c 79 20 77 69 74 68 69 6e 20 61 |ed only within a| 0000ee20 20 6d 61 63 72 6f 2c 20 20 61 6e 64 0d 20 20 20 | macro, and. | 0000ee30 20 20 20 20 20 63 72 65 61 74 65 73 20 61 20 6c | creates a l| 0000ee40 6f 63 61 6c 20 41 54 56 20 72 61 74 68 65 72 20 |ocal ATV rather | 0000ee50 74 68 61 6e 20 61 20 67 6c 6f 62 61 6c 20 6f 6e |than a global on| 0000ee60 65 2e 0d 0d 0d 1b 47 4d 53 45 54 20 20 20 1b 48 |e.....GMSET .H| 0000ee70 20 41 73 20 20 66 6f 72 20 20 41 53 45 54 2c 20 | As for ASET, | 0000ee80 20 62 75 74 20 74 68 69 73 20 63 61 6e 20 62 65 | but this can be| 0000ee90 20 75 73 65 64 20 6f 6e 6c 79 20 77 69 74 68 69 | used only withi| 0000eea0 6e 20 61 20 6d 61 63 72 6f 2c 20 20 61 6e 64 0d |n a macro, and.| 0000eeb0 20 20 20 20 20 20 20 20 63 72 65 61 74 65 73 20 | creates | 0000eec0 61 20 6c 6f 63 61 6c 20 41 54 56 20 72 61 74 68 |a local ATV rath| 0000eed0 65 72 20 74 68 61 6e 20 61 20 67 6c 6f 62 61 6c |er than a global| 0000eee0 20 6f 6e 65 2e 0d 0d 0d 1b 47 4d 53 54 52 20 20 | one.....GMSTR | 0000eef0 20 1b 48 20 41 73 20 20 66 6f 72 20 20 41 53 54 | .H As for AST| 0000ef00 52 2c 20 20 62 75 74 20 74 68 69 73 20 63 61 6e |R, but this can| 0000ef10 20 62 65 20 75 73 65 64 20 6f 6e 6c 79 20 77 69 | be used only wi| 0000ef20 74 68 69 6e 20 61 20 6d 61 63 72 6f 2c 20 20 61 |thin a macro, a| 0000ef30 6e 64 0d 20 20 20 20 20 20 20 20 63 72 65 61 74 |nd. creat| 0000ef40 65 73 20 61 20 6c 6f 63 61 6c 20 41 54 56 20 72 |es a local ATV r| 0000ef50 61 74 68 65 72 20 74 68 61 6e 20 61 20 67 6c 6f |ather than a glo| 0000ef60 62 61 6c 20 6f 6e 65 2e 0d 0d 0d 1b 47 4d 53 54 |bal one.....GMST| 0000ef70 52 49 50 20 1b 48 20 41 73 20 66 6f 72 20 41 53 |RIP .H As for AS| 0000ef80 54 52 49 50 2c 20 20 62 75 74 20 74 68 69 73 20 |TRIP, but this | 0000ef90 63 61 6e 20 62 65 20 75 73 65 64 20 6f 6e 6c 79 |can be used only| 0000efa0 20 77 69 74 68 69 6e 20 61 20 6d 61 63 72 6f 2c | within a macro,| 0000efb0 20 20 61 6e 64 0d 20 20 20 20 20 20 20 20 63 72 | and. cr| 0000efc0 65 61 74 65 73 20 61 20 6c 6f 63 61 6c 20 41 54 |eates a local AT| 0000efd0 56 20 72 61 74 68 65 72 20 74 68 61 6e 20 61 20 |V rather than a | 0000efe0 67 6c 6f 62 61 6c 20 6f 6e 65 2e 0d 0d 0d 0d 1b |global one......| 0000eff0 47 4d 53 57 20 20 20 20 1b 48 20 53 65 74 73 20 |GMSW .H Sets | 0000f000 74 68 65 20 74 77 6f 20 74 6f 70 20 62 79 74 65 |the two top byte| 0000f010 73 20 6f 66 20 74 68 65 20 6c 6f 61 64 20 61 6e |s of the load an| 0000f020 64 20 65 78 65 63 75 74 69 6f 6e 20 61 64 64 72 |d execution addr| 0000f030 65 73 73 65 73 2e 0d 0d 20 20 20 20 20 20 20 20 |esses... | 0000f040 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 |Syntax:.. | 0000f050 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f060 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 4d 53 57 20 | [<label>] MSW | 0000f070 20 3c 65 78 70 72 3e 0d 0d 20 20 20 20 20 20 20 | <expr>.. | 0000f080 20 42 79 20 64 65 66 61 75 6c 74 20 74 68 65 20 | By default the | 0000f090 62 79 74 65 73 20 75 73 65 64 20 61 72 65 20 24 |bytes used are $| 0000f0a0 46 46 46 46 2c 20 62 75 74 20 69 66 20 79 6f 75 |FFFF, but if you| 0000f0b0 20 61 72 65 20 61 73 73 65 6d 62 6c 69 6e 67 0d | are assembling.| 0000f0c0 20 20 20 20 20 20 20 20 63 6f 64 65 20 74 6f 20 | code to | 0000f0d0 72 75 6e 20 6f 6e 20 61 20 73 65 63 6f 6e 64 20 |run on a second | 0000f0e0 70 72 6f 63 65 73 73 6f 72 20 79 6f 75 20 77 69 |processor you wi| 0000f0f0 6c 6c 20 6e 65 65 64 20 74 6f 20 63 68 61 6e 67 |ll need to chang| 0000f100 65 20 74 68 65 6d 0d 20 20 20 20 20 20 20 20 74 |e them. t| 0000f110 6f 20 74 68 65 20 61 70 70 72 6f 70 72 69 61 74 |o the appropriat| 0000f120 65 20 76 61 6c 75 65 2e 0d 0d 20 20 20 20 20 20 |e value... | 0000f130 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 20 | Example:.. | 0000f140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f150 20 20 20 20 20 20 20 20 20 20 20 20 4d 53 57 20 | MSW | 0000f160 20 30 0d 0d 0d 1b 47 4f 52 47 20 20 20 20 1b 48 | 0....GORG .H| 0000f170 20 53 65 74 73 20 74 68 65 20 76 61 6c 75 65 20 | Sets the value | 0000f180 6f 66 20 74 68 65 20 61 64 64 72 65 73 73 20 63 |of the address c| 0000f190 6f 75 6e 74 65 72 2e 0d 0d 20 20 20 20 20 20 20 |ounter... | 0000f1a0 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 | Syntax:.. | 0000f1b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f1c0 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 4f 52 47 | [<label>] ORG| 0000f1d0 20 20 3c 65 78 70 72 3e 0d 0d 20 20 20 20 20 20 | <expr>.. | 0000f1e0 20 20 3c 65 78 70 72 3e 2c 20 20 77 68 69 63 68 | <expr>, which| 0000f1f0 20 6d 75 73 74 20 6e 6f 74 20 63 6f 6e 74 61 69 | must not contai| 0000f200 6e 20 66 6f 72 77 61 72 64 20 72 65 66 65 72 65 |n forward refere| 0000f210 6e 63 65 73 2c 20 20 67 69 76 65 73 20 74 68 65 |nces, gives the| 0000f220 0d 20 20 20 20 20 20 20 20 6e 65 77 20 20 76 61 |. new va| 0000f230 6c 75 65 2e 20 20 54 68 65 20 20 66 69 72 73 74 |lue. The first| 0000f240 20 20 4f 52 47 20 20 64 69 72 65 63 74 69 76 65 | ORG directive| 0000f250 20 20 74 68 61 74 20 20 69 73 20 20 6e 6f 74 20 | that is not | 0000f260 20 69 6e 20 20 20 61 0d 20 20 20 20 20 20 20 20 | in a. | 0000f270 44 53 45 43 54 2e 2e 44 45 4e 44 20 20 62 6c 6f |DSECT..DEND blo| 0000f280 63 6b 20 61 6c 73 6f 20 64 65 66 69 6e 65 73 20 |ck also defines | 0000f290 74 68 65 20 64 65 66 61 75 6c 74 20 6c 6f 61 64 |the default load| 0000f2a0 20 61 6e 64 20 65 78 65 63 75 74 69 6f 6e 0d 20 | and execution. | 0000f2b0 20 20 20 20 20 20 20 61 64 64 72 65 73 73 65 73 | addresses| 0000f2c0 2e 0d 0d 20 20 20 20 20 20 20 20 54 68 65 20 6f |... The o| 0000f2d0 62 6a 65 63 74 20 66 69 6c 65 20 69 73 20 6e 6f |bject file is no| 0000f2e0 74 20 61 66 66 65 63 74 65 64 20 69 6e 20 61 6e |t affected in an| 0000f2f0 79 20 77 61 79 3b 20 20 74 68 75 73 20 69 66 20 |y way; thus if | 0000f300 20 79 6f 75 20 20 75 73 65 0d 20 20 20 20 20 20 | you use. | 0000f310 20 20 4f 52 47 20 74 6f 20 61 64 76 61 6e 63 65 | ORG to advance| 0000f320 20 74 68 65 20 61 64 64 72 65 73 73 20 76 61 6c | the address val| 0000f330 75 65 2c 20 74 68 65 20 41 73 73 65 6d 62 6c 65 |ue, the Assemble| 0000f340 72 20 77 69 6c 6c 20 6e 6f 74 20 70 6c 61 6e 74 |r will not plant| 0000f350 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 0000f360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f370 20 20 20 20 37 30 0d 0d 0d 0d 0d 0d 1b 47 20 20 | 70.......G | 0000f380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f390 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 | USING THE 65| 0000f3a0 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d |C02 ASSEMBLER.H.| 0000f3b0 0d 0d 0d 20 20 20 20 20 20 20 20 61 6e 79 20 20 |... any | 0000f3c0 62 79 74 65 73 20 20 69 6e 20 74 68 65 20 6f 62 |bytes in the ob| 0000f3d0 6a 65 63 74 20 66 69 6c 65 20 74 6f 20 66 69 6c |ject file to fil| 0000f3e0 6c 20 74 68 65 20 67 61 70 2e 20 20 54 6f 20 61 |l the gap. To a| 0000f3f0 63 63 6f 6d 70 6c 69 73 68 0d 20 20 20 20 20 20 |ccomplish. | 0000f400 20 20 74 68 69 73 20 65 66 66 65 63 74 2c 20 79 | this effect, y| 0000f410 6f 75 20 63 61 6e 20 75 73 65 20 74 68 65 20 44 |ou can use the D| 0000f420 53 20 64 69 72 65 63 74 69 76 65 2e 0d 0d 20 20 |S directive... | 0000f430 20 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d | Example:..| 0000f440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f450 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 52 | OR| 0000f460 47 20 20 24 31 39 30 30 0d 0d 0d 1b 47 50 41 47 |G $1900....GPAG| 0000f470 45 20 20 20 1b 48 20 44 65 66 69 6e 65 73 20 74 |E .H Defines t| 0000f480 68 65 20 70 61 67 65 20 6c 65 6e 67 74 68 20 61 |he page length a| 0000f490 6e 64 20 77 69 64 74 68 20 6f 66 20 74 68 65 20 |nd width of the | 0000f4a0 6c 69 73 74 69 6e 67 2e 0d 0d 20 20 20 20 20 20 |listing... | 0000f4b0 20 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 | Syntax:.. | 0000f4c0 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 3c 6c | [<l| 0000f4d0 61 62 65 6c 3e 5d 20 20 50 41 47 45 20 20 3c 65 |abel>] PAGE <e| 0000f4e0 78 70 72 31 3e 5b 2c 3c 65 78 70 72 32 3e 5d 0d |xpr1>[,<expr2>].| 0000f4f0 0d 20 20 20 20 20 20 20 20 3c 65 78 70 72 31 3e |. <expr1>| 0000f500 20 69 73 20 74 68 65 20 70 68 79 73 69 63 61 6c | is the physical| 0000f510 20 6e 75 6d 62 65 72 20 6f 66 20 6c 69 6e 65 73 | number of lines| 0000f520 20 6f 6e 20 74 68 65 20 70 61 70 65 72 20 20 28 | on the paper (| 0000f530 64 65 66 61 75 6c 74 0d 20 20 20 20 20 20 20 20 |default. | 0000f540 36 36 29 2e 20 54 68 65 20 41 73 73 65 6d 62 6c |66). The Assembl| 0000f550 65 72 20 6c 65 61 76 65 73 20 61 20 73 6d 61 6c |er leaves a smal| 0000f560 6c 20 67 61 70 20 61 74 20 74 68 65 20 65 6e 64 |l gap at the end| 0000f570 20 6f 66 20 65 61 63 68 20 70 61 67 65 2c 0d 20 | of each page,. | 0000f580 20 20 20 20 20 20 20 74 6f 20 61 76 6f 69 64 20 | to avoid | 0000f590 74 68 65 20 70 65 72 66 6f 72 61 74 69 6f 6e 73 |the perforations| 0000f5a0 2e 0d 0d 20 20 20 20 20 20 20 20 3c 65 78 70 72 |... <expr| 0000f5b0 32 3e 20 69 73 20 74 68 65 20 6e 75 6d 62 65 72 |2> is the number| 0000f5c0 20 6f 66 20 63 68 61 72 61 63 74 65 72 73 20 74 | of characters t| 0000f5d0 6f 20 70 72 69 6e 74 20 6f 6e 20 65 61 63 68 20 |o print on each | 0000f5e0 6c 69 6e 65 2e 20 20 49 66 0d 20 20 20 20 20 20 |line. If. | 0000f5f0 20 20 6f 6d 69 74 74 65 64 2c 20 74 68 65 20 76 | omitted, the v| 0000f600 61 6c 75 65 20 69 73 20 73 65 74 20 74 6f 20 38 |alue is set to 8| 0000f610 30 2e 0d 0d 20 20 20 20 20 20 20 20 50 41 47 45 |0... PAGE| 0000f620 20 68 61 73 20 6e 6f 20 65 66 66 65 63 74 20 6f | has no effect o| 0000f630 6e 20 74 68 65 20 73 63 72 65 65 6e 20 64 69 73 |n the screen dis| 0000f640 70 6c 61 79 2e 0d 0d 20 20 20 20 20 20 20 20 45 |play... E| 0000f650 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 20 20 20 20 |xample:.. | 0000f660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f670 20 20 20 20 20 20 50 41 47 45 20 20 38 38 2c 31 | PAGE 88,1| 0000f680 33 32 0d 0d 0d 0d 1b 47 51 55 45 52 59 20 20 1b |32.....GQUERY .| 0000f690 48 20 44 69 73 70 6c 61 79 73 20 20 61 20 71 75 |H Displays a qu| 0000f6a0 65 73 74 69 6f 6e 20 61 6e 64 20 72 65 61 64 73 |estion and reads| 0000f6b0 20 69 6e 20 61 20 72 65 70 6c 79 2c 20 20 77 68 | in a reply, wh| 0000f6c0 69 63 68 20 69 73 20 65 76 61 6c 75 61 74 65 64 |ich is evaluated| 0000f6d0 0d 20 20 20 20 20 20 20 20 61 73 20 61 6e 20 65 |. as an e| 0000f6e0 78 70 72 65 73 73 69 6f 6e 20 61 6e 64 20 75 73 |xpression and us| 0000f6f0 65 64 20 74 6f 20 64 65 66 69 6e 65 20 61 20 6c |ed to define a l| 0000f700 61 62 65 6c 2e 0d 0d 20 20 20 20 20 20 20 20 53 |abel... S| 0000f710 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 |yntax:.. | 0000f720 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c | <| 0000f730 6c 61 62 65 6c 3e 20 20 51 55 45 52 59 20 20 3c |label> QUERY <| 0000f740 73 74 72 69 6e 67 3e 0d 0d 20 20 20 20 20 20 20 |string>.. | 0000f750 20 46 6f 72 20 64 65 74 61 69 6c 73 2c 20 73 65 | For details, se| 0000f760 65 20 73 65 63 74 69 6f 6e 20 38 2e 33 0d 0d 0d |e section 8.3...| 0000f770 0d 1b 47 52 45 50 20 20 20 20 1b 48 20 4f 75 74 |..GREP .H Out| 0000f780 70 75 74 73 20 61 20 63 6f 6d 6d 65 6e 74 20 20 |puts a comment | 0000f790 6c 69 6e 65 20 20 74 6f 20 20 74 68 65 20 20 6c |line to the l| 0000f7a0 69 73 74 69 6e 67 20 20 74 6f 20 20 6d 61 72 6b |isting to mark| 0000f7b0 20 20 61 20 20 73 6f 75 72 63 65 0d 20 20 20 20 | a source. | 0000f7c0 20 20 20 20 64 69 76 69 73 69 6f 6e 2e 0d 0d 20 | division... | 0000f7d0 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d | Syntax:..| 0000f7e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f7f0 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d | [<label>]| 0000f800 20 20 52 45 50 20 20 5b 3c 65 78 70 72 3e 5d 0d | REP [<expr>].| 0000f810 0d 20 20 20 20 20 20 20 20 3c 65 78 70 72 3e 20 |. <expr> | 0000f820 20 6d 75 73 74 20 20 6e 6f 74 20 20 65 78 63 65 | must not exce| 0000f830 65 64 20 20 31 33 32 2c 20 61 6e 64 20 20 6d 75 |ed 132, and mu| 0000f840 73 74 20 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 |st not contain | 0000f850 66 6f 72 77 61 72 64 0d 20 20 20 20 20 20 20 20 |forward. | 0000f860 72 65 66 65 72 65 6e 63 65 73 2e 20 49 66 20 79 |references. If y| 0000f870 6f 75 20 6f 6d 69 74 20 74 68 65 20 76 61 6c 75 |ou omit the valu| 0000f880 65 2c 20 74 68 65 20 41 73 73 65 6d 62 6c 65 72 |e, the Assembler| 0000f890 20 77 69 6c 6c 20 66 69 6c 6c 20 74 68 65 0d 20 | will fill the. | 0000f8a0 20 20 20 20 20 20 20 6f 75 74 70 75 74 20 6c 69 | output li| 0000f8b0 6e 65 20 74 6f 20 69 74 73 20 66 75 6c 6c 20 77 |ne to its full w| 0000f8c0 69 64 74 68 2e 0d 0d 20 20 20 20 20 20 20 20 46 |idth... F| 0000f8d0 6f 72 20 64 65 74 61 69 6c 73 2c 20 73 65 65 20 |or details, see | 0000f8e0 73 65 63 74 69 6f 6e 20 33 2e 36 2e 34 0d 0d 0d |section 3.6.4...| 0000f8f0 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 0000f900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f910 20 20 20 37 31 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 | 71.......G | 0000f920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f930 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 | USING THE 65C| 0000f940 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d |02 ASSEMBLER.H..| 0000f950 0d 0d 1b 47 53 46 43 4f 4e 44 20 1b 48 20 53 70 |...GSFCOND .H Sp| 0000f960 65 63 69 66 69 65 73 20 74 68 61 74 20 6c 69 6e |ecifies that lin| 0000f970 65 73 20 73 6b 69 70 70 65 64 20 69 6e 20 61 20 |es skipped in a | 0000f980 63 6f 6e 64 69 74 69 6f 6e 61 6c 20 20 73 68 6f |conditional sho| 0000f990 75 6c 64 20 20 6e 6f 74 20 20 62 65 0d 20 20 20 |uld not be. | 0000f9a0 20 20 20 20 20 6c 69 73 74 65 64 2e 0d 0d 20 20 | listed... | 0000f9b0 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 | Syntax:.. | 0000f9c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000f9d0 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c | [<label| 0000f9e0 3e 5d 20 20 53 46 43 4f 4e 44 0d 0d 20 20 20 20 |>] SFCOND.. | 0000f9f0 20 20 20 20 46 6f 72 20 64 65 74 61 69 6c 73 2c | For details,| 0000fa00 20 73 65 65 20 73 65 63 74 69 6f 6e 20 37 2e 34 | see section 7.4| 0000fa10 0d 0d 0d 1b 47 53 4b 50 20 20 20 20 1b 48 20 4c |....GSKP .H L| 0000fa20 65 61 76 65 73 20 61 20 67 61 70 20 69 6e 20 74 |eaves a gap in t| 0000fa30 68 65 20 6c 69 73 74 69 6e 67 20 6f 72 20 73 74 |he listing or st| 0000fa40 61 72 74 73 20 61 20 6e 65 77 20 70 61 67 65 2e |arts a new page.| 0000fa50 0d 0d 20 20 20 20 20 20 20 20 53 79 6e 74 61 78 |.. Syntax| 0000fa60 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |:.. | 0000fa70 20 20 20 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 | [<lab| 0000fa80 65 6c 3e 5d 20 20 53 4b 50 20 20 3c 65 78 70 72 |el>] SKP <expr| 0000fa90 3e 0d 20 20 20 20 20 20 20 20 20 20 20 6f 72 0d |>. or.| 0000faa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000fab0 20 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e | [<label>| 0000fac0 5d 20 20 53 4b 50 20 20 48 0d 0d 20 20 20 20 20 |] SKP H.. | 0000fad0 20 20 20 49 6e 20 74 68 65 20 66 69 72 73 74 20 | In the first | 0000fae0 66 6f 72 6d 2c 20 3c 65 78 70 72 3e 20 67 69 76 |form, <expr> giv| 0000faf0 65 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 |es the number of| 0000fb00 20 6c 69 6e 65 73 20 74 6f 20 62 65 20 6c 65 66 | lines to be lef| 0000fb10 74 0d 20 20 20 20 20 20 20 20 62 6c 61 6e 6b 2e |t. blank.| 0000fb20 20 49 6e 20 74 68 65 20 73 65 63 6f 6e 64 2c 20 | In the second, | 0000fb30 61 20 6e 65 77 20 70 61 67 65 20 69 73 20 73 74 |a new page is st| 0000fb40 61 72 74 65 64 2e 0d 0d 20 20 20 20 20 20 20 20 |arted... | 0000fb50 54 68 65 20 53 4b 50 20 64 69 72 65 63 74 69 76 |The SKP directiv| 0000fb60 65 20 69 74 73 65 6c 66 20 69 73 20 6e 6f 74 20 |e itself is not | 0000fb70 6c 69 73 74 65 64 2e 0d 0d 20 20 20 20 20 20 20 |listed... | 0000fb80 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 20 20 | Example:.. | 0000fb90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000fba0 20 20 20 20 20 20 20 20 20 20 20 53 4b 50 20 20 | SKP | 0000fbb0 35 0d 0d 0d 1b 47 53 54 4f 50 20 20 20 1b 48 20 |5....GSTOP .H | 0000fbc0 41 62 6f 72 74 73 20 74 68 65 20 61 73 73 65 6d |Aborts the assem| 0000fbd0 62 6c 79 20 6f 6e 20 70 61 73 73 20 31 2c 20 6f |bly on pass 1, o| 0000fbe0 75 74 70 75 74 74 69 6e 67 20 61 20 6d 65 73 73 |utputting a mess| 0000fbf0 61 67 65 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 |age... Sy| 0000fc00 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 |ntax:.. | 0000fc10 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 3c 6c | [<l| 0000fc20 61 62 65 6c 3e 5d 20 20 53 54 4f 50 20 20 3c 73 |abel>] STOP <s| 0000fc30 74 72 69 6e 67 3e 0d 0d 20 20 20 20 20 20 20 20 |tring>.. | 0000fc40 54 68 65 20 41 73 73 65 6d 62 6c 65 72 20 77 69 |The Assembler wi| 0000fc50 6c 6c 20 64 69 73 70 6c 61 79 20 3c 73 74 72 69 |ll display <stri| 0000fc60 6e 67 3e 2c 20 74 68 65 6e 20 61 62 6f 72 74 20 |ng>, then abort | 0000fc70 77 69 74 68 20 74 68 65 20 65 72 72 6f 72 0d 20 |with the error. | 0000fc80 20 20 20 20 20 20 20 6d 65 73 73 61 67 65 20 22 | message "| 0000fc90 53 74 6f 70 70 65 64 22 2e 0d 0d 20 20 20 20 20 |Stopped"... | 0000fca0 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 | Example:.. | 0000fcb0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000fcc0 20 53 54 4f 50 20 20 27 54 6f 6f 20 6d 75 63 68 | STOP 'Too much| 0000fcd0 20 69 6e 20 70 61 67 65 20 7a 65 72 6f 27 0d 0d | in page zero'..| 0000fce0 0d 1b 47 53 54 52 20 20 20 20 1b 48 20 54 68 69 |..GSTR .H Thi| 0000fcf0 73 20 20 69 73 20 20 73 69 6d 69 6c 61 72 20 20 |s is similar | 0000fd00 74 6f 20 20 41 53 43 2c 20 20 65 78 63 65 70 74 |to ASC, except| 0000fd10 20 20 74 68 61 74 20 20 74 68 65 20 20 41 73 73 | that the Ass| 0000fd20 65 6d 62 6c 65 72 20 77 69 6c 6c 0d 20 20 20 20 |embler will. | 0000fd30 20 20 20 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c | automaticall| 0000fd40 79 20 61 64 64 20 61 20 24 30 44 20 62 79 74 65 |y add a $0D byte| 0000fd50 20 28 43 61 72 72 69 61 67 65 20 52 65 74 75 72 | (Carriage Retur| 0000fd60 6e 29 20 20 74 6f 20 20 74 68 65 20 20 62 79 74 |n) to the byt| 0000fd70 65 73 0d 20 20 20 20 20 20 20 20 67 65 6e 65 72 |es. gener| 0000fd80 61 74 65 64 2e 0d 0d 0d 1b 47 53 59 53 43 4c 49 |ated.....GSYSCLI| 0000fd90 20 1b 48 20 49 73 73 75 65 73 20 61 20 4d 4f 53 | .H Issues a MOS| 0000fda0 20 63 6f 6d 6d 61 6e 64 2c 20 61 6c 6c 6f 77 69 | command, allowi| 0000fdb0 6e 67 20 79 6f 75 2c 20 66 6f 72 20 65 78 61 6d |ng you, for exam| 0000fdc0 70 6c 65 2c 20 74 6f 20 63 68 61 6e 67 65 20 74 |ple, to change t| 0000fdd0 68 65 0d 20 20 20 20 20 20 20 20 64 65 66 61 75 |he. defau| 0000fde0 6c 74 20 64 69 73 63 20 64 72 69 76 65 2e 0d 0d |lt disc drive...| 0000fdf0 20 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d | Syntax:.| 0000fe00 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 0000fe10 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 | [<label>] | 0000fe20 20 53 59 53 43 4c 49 20 20 3c 73 74 72 69 6e 67 | SYSCLI <string| 0000fe30 3e 0d 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |>.... | 0000fe40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000fe50 20 20 20 20 20 20 37 32 0d 0d 0d 0d 0d 0d 1b 47 | 72.......G| 0000fe60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 0000fe70 20 20 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 | USING THE | 0000fe80 36 35 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b |65C02 ASSEMBLER.| 0000fe90 48 0d 0d 0d 0d 20 20 20 20 20 20 20 20 59 6f 75 |H.... You| 0000fea0 20 20 6e 65 65 64 20 20 6e 6f 74 20 20 62 65 67 | need not beg| 0000feb0 69 6e 20 74 68 65 20 73 74 72 69 6e 67 20 74 6f |in the string to| 0000fec0 20 62 65 20 69 73 73 75 65 64 20 61 73 20 61 20 | be issued as a | 0000fed0 4d 4f 53 20 63 6f 6d 6d 61 6e 64 0d 20 20 20 20 |MOS command. | 0000fee0 20 20 20 20 77 69 74 68 20 61 20 22 2a 22 2c 20 | with a "*", | 0000fef0 62 75 74 20 69 74 20 64 6f 65 73 6e 27 74 20 6d |but it doesn't m| 0000ff00 61 74 74 65 72 20 69 66 20 79 6f 75 20 64 6f 2e |atter if you do.| 0000ff10 20 4e 6f 74 65 20 74 68 61 74 20 63 61 72 65 20 | Note that care | 0000ff20 69 73 0d 20 20 20 20 20 20 20 20 6e 65 65 64 65 |is. neede| 0000ff30 64 20 6f 76 65 72 20 74 68 65 20 63 6f 6d 6d 61 |d over the comma| 0000ff40 6e 64 73 20 79 6f 75 20 74 72 79 20 20 74 6f 20 |nds you try to | 0000ff50 20 65 78 65 63 75 74 65 2e 20 20 41 6e 79 74 68 | execute. Anyth| 0000ff60 69 6e 67 20 20 74 68 61 74 0d 20 20 20 20 20 20 |ing that. | 0000ff70 20 20 75 73 65 73 20 20 6d 65 6d 6f 72 79 20 20 | uses memory | 0000ff80 77 69 6c 6c 20 20 61 6c 6d 6f 73 74 20 20 63 65 |will almost ce| 0000ff90 72 74 61 69 6e 6c 79 20 20 63 6f 72 72 75 70 74 |rtainly corrupt| 0000ffa0 20 74 68 65 20 41 73 73 65 6d 62 6c 65 72 27 73 | the Assembler's| 0000ffb0 0d 20 20 20 20 20 20 20 20 77 6f 72 6b 73 70 61 |. workspa| 0000ffc0 63 65 20 61 6e 64 20 63 61 75 73 65 20 61 73 73 |ce and cause ass| 0000ffd0 65 6d 62 6c 79 20 74 6f 20 67 6f 20 68 6f 72 72 |embly to go horr| 0000ffe0 69 62 6c 79 20 77 72 6f 6e 67 2e 0d 0d 20 20 20 |ibly wrong... | 0000fff0 20 20 20 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 | Example:.. | 00010000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00010010 20 20 20 20 20 20 20 20 20 53 59 53 43 4c 49 20 | SYSCLI | 00010020 20 27 44 52 49 56 45 20 32 27 0d 0d 0d 1b 47 53 | 'DRIVE 2'....GS| 00010030 59 53 56 44 55 20 1b 48 20 4f 75 74 70 75 74 73 |YSVDU .H Outputs| 00010040 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 62 79 74 | one or more byt| 00010050 65 73 20 74 6f 20 74 68 65 20 73 63 72 65 65 6e |es to the screen| 00010060 20 61 6e 64 20 70 72 69 6e 74 65 72 2e 0d 0d 20 | and printer... | 00010070 20 20 20 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d | Syntax:..| 00010080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00010090 5b 3c 6c 61 62 65 6c 3e 5d 20 20 53 59 53 56 44 |[<label>] SYSVD| 000100a0 55 20 20 3c 65 78 70 72 3e 5b 2c 3c 65 78 70 72 |U <expr>[,<expr| 000100b0 3e 2e 2e 2e 5d 0d 0d 20 20 20 20 20 20 20 20 54 |>...].. T| 000100c0 68 65 20 64 69 72 65 63 74 69 76 65 20 20 69 73 |he directive is| 000100d0 20 20 73 69 6d 69 6c 61 72 20 20 74 6f 20 20 74 | similar to t| 000100e0 68 65 20 20 42 41 53 49 43 20 20 56 44 55 20 20 |he BASIC VDU | 000100f0 63 6f 6d 6d 61 6e 64 2e 20 20 54 68 65 0d 20 20 |command. The. | 00010100 20 20 20 20 20 20 6c 6f 77 2d 62 79 74 65 20 6f | low-byte o| 00010110 66 20 65 61 63 68 20 3c 65 78 70 72 3e 20 69 73 |f each <expr> is| 00010120 20 77 72 69 74 74 65 6e 20 77 69 74 68 20 61 20 | written with a | 00010130 63 61 6c 6c 20 74 6f 20 4f 53 57 52 43 48 2e 20 |call to OSWRCH. | 00010140 54 68 69 73 0d 20 20 20 20 20 20 20 20 67 69 76 |This. giv| 00010150 65 73 20 79 6f 75 20 61 20 6d 65 61 6e 73 20 6f |es you a means o| 00010160 66 20 73 65 6e 64 69 6e 67 20 63 6f 6e 74 72 6f |f sending contro| 00010170 6c 20 63 6f 64 65 73 20 74 6f 20 61 20 70 72 69 |l codes to a pri| 00010180 6e 74 65 72 20 74 6f 20 73 65 74 0d 20 20 20 20 |nter to set. | 00010190 20 20 20 20 70 61 67 65 20 66 6f 72 6d 61 74 73 | page formats| 000101a0 2c 20 65 74 63 2e 0d 0d 20 20 20 20 20 20 20 20 |, etc... | 000101b0 53 59 53 56 44 55 20 20 77 69 6c 6c 20 73 65 6e |SYSVDU will sen| 000101c0 64 20 61 6c 6c 20 74 68 65 20 62 79 74 65 73 20 |d all the bytes | 000101d0 79 6f 75 20 73 70 65 63 69 66 79 20 74 6f 20 74 |you specify to t| 000101e0 68 65 20 73 63 72 65 65 6e 2e 20 20 49 66 0d 20 |he screen. If. | 000101f0 20 20 20 20 20 20 20 79 6f 75 20 68 61 76 65 20 | you have | 00010200 75 73 65 64 20 74 68 65 20 22 2d 50 22 20 63 6f |used the "-P" co| 00010210 6d 6d 61 6e 64 2d 6c 69 6e 65 20 6f 70 74 69 6f |mmand-line optio| 00010220 6e 2c 20 74 68 65 79 20 77 69 6c 6c 20 61 6c 73 |n, they will als| 00010230 6f 20 20 62 65 0d 20 20 20 20 20 20 20 20 73 65 |o be. se| 00010240 6e 74 20 20 74 6f 20 20 74 68 65 20 70 72 69 6e |nt to the prin| 00010250 74 65 72 2e 20 20 54 6f 20 73 65 6e 64 20 74 68 |ter. To send th| 00010260 65 20 62 79 74 65 73 20 1b 2d 01 6f 6e 6c 79 1b |e bytes .-.only.| 00010270 2d 00 20 74 6f 20 74 68 65 20 70 72 69 6e 74 65 |-. to the printe| 00010280 72 2c 0d 20 20 20 20 20 20 20 20 70 72 65 63 65 |r,. prece| 00010290 64 65 20 65 61 63 68 20 77 69 74 68 20 61 20 22 |de each with a "| 000102a0 31 22 20 76 61 6c 75 65 2e 20 20 54 68 65 20 62 |1" value. The b| 000102b0 79 74 65 73 20 61 72 65 20 6e 6f 74 20 20 73 65 |ytes are not se| 000102c0 6e 74 20 20 74 6f 20 20 61 0d 20 20 20 20 20 20 |nt to a. | 000102d0 20 20 6c 69 73 74 69 6e 67 20 66 69 6c 65 20 73 | listing file s| 000102e0 65 6c 65 63 74 65 64 20 77 69 74 68 20 74 68 65 |elected with the| 000102f0 20 22 2d 46 22 20 6f 70 74 69 6f 6e 2e 0d 0d 20 | "-F" option... | 00010300 20 20 20 20 20 20 20 53 59 53 56 44 55 20 6f 70 | SYSVDU op| 00010310 65 72 61 74 65 73 20 6f 6e 20 62 6f 74 68 20 70 |erates on both p| 00010320 61 73 73 65 73 20 6f 66 20 74 68 65 20 41 73 73 |asses of the Ass| 00010330 65 6d 62 6c 65 72 2e 0d 0d 20 20 20 20 20 20 20 |embler... | 00010340 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 20 20 | Example:.. | 00010350 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00010360 20 20 20 20 20 53 59 53 56 44 55 20 20 31 2c 32 | SYSVDU 1,2| 00010370 37 2c 31 2c 27 45 27 0d 0d 0d 1b 47 53 59 53 56 |7,1,'E'....GSYSV| 00010380 44 55 31 1b 48 20 54 68 69 73 20 64 69 72 65 63 |DU1.H This direc| 00010390 74 69 76 65 20 69 73 20 69 64 65 6e 74 69 63 61 |tive is identica| 000103a0 6c 20 74 6f 20 20 53 59 53 56 44 55 2c 20 20 62 |l to SYSVDU, b| 000103b0 75 74 20 6f 70 65 72 61 74 65 73 20 6f 6e 6c 79 |ut operates only| 000103c0 20 20 6f 6e 0d 20 20 20 20 20 20 20 20 70 61 73 | on. pas| 000103d0 73 20 31 2e 0d 0d 1b 47 53 59 53 56 44 55 32 1b |s 1....GSYSVDU2.| 000103e0 48 20 54 68 69 73 20 64 69 72 65 63 74 69 76 65 |H This directive| 000103f0 20 69 73 20 69 64 65 6e 74 69 63 61 6c 20 74 6f | is identical to| 00010400 20 20 53 59 53 56 44 55 2c 20 20 62 75 74 20 6f | SYSVDU, but o| 00010410 70 65 72 61 74 65 73 20 6f 6e 6c 79 20 20 6f 6e |perates only on| 00010420 0d 20 20 20 20 20 20 20 20 70 61 73 73 20 32 2e |. pass 2.| 00010430 0d 0d 0d 1b 47 54 41 42 53 20 20 20 1b 48 20 54 |....GTABS .H T| 00010440 68 69 73 20 20 64 69 72 65 63 74 69 76 65 20 20 |his directive | 00010450 61 6c 6c 6f 77 73 20 20 79 6f 75 20 74 6f 20 72 |allows you to r| 00010460 65 64 65 66 69 6e 65 20 74 68 65 20 54 41 42 20 |edefine the TAB | 00010470 70 6f 73 69 74 69 6f 6e 73 20 74 68 65 0d 20 20 |positions the. | 00010480 20 20 20 20 20 20 41 73 73 65 6d 62 6c 65 72 20 | Assembler | 00010490 77 69 6c 6c 20 75 73 65 20 77 68 65 6e 20 6c 69 |will use when li| 000104a0 73 74 69 6e 67 20 73 6f 75 72 63 65 20 6c 69 6e |sting source lin| 000104b0 65 73 2e 0d 0d 20 20 20 20 20 20 20 20 53 79 6e |es... Syn| 000104c0 74 61 78 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 |tax:.. | 000104d0 20 20 20 20 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d | [<label>]| 000104e0 20 20 54 41 42 53 20 20 3c 65 78 70 72 3e 5b 2c | TABS <expr>[,| 000104f0 3c 65 78 70 72 3e 2e 2e 2e 5d 0d 0d 20 20 20 20 |<expr>...].. | 00010500 20 20 20 20 59 6f 75 20 6d 61 79 20 73 70 65 63 | You may spec| 00010510 69 66 79 20 75 70 20 74 6f 20 31 34 20 54 41 42 |ify up to 14 TAB| 00010520 20 70 6f 73 69 74 69 6f 6e 73 3a 20 61 6e 79 20 | positions: any | 00010530 65 78 63 65 73 73 20 76 61 6c 75 65 73 20 77 69 |excess values wi| 00010540 6c 6c 0d 20 20 20 20 20 20 20 20 62 65 20 69 67 |ll. be ig| 00010550 6e 6f 72 65 64 2e 20 20 53 70 65 63 69 66 79 69 |nored. Specifyi| 00010560 6e 67 20 74 68 65 20 64 69 72 65 63 74 69 76 65 |ng the directive| 00010570 20 77 69 74 68 20 20 6e 6f 20 20 6f 70 65 72 61 | with no opera| 00010580 6e 64 20 20 66 69 65 6c 64 0d 20 20 20 20 20 20 |nd field. | 00010590 20 20 77 69 6c 6c 20 72 65 73 65 74 20 74 68 65 | will reset the| 000105a0 20 62 75 69 6c 74 2d 69 6e 20 64 65 66 61 75 6c | built-in defaul| 000105b0 74 73 2e 0d 0d 20 20 20 20 20 20 20 20 53 65 65 |ts... See| 000105c0 20 73 65 63 74 69 6f 6e 20 33 2e 32 20 66 6f 72 | section 3.2 for| 000105d0 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0d | more details...| 000105e0 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000105f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00010600 20 20 37 33 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 | 73.......G | 00010610 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00010620 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 | USING THE 65C0| 00010630 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d |2 ASSEMBLER.H...| 00010640 0d 0d 1b 47 54 54 4c 20 20 20 20 1b 48 20 44 65 |...GTTL .H De| 00010650 66 69 6e 65 73 20 74 68 65 20 74 69 74 6c 65 20 |fines the title | 00010660 73 74 72 69 6e 67 20 6f 6e 20 74 68 65 20 74 6f |string on the to| 00010670 70 20 6f 66 20 65 61 63 68 20 6c 69 73 74 69 6e |p of each listin| 00010680 67 20 70 61 67 65 2e 0d 0d 20 20 20 20 20 20 20 |g page... | 00010690 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 20 20 20 | Syntax:.. | 000106a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000106b0 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 54 54 4c 20 | [<label>] TTL | 000106c0 20 3c 73 74 72 69 6e 67 3e 0d 0d 20 20 20 20 20 | <string>.. | 000106d0 20 20 20 54 68 65 20 20 41 73 73 65 6d 62 6c 65 | The Assemble| 000106e0 72 20 20 75 73 65 73 20 20 74 68 65 20 20 66 69 |r uses the fi| 000106f0 72 73 74 20 32 30 20 62 79 74 65 73 20 6f 66 20 |rst 20 bytes of | 00010700 74 68 65 20 73 74 72 69 6e 67 20 61 73 20 74 68 |the string as th| 00010710 65 0d 20 20 20 20 20 20 20 20 70 61 67 65 20 74 |e. page t| 00010720 69 74 6c 65 2c 20 61 6e 64 20 61 6c 73 6f 20 73 |itle, and also s| 00010730 74 61 72 74 73 20 61 20 6e 65 77 20 70 61 67 65 |tarts a new page| 00010740 2e 0d 0d 20 20 20 20 20 20 20 20 45 78 61 6d 70 |... Examp| 00010750 6c 65 3a 0d 0d 20 20 20 20 20 20 20 20 20 20 20 |le:.. | 00010760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 54 | TT| 00010770 4c 20 20 27 53 63 72 65 65 6e 20 44 75 6d 70 65 |L 'Screen Dumpe| 00010780 72 27 0d 0d 0d 1b 47 54 49 4d 45 20 20 20 1b 48 |r'....GTIME .H| 00010790 20 44 65 66 69 6e 65 73 20 74 68 65 20 74 69 6d | Defines the tim| 000107a0 65 73 74 61 6d 70 20 73 74 72 69 6e 67 20 6f 75 |estamp string ou| 000107b0 74 70 75 74 20 6f 6e 20 65 61 63 68 20 6c 69 73 |tput on each lis| 000107c0 74 69 6e 67 20 70 61 67 65 2e 0d 0d 20 20 20 20 |ting page... | 000107d0 20 20 20 20 53 79 6e 74 61 78 3a 0d 0d 20 20 20 | Syntax:.. | 000107e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000107f0 20 20 20 5b 3c 6c 61 62 65 6c 3e 5d 20 20 54 49 | [<label>] TI| 00010800 4d 45 20 20 3c 73 74 72 69 6e 67 3e 0d 0d 20 20 |ME <string>.. | 00010810 20 20 20 20 20 20 54 68 65 20 41 73 73 65 6d 62 | The Assemb| 00010820 6c 65 72 20 75 73 65 73 20 74 68 65 20 66 69 72 |ler uses the fir| 00010830 73 74 20 32 34 20 62 79 74 65 73 20 6f 66 20 74 |st 24 bytes of t| 00010840 68 65 20 20 73 74 72 69 6e 67 20 20 66 6f 72 20 |he string for | 00010850 20 74 68 65 0d 20 20 20 20 20 20 20 20 6e 65 77 | the. new| 00010860 20 74 69 6d 65 73 74 61 6d 70 2e 20 54 68 65 20 | timestamp. The | 00010870 76 61 6c 75 65 20 6e 65 65 64 20 6e 6f 74 20 62 |value need not b| 00010880 65 20 61 20 74 69 6d 65 3b 20 79 6f 75 20 63 61 |e a time; you ca| 00010890 6e 20 75 73 65 20 69 74 20 61 73 0d 20 20 20 20 |n use it as. | 000108a0 20 20 20 20 61 20 73 75 62 73 69 64 69 61 72 79 | a subsidiary| 000108b0 20 70 61 67 65 20 74 69 74 6c 65 2e 0d 0d 20 20 | page title... | 000108c0 20 20 20 20 20 20 4f 6e 20 61 20 4d 61 73 74 65 | On a Maste| 000108d0 72 20 31 32 38 20 74 68 65 20 64 69 72 65 63 74 |r 128 the direct| 000108e0 69 76 65 20 69 73 20 69 67 6e 6f 72 65 64 2c 20 |ive is ignored, | 000108f0 20 61 73 20 74 68 65 20 74 69 6d 65 73 74 61 6d | as the timestam| 00010900 70 20 69 73 0d 20 20 20 20 20 20 20 20 72 65 61 |p is. rea| 00010910 64 20 20 66 72 6f 6d 20 20 74 68 65 20 20 72 65 |d from the re| 00010920 61 6c 2d 74 69 6d 65 20 20 63 6c 6f 63 6b 2e 20 |al-time clock. | 00010930 20 54 68 65 20 20 41 73 73 65 6d 62 6c 65 72 20 | The Assembler | 00010940 63 61 6e 20 61 6c 73 6f 20 62 65 0d 20 20 20 20 |can also be. | 00010950 20 20 20 20 63 6f 6e 66 69 67 75 72 65 64 20 74 | configured t| 00010960 6f 20 72 65 61 64 20 61 20 74 68 69 72 64 2d 70 |o read a third-p| 00010970 61 72 74 79 20 20 72 65 61 6c 2d 74 69 6d 65 20 |arty real-time | 00010980 20 63 6c 6f 63 6b 20 20 66 69 74 74 65 64 20 20 | clock fitted | 00010990 74 6f 0d 20 20 20 20 20 20 20 20 6f 74 68 65 72 |to. other| 000109a0 20 6d 6f 64 65 6c 73 2e 0d 0d 20 20 20 20 20 20 | models... | 000109b0 20 20 45 78 61 6d 70 6c 65 3a 0d 0d 20 20 20 20 | Example:.. | 000109c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000109d0 20 54 49 4d 45 20 20 27 32 35 2d 41 75 67 75 73 | TIME '25-Augus| 000109e0 74 2d 31 39 38 36 20 31 33 3a 30 30 27 0d 0d 0d |t-1986 13:00'...| 000109f0 1b 47 57 41 49 54 20 20 20 1b 48 20 54 68 69 73 |.GWAIT .H This| 00010a00 20 20 64 69 73 70 6c 61 79 73 20 20 61 20 20 73 | displays a s| 00010a10 74 72 69 6e 67 20 20 28 73 65 65 20 20 75 6e 64 |tring (see und| 00010a20 65 72 20 20 44 49 53 50 29 2c 20 74 68 65 6e 20 |er DISP), then | 00010a30 70 61 75 73 65 73 20 74 68 65 0d 20 20 20 20 20 |pauses the. | 00010a40 20 20 20 61 73 73 65 6d 62 6c 79 20 75 6e 74 69 | assembly unti| 00010a50 6c 20 79 6f 75 20 70 72 65 73 73 20 61 20 6b 65 |l you press a ke| 00010a60 79 2e 0d 0d 0d 1b 47 57 41 49 54 31 20 20 1b 48 |y.....GWAIT1 .H| 00010a70 20 41 73 20 66 6f 72 20 57 41 49 54 2c 20 62 75 | As for WAIT, bu| 00010a80 74 20 6f 70 65 72 61 74 65 73 20 6f 6e 6c 79 20 |t operates only | 00010a90 6f 6e 20 70 61 73 73 20 31 2e 0d 0d 0d 1b 47 57 |on pass 1.....GW| 00010aa0 41 49 54 32 20 20 1b 48 20 41 73 20 66 6f 72 20 |AIT2 .H As for | 00010ab0 57 41 49 54 2c 20 62 75 74 20 6f 70 65 72 61 74 |WAIT, but operat| 00010ac0 65 73 20 6f 6e 6c 79 20 6f 6e 20 70 61 73 73 20 |es only on pass | 00010ad0 32 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |2...............| 00010ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00010b00 20 37 34 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 | 74.......G | 00010b10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00010b20 20 55 53 49 4e 47 20 54 48 45 20 36 35 43 30 32 | USING THE 65C02| 00010b30 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d | ASSEMBLER.H....| 00010b40 1b 2d 01 1b 47 41 70 70 65 6e 64 69 78 20 33 2e |.-..GAppendix 3.| 00010b50 20 44 49 46 46 45 52 45 4e 43 45 53 20 46 52 4f | DIFFERENCES FRO| 00010b60 4d 20 54 48 45 20 41 44 45 20 41 53 53 45 4d 42 |M THE ADE ASSEMB| 00010b70 4c 45 52 1b 2d 00 1b 48 0d 0d 20 20 20 54 68 65 |LER.-..H.. The| 00010b80 20 36 35 43 30 32 20 41 73 73 65 6d 62 6c 65 72 | 65C02 Assembler| 00010b90 20 63 6f 6e 74 61 69 6e 73 20 61 20 6e 75 6d 62 | contains a numb| 00010ba0 65 72 20 6f 66 20 73 69 6d 69 6c 61 72 20 64 69 |er of similar di| 00010bb0 72 65 63 74 69 76 65 73 20 74 6f 20 20 74 68 65 |rectives to the| 00010bc0 0d 41 44 45 20 41 73 73 65 6d 62 6c 65 72 2c 20 |.ADE Assembler, | 00010bd0 61 6e 64 20 69 6e 20 61 6c 6d 6f 73 74 20 61 6c |and in almost al| 00010be0 6c 20 63 61 73 65 73 20 69 74 20 77 69 6c 6c 20 |l cases it will | 00010bf0 62 65 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 61 |be possible to a| 00010c00 73 73 65 6d 62 6c 65 0d 70 72 6f 67 72 61 6d 73 |ssemble.programs| 00010c10 20 77 72 69 74 74 65 6e 20 66 6f 72 20 41 44 45 | written for ADE| 00010c20 20 77 69 74 68 20 69 74 2e 0d 0d 20 20 20 41 20 | with it... A | 00010c30 20 66 65 77 20 20 64 69 72 65 63 74 69 76 65 73 | few directives| 00010c40 2c 20 74 68 6f 75 67 68 2c 20 68 61 76 65 20 73 |, though, have s| 00010c50 6f 6d 65 20 6d 69 6e 6f 72 20 64 69 66 66 65 72 |ome minor differ| 00010c60 65 6e 63 65 73 2c 20 20 61 6e 64 20 74 68 65 72 |ences, and ther| 00010c70 65 0d 61 72 65 20 61 6c 73 6f 20 73 6f 6d 65 20 |e.are also some | 00010c80 73 6d 61 6c 6c 20 70 6f 69 6e 74 73 20 6f 6e 20 |small points on | 00010c90 73 6f 75 72 63 65 20 66 6f 72 6d 61 74 20 74 68 |source format th| 00010ca0 61 74 20 6d 75 73 74 20 62 65 20 63 6f 6e 73 69 |at must be consi| 00010cb0 64 65 72 65 64 2e 0d 0d 20 20 2d 20 4f 6e 6c 79 |dered... - Only| 00010cc0 20 73 69 6e 67 6c 65 2d 20 61 6e 64 20 64 6f 75 | single- and dou| 00010cd0 62 6c 65 2d 71 75 6f 74 65 20 63 68 61 72 61 63 |ble-quote charac| 00010ce0 74 65 72 73 20 6d 61 79 20 64 65 6c 69 6d 69 74 |ters may delimit| 00010cf0 20 73 74 72 69 6e 67 73 2e 0d 0d 20 20 2d 20 54 | strings... - T| 00010d00 68 65 20 73 65 63 6f 6e 64 20 64 65 6c 69 6d 69 |he second delimi| 00010d10 74 65 72 20 6d 75 73 74 20 6e 6f 74 20 62 65 20 |ter must not be | 00010d20 6f 6d 69 74 74 65 64 20 66 72 6f 6d 20 63 68 61 |omitted from cha| 00010d30 72 61 63 74 65 72 20 63 6f 6e 73 74 61 6e 74 73 |racter constants| 00010d40 2e 0d 0d 20 20 2d 20 43 68 61 72 61 63 74 65 72 |... - Character| 00010d50 20 63 6f 6e 73 74 61 6e 74 73 20 6f 62 65 79 20 | constants obey | 00010d60 74 68 65 20 73 61 6d 65 20 72 75 6c 65 20 61 73 |the same rule as| 00010d70 20 73 74 72 69 6e 67 73 20 69 6e 20 74 68 65 20 | strings in the | 00010d80 20 41 53 43 20 20 61 6e 64 0d 20 20 20 20 53 54 | ASC and. ST| 00010d90 52 20 20 64 69 72 65 63 74 69 76 65 73 20 20 66 |R directives f| 00010da0 6f 72 20 20 63 6f 6e 74 72 6f 6c 20 63 68 61 72 |or control char| 00010db0 61 63 74 65 72 73 20 61 6e 64 20 74 68 6f 73 65 |acters and those| 00010dc0 20 77 69 74 68 20 62 69 74 20 37 20 73 65 74 2e | with bit 7 set.| 00010dd0 0d 20 20 20 20 54 68 75 73 20 74 68 65 20 22 7c |. Thus the "|| 00010de0 22 20 61 6e 64 20 22 5e 22 20 63 68 61 72 61 63 |" and "^" charac| 00010df0 74 65 72 73 20 6e 65 65 64 20 74 6f 20 62 65 20 |ters need to be | 00010e00 20 64 6f 75 62 6c 65 64 20 20 69 66 20 20 74 68 | doubled if th| 00010e10 65 79 20 20 61 72 65 0d 20 20 20 20 62 65 69 6e |ey are. bein| 00010e20 67 20 64 65 66 69 6e 65 64 20 61 73 20 63 6f 6e |g defined as con| 00010e30 73 74 61 6e 74 73 2e 0d 0d 20 20 2d 20 53 74 72 |stants... - Str| 00010e40 69 6e 67 73 20 20 63 6f 6e 74 61 69 6e 69 6e 67 |ings containing| 00010e50 20 20 63 6f 6d 6d 61 73 2c 20 20 6f 72 20 20 6c | commas, or l| 00010e60 65 61 64 69 6e 67 20 6f 72 20 74 72 61 69 6c 69 |eading or traili| 00010e70 6e 67 20 73 70 61 63 65 73 2c 20 20 61 72 65 0d |ng spaces, are.| 00010e80 20 20 20 20 73 70 65 63 69 66 69 65 64 20 61 73 | specified as| 00010e90 20 6d 61 63 72 6f 20 20 70 61 72 61 6d 65 74 65 | macro paramete| 00010ea0 72 73 20 20 77 69 74 68 69 6e 20 20 6e 6f 72 6d |rs within norm| 00010eb0 61 6c 20 20 73 74 72 69 6e 67 20 20 64 65 6c 69 |al string deli| 00010ec0 6d 69 74 65 72 73 0d 20 20 20 20 72 61 74 68 65 |miters. rathe| 00010ed0 72 20 74 68 61 6e 20 69 6e 20 5b 5d 20 62 72 61 |r than in [] bra| 00010ee0 63 6b 65 74 73 2e 0d 0d 20 20 2d 20 4d 61 63 72 |ckets... - Macr| 00010ef0 6f 20 70 61 72 61 6d 65 74 65 72 73 20 6d 75 73 |o parameters mus| 00010f00 74 20 61 6c 77 61 79 73 20 62 65 20 73 65 70 61 |t always be sepa| 00010f10 72 61 74 65 64 20 62 79 20 63 6f 6d 6d 61 73 2e |rated by commas.| 00010f20 0d 0d 20 20 2d 20 54 68 65 20 20 53 59 53 46 58 |.. - The SYSFX| 00010f30 20 64 69 72 65 63 74 69 76 65 20 69 73 20 69 67 | directive is ig| 00010f40 6e 6f 72 65 64 3a 20 74 6f 20 61 63 68 69 65 76 |nored: to achiev| 00010f50 65 20 74 68 65 20 64 65 73 69 72 65 64 20 65 66 |e the desired ef| 00010f60 66 65 63 74 20 79 6f 75 0d 20 20 20 20 73 68 6f |fect you. sho| 00010f70 75 6c 64 20 75 73 65 20 74 68 65 20 53 59 53 43 |uld use the SYSC| 00010f80 4c 49 20 64 69 72 65 63 74 69 76 65 20 74 6f 20 |LI directive to | 00010f90 69 73 73 75 65 20 61 20 2a 46 58 20 63 6f 6d 6d |issue a *FX comm| 00010fa0 61 6e 64 2e 0d 0d 20 20 2d 20 4d 61 63 72 6f 20 |and... - Macro | 00010fb0 6c 69 62 72 61 72 69 65 73 20 61 72 65 20 6e 6f |libraries are no| 00010fc0 74 20 69 6d 70 6c 65 6d 65 6e 74 65 64 2e 0d 0d |t implemented...| 00010fd0 20 20 2d 20 4c 6f 63 61 6c 20 6c 61 62 65 6c 73 | - Local labels| 00010fe0 20 77 69 74 68 69 6e 20 6d 61 63 72 6f 73 20 61 | within macros a| 00010ff0 72 65 20 6e 6f 74 20 69 6d 70 6c 65 6d 65 6e 74 |re not implement| 00011000 65 64 2e 20 54 68 65 20 73 79 73 74 65 6d 20 41 |ed. The system A| 00011010 54 56 20 24 4d 43 0d 20 20 20 20 73 68 6f 75 6c |TV $MC. shoul| 00011020 64 20 62 65 20 75 73 65 64 20 74 6f 20 63 6f 6e |d be used to con| 00011030 73 74 72 75 63 74 20 75 6e 69 71 75 65 20 6c 61 |struct unique la| 00011040 62 65 6c 73 20 61 73 20 64 65 73 63 72 69 62 65 |bels as describe| 00011050 64 20 69 6e 20 20 73 65 63 74 69 6f 6e 0d 20 20 |d in section. | 00011060 20 20 39 2e 35 2e 0d 0d 20 20 2d 20 45 78 70 72 | 9.5... - Expr| 00011070 65 73 73 69 6f 6e 73 20 20 20 61 72 65 20 20 20 |essions are | 00011080 65 76 61 6c 75 61 74 65 64 20 20 66 75 6c 6c 79 |evaluated fully| 00011090 20 20 68 69 65 72 61 72 63 68 69 63 61 6c 6c 79 | hierarchically| 000110a0 20 20 72 61 74 68 65 72 20 20 74 68 61 6e 0d 20 | rather than. | 000110b0 20 20 20 6c 65 66 74 2d 74 6f 2d 72 69 67 68 74 | left-to-right| 000110c0 2e 0d 0d 20 20 2d 20 54 68 65 20 22 23 22 20 61 |... - The "#" a| 000110d0 72 69 74 68 6d 65 74 69 63 20 6f 70 65 72 61 74 |rithmetic operat| 000110e0 6f 72 20 69 73 20 75 73 65 64 20 66 6f 72 20 22 |or is used for "| 000110f0 69 6e 65 71 75 61 6c 69 74 79 22 2c 20 72 65 74 |inequality", ret| 00011100 75 72 6e 69 6e 67 20 2d 31 0d 20 20 20 20 69 66 |urning -1. if| 00011110 20 75 6e 65 71 75 61 6c 20 61 6e 64 20 30 20 69 | unequal and 0 i| 00011120 66 20 65 71 75 61 6c 2c 20 72 61 74 68 65 72 20 |f equal, rather | 00011130 74 68 61 6e 20 22 6d 6f 64 75 6c 75 73 22 2e 0d |than "modulus"..| 00011140 0d 20 20 2d 20 54 68 65 20 4c 53 54 20 64 69 72 |. - The LST dir| 00011150 65 63 74 69 76 65 20 68 61 73 20 61 20 6e 75 6d |ective has a num| 00011160 65 72 69 63 20 6f 70 65 72 61 6e 64 20 72 61 74 |eric operand rat| 00011170 68 65 72 20 20 74 68 61 6e 20 20 74 68 65 20 20 |her than the | 00011180 73 74 72 69 6e 67 73 0d 20 20 20 20 4f 46 46 2c |strings. OFF,| 00011190 20 20 4f 4e 20 20 61 6e 64 20 20 46 55 4c 4c 2e | ON and FULL.| 000111a0 20 46 6f 72 20 41 44 45 20 63 6f 6d 70 61 74 69 | For ADE compati| 000111b0 62 69 6c 69 74 79 2c 20 64 65 66 69 6e 65 20 73 |bility, define s| 000111c0 79 6d 62 6f 6c 73 20 4f 46 46 2c 20 4f 4e 0d 20 |ymbols OFF, ON. | 000111d0 20 20 20 61 6e 64 20 46 55 4c 4c 20 77 69 74 68 | and FULL with| 000111e0 20 74 68 65 20 45 51 55 20 64 69 72 65 63 74 69 | the EQU directi| 000111f0 76 65 20 74 6f 20 68 61 76 65 20 76 61 6c 75 65 |ve to have value| 00011200 73 20 30 2c 20 31 20 20 61 6e 64 20 20 32 2e 20 |s 0, 1 and 2. | 00011210 20 4c 69 73 74 0d 20 20 20 20 6c 65 76 65 6c 20 | List. level | 00011220 33 20 68 61 73 20 6e 6f 20 65 71 75 69 76 61 6c |3 has no equival| 00011230 65 6e 74 20 69 6e 20 41 44 45 2e 0d 0d 20 20 2d |ent in ADE... -| 00011240 20 54 68 65 20 20 6c 6f 61 64 20 20 61 6e 64 20 | The load and | 00011250 20 65 78 65 63 75 74 69 6f 6e 20 20 61 64 64 72 | execution addr| 00011260 65 73 73 65 73 20 20 61 72 65 20 20 73 65 74 20 |esses are set | 00011270 20 62 79 20 20 74 68 65 20 20 66 69 72 73 74 20 | by the first | 00011280 4f 52 47 0d 20 20 20 20 64 69 72 65 63 74 69 76 |ORG. directiv| 00011290 65 20 6f 6e 6c 79 2e 20 54 6f 20 73 65 74 20 74 |e only. To set t| 000112a0 68 65 6d 20 74 6f 20 64 69 66 66 65 72 65 6e 74 |hem to different| 000112b0 20 76 61 6c 75 65 73 20 75 73 65 20 74 68 65 20 | values use the | 000112c0 20 4c 4f 41 44 20 20 61 6e 64 0d 20 20 20 20 45 | LOAD and. E| 000112d0 58 45 43 20 64 69 72 65 63 74 69 76 65 73 2e 0d |XEC directives..| 000112e0 0d 0d 0d 0d 0d 0d 0d 0d 0d 20 20 20 20 20 20 20 |......... | 000112f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00011300 20 20 20 20 20 20 20 20 20 20 37 35 0d 0d 0d 0d | 75....| 00011310 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 20 |...G | 00011320 20 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 20 | USING | 00011330 54 48 45 20 36 35 43 30 32 20 41 53 53 45 4d 42 |THE 65C02 ASSEMB| 00011340 4c 45 52 1b 48 0d 0d 0d 0d 1b 2d 01 1b 47 41 70 |LER.H.....-..GAp| 00011350 70 65 6e 64 69 78 20 34 2e 20 44 49 46 46 45 52 |pendix 4. DIFFER| 00011360 45 4e 43 45 53 20 46 52 4f 4d 20 50 52 45 56 49 |ENCES FROM PREVI| 00011370 4f 55 53 20 52 45 4c 45 41 53 45 53 1b 2d 00 1b |OUS RELEASES.-..| 00011380 48 0d 0d 20 20 20 56 65 72 73 69 6f 6e 20 31 2e |H.. Version 1.| 00011390 36 30 20 6f 66 20 74 68 65 20 36 35 43 30 32 20 |60 of the 65C02 | 000113a0 41 73 73 65 6d 62 6c 65 72 20 69 6e 63 6c 75 64 |Assembler includ| 000113b0 65 73 20 73 65 76 65 72 61 6c 20 6e 65 77 20 66 |es several new f| 000113c0 61 63 69 6c 69 74 69 65 73 0d 61 6e 64 20 61 20 |acilities.and a | 000113d0 6e 75 6d 62 65 72 20 6f 66 20 63 6f 72 72 65 63 |number of correc| 000113e0 74 69 6f 6e 73 20 66 72 6f 6d 20 74 68 65 20 70 |tions from the p| 000113f0 72 65 76 69 6f 75 73 20 31 2e 35 32 20 72 65 6c |revious 1.52 rel| 00011400 65 61 73 65 2e 20 20 20 54 68 65 20 6d 6f 73 74 |ease. The most| 00011410 0d 69 6d 70 6f 72 74 61 6e 74 20 63 68 61 6e 67 |.important chang| 00011420 65 73 20 6d 61 64 65 20 61 72 65 20 61 73 20 66 |es made are as f| 00011430 6f 6c 6c 6f 77 73 3a 0d 0d 0d 2d 20 41 20 6e 65 |ollows:...- A ne| 00011440 77 20 64 69 72 65 63 74 69 76 65 2c 20 54 41 42 |w directive, TAB| 00011450 53 2c 20 61 6c 6c 6f 77 73 20 74 68 65 20 6c 61 |S, allows the la| 00011460 79 6f 75 74 20 20 6f 66 20 20 6c 69 73 74 69 6e |yout of listin| 00011470 67 20 20 6c 69 6e 65 73 20 20 74 6f 20 20 62 65 |g lines to be| 00011480 0d 20 20 63 6f 6e 66 69 67 75 72 65 64 2e 20 20 |. configured. | 00011490 41 20 20 70 61 74 63 68 20 20 66 61 63 69 6c 69 |A patch facili| 000114a0 74 79 20 20 61 6c 6c 6f 77 73 20 20 74 68 65 20 |ty allows the | 000114b0 20 64 65 66 61 75 6c 74 20 73 65 74 74 69 6e 67 | default setting| 000114c0 73 20 74 6f 20 62 65 0d 20 20 63 6f 6e 66 69 67 |s to be. config| 000114d0 75 72 65 64 2e 0d 0d 2d 20 4e 65 77 20 64 69 72 |ured...- New dir| 000114e0 65 63 74 69 76 65 73 20 53 59 53 56 44 55 31 20 |ectives SYSVDU1 | 000114f0 61 6e 64 20 53 59 53 56 44 55 32 20 70 65 72 66 |and SYSVDU2 perf| 00011500 6f 72 6d 20 74 68 65 20 73 61 6d 65 20 61 63 74 |orm the same act| 00011510 69 6f 6e 20 61 73 20 53 59 53 56 44 55 0d 20 20 |ion as SYSVDU. | 00011520 62 75 74 20 6f 6e 6c 79 20 6f 6e 20 70 61 73 73 |but only on pass| 00011530 20 31 20 61 6e 64 20 70 61 73 73 20 32 20 72 65 | 1 and pass 2 re| 00011540 73 70 65 63 74 69 76 65 6c 79 2e 0d 0d 2d 20 43 |spectively...- C| 00011550 6f 6d 6d 65 6e 74 20 6c 69 6e 65 73 20 63 61 6e |omment lines can| 00011560 20 62 65 20 73 74 61 72 74 65 64 20 77 69 74 68 | be started with| 00011570 20 61 20 22 21 22 20 63 68 61 72 61 63 74 65 72 | a "!" character| 00011580 3b 20 73 75 63 68 20 6c 69 6e 65 73 20 77 69 74 |; such lines wit| 00011590 68 69 6e 0d 20 20 6d 61 63 72 6f 20 64 65 66 69 |hin. macro defi| 000115a0 6e 69 74 69 6f 6e 73 20 61 72 65 20 6e 6f 74 20 |nitions are not | 000115b0 73 74 6f 72 65 64 20 20 69 6e 20 20 6d 65 6d 6f |stored in memo| 000115c0 72 79 20 20 61 6e 64 20 20 63 61 6e 20 20 62 65 |ry and can be| 000115d0 20 20 75 73 65 64 20 20 74 6f 0d 20 20 61 6e 6e | used to. ann| 000115e0 6f 74 61 74 65 20 74 68 65 20 6d 61 63 72 6f 20 |otate the macro | 000115f0 69 74 73 65 6c 66 2e 0d 0d 2d 20 50 72 69 6e 74 |itself...- Print| 00011600 65 72 20 20 68 61 6e 64 6c 69 6e 67 20 20 68 61 |er handling ha| 00011610 73 20 20 62 65 65 6e 20 65 78 74 65 6e 73 69 76 |s been extensiv| 00011620 65 6c 79 20 72 65 77 72 69 74 74 65 6e 20 74 6f |ely rewritten to| 00011630 20 61 76 6f 69 64 20 70 72 6f 62 6c 65 6d 73 0d | avoid problems.| 00011640 20 20 77 68 65 6e 20 75 73 69 6e 67 20 45 63 6f | when using Eco| 00011650 6e 65 74 20 70 72 69 6e 74 20 73 65 72 76 65 72 |net print server| 00011660 73 2e 0d 0d 2d 20 41 73 73 65 6d 62 6c 79 20 20 |s...- Assembly | 00011670 6c 69 73 74 69 6e 67 73 20 20 63 61 6e 20 20 62 |listings can b| 00011680 65 20 20 64 69 72 65 63 74 65 64 20 20 74 6f 20 |e directed to | 00011690 20 61 20 20 66 69 6c 65 20 20 77 69 74 68 20 20 | a file with | 000116a0 74 68 65 20 20 20 22 2d 46 22 0d 20 20 63 6f 6d |the "-F". com| 000116b0 6d 61 6e 64 2d 6c 69 6e 65 20 6f 70 74 69 6f 6e |mand-line option| 000116c0 2e 0d 0d 2d 20 53 74 72 69 6e 67 20 20 73 6c 69 |...- String sli| 000116d0 63 69 6e 67 20 20 6f 70 65 72 61 74 69 6f 6e 73 |cing operations| 000116e0 20 69 6e 20 74 68 65 20 41 53 45 54 20 61 6e 64 | in the ASET and| 000116f0 20 4d 53 45 54 20 64 69 72 65 63 74 69 76 65 73 | MSET directives| 00011700 20 6e 6f 77 20 77 6f 72 6b 0d 20 20 65 78 61 63 | now work. exac| 00011710 74 6c 79 20 61 73 20 64 6f 63 75 6d 65 6e 74 65 |tly as documente| 00011720 64 2e 20 20 49 6e 20 76 65 72 73 69 6f 6e 20 31 |d. In version 1| 00011730 2e 35 32 2c 20 20 74 68 65 20 73 74 72 69 6e 67 |.52, the string| 00011740 20 73 74 61 72 74 20 61 6e 64 20 73 6c 69 63 65 | start and slice| 00011750 0d 20 20 73 69 7a 65 20 70 61 72 61 6d 65 74 65 |. size paramete| 00011760 72 73 20 77 65 72 65 20 72 65 76 65 72 73 65 64 |rs were reversed| 00011770 2c 20 20 61 6e 64 20 74 68 65 20 66 69 72 73 74 |, and the first| 00011780 20 62 79 74 65 20 6f 66 20 74 68 65 20 73 74 72 | byte of the str| 00011790 69 6e 67 20 77 61 73 0d 20 20 6e 75 6d 62 65 72 |ing was. number| 000117a0 65 64 20 30 20 61 6e 64 20 6e 6f 74 20 31 2e 0d |ed 0 and not 1..| 000117b0 0d 2d 20 41 20 6e 65 77 20 4d 4f 53 20 63 6f 6d |.- A new MOS com| 000117c0 6d 61 6e 64 2c 20 2a 43 4c 49 2c 20 61 6c 6c 6f |mand, *CLI, allo| 000117d0 77 73 20 20 74 68 65 20 20 41 73 73 65 6d 62 6c |ws the Assembl| 000117e0 65 72 27 73 20 20 43 4c 49 20 20 6d 6f 64 65 20 |er's CLI mode | 000117f0 20 74 6f 20 20 62 65 0d 20 20 65 78 70 6c 69 63 | to be. explic| 00011800 69 74 6c 79 20 65 6e 74 65 72 65 64 20 66 72 6f |itly entered fro| 00011810 6d 20 61 6e 79 20 6c 61 6e 67 75 61 67 65 2e 0d |m any language..| 00011820 0d 2d 20 41 20 20 52 45 50 20 20 64 69 72 65 63 |.- A REP direc| 00011830 74 69 76 65 20 20 77 69 74 68 20 20 6e 6f 20 6f |tive with no o| 00011840 70 65 72 61 6e 64 20 6e 6f 77 20 66 69 6c 6c 73 |perand now fills| 00011850 20 74 68 65 20 6f 75 74 70 75 74 20 6c 69 6e 65 | the output line| 00011860 20 74 6f 20 69 74 73 0d 20 20 64 65 66 69 6e 65 | to its. define| 00011870 64 20 77 69 64 74 68 2e 0d 0d 2d 20 53 79 73 74 |d width...- Syst| 00011880 65 6d 20 41 54 56 73 20 20 24 50 57 49 44 54 48 |em ATVs $PWIDTH| 00011890 20 61 6e 64 20 24 50 4c 45 4e 47 54 48 20 61 6c | and $PLENGTH al| 000118a0 6c 6f 77 20 74 68 65 20 76 61 6c 75 65 73 20 73 |low the values s| 000118b0 65 74 20 62 79 20 20 74 68 65 20 20 50 41 47 45 |et by the PAGE| 000118c0 0d 20 20 64 69 72 65 63 74 69 76 65 20 74 6f 20 |. directive to | 000118d0 62 65 20 72 65 61 64 2e 0d 0d 2d 20 53 79 73 74 |be read...- Syst| 000118e0 65 6d 20 20 41 54 56 20 20 24 50 52 49 4e 54 49 |em ATV $PRINTI| 000118f0 4e 47 20 20 61 6c 6c 6f 77 73 20 20 74 68 65 20 |NG allows the | 00011900 73 6f 75 72 63 65 20 74 6f 20 64 65 74 65 72 6d |source to determ| 00011910 69 6e 65 20 69 66 20 61 6e 20 6f 75 74 70 75 74 |ine if an output| 00011920 0d 20 20 6c 69 73 74 69 6e 67 20 69 73 20 62 65 |. listing is be| 00011930 69 6e 67 20 73 65 6e 74 20 74 6f 20 70 72 69 6e |ing sent to prin| 00011940 74 65 72 20 6f 72 20 66 69 6c 65 2c 20 6f 72 20 |ter or file, or | 00011950 74 6f 20 74 68 65 20 73 63 72 65 65 6e 20 6f 6e |to the screen on| 00011960 6c 79 2e 0d 0d 2d 20 41 20 72 65 70 65 61 74 20 |ly...- A repeat | 00011970 63 6f 75 6e 74 20 6f 66 20 7a 65 72 6f 20 69 6e |count of zero in| 00011980 20 64 69 72 65 63 74 69 76 65 73 20 73 75 63 68 | directives such| 00011990 20 61 73 20 44 42 20 63 61 75 73 65 73 20 6e 6f | as DB causes no| 000119a0 20 20 62 79 74 65 73 20 20 74 6f 0d 20 20 62 65 | bytes to. be| 000119b0 20 20 77 72 69 74 74 65 6e 20 20 74 6f 20 20 74 | written to t| 000119c0 68 65 20 6f 62 6a 65 63 74 20 66 69 6c 65 2c 20 |he object file, | 000119d0 20 72 61 74 68 65 72 20 74 68 61 6e 20 72 65 70 | rather than rep| 000119e0 65 61 74 69 6e 67 20 74 68 65 20 6f 70 65 72 61 |eating the opera| 000119f0 6e 64 0d 20 20 36 35 35 33 36 20 74 69 6d 65 73 |nd. 65536 times| 00011a00 2e 0d 0d 2d 20 41 20 7a 65 72 6f 20 6f 70 65 72 |...- A zero oper| 00011a10 61 6e 64 20 69 6e 20 74 68 65 20 44 53 20 64 69 |and in the DS di| 00011a20 72 65 63 74 69 76 65 20 63 61 75 73 65 73 20 61 |rective causes a| 00011a30 20 67 61 70 20 73 69 7a 65 20 6f 66 20 7a 65 72 | gap size of zer| 00011a40 6f 20 20 72 61 74 68 65 72 0d 20 20 74 68 61 6e |o rather. than| 00011a50 20 36 35 35 33 36 2e 0d 0d 2d 20 50 61 74 63 68 | 65536...- Patch| 00011a60 20 66 61 63 69 6c 69 74 69 65 73 20 61 6c 6c 6f | facilities allo| 00011a70 77 20 74 68 65 20 41 73 73 65 6d 62 6c 65 72 27 |w the Assembler'| 00011a80 73 20 20 74 72 61 6e 73 6c 61 74 69 6f 6e 20 20 |s translation | 00011a90 6f 66 20 73 6f 75 72 63 65 20 62 79 74 65 73 0d |of source bytes.| 00011aa0 20 20 69 6e 20 74 68 65 20 72 61 6e 67 65 20 31 | in the range 1| 00011ab0 32 38 2e 2e 32 35 35 20 74 6f 20 62 65 20 63 6f |28..255 to be co| 00011ac0 6e 66 69 67 75 72 65 64 2e 0d 0d 2d 20 50 61 74 |nfigured...- Pat| 00011ad0 63 68 20 66 61 63 69 6c 69 74 69 65 73 20 66 6f |ch facilities fo| 00011ae0 72 63 65 20 74 68 65 20 41 73 73 65 6d 62 6c 65 |rce the Assemble| 00011af0 72 20 74 6f 20 72 65 61 64 20 61 20 20 72 65 61 |r to read a rea| 00011b00 6c 2d 74 69 6d 65 20 20 63 6c 6f 63 6b 20 20 6f |l-time clock o| 00011b10 6e 0d 20 20 6d 61 63 68 69 6e 65 73 20 6f 74 68 |n. machines oth| 00011b20 65 72 20 74 68 61 6e 20 61 20 4d 61 73 74 65 72 |er than a Master| 00011b30 20 31 32 38 2e 0d 0d 0d 0d 20 20 20 20 20 20 20 | 128..... | 00011b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00011b50 20 20 20 20 20 20 20 20 20 20 37 36 0d 0d 0d 0d | 76....| 00011b60 0d 0d 1b 47 20 20 20 20 20 20 20 20 20 20 20 20 |...G | 00011b70 20 20 20 20 20 20 20 20 20 20 55 53 49 4e 47 20 | USING | 00011b80 54 48 45 20 36 35 43 30 32 20 41 53 53 45 4d 42 |THE 65C02 ASSEMB| 00011b90 4c 45 52 1b 48 0d 0d 0d 0d 2d 20 50 61 74 63 68 |LER.H....- Patch| 00011ba0 20 66 61 63 69 6c 69 74 69 65 73 20 20 65 6e 61 | facilities ena| 00011bb0 62 6c 65 20 20 74 68 65 20 20 22 7e 22 20 63 68 |ble the "~" ch| 00011bc0 61 72 61 63 74 65 72 20 74 6f 20 62 65 20 75 73 |aracter to be us| 00011bd0 65 64 20 69 6e 20 63 68 61 72 61 63 74 65 72 0d |ed in character.| 00011be0 20 20 63 6f 6e 73 74 61 6e 74 73 20 61 6e 64 20 | constants and | 00011bf0 73 74 72 69 6e 67 73 20 74 6f 20 70 6c 61 6e 74 |strings to plant| 00011c00 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 | the following c| 00011c10 68 61 72 61 63 74 65 72 20 61 73 20 61 20 20 63 |haracter as a c| 00011c20 6f 6e 74 72 6f 6c 0d 20 20 63 68 61 72 61 63 74 |ontrol. charact| 00011c30 65 72 20 77 69 74 68 20 62 69 74 20 37 20 73 65 |er with bit 7 se| 00011c40 74 2e 0d 0d 2d 20 50 61 74 63 68 20 66 61 63 69 |t...- Patch faci| 00011c50 6c 69 74 69 65 73 20 20 61 6c 6c 6f 77 20 20 74 |lities allow t| 00011c60 68 65 20 46 6f 72 6d 20 46 65 65 64 73 20 73 65 |he Form Feeds se| 00011c70 6e 74 20 74 6f 20 61 20 70 72 69 6e 74 65 72 20 |nt to a printer | 00011c80 61 74 20 74 68 65 20 65 6e 64 0d 20 20 6f 66 20 |at the end. of | 00011c90 61 20 6c 69 73 74 69 6e 67 20 74 6f 20 62 65 20 |a listing to be | 00011ca0 73 75 70 70 72 65 73 73 65 64 2e 0d 0d 2d 20 53 |suppressed...- S| 00011cb0 6f 75 72 63 65 20 66 69 6c 65 20 72 65 70 6f 73 |ource file repos| 00011cc0 69 74 69 6f 6e 69 6e 67 20 28 69 6e 20 64 69 72 |itioning (in dir| 00011cd0 65 63 74 69 76 65 73 20 73 75 63 68 20 61 73 20 |ectives such as | 00011ce0 41 47 4f 2c 20 41 49 46 29 20 6e 6f 20 6c 6f 6e |AGO, AIF) no lon| 00011cf0 67 65 72 0d 20 20 63 61 75 73 65 73 20 72 61 6e |ger. causes ran| 00011d00 64 6f 6d 20 66 61 69 6c 75 72 65 73 20 77 69 74 |dom failures wit| 00011d10 68 20 66 69 6c 65 73 20 6c 61 72 67 65 72 20 74 |h files larger t| 00011d20 68 61 6e 20 31 34 6b 62 79 74 65 73 20 6f 6e 20 |han 14kbytes on | 00011d30 20 61 20 20 73 65 63 6f 6e 64 0d 20 20 70 72 6f | a second. pro| 00011d40 63 65 73 73 6f 72 2e 0d 0d 2d 20 54 68 65 20 20 |cessor...- The | 00011d50 44 42 20 20 64 69 72 65 63 74 69 76 65 20 20 6e |DB directive n| 00011d60 6f 77 20 61 63 63 65 70 74 73 20 6e 65 67 61 74 |ow accepts negat| 00011d70 69 76 65 20 6f 70 65 72 61 6e 64 73 20 69 6e 20 |ive operands in | 00011d80 74 68 65 20 72 61 6e 67 65 20 2d 31 20 74 6f 0d |the range -1 to.| 00011d90 20 20 2d 31 32 38 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d | -128..........| 00011da0 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |................| * 00011dc0 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 00011dd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00011de0 20 20 20 20 37 37 0d 0d 0d 0d 0d 0d 1b 47 20 20 | 77.......G | 00011df0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00011e00 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 | USING THE 65| 00011e10 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d |C02 ASSEMBLER.H.| 00011e20 0d 0d 0d 1b 2d 01 1b 47 41 70 70 65 6e 64 69 78 |....-..GAppendix| 00011e30 20 35 2e 20 43 55 53 54 4f 4d 49 53 49 4e 47 20 | 5. CUSTOMISING | 00011e40 54 48 45 20 41 53 53 45 4d 42 4c 45 52 1b 2d 00 |THE ASSEMBLER.-.| 00011e50 1b 48 0d 0d 20 20 20 56 65 72 73 69 6f 6e 20 31 |.H.. Version 1| 00011e60 2e 36 30 20 6f 66 20 74 68 65 20 41 73 73 65 6d |.60 of the Assem| 00011e70 62 6c 65 72 20 63 6f 6e 74 61 69 6e 73 20 61 20 |bler contains a | 00011e80 6e 75 6d 62 65 72 20 6f 66 20 6f 70 74 69 6f 6e |number of option| 00011e90 73 20 74 68 61 74 20 63 61 6e 0d 62 65 20 63 6f |s that can.be co| 00011ea0 6e 66 69 67 75 72 65 64 20 6f 72 20 61 63 74 69 |nfigured or acti| 00011eb0 76 61 74 65 64 20 62 79 20 63 68 61 6e 67 65 73 |vated by changes| 00011ec0 20 74 6f 20 74 68 65 20 52 4f 4d 20 69 6d 61 67 | to the ROM imag| 00011ed0 65 2e 20 20 54 79 70 69 63 61 6c 6c 79 20 74 68 |e. Typically th| 00011ee0 65 0d 66 61 63 69 6c 69 74 69 65 73 20 20 63 6f |e.facilities co| 00011ef0 6e 74 72 6f 6c 6c 65 64 20 20 69 6e 20 20 74 68 |ntrolled in th| 00011f00 69 73 20 77 61 79 20 61 72 65 20 68 69 67 68 6c |is way are highl| 00011f10 79 20 73 70 65 63 69 66 69 63 20 74 6f 20 70 61 |y specific to pa| 00011f20 72 74 69 63 75 6c 61 72 0d 68 61 72 64 77 61 72 |rticular.hardwar| 00011f30 65 20 6f 72 20 6d 6f 64 65 73 20 6f 66 20 77 6f |e or modes of wo| 00011f40 72 6b 69 6e 67 2c 20 72 61 74 68 65 72 20 74 68 |rking, rather th| 00011f50 61 6e 20 6f 66 20 67 65 6e 65 72 61 6c 20 75 73 |an of general us| 00011f60 65 2e 0d 0d 20 20 20 49 6e 20 6f 72 64 65 72 20 |e... In order | 00011f70 74 6f 20 63 6f 6e 66 69 67 75 72 65 20 74 68 65 |to configure the| 00011f80 20 41 73 73 65 6d 62 6c 65 72 20 79 6f 75 20 77 | Assembler you w| 00011f90 69 6c 6c 20 20 6e 65 65 64 20 20 74 6f 20 20 61 |ill need to a| 00011fa0 6c 74 65 72 20 20 73 6f 6d 65 0d 62 79 74 65 73 |lter some.bytes| 00011fb0 20 20 77 69 74 68 69 6e 20 20 69 74 2c 20 20 75 | within it, u| 00011fc0 73 69 6e 67 20 20 61 20 20 6d 61 63 68 69 6e 65 |sing a machine| 00011fd0 20 20 63 6f 64 65 20 20 6d 6f 6e 69 74 6f 72 20 | code monitor | 00011fe0 20 73 75 63 68 20 61 73 20 45 78 6d 6f 6e 20 6f | such as Exmon o| 00011ff0 72 0d 42 65 65 62 6d 6f 6e 2e 20 54 68 65 20 74 |r.Beebmon. The t| 00012000 68 69 6e 67 73 20 79 6f 75 20 6e 65 65 64 20 74 |hings you need t| 00012010 6f 20 64 6f 20 61 72 65 20 73 69 6d 70 6c 65 20 |o do are simple | 00012020 61 6e 64 20 73 74 72 61 69 67 68 74 66 6f 72 77 |and straightforw| 00012030 61 72 64 2c 20 62 75 74 0d 61 73 20 77 69 74 68 |ard, but.as with| 00012040 20 61 6c 6c 20 20 73 75 63 68 20 20 6f 70 65 72 | all such oper| 00012050 61 74 69 6f 6e 73 2c 20 20 79 6f 75 20 20 73 68 |ations, you sh| 00012060 6f 75 6c 64 20 20 6d 61 6b 65 20 20 73 75 72 65 |ould make sure| 00012070 20 20 79 6f 75 20 20 68 61 76 65 20 20 61 6e 0d | you have an.| 00012080 75 6e 61 6c 74 65 72 65 64 20 20 63 6f 70 79 20 |unaltered copy | 00012090 20 6f 66 20 20 74 68 65 20 20 41 73 73 65 6d 62 | of the Assemb| 000120a0 6c 65 72 20 73 74 6f 72 65 64 20 73 61 66 65 6c |ler stored safel| 000120b0 79 20 6f 6e 20 61 20 64 69 73 63 20 62 65 66 6f |y on a disc befo| 000120c0 72 65 20 79 6f 75 0d 62 65 67 69 6e 2e 20 20 59 |re you.begin. Y| 000120d0 6f 75 20 1b 2d 01 77 69 6c 6c 1b 2d 00 20 6e 65 |ou .-.will.-. ne| 000120e0 65 64 20 20 74 6f 20 20 62 65 20 20 63 61 72 65 |ed to be care| 000120f0 66 75 6c 20 20 74 68 61 74 20 20 79 6f 75 20 20 |ful that you | 00012100 61 6c 74 65 72 20 20 74 68 65 20 20 63 6f 72 72 |alter the corr| 00012110 65 63 74 0d 6c 6f 63 61 74 69 6f 6e 73 20 20 61 |ect.locations a| 00012120 6e 64 20 20 70 75 74 20 20 69 6e 20 20 74 68 65 |nd put in the| 00012130 20 20 63 6f 72 72 65 63 74 20 20 76 61 6c 75 65 | correct value| 00012140 73 3a 20 20 74 68 65 20 20 41 73 73 65 6d 62 6c |s: the Assembl| 00012150 65 72 20 77 69 6c 6c 20 62 65 0d 75 6e 6c 69 6b |er will be.unlik| 00012160 65 6c 79 20 74 6f 20 77 6f 72 6b 20 63 6f 72 72 |ely to work corr| 00012170 65 63 74 6c 79 2c 20 61 6e 64 20 70 72 6f 62 61 |ectly, and proba| 00012180 62 6c 79 20 77 69 6c 6c 20 6e 6f 74 20 77 6f 72 |bly will not wor| 00012190 6b 20 61 74 20 61 6c 6c 2c 20 20 69 66 20 79 6f |k at all, if yo| 000121a0 75 0d 6d 61 6b 65 20 61 20 6d 69 73 74 61 6b 65 |u.make a mistake| 000121b0 2e 0d 0d 0d 1b 2d 01 41 35 2e 31 20 54 68 65 20 |.....-.A5.1 The | 000121c0 70 61 74 63 68 20 61 72 65 61 1b 2d 00 0d 0d 20 |patch area.-... | 000121d0 20 20 49 6e 20 6f 72 64 65 72 20 74 6f 20 70 61 | In order to pa| 000121e0 74 63 68 20 74 68 65 20 41 73 73 65 6d 62 6c 65 |tch the Assemble| 000121f0 72 2c 20 20 79 6f 75 20 77 69 6c 6c 20 66 69 72 |r, you will fir| 00012200 73 74 20 6e 65 65 64 20 74 6f 20 6c 6f 63 61 74 |st need to locat| 00012210 65 20 74 68 65 0d 70 61 74 63 68 20 74 61 62 6c |e the.patch tabl| 00012220 65 2e 20 20 54 68 69 73 20 69 73 20 61 6e 20 61 |e. This is an a| 00012230 72 65 61 20 20 6f 66 20 20 6d 65 6d 6f 72 79 20 |rea of memory | 00012240 20 74 68 61 74 20 20 65 69 74 68 65 72 20 20 63 | that either c| 00012250 6f 6e 74 61 69 6e 73 20 20 74 68 65 0d 61 63 74 |ontains the.act| 00012260 75 61 6c 20 6c 6f 63 61 74 69 6f 6e 73 20 79 6f |ual locations yo| 00012270 75 20 61 6c 74 65 72 2c 20 6f 72 20 63 6f 6e 74 |u alter, or cont| 00012280 61 69 6e 73 20 74 68 65 20 61 64 64 72 65 73 73 |ains the address| 00012290 65 73 20 6f 66 20 74 68 65 20 6c 6f 63 61 74 69 |es of the locati| 000122a0 6f 6e 73 0d 69 6e 20 6f 74 68 65 72 20 70 61 72 |ons.in other par| 000122b0 74 73 20 6f 66 20 74 68 65 20 52 4f 4d 2e 0d 0d |ts of the ROM...| 000122c0 20 20 20 54 68 65 20 20 70 61 74 63 68 20 20 61 | The patch a| 000122d0 72 65 61 20 69 73 20 6e 6f 74 20 68 65 6c 64 20 |rea is not held | 000122e0 61 74 20 61 20 66 69 78 65 64 20 61 62 73 6f 6c |at a fixed absol| 000122f0 75 74 65 20 61 64 64 72 65 73 73 2c 20 20 62 75 |ute address, bu| 00012300 74 20 77 69 6c 6c 0d 61 6c 77 61 79 73 20 66 6f |t will.always fo| 00012310 6c 6c 6f 77 20 74 68 65 20 73 74 61 6e 64 61 72 |llow the standar| 00012320 64 20 73 69 64 65 77 61 79 73 20 52 4f 4d 20 68 |d sideways ROM h| 00012330 65 61 64 65 72 2e 20 54 6f 20 66 69 6e 64 20 69 |eader. To find i| 00012340 74 2c 20 6c 6f 6f 6b 20 66 69 72 73 74 0d 61 74 |t, look first.at| 00012350 20 62 79 74 65 20 24 38 30 30 37 20 69 6e 20 74 | byte $8007 in t| 00012360 68 65 20 52 4f 4d 20 20 28 69 6e 20 74 68 69 73 |he ROM (in this| 00012370 20 73 65 63 74 69 6f 6e 2c 20 20 61 6c 6c 20 61 | section, all a| 00012380 64 64 72 65 73 73 65 73 20 20 61 72 65 20 20 67 |ddresses are g| 00012390 69 76 65 6e 0d 66 72 6f 6d 20 74 68 65 20 62 61 |iven.from the ba| 000123a0 73 65 20 6f 66 20 24 38 30 30 30 2c 20 77 68 69 |se of $8000, whi| 000123b0 63 68 20 69 73 20 74 68 65 20 6d 65 6d 6f 72 79 |ch is the memory| 000123c0 20 61 64 64 72 65 73 73 20 74 68 65 20 41 73 73 | address the Ass| 000123d0 65 6d 62 6c 65 72 20 72 75 6e 73 0d 61 74 2e 20 |embler runs.at. | 000123e0 20 54 6f 20 20 67 65 74 20 20 74 68 65 20 6f 66 | To get the of| 000123f0 66 73 65 74 20 77 69 74 68 69 6e 20 61 20 66 69 |fset within a fi| 00012400 6c 65 20 66 6f 72 20 74 68 65 20 62 79 74 65 73 |le for the bytes| 00012410 20 63 6f 6e 63 65 72 6e 65 64 2c 20 73 69 6d 70 | concerned, simp| 00012420 6c 79 0d 73 75 62 74 72 61 63 74 20 24 38 30 30 |ly.subtract $800| 00012430 30 20 66 72 6f 6d 20 61 6c 6c 20 76 61 6c 75 65 |0 from all value| 00012440 73 29 2e 20 41 64 64 20 74 68 65 20 76 61 6c 75 |s). Add the valu| 00012450 65 20 6f 66 20 62 79 74 65 20 24 38 30 30 37 20 |e of byte $8007 | 00012460 74 6f 20 24 38 30 30 30 2c 0d 74 6f 20 6f 62 74 |to $8000,.to obt| 00012470 61 69 6e 20 74 68 65 20 61 64 64 72 65 73 73 20 |ain the address | 00012480 6f 66 20 74 68 65 20 63 6f 70 79 72 69 67 68 74 |of the copyright| 00012490 20 20 73 74 72 69 6e 67 20 20 28 69 6e 20 20 76 | string (in v| 000124a0 65 72 73 69 6f 6e 20 20 31 2e 36 30 20 20 69 74 |ersion 1.60 it| 000124b0 0d 72 65 61 64 73 20 22 28 43 29 31 39 38 37 20 |.reads "(C)1987 | 000124c0 41 6c 61 6e 20 50 68 69 6c 6c 69 70 73 22 29 2e |Alan Phillips").| 000124d0 0d 0d 20 20 20 41 74 20 20 74 68 65 20 65 6e 64 |.. At the end| 000124e0 20 6f 66 20 74 68 65 20 63 6f 70 79 72 69 67 68 | of the copyrigh| 000124f0 74 20 73 74 72 69 6e 67 20 79 6f 75 20 77 69 6c |t string you wil| 00012500 6c 20 66 69 6e 64 20 61 20 62 79 74 65 20 63 6f |l find a byte co| 00012510 6e 74 61 69 6e 69 6e 67 0d 74 68 65 20 76 61 6c |ntaining.the val| 00012520 75 65 20 6f 66 20 7a 65 72 6f 3b 20 74 68 65 20 |ue of zero; the | 00012530 70 61 74 63 68 20 20 61 72 65 61 20 20 73 74 61 |patch area sta| 00012540 72 74 73 20 20 61 74 20 20 74 68 65 20 20 62 79 |rts at the by| 00012550 74 65 20 20 69 6d 6d 65 64 69 61 74 65 6c 79 0d |te immediately.| 00012560 66 6f 6c 6c 6f 77 69 6e 67 20 74 68 69 73 20 6f |following this o| 00012570 6e 65 2e 0d 0d 20 20 20 41 6c 74 68 6f 75 67 68 |ne... Although| 00012580 20 20 74 68 65 20 20 61 62 73 6f 6c 75 74 65 20 | the absolute | 00012590 20 70 6f 73 69 74 69 6f 6e 20 20 6f 66 20 20 74 | position of t| 000125a0 68 65 20 20 70 61 74 63 68 20 61 72 65 61 20 69 |he patch area i| 000125b0 73 20 6e 6f 74 20 66 69 78 65 64 0d 62 65 74 77 |s not fixed.betw| 000125c0 65 65 6e 20 72 65 6c 65 61 73 65 73 2c 20 74 68 |een releases, th| 000125d0 65 20 66 6f 72 6d 61 74 20 6f 66 20 69 74 20 69 |e format of it i| 000125e0 73 2c 20 73 6f 20 74 68 61 74 20 74 68 65 20 66 |s, so that the f| 000125f0 6f 6c 6c 6f 77 69 6e 67 20 20 73 65 63 74 69 6f |ollowing sectio| 00012600 6e 73 0d 61 70 70 6c 79 20 74 6f 20 31 2e 36 30 |ns.apply to 1.60| 00012610 20 61 6e 64 20 61 6e 79 20 66 75 74 75 72 65 20 | and any future | 00012620 72 65 6c 65 61 73 65 73 2e 0d 0d 0d 20 20 20 20 |releases.... | 00012630 20 1b 2d 01 41 35 2e 31 2e 31 20 54 68 65 20 64 | .-.A5.1.1 The d| 00012640 65 66 61 75 6c 74 20 54 41 42 20 70 6f 73 69 74 |efault TAB posit| 00012650 69 6f 6e 20 6c 69 73 74 1b 2d 00 0d 0d 20 20 20 |ion list.-... | 00012660 20 20 42 79 74 65 73 20 20 30 20 61 6e 64 20 31 | Bytes 0 and 1| 00012670 20 20 6f 66 20 74 68 65 20 70 61 74 63 68 20 74 | of the patch t| 00012680 61 62 6c 65 20 61 72 65 20 74 68 65 20 61 64 64 |able are the add| 00012690 72 65 73 73 20 6f 66 20 74 68 65 20 64 65 66 61 |ress of the defa| 000126a0 75 6c 74 0d 20 20 20 20 20 54 41 42 20 74 61 62 |ult. TAB tab| 000126b0 6c 65 20 75 73 65 64 20 62 79 20 74 68 65 20 41 |le used by the A| 000126c0 73 73 65 6d 62 6c 65 72 20 77 68 65 6e 20 6c 69 |ssembler when li| 000126d0 73 74 69 6e 67 20 73 6f 75 72 63 65 20 6c 69 6e |sting source lin| 000126e0 65 73 2e 20 20 28 4e 6f 74 65 0d 20 20 20 20 20 |es. (Note. | 000126f0 74 68 61 74 2c 20 20 61 73 20 75 73 75 61 6c 2c |that, as usual,| 00012700 20 74 68 65 20 61 64 64 72 65 73 73 20 69 73 20 | the address is | 00012710 73 74 6f 72 65 64 20 77 69 74 68 20 74 68 65 20 |stored with the | 00012720 6c 65 61 73 74 20 73 69 67 6e 69 66 69 63 61 6e |least significan| 00012730 74 0d 20 20 20 20 20 62 79 74 65 20 66 69 72 73 |t. byte firs| 00012740 74 29 2e 0d 0d 20 20 20 20 20 54 68 65 20 61 64 |t)... The ad| 00012750 64 72 65 73 73 20 69 6e 20 74 68 65 20 70 61 74 |dress in the pat| 00012760 63 68 20 74 61 62 6c 65 20 74 61 6b 65 73 20 79 |ch table takes y| 00012770 6f 75 20 74 6f 20 74 68 65 20 61 72 65 61 20 6f |ou to the area o| 00012780 66 20 20 74 68 65 20 20 52 4f 4d 0d 20 20 20 20 |f the ROM. | 00012790 20 77 68 65 72 65 20 20 74 68 65 20 20 64 65 66 | where the def| 000127a0 61 75 6c 74 20 20 54 41 42 20 20 70 6f 73 69 74 |ault TAB posit| 000127b0 69 6f 6e 73 20 61 72 65 20 68 65 6c 64 2e 20 54 |ions are held. T| 000127c0 6f 20 63 68 61 6e 67 65 20 74 68 65 6d 2c 20 79 |o change them, y| 000127d0 6f 75 0d 20 20 20 20 20 73 68 6f 75 6c 64 20 61 |ou. should a| 000127e0 6c 74 65 72 20 74 68 65 20 66 69 72 73 74 20 62 |lter the first b| 000127f0 79 74 65 20 6f 66 20 74 68 65 20 74 61 62 6c 65 |yte of the table| 00012800 20 74 6f 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 | to contain the | 00012810 6e 75 6d 62 65 72 20 6f 66 0d 20 20 20 20 20 54 |number of. T| 00012820 41 42 20 70 6f 73 69 74 69 6f 6e 73 20 79 6f 75 |AB positions you| 00012830 20 77 69 73 68 20 74 6f 20 64 65 66 69 6e 65 20 | wish to define | 00012840 28 74 68 65 20 20 6e 75 6d 62 65 72 20 20 79 6f |(the number yo| 00012850 75 20 20 75 73 65 20 20 6d 75 73 74 20 20 62 65 |u use must be| 00012860 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 00012870 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00012880 20 20 20 20 37 38 0d 0d 0d 0d 0d 0d 1b 47 20 20 | 78.......G | 00012890 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000128a0 20 20 20 20 55 53 49 4e 47 20 54 48 45 20 36 35 | USING THE 65| 000128b0 43 30 32 20 41 53 53 45 4d 42 4c 45 52 1b 48 0d |C02 ASSEMBLER.H.| 000128c0 0d 0d 0d 20 20 20 20 20 62 65 74 77 65 65 6e 20 |... between | 000128d0 20 31 20 20 61 6e 64 20 20 31 34 29 2e 20 20 46 | 1 and 14). F| 000128e0 6f 6c 6c 6f 77 69 6e 67 20 20 74 68 69 73 20 20 |ollowing this | 000128f0 79 6f 75 20 20 73 68 6f 75 6c 64 20 70 6c 61 63 |you should plac| 00012900 65 20 74 68 65 20 54 41 42 0d 20 20 20 20 20 70 |e the TAB. p| 00012910 6f 73 69 74 69 6f 6e 73 20 74 68 65 6d 73 65 6c |ositions themsel| 00012920 76 65 73 3b 20 74 68 65 79 20 6d 75 73 74 20 62 |ves; they must b| 00012930 65 20 69 6e 20 61 73 63 65 6e 64 69 6e 67 20 6e |e in ascending n| 00012940 75 6d 65 72 69 63 20 6f 72 64 65 72 2e 0d 0d 20 |umeric order... | 00012950 20 20 20 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c | For example,| 00012960 20 74 6f 20 64 65 66 69 6e 65 20 35 20 64 65 66 | to define 5 def| 00012970 61 75 6c 74 20 54 41 42 20 70 6f 73 69 74 69 6f |ault TAB positio| 00012980 6e 73 20 61 74 20 63 6f 6c 75 6d 6e 73 20 20 38 |ns at columns 8| 00012990 2c 20 31 37 2c 0d 20 20 20 20 20 32 36 2c 20 33 |, 17,. 26, 3| 000129a0 32 20 61 6e 64 20 34 30 2c 20 20 79 6f 75 20 77 |2 and 40, you w| 000129b0 6f 75 6c 64 20 63 68 61 6e 67 65 20 74 68 65 20 |ould change the | 000129c0 62 79 74 65 73 20 69 6e 20 74 68 65 20 54 41 42 |bytes in the TAB| 000129d0 20 74 61 62 6c 65 20 74 6f 20 62 65 0d 0d 20 20 | table to be.. | 000129e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000129f0 20 20 20 20 20 20 30 35 20 20 30 38 20 20 31 31 | 05 08 11| 00012a00 20 20 31 41 20 20 32 30 20 20 32 38 0d 0d 0d 20 | 1A 20 28... | 00012a10 20 20 20 20 1b 2d 01 41 35 2e 31 2e 32 20 53 6f | .-.A5.1.2 So| 00012a20 75 72 63 65 20 63 68 61 72 61 63 74 65 72 20 74 |urce character t| 00012a30 72 61 6e 73 6c 61 74 69 6f 6e 1b 2d 00 0d 0d 20 |ranslation.-... | 00012a40 20 20 20 20 42 79 74 65 20 32 20 6f 66 20 74 68 | Byte 2 of th| 00012a50 65 20 20 70 61 74 63 68 20 20 61 72 65 61 20 20 |e patch area | 00012a60 63 6f 6e 74 72 6f 6c 73 20 20 68 6f 77 20 20 74 |controls how t| 00012a70 68 65 20 20 41 73 73 65 6d 62 6c 65 72 20 20 74 |he Assembler t| 00012a80 72 65 61 74 73 0d 20 20 20 20 20 63 68 61 72 61 |reats. chara| 00012a90 63 74 65 72 73 20 69 6e 20 74 68 65 20 73 6f 75 |cters in the sou| 00012aa0 72 63 65 20 66 69 6c 65 20 77 69 74 68 20 62 69 |rce file with bi| 00012ab0 74 20 37 20 73 65 74 2e 20 20 4e 6f 72 6d 61 6c |t 7 set. Normal| 00012ac0 6c 79 20 74 68 65 20 76 61 6c 75 65 0d 20 20 20 |ly the value. | 00012ad0 20 20 69 73 20 7a 65 72 6f 2c 20 69 6e 73 74 72 | is zero, instr| 00012ae0 75 63 74 69 6e 67 20 74 68 65 20 41 73 73 65 6d |ucting the Assem| 00012af0 62 6c 65 72 20 74 6f 20 69 67 6e 6f 72 65 20 73 |bler to ignore s| 00012b00 75 63 68 20 62 79 74 65 73 2e 20 43 68 61 6e 67 |uch bytes. Chang| 00012b10 69 6e 67 0d 20 20 20 20 20 69 74 20 20 74 6f 20 |ing. it to | 00012b20 20 73 6f 6d 65 20 20 6f 74 68 65 72 20 20 76 61 | some other va| 00012b30 6c 75 65 20 6d 61 6b 65 73 20 74 68 65 20 41 73 |lue makes the As| 00012b40 73 65 6d 62 6c 65 72 20 1b 2d 01 72 65 70 6c 61 |sembler .-.repla| 00012b50 63 65 1b 2d 00 20 73 75 63 68 20 62 79 74 65 73 |ce.-. such bytes| 00012b60 0d 20 20 20 20 20 77 69 74 68 20 74 68 65 20 76 |. with the v| 00012b70 61 6c 75 65 20 79 6f 75 20 73 75 70 70 6c 79 2e |alue you supply.| 00012b80 0d 0d 20 20 20 20 20 54 68 75 73 2c 20 66 6f 72 |.. Thus, for| 00012b90 20 65 78 61 6d 70 6c 65 2c 20 79 6f 75 20 63 6f | example, you co| 00012ba0 75 6c 64 20 63 68 61 6e 67 65 20 74 68 65 20 62 |uld change the b| 00012bb0 79 74 65 20 69 6e 20 74 68 65 20 20 70 61 74 63 |yte in the patc| 00012bc0 68 20 20 74 61 62 6c 65 0d 20 20 20 20 20 74 6f |h table. to| 00012bd0 20 20 74 68 65 20 20 76 61 6c 75 65 20 20 24 32 | the value $2| 00012be0 30 20 20 28 74 68 65 20 63 6f 64 65 20 66 6f 72 |0 (the code for| 00012bf0 20 61 20 73 70 61 63 65 20 63 68 61 72 61 63 74 | a space charact| 00012c00 65 72 29 20 20 74 6f 20 72 65 70 6c 61 63 65 0d |er) to replace.| 00012c10 20 20 20 20 20 73 6f 75 72 63 65 20 63 68 61 72 | source char| 00012c20 61 63 74 65 72 73 20 77 69 74 68 20 62 69 74 20 |acters with bit | 00012c30 37 20 73 65 74 20 77 69 74 68 20 61 20 73 70 61 |7 set with a spa| 00012c40 63 65 29 2e 0d 0d 20 20 20 20 20 49 74 20 69 73 |ce)... It is| 00012c50 20 75 70 20 74 6f 20 79 6f 75 20 74 6f 20 6d 61 | up to you to ma| 00012c60 6b 65 20 73 75 72 65 20 74 68 61 74 20 74 68 65 |ke sure that the| 00012c70 20 76 61 6c 75 65 20 79 6f 75 20 75 73 65 20 69 | value you use i| 00012c80 73 20 20 73 65 6e 73 69 62 6c 65 3a 0d 20 20 20 |s sensible:. | 00012c90 20 20 79 6f 75 20 73 68 6f 75 6c 64 20 73 65 74 | you should set| 00012ca0 20 74 68 65 20 62 79 74 65 20 65 69 74 68 65 72 | the byte either| 00012cb0 20 74 6f 20 61 20 73 70 61 63 65 20 6f 72 20 74 | to a space or t| 00012cc0 6f 20 61 20 54 41 42 20 63 68 61 72 61 63 74 65 |o a TAB characte| 00012cd0 72 2e 0d 0d 0d 20 20 20 20 20 1b 2d 01 41 35 2e |r.... .-.A5.| 00012ce0 31 2e 33 20 52 65 61 6c 20 74 69 6d 65 20 63 6c |1.3 Real time cl| 00012cf0 6f 63 6b 20 68 61 6e 64 6c 69 6e 67 1b 2d 00 0d |ock handling.-..| 00012d00 0d 20 20 20 20 20 42 79 74 65 20 33 20 20 6f 66 |. Byte 3 of| 00012d10 20 20 74 68 65 20 20 70 61 74 63 68 20 20 61 72 | the patch ar| 00012d20 65 61 20 20 63 6f 6e 74 72 6f 6c 73 20 68 6f 77 |ea controls how| 00012d30 20 74 68 65 20 41 73 73 65 6d 62 6c 65 72 20 75 | the Assembler u| 00012d40 73 65 73 20 61 6e 79 0d 20 20 20 20 20 72 65 61 |ses any. rea| 00012d50 6c 2d 74 69 6d 65 20 63 6c 6f 63 6b 20 79 6f 75 |l-time clock you| 00012d60 20 6d 61 79 20 68 61 76 65 20 66 69 74 74 65 64 | may have fitted| 00012d70 2e 20 42 79 20 64 65 66 61 75 6c 74 20 74 68 65 |. By default the| 00012d80 20 76 61 6c 75 65 20 69 73 20 24 46 46 2c 0d 20 | value is $FF,. | 00012d90 20 20 20 20 61 6e 64 20 74 68 65 20 41 73 73 65 | and the Asse| 00012da0 6d 62 6c 65 72 20 77 69 6c 6c 20 61 74 74 65 6d |mbler will attem| 00012db0 70 74 20 74 6f 20 72 65 61 64 20 61 20 72 65 61 |pt to read a rea| 00012dc0 6c 2d 74 69 6d 65 20 63 6c 6f 63 6b 20 6f 6e 6c |l-time clock onl| 00012dd0 79 20 20 6f 6e 0d 20 20 20 20 20 61 20 4d 61 73 |y on. a Mas| 00012de0 74 65 72 20 31 32 38 2e 20 59 6f 75 20 6d 61 79 |ter 128. You may| 00012df0 2c 20 74 68 6f 75 67 68 2c 20 68 61 76 65 20 66 |, though, have f| 00012e00 69 74 74 65 64 20 61 20 74 68 69 72 64 2d 70 61 |itted a third-pa| 00012e10 72 74 79 20 63 6c 6f 63 6b 20 74 6f 0d 20 20 20 |rty clock to. | 00012e20 20 20 61 6e 6f 74 68 65 72 20 20 6d 6f 64 65 6c | another model| 00012e30 3a 20 20 73 65 74 74 69 6e 67 20 20 74 68 65 20 |: setting the | 00012e40 20 62 79 74 65 20 20 76 61 6c 75 65 20 20 74 6f | byte value to| 00012e50 20 20 30 20 20 77 69 6c 6c 20 20 6d 61 6b 65 20 | 0 will make | 00012e60 74 68 65 0d 20 20 20 20 20 41 73 73 65 6d 62 6c |the. Assembl| 00012e70 65 72 20 74 72 79 20 74 6f 20 72 65 61 64 20 74 |er try to read t| 00012e80 68 65 20 74 69 6d 65 20 6f 6e 20 61 6c 6c 20 6d |he time on all m| 00012e90 6f 64 65 6c 73 2e 0d 0d 20 20 20 20 20 4e 6f 74 |odels... Not| 00012ea0 65 2c 20 74 68 6f 75 67 68 2c 20 74 68 61 74 20 |e, though, that | 00012eb0 79 6f 75 72 20 72 65 61 6c 2d 74 69 6d 65 20 63 |your real-time c| 00012ec0 6c 6f 63 6b 20 6d 75 73 74 20 20 72 65 73 70 6f |lock must respo| 00012ed0 6e 64 20 20 74 6f 20 1b 2d 01 65 78 61 63 74 6c |nd to .-.exactl| 00012ee0 79 1b 2d 00 0d 20 20 20 20 20 74 68 65 20 20 73 |y.-.. the s| 00012ef0 61 6d 65 20 20 2a 46 58 20 63 61 6c 6c 73 20 61 |ame *FX calls a| 00012f00 73 20 75 73 65 64 20 6f 6e 20 74 68 65 20 4d 61 |s used on the Ma| 00012f10 73 74 65 72 20 31 32 38 3a 20 74 68 65 20 41 73 |ster 128: the As| 00012f20 73 65 6d 62 6c 65 72 20 68 61 73 0d 20 20 20 20 |sembler has. | 00012f30 20 6e 6f 20 6d 65 61 6e 73 20 6f 66 20 6b 6e 6f | no means of kno| 00012f40 77 69 6e 67 20 68 6f 77 20 74 6f 20 72 65 61 64 |wing how to read| 00012f50 20 74 68 65 20 74 69 6d 65 20 20 66 72 6f 6d 20 | the time from | 00012f60 20 63 6c 6f 63 6b 73 20 20 74 68 61 74 20 20 61 | clocks that a| 00012f70 72 65 0d 20 20 20 20 20 6f 70 65 72 61 74 65 64 |re. operated| 00012f80 20 69 6e 20 6f 74 68 65 72 20 77 61 79 73 2e 0d | in other ways..| 00012f90 0d 0d 20 20 20 20 20 1b 2d 01 41 35 2e 31 2e 34 |.. .-.A5.1.4| 00012fa0 20 43 68 61 72 61 63 74 65 72 20 63 6f 6e 73 74 | Character const| 00012fb0 61 6e 74 20 61 6e 64 20 73 74 72 69 6e 67 20 6f |ant and string o| 00012fc0 70 74 69 6f 6e 73 1b 2d 00 0d 0d 20 20 20 20 20 |ptions.-... | 00012fd0 42 79 74 65 20 34 20 20 6f 66 20 20 74 68 65 20 |Byte 4 of the | 00012fe0 20 70 61 74 63 68 20 20 61 72 65 61 20 20 63 6f | patch area co| 00012ff0 6e 74 72 6f 6c 73 20 20 68 6f 77 20 20 74 68 65 |ntrols how the| 00013000 20 22 7e 22 20 63 68 61 72 61 63 74 65 72 20 69 | "~" character i| 00013010 73 0d 20 20 20 20 20 74 72 65 61 74 65 64 20 69 |s. treated i| 00013020 6e 20 63 68 61 72 61 63 74 65 72 20 63 6f 6e 73 |n character cons| 00013030 74 61 6e 74 73 20 61 6e 64 20 73 74 72 69 6e 67 |tants and string| 00013040 73 2e 20 20 42 79 20 64 65 66 61 75 6c 74 20 74 |s. By default t| 00013050 68 65 20 76 61 6c 75 65 0d 20 20 20 20 20 6f 66 |he value. of| 00013060 20 74 68 65 20 62 79 74 65 20 69 73 20 7a 65 72 | the byte is zer| 00013070 6f 2c 20 61 6e 64 20 74 68 65 20 63 68 61 72 61 |o, and the chara| 00013080 63 74 65 72 20 20 68 61 73 20 20 6e 6f 20 20 73 |cter has no s| 00013090 70 65 63 69 61 6c 20 20 65 66 66 65 63 74 2e 0d |pecial effect..| 000130a0 20 20 20 20 20 43 68 61 6e 67 69 6e 67 20 20 74 | Changing t| 000130b0 68 65 20 20 76 61 6c 75 65 20 74 6f 20 24 46 46 |he value to $FF| 000130c0 20 63 61 75 73 65 73 20 74 68 65 20 22 7e 22 20 | causes the "~" | 000130d0 63 68 61 72 61 63 74 65 72 20 74 6f 20 74 61 6b |character to tak| 000130e0 65 20 6f 6e 20 61 0d 20 20 20 20 20 73 70 65 63 |e on a. spec| 000130f0 69 61 6c 20 6d 65 61 6e 69 6e 67 3a 20 20 69 74 |ial meaning: it| 00013100 20 77 69 6c 6c 20 6e 6f 77 20 63 61 75 73 65 20 | will now cause | 00013110 74 68 65 20 1b 2d 01 66 6f 6c 6c 6f 77 69 6e 67 |the .-.following| 00013120 1b 2d 00 20 63 68 61 72 61 63 74 65 72 20 74 6f |.-. character to| 00013130 20 62 65 0d 20 20 20 20 20 70 6c 61 6e 74 65 64 | be. planted| 00013140 20 61 73 20 61 20 63 6f 6e 74 72 6f 6c 20 63 68 | as a control ch| 00013150 61 72 61 63 74 65 72 20 77 69 74 68 20 20 62 69 |aracter with bi| 00013160 74 20 37 20 20 73 65 74 2e 20 20 4e 61 74 75 72 |t 7 set. Natur| 00013170 61 6c 6c 79 2c 20 20 79 6f 75 0d 20 20 20 20 20 |ally, you. | 00013180 77 6f 75 6c 64 20 20 6e 65 65 64 20 20 74 6f 20 |would need to | 00013190 20 77 72 69 74 65 20 27 7e 7e 27 20 69 6e 20 61 | write '~~' in a| 000131a0 20 63 68 61 72 61 63 74 65 72 20 63 6f 6e 73 74 | character const| 000131b0 61 6e 74 20 74 6f 20 6f 62 74 61 69 6e 20 74 68 |ant to obtain th| 000131c0 65 0d 20 20 20 20 20 22 7e 22 20 63 68 61 72 61 |e. "~" chara| 000131d0 63 74 65 72 20 69 74 73 65 6c 66 20 69 66 20 79 |cter itself if y| 000131e0 6f 75 20 74 75 72 6e 20 74 68 69 73 20 6f 70 74 |ou turn this opt| 000131f0 69 6f 6e 20 6f 6e 2e 0d 0d 0d 0d 0d 0d 0d 20 20 |ion on........ | 00013200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00013210 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 37 | 7| 00013220 39 0d 0d 0d 0d 0d 0d 1b 47 20 20 20 20 20 20 20 |9.......G | 00013230 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 | U| 00013240 53 49 4e 47 20 54 48 45 20 36 35 43 30 32 20 41 |SING THE 65C02 A| 00013250 53 53 45 4d 42 4c 45 52 1b 48 0d 0d 0d 0d 20 20 |SSEMBLER.H.... | 00013260 20 20 20 1b 2d 01 41 35 2e 31 2e 35 20 50 61 67 | .-.A5.1.5 Pag| 00013270 65 20 74 68 72 6f 77 73 20 61 74 20 74 68 65 20 |e throws at the | 00013280 65 6e 64 20 6f 66 20 61 20 6c 69 73 74 69 6e 67 |end of a listing| 00013290 1b 2d 00 0d 0d 20 20 20 20 20 42 79 74 65 20 35 |.-... Byte 5| 000132a0 20 6f 66 20 74 68 65 20 70 61 74 63 68 20 61 72 | of the patch ar| 000132b0 65 61 20 63 6f 6e 74 72 6f 6c 73 20 77 68 65 74 |ea controls whet| 000132c0 68 65 72 20 74 68 65 20 20 41 73 73 65 6d 62 6c |her the Assembl| 000132d0 65 72 20 20 6f 75 74 70 75 74 73 0d 20 20 20 20 |er outputs. | 000132e0 20 46 6f 72 6d 20 46 65 65 64 20 63 68 61 72 61 | Form Feed chara| 000132f0 63 74 65 72 73 20 74 6f 20 61 20 70 72 69 6e 74 |cters to a print| 00013300 65 72 20 6f 72 20 6c 69 73 74 69 6e 67 20 66 69 |er or listing fi| 00013310 6c 65 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 |le at the end of| 00013320 20 61 0d 20 20 20 20 20 6c 69 73 74 69 6e 67 2e | a. listing.| 00013330 20 20 42 79 20 64 65 66 61 75 6c 74 20 74 68 65 | By default the| 00013340 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 62 79 | value of the by| 00013350 74 65 20 69 73 20 24 46 46 3a 20 74 68 69 73 20 |te is $FF: this | 00013360 6d 61 6b 65 73 20 74 68 65 0d 20 20 20 20 20 41 |makes the. A| 00013370 73 73 65 6d 62 6c 65 72 20 6f 75 74 70 75 74 20 |ssembler output | 00013380 61 20 46 6f 72 6d 20 46 65 65 64 20 62 6f 74 68 |a Form Feed both| 00013390 20 62 65 66 6f 72 65 20 61 6e 64 20 61 66 74 65 | before and afte| 000133a0 72 20 74 68 65 20 20 6c 69 6e 65 73 20 20 6f 66 |r the lines of| 000133b0 0d 20 20 20 20 20 73 74 61 74 69 73 74 69 63 73 |. statistics| 000133c0 20 74 68 61 74 20 74 65 6c 6c 20 79 6f 75 20 74 | that tell you t| 000133d0 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 65 72 72 |he number of err| 000133e0 6f 72 73 2c 20 65 74 63 2e 20 20 43 68 61 6e 67 |ors, etc. Chang| 000133f0 69 6e 67 20 74 68 65 0d 20 20 20 20 20 62 79 74 |ing the. byt| 00013400 65 20 20 20 74 6f 20 20 20 30 20 20 73 75 70 70 |e to 0 supp| 00013410 72 65 73 73 65 73 20 20 74 68 65 20 20 46 6f 72 |resses the For| 00013420 6d 20 20 46 65 65 64 73 2c 20 20 73 6f 20 20 74 |m Feeds, so t| 00013430 68 65 20 20 73 74 61 74 69 73 74 69 63 73 0d 20 |he statistics. | 00013440 20 20 20 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 | immediately | 00013450 66 6f 6c 6c 6f 77 20 74 68 65 20 73 79 6d 62 6f |follow the symbo| 00013460 6c 20 74 61 62 6c 65 20 6c 69 73 74 69 6e 67 2c |l table listing,| 00013470 20 20 77 69 74 68 20 20 6e 6f 20 20 74 68 72 6f | with no thro| 00013480 77 20 20 74 6f 0d 20 20 20 20 20 68 65 61 64 2d |w to. head-| 00013490 6f 66 2d 66 6f 72 6d 20 66 6f 6c 6c 6f 77 69 6e |of-form followin| 000134a0 67 20 74 68 65 6d 2e 0d 0d 0d 0d 0d 0d 0d 0d 0d |g them..........| 000134b0 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d |................| * 000134d0 0d 0d 0d 0d 0d 0d 20 20 20 20 20 20 20 20 20 20 |...... | 000134e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000134f0 20 20 20 20 20 20 20 38 30 0d 0d 0d 0d | 80....| 000134fd