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   B z %`  %\\\ ,`*ݢ [=\h}, ` 8` AG6`0:` eHdH  z`L *i} H h6̬ ¬ =`   ELĬ$e`  e zj} :    ɛ $ {. Ĭ E67L' ` S\* m= *k}Ϣ C S0% yL /7X 4LSPYXA@ -` @l} L\`"Т` -  (H  hฅ &*i? Ĭ  m}Ӹ Ĭٸ Ĭ`iee L J J") JJJJJ)Ƹ)) JJJ n}Ȉ`H h8UL@E@ 0"E3@ @E3@ @E@ "D3ЌD"D3ЌD"D3@ "D3@ bx!YMJ,),#($YX$$#]o}#)i#$S#$S[[i$$)|mi)S4i#bZH&bTDThDt(ntJrtttrDh2"&&rr&HDDȢʎp}ʎ "` 0[.\0 \]\ =TH )hTT& v F ¬ tU  K.-q}*Ф =LT 蝬$ʎ  B `` 2ee ` Br} ` ` ŵ m8+H\ ϭhH h?  eeLɺ W ` s}Ȅ m ϭ / % z dLBDEiHiI  Lt}0 Џ qLt`8`e e`H h`H Ә VǻhӘ` 1u} 0ۻ1ݻ01` `e e`H h`H Ә VǻhӘ` 1*- ASSEMBLER SECTION -- EXPRESSIONS -Expressions can be made from decimal numbers, hex numbers by using "$",binary numbersw} by using "%", single ASCII characters with a "'" (singlequote), and label names.Any of these values can be mixed with matx}h operators +-*/, ! (bitwiseOR), & (bitwise AND), and unary -. The | vertical bar can be used inplace of !.There are aly}so special operators that refer to the low byte, high byte,and bank byte (24-bit highest byte) of the calculated expression.z} Theseoperators are <, >, and ^.There is no operator precedence. All math is evaluated left to right,with the exception{} of <, >, and ^, which are done after the rest of theexpression has been evaluated.Examples of valid expressions: |}LDA #'A-$20 ;= $21 LDA #-1 ;= $FF LDA #%101&3 ;= 1 LDA #>$1234+1 ;= $12 LDA #>$}}1234+256 ;= $13 LDA #^$123456 ;= $12 LDA #>$123456 ;= $34 (mid byte)All of these expression types can be ~}used in .BY statements as well.Like:LOWS .BY LABEL1 >LABEL2 >LABEL3 .BY 15+3!}%1000 etc...- LABELS -The first character of a label may be any letter, or the symbols @, \, _,or ?. All remaini}ng characters may also include numbers plus the symbols., :, ;, <, =, >, and ^. Labels may be up to 15 characters long.La}bel names, and for that matter all text entered with the assembler, canbe entered in upper or lower case. Labels are not ca}se-sensitive.When the first character of a label is '?', the label is a 'local label'.Locals are defined only in the sourc}e code segment between two global(i.e. non-local) labels. References to local labels cannot cross aglobal label definition}.Internally, the assembler creates local labels by appending the local ontothe end of the previous global label. Thus in }the following code segment:DELAY LDX #100?L DEX BNE ?L'?L' is a local label, and will be entered in the symb}ol table as DELAY?L.Knowing how the label is stored, allows you to access it from the debuggeror the Esc-V expression evalu}ator. You can also code a direct referenceto the label DELAY?L if you need to access the local from the other sideof the g}lobal label DELAY.Locals are not printed in X-reference or symbol table listings, whichmakes them very useful for simple l}oop and branch structures where youdon't want to think up unique label names for all occurrences.- ADDRESSING MODES -All} 6502 and 65816 addressing modes are supported. Any addresses thatevaluate less than $100 will use zero page modes when pos}sible. Thus,zero page labels must be defined before being used, or assembly errorswill result.There is also a way to for}ce 8 bit, 16 bit, or 24 bit addresses using theoperators <, !, and >. (Yes, I know this is inconsistent with theimmediate }operators for low, high and bank bytes -- I didn't write the65816 assembler specifications). This can be really useful for }forcingabsolute 16 bit addressing on zero page labels, to add 1 cycle in timecritical applications. For the 65816, it can }force direct page addressingfor non-ZP labels, (which of course requires you to move the direct pageregister to the proper }page address). ALL 24-bit addresses must bepreceded by the > character.The operands for the 65816 MVP and MVN instruction}s should be simple bankbytes -- not full addresses. Ex: MVP $40 $80moves memory from bank $40 to bank $80, using t}he addresses in X and Y.Or: MVP ^SRC ^DESTUse the bank byte of the source and destination addresses.- PSEUDO-OPS }-Note that only 2 letters are required, but if additional letters arepresent they will be truncated without assembly error}s. For example, youmay use pseudo-ops like '.byte' and '.org'. Personally, I really likehaving the pseudo-ops the same wi}dth as all 6502 instructions, and onlyuse 2 letters. .24Sets the symbol table and program counter to use 24 bit add}resses.This is only useful for 65816 programs, and may crash your machine if youtry to use it without having a 65816 CPU.} .ABThe assembler will generate byte-sized values for accumulator-relatedimmediate constants. (Default) .AW}The assembler will generate word-sized values for accumulator-relatedimmediate constants. This is only useful for 65816 pro}grams. .BA byteFor bank addressing, you can specify an operand to force assemblergenerated object code into bank se}lect RAM. This byte will be stored intolocation $D301 when storing bytes of object code into RAM. .BI filenameIncl}udes the contents of a binary disk file into the assembly. If thisfile does not contain a DOS binary header, it will be ass}embled as in-linedata at the current PC. Otherwise, a file that contains a header will beloaded at its load address. } .BY [+byte] bytes and/or ASCIIStore byte values in memory. ASCII strings can be specified by enclosingthe string in eit}her single or double quotes.If the first character of the operand field is a '+', then the followingbyte will be used as a} constant and added to all remaining bytes of theinstruction.Ex: .BY +$80 1 10 $10 'Hello' $9Bwill generate:81 8}A 90 C8 E5 EC EC EF 1BValues in .BY statements may also be separated with commas forcompatibility with other assemblers. }Spaces are allowed since they areeasier to type.See also .SB which creates ATASCII screen codes. .CA byteThis is }to allow for assembly directly into a bank select cartridgeenvironment. The byte is placed in the X register, and a STA $D5}00,X isperformed when object code bytes are stored into memory. The only catch,is that the assembler needs to be able to r}eturn the bank select cartridgeto normal. There is currently a 'STA $D5DC' for this purpose, but this maynot be the right }address for your cartridge setup. You should search thedisk file for this instruction, ($8D $DC $D5), and replace it with t}heappropriate address. .CLClose output object code file. When using the .OU pseudo-op to createobject code files }on disk, the file will normally be closed at the end ofassembly. However, if you wish to close the file before that, it can} beforced closed with the .CL pseudo-op. You may use this to create multipleoutput files in one assembly, or to place some}thing in RAM in addition tothe disk file. .DC word byteDefine constant-filled block. This will fill an area of siz}e 'word' withthe constant 'byte'. .DS wordDefine storage. This will reserve an area of storage equal to size'word}'. .ECDo not display macro generated code in the assembly listing. Only themacro call itself will appear. }.EJEject -- Send a form feed code to eject the page in an assembly listing. .ENThis is an optional pseudo-op to mar}k the end of assembly. It can beplaced before the end of your source file to prevent a portion of itfrom being assembled.} .ESDisplay the code resulting from Macro expansions. .HE hex bytesStore hex bytes in memory. This is a con}venient method to enter stringsof hex bytes, since it does not require the use of the '$' character. Thebytes are still se}parated by spaces however, which I feel makes a muchmore readable layout than the 'all run together' form of hex statementt}hat some other assemblers use. Example: .HE 0 55 AA FF .IBThe assembler will generate byte-sized values for }index register-relatedimmediate constants. (Default) .IWThe assembler will generate word-sized values for index re}gister-relatedimmediate constants. This is only useful for 65816 programs. .IN filenameInclude additional files in} the assembly. Only the main source file cancontain .IN pseudo-ops. You cannot nest them. Default drive processingworks }the same here as it does when loading files from the editor, and soyou will usually not need any 'Dn:' types of filespecs. }The file nameonly should be sufficient. No quotes are needed either. .LCTurn off (clear) the display of the assemb}ly listing. (Default) .LLDisplay the assembly listing on this line only, even if the full listingis turned off. T}his can be extremely handy to display the program countervalue at important positions in the source file. .LO longwo}rdsStores longwords, (3 byte values) in memory. .LSTurn on (set) the display of the assembly listing. .MC a}drMove Code to a different address than the .OR assembly origin. If you areassembling to RAM, your code will be stored sta}rting at the address afterthe .MC pseudo-op. When assembling to disk, the .MC address will be usedwhen creating the binary} file headers, affecting where the code will beloaded into.!!!name .MD ([label1] [label2]...)Begin macro definition. Des}cribed in a separate section. .MEEnd macro definition. .MGMark the current .IN include file as Macro Global}. This keeps this filein memory throughout the assembly, which is required if the file containsmacros that are referenced }in other included files. .OCTurn off (clear) the storing of object code in memory. .OR adrSets the origin a}ddress for the assembly.Note: If there is a label on this line, it will be given the value of thenew origin. This is not} the same as in Mac/65 which could use its origindirective to reserve space (*= *+1). You should use the .DS pseudo-op for}reserving space. .OSTurn on (set) the storing of object code in memory. (Default) .OU filenameCreate an ou}tput disk file for the object code. Regretfully, this file ismade up of individual 256 byte segments much like Mac/65 does.} Iapologize for the laziness here on my part, but it really was a lot easierto do this way. You will need to run some typ}e of strip program tode-segment the file. The .OU pseudo-op should be placed above the .ORpseudo-op. .PR "text"Pr}int a text message to the screen on pass 1 of the assembly. This isgenerally used with the .VA pseudo-op when prompting for} values to beentered from the keyboard. .SB [+byte] bytes and/or ASCIIThis is in the same format as the .BY pseudo-}op, except that it willconvert all bytes into ATASCII screen codes before storing them. TheATASCII conversion is done befo}re any constant is added with the '+'modifier.label .VAWill print a '?', and then accept input from the keyboard. You m}ay enterany value, which will be given to the label in front of the .VA. .WO wordsStores words in memory. Multiple} words can be entered. SET label = expressionSet the specified label to a new value. This instruction allows a labe}lto be redefined with different values during the assembly. Any label canbe SET.- CONDITIONAL ASSEMBLY -There are four} conditional instructions IFE, IFN, IFP, and IFM, thatrepresent conditional assembly if Equal, Not equal, Positive, and Minu}s.The operand of the IF instruction will be evaluated, and if the processorstatus codes match the type of IF statement, the}n the source codefollowing the IF will be assembled. Mark the end of the conditional blockof code with the pseudo-op '***'}. (*** is like an ENDIF statement).There is no 'ELSE' instruction, and so you must use complementing IFstatements.Examp}les: IFN FLAG . ;This block of . ;code gets asm'ed . ;whe}n FLAG <> 0 *** IFE FLAG . ;This block does . ;when FLAG=0 ***} IFN FLAG1!FLAG2 . ;asm'ed if FLAG1 . ;or FLAG2 <> 0 IFE WIDTH-40 } . ;This gets asm'ed . ;when width=40 *** IFM WIDTH-40 . } ;asm'ed if WIDTH . ;less than 40 *** IFP WIDTH-40 . ;if WIDTH greate}r . ;or equal to 40- MACROS -Macros must be defined before they are used in your source. Thedefinit}ion looks like this:!!!name .MD ([label1] [label2]...)The parentheses in the definition are optional, and may be omitted.}Where 'name' is the name of the macro, and 'label1' etc. are itsparameters, separated by spaces. The three exclamation ma}rks are aspecial macro identifier, and must precede the macro name. If the macrotakes no parameters, then omit the parenth}eses after the ".MD". The bodyof the macro definition will follow, and should be ended with a .MEpseudo-op.The number of} parameters used when calling the macro must always match thenumber of labels in the definition. When called, these paramet}ers will beplaced into the label names, in order, where they can be used in the bodyof the macro. Parameters can only be e}xpressions -- there is no methodfor passing arbitrary text strings. Labels used in the macro definitionare stored in the s}ymbol table along with regular labels. Thus, theremust not be name conflicts between macro parameter labels and programlab}els. I suggest you adopt a naming convention for macro labels, likealways starting them with "Z" or something, to make it e}asier to avoidname conflicts.Macros can pass up to 8 parameters.Any labels defined within a macro must use a special for}m. Because macroscan be expanded multiple times, a special label type exists to avoiderrors from multiple label definition}s. These label types start withthree periods, followed by any normal label name. These special macrolabels will be given }unique numbers with each macro expansion to keep themseparate. You can consider them local labels to each macro expansion.}Here's an example of a macro to increment a two byte value:!!!IND .MD (ZLOC) INC ZLOC BNE ...SKP INC }ZLOC+1...SKP .METo call this macro, you would use: IND $80There are more macro examples in the supplied include }file MACROS.- ERROR MESSAGES -These are the error messages that can be produced by the assembler. Errormessages are mar}ked with an '!', and also include the source line numberthat they occurred on. If you are assembling a single file, or if t}heerrors occurs in your main file, you will be able to use the editor ^Hcommand to jump directly to the errors. For errors} that occur in includedfiles, you will need to load in that file, and jump to those line numbersmanually using the ^G goto }line number command. BRANCHBranch instruction out of range. OPCODEError in opcode field. This can be eithe}r a bad 65816 instruction, badpseudo-op, or an undefined macro. DUPDuplicate label definition. EOFEnd of F}ile error. All assemblies must end with a .EN pseudo-op. Thisshould be in the main source file, not in any included files.} This errorcan also occur if a conditional or macro definition is pending at the .EN. UNDEFUndefined label referen}ce. NESTNested definition. Conditional IFs may not be nested. .MD macrodefinitions cannot contain additional defi}nitions. .IN included filesmay not include additional .IN files. OPERANDError in operand field. ADR MODEA}ddressing mode not supported. BAD LABELBad characters in label name. MACRO OVMacro overflow in either the n}umber of expansions, or level of nestedexpansions. SYM OVSymbol table overflow. PARMSNumber of macro param}eters in the call does not match the definition. LABEL MISSINGMissing label on either a SET pseudo-op or in an = equ}ate definition. does not match the definition. LABEL MISSINGMissing label on either a SET pseudo-op or in an = equ- DEBUGGER -- GENERAL INFORMATION -Note: 24 bit support, and the full 65816 instruction set are notcompleted yet. This }is basically a 6502 debugger right now.Filenames default to the current drive number which can be changed.(input of 'FILE'} = 'D1:FILE') A full filespec will override the default.Non destructive prompt character (.) for ease in full screen editin}g.Also, the prompt does not interfere with command decoding. If the cursoris moved up to redo a prior command, the '.' doe}s not need to be deleted.Upper and Lower case accepted.The debugger is ZP clean, so all of ZP is available for the user.}You can look at RAM under the OS, by resetting the bit in $D301, as longas you are using SpartaDOS or some method of handli}ng interrupts whenthe OS is disabled.The debugger uses the E: handler, which can allow two screen debuggingwith some 80 c}olumn devices. (Your program is displayed through the Atari,while debugging output is on the 80 column device.) Currently,} the XEP80does not work very well in this manner, because its screen drivers requirethe Atari DMA to be turned off. You ca}n partially support this by addingan external user function to toggle DMA. More information about this willbe given in a l}ater section. For machines without an 80 column device, thedebugger supports flipping between two display lists, one for th}e E:screen, and one for your program. In all cases, there can be potentialconflicts when trying to debug programs that use } the E: handler themselves,as both the debugger and your program struggle for the same locations. Thedebugger's design is }admittedly not ideal for use in this situation, but itworks out well for programs that create their own screen.Any continu }ous displays can be paused and stepped one line at a time withthe space bar. Press 'C' to return to continuous display. ES }C, RETURN, orBREAK will stop the display. While the display is paused, the V commandfor switching view screens, and also t }he U user function, can both be used.ALL addresses and data bytes can be entered in HEX (default), in DECIMALwith # (#1234 }), in BINARY with % (%10011010), in ASCII with ' ('A) or as alabel currently defined in the MAE symbol table with . (.LABEL) }.Arithmetic operators +-*/&! can also be used, and will be performed leftto right. Any combination of these can be mixed }at any time in acompletely free format scheme, with no limits on length.(Ex: 2000-#256+'W/100) Very little will be mention }ed about this featurelater on, but ALL numbers for ALL commands accept this versatile entrysystem.All commands use spaces } as delimiters. A '?' indicates a command error.Parameter uses for commands are abbreviated to:adr: a 16 bit address.by }: an 8 bit byte. ('by' with numbers indicates a string of bytes.)bit: a 0 or a 1.char: an ASCII character.Quantities i }n [brackets] are optional parameters. Default values will beused if they are not entered. All non-bracketted values must b }e entered.Any other upper case characters or symbols should be entered as stated.'Current address' refers to the last disp }layed or changed address, (+$1),and is separate from the current program counter or PC.- COMMANDS - Display Mem }ory. M [adr] [adr][/]Displays hex and ASCII. Displays 24 locations if only 1 parameter.Displays from current adr if no } parms. '/' = to $FFFF. The '/' can beused on all other commands as well. Does not display ASCII controlcharacters when }output is being sent to an external device. Peek Memory. P adr1 [adr2..] [*]Special memory display that al }lows multiple addresses to be entered, andonly prints one byte per address. * causes a continuous print of the listof addr }esses, and is really useful for finding keycodes from $D209, orexamining any locations that have changing data. Push Break }to abort thecontinuous peek. Change Memory. :adr by1 [by2..by8]The change memory command ':' can be entered } directly, or edited from thedisplay memory command. Only 8 data bytes will be changed. You cansubstitute the character = } for the adr, which will then use the currentaddress. This allows you to enter successive lines of bytes withoutrequiring }any other addresses. Ex::600 1 2 3 4 5 6 7 8:= 9 A B C D E F ASCII Mem Change C adr ASCII_STRINGStores ASC }II string at adr. Disassemble D [adr]Disassembles memory starting at adr, or the current adr if not entered.The }disassembly code, (the instructions -- not the hex bytes), can bemodified using normal screen editing. This gives you a sin }gle lineassembler process that is a direct link to the syntax processor in themain assembler section. Therefore, it uses t }he same format, and has allof the same features as any one line of code that you could enter in theassembler section. You }can use labels, < and > operators, and evenpseudo-ops! You can enter branch instructions with an address like "*+8",which }means the current PC +8. The only restriction is that you cannot usea macro call. You can enter 816-only instructions, bec }ause the assemblerunderstands them all. However, after you press return, the disassemblerwill not be able to properly disp }lay the code you just typed. So eventhough it will assemble the code correctly, you won't be able to see it inthe debugger }. Another problem, is that the disassembler will not know howmany bytes were required by a line of 816 code. It will assum }e that allunknown instructions are one byte, so anytime you enter a multi-byte 816instruction, the address displayed for th !}e next line will be incorrect. Itwill be one byte past the line you just entered, which will be in theoperand field of the "} last instruction. For now, it is up to the programmerto be aware of how long the 816 instructions really are, and ensure t #}hatthe next line is typed at the proper address. Anytime you need to changethe address on a disassembly line, you need to $}move the cursor up and thenback down, to reset the Atari screen editor for accepting the entire lineof text.Single line a %}ssembly can be started from scratch, (as opposed to editingan existing disassembly), by typing, "-adr ." followed by an Asse &}mblymnemonic. (The '.' is necessary). Such as:-600 .LDA #0Because the period is a marker for the beginning of the inst '}ruction field,entering a pseudo-op will require two periods. Such as:-600 ..HE 55 AA FFThis gives you additional method (}s for putting bytes into memory. Since theregular Change Memory command is limited to 8 bytes, you can use the above.HE fo )}rmat when you want to enter more bytes than that. Or use .BY whenyou want to enter mixed strings of ASCII, HEX, and DECIMAL *}. Maximum lineentry length is always limited to 80 characters though. Other pseudo-opsthat can be useful are, .DC for blo +}cks of constant data, and .SB forATASCII screen code bytes. You can also enter the .24, .AB, .AW, .IB, and.IW pseudo-ops t ,}o control the size of the operands that you enter, just asyou would need to do in the assembler. None of the other pseudo-o -}psproduce useful results, and some can be hazardous to use.From within the single line assembler, you may enter '*' as the .} firstmnemonic character to continue disassembly from that address forward. Display Registers RDisplays 6502 r /}egisters in this form: ,A X Y NV-BDIZC SP ;AB 5D FA 10110001 FF 7014 LDA #$00The 65816 version of MAE displays regist 0}ers in this form:,NVMXDIZC E;00AB 005D 00FA FF 7014 LDA #$00Status flags will be inverse when they are set, and normal w 1}hen clear. Change Registers ; register bytesSupports screen editing of R command. Status flags can be modifie 2}d in bitform. When entering values directly, a comma will skip to the nextregister, and you don't need to enter all the va 3}lues. EX: ';55' willchange the A register to 55. ';,,20' will change Y to 20.When setting flags in the 65816 version, yo 4}u can enter either normal orinverse flag characters, or enter 0's or 1's, and can freely mix the two. Goto 5} G[S] [adr] [*brkpt] [C by] [r by] [Pf bit]Run program at adr, or PC if not entered. At any time during execution, 6}the Break key will return to the debugger and display the currentregisters and PC. Use the 'S' option to run code that ends 7} in an RTS.(Note: When using the S option, the PC adr in the register display onreturn is an internal address, not the add 8}ress where the actual RTSoccurred.)A breakpoint will create a return point to the debugger whenever aparticular address o 9}r condition is reached. *brkpt will place a 00 (BRK)at the breakpoint address. For this reason, breakpoints can not be use :}dfor programs in ROM. A '?' will be printed in this case. The breakpointmust also be set at an opcode rather than an oper ;}and location so that itwill execute. The rest of the parameters add conditions to thebreakpoint.C + by Counts the number <} of times the breakpoint is reached. Executioncontinues until the BRK is passed the specified number of times.Breakpoints =}can also test for specific conditions by specifying (r) regname and (by) byte it must contain in order to BRK. Processor fl >}ags canalso be tested by 'P' + flag character + (bit) for condition. Use theflag characters as in the register display.T ?}he breakpoint will be skipped over until the specific condition isreached. When both count and condition options are used, @}the count willapply to the number of times the condition is met. Execution speed willbe slightly slower than real time in A}this mode. Actual speed will dependon how often the program is interrupted to check conditions.NOTE: A peculiar bug in t B}he 6502 chip causes breakpoints to beintermittently skipped over. When the BRK interrupt occurs, the programcounter+2 is p C}ushed on the stack, but instead of jumping through theinterrupt vector, the OS will occasionally just return to the program D}atPC+2. This is usually a very rare occurrence, but can happen more oftenwhen using conditional breakpoints on very small E}and quick loops, thus BRKinterrupts are occurring very rapidly. It took many years before I wasable to really understand w F}hat was going on, and be assured that theproblem was indeed in the 6502, and not a bug in the debugger.ADDITIONAL NOTE: Th G}is bug does not occur on the 65816 processor! Go command examples.G 2000 = Run program at $2000G 4000 *4124 H} = Run at $4000, and break at $4124G *3100 A'Q = Run at current PC and break at 3100 when A register I} equals ASCII 'Q'G *4200 C10 PZ1 = Run at PC and break at 4200 the 16th time the zero flag is set J} Remove Breakpt *Brkpts remove themselves, and replace what was there when the BRK isexecuted. However, in case the K} program stops at other than the brkpt, *will remove it. This can occur when the Break key is pressed, conditionalor count L} values are not reached, or when the BRK is set in an operandrather than an opcode. Setting a new brkpt with the G command M}will alsoremove an unused BRK. Exit to DOS X Return to Assembler A Fill Memory N} F adr1 adr2 [by1] [by2 by3...]Fill memory with 0 if no data bytes. Otherwise enter 1 byte, or a sequenceof any number O}of bytes to fill with. Transfer Mem T adr1 adr2 adr3Move memory from adr1 through adr2 to adr3. Handles o P}verlapping moves. Hunt for chars H adr1 adr2 by1 [by2...][?] Hunt for String H adr1 adr2 'ASCII Q} string [?]Hunt memory for ASCII string or string of hex bytes up to length of 30.Use '?' for a wildcard to match anything. R} Note that the default wildcard byte is also $3F hex, meaning that any searches with 3F in a hexstring will be treated as S}a wildcard as well. See the next command forchanging the wildcard character in cases of interference. Realize thenumber e T}ntry system will let you search for things like "A9 'A", (as inLDA #'A), but not the reverse of this. Entering "'A A9" will U} put the huntinto full ASCII form, and search for the literal string that you typed in.The second example can actually be e V}ntered in the form "? 'A A9", using awildcard to avoid the initial ' identifier. For one more example, let'ssay you wanted W} to search for a JSR to a MAE defined label. This can beentered as "20 .