MAS65 User's Guide (preliminary) For additional specifications, see MAS65.SPC.TXT MAS65 Cross-assembler, 6502 microprocessor v1.00.xx Copyright (C) 1996 Douglas Beattie Jr. Usage: MAS65 [filename {filename} {filename ...}] -switch {-switch ...} Assembler options -bin .... binary image output -s19 .... Motorola S-record output -hex .... Intel HEX output -s .... generate symbol table -cre .... generate cross-ref -c .... include cycle count -noc .... omit cycle count -l .... create listing (default) -nol .... do not create listing Explanation of Assembler Directives and Pseudo-Ops: Reserve Memory Bytes: ".DS", "DS", "RMB" Useful for generating addresses of data which will be in RAM, such as zero-page variables. e.g. ORG $0000 data.byte.one DS 1 data.byte.two DS 1 data.word.one DS 2 data.byte.three DS 1 Form Constant Bytes: ".BYTE", "DFB", "FCB" Defines constant bytes which are inserted into the code at the current location counter. Form Double Bytes (words) ".WORD", "DW", "FDB" defines byte-reversed (low-order, then high-order) words in the code. Useful for vectors and jump-tables. Form Constant Characters "FCC", "FCS" Takes a string, and generates ASCII in the object code. Uses either single or double quotes (either can enclose the other). FCS 'This is a "legal" string' FCS "Also a 'legal' string" Origin of object code "ORG" Sets the current location counter to the value of an expression which follows "ORG" ORG $0200 ORG *+30 ;skip 30 bytes in code ORG INTSERV Equate label with constant "EQU" {label} EQU {expression} Label starts in column 1; expression can be almost anything Zero memory bytes "BSZ", "ZMB" Fills memory with bytes of binary 00. BSZ 23 ;insert twenty-three zeroes into memory Block fill constant bytes "FILL" Similar to BSZ except the user also specifies binary value to use. Set assembler option "OPT" Causes the assembler to use specific options (see 'Assembler Options'). Should be used once at the beginning of the first source file. OPT -nol -hex Null pseudo ops: "NAM", "NAME", "SPC", "TTL" These do nothing. They are included for source-compatibility reasons. New page: "PAG", "PAGE" Inserts a Form Feed (ASCII 0C hex) into the list output file. End of assembly "END", ".END" Tells the assembler to stop and wrap up, forcing a normal end of assembly. Anything beyond the "END" directive is ignored. If followed by a label or constant, that address will be contained in the final zero-length record of the .HEX file. This can be utilized by a loader to begin execution at that address. Macros: "MACRO", "LOCAL", "ENDM" MACRO mac.function.name arg.one,arg.two,arg.three,arg.four Optional use of "LOCAL" can declare variables which are local to the macro. MAS65 automatically generates serialized labels (like ??001, ??002) for these labels when the macro is invoked. "ENDM" terminates the macro definition. The macro must be invoked by using an exclamation point { ! } as the first character in the line, e.g. ! mac.function.name TABLE.ONE,99,DEVICE.SCSI,SLOW Conditional assembly: "IF", ".COND" -- "ELSE", ".ELSE" -- "ENDIF", ".ENDC" When "IF {expression}" evaluates expression as zero, source is skipped until "ENDIF" is encountered. When ELSE is also used, the following occurs: When expression is true (non-zero), all source until "ELSE" is used, and evrything after "ELSE" is ignored until "ENDIF". When expression is false (= zero), all source before "ELSE" encountered is ignored, and everything after "ELSE" is used. Set label to variable value "SET" Similar to EQU except that the label can be re-defined. Therefore the value of a variable defined by SET can be different at various points in the assembly. This allows for general-purpose variables; also very useful within macros. ;MAS65 User's guide, last updated 21 JUN 1996 ;questions and comments to