home *** CD-ROM | disk | FTP | other *** search
Text File | 1985-08-20 | 13.4 KB | 468 lines | [TEXT/Anon] |
-
- MAC.68K
-
-
- II.11 ASCII Control Characters II.11 ASCII Control Characters II.11 ASCII Control Characters
-
-
- Any ASCII control characters found in the source input will
- be converted to # prior to processing except for: CR ($0D), LF
- ($0A), DLE ($10), and HT ($09) (see II.4).
-
-
- II.12 Numeric Data Representation II.12 Numeric Data Representation II.12 Numeric Data Representation
-
-
- Hex numbers begin with the symbol $, octal numbers use a
- postfix radix character of B or Q, and decimal numbers may
- optionally use a radix of D. Radix and hex alpha characters may
- be any mixture of upper and/or lower case.
- All numbers are represented internally as 32-bit integers.
- This places a range limit of +2**31 - 1 on the value of any _
- number.
-
- Examples DECIMAL OCTAL HEX
-
- unsigned 18 7Q $1AF
- signed -123D -77Q -$30
- +5 +03Q +$FF
-
-
- II.13 Character Data Representation II.13 Character Data Representation II.13 Character Data Representation
-
-
- Character data may be defined by placing the desired
- character string within single quotes. (Double quotes are used
- for STRING names.)
-
- MAC.68K also supports a variety of left and right justified
- character data types. Justification occurs when the specified
- character data is shorter than its field. For example one byte of
- data in a word field, or 21 bytes in a 6 long word field will be
- aligned to a left or right field boundary. Space and zero fill
- are available options.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -7- MAC.68K
- MAC.68K
-
-
- The general form for justified character data is:
-
- n / type / string
-
- A special form available for DC operations only is:
-
- #type / d / string / d
-
- where n is the field size and d is any character
-
-
- type description
-
- A Right justified with blank fill
- H Left justified with blank fill
- L Left justified with zero fill
- R Right justified with zero fill
- Z Left justified with zero fill. For DC
- instructions, one trailing zero byte
- is guaranteed even if another byte, word,
- or long word must be allocated. Within
- an expression or constant, type Z is
- equivalent to type L.
-
- Each character data type may either have an explicit
- character length or may use delimiter characters to bracket the
- string. For example, 4LABCD and L*ABCD* each describe a string of
- length 4 characters. The delimiting character may be any
- character (other than & or ") that does not appear in the string
- itself. The type designation character must be upper case.
-
- Examples
-
- MOVE.L #'ABCD',D1
- CMP.W #1R-,D2 Compare Right Justified Character Data
- DC.L 22H THIS IS A LONG STRING
- DC.B #Z*SAMPLE ZERO BYTE TERMINATED MESSAGE*
- DC.B 'The End'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MAC.68K -8-
- MAC.68K
-
-
- II.14 Expression EvaluationII.14 Expression EvaluationII.14 Expression Evaluation
-
-
- Symbols and data values can be combined into expressions
- using normal algebraic notation. A single term expression takes
- on the value of the term involved. Multiple term expressions are
- reduced to a single value following the rules:
-
- Unary operator + -
- Binary operator + - * /
-
- 1. Parenthesized expressions are evaluated from the innermost
- outward. Parenthesis can be nested to six levels.
-
- 2. Arithmetic operators are evaluated left to right, with
- multiplication and division taking precedence over addition
- and subtraction.
-
- 3. Each term is evaluated as a 32-bit value.
-
- 4. Division yields a 32-bit integer with no remainder, and
- division by zero yields zero, but it is flagged as an error.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -9- MAC.68K
- MAC.68K
-
-
- III. MACROSIII. MACROSIII. MACROS
-
-
- A macro definition contains a sequence of source lines that
- are saved, and then later inserted into the program text when
- referenced by using the macro name as an operation code.
-
- The first line of a macro definition contains the MACRO or
- MACROL operation code, the macro name, and any substitutable
- parameters used within the body of the macro. Reserved macro
- names are: END ENDM LOCAL ENDD.
-
- Next, a macro definition may optionally contain one or more
- LOCAL pseudo ops that identify symbols used within the body of
- the macro that are local to the macro definition. During macro
- expansion, local symbols are replaced with a symbol name of
- ..hhhh where hhhh is a hex number starting at 0000 and being
- incremented by one each time a local symbol is created. By
- generating unique symbol names, a macro may be expanded more than
- once without causing duplicate symbol definition errors. These
- generated symbol names are not listed in the symbol table and are
- not cross referenced.
-
- The body of the macro comes next. It consists of a sequence
- of source lines terminated by an ENDM operation code. The source
- lines may contain any combination of operation codes, comment
- lines, or macro calls except op code END. By using named ENDM op
- codes (see ENDM) a macro may even contain other macro
- definitions. Note that any macros contained within another macro
- are merely saved and not processed/defined until the outer level
- macro is called.
-
- The name of a substitutable parameter or local symbol can
- occur in any field in a macro body source line. The name is
- recognized if it is bracketed by two of the following macro
- delimiter characters:
-
- space + - * / ( ) & , = "
-
- A macro must be defined prior to its call. A macro defined by
- program source lines (including INCLUDE source lines) is
- considered a user macro. A macro defined thru inclusion of a
- preassembled macro file (see INCLUDES) is considered a system
- macro. By default MAC.68K does not list either user or system
- macro call expansions. See LIST for the appropriate macro list
- option.
-
-
-
-
-
- IV. (deleted)IV.IV.
-
-
-
-
-
-
-
- MAC.68K -10-
- MAC.68K
-
-
- V. PROGRAM LIST FORMATS AND LIST CONTROLV. PROGRAM LIST FORMATS AND LIST CONTROLV. PROGRAM LIST FORMATS AND LIST CONTROL
-
-
- MAC.68K does not automatically list every line of input to
- the output device. Each line is categorized by its origin type
- (e.g., a line from an included text file, a line generated by a
- macro, etc) and is listed only if the appropriate list options
- are currently enabled. Pseudo op LIST controls the active list
- options.
-
- Output is formatted either for an 80 column device or a 120
- column device. The console is assumed to be 80 columns wide and
- everything else 120. This may be overridden by the PAGE
- initialization pseudo op. When going to an 80 column output
- device, any data characters beyond column 80 are by default
- truncated. When overridden by the OPTION WRAP, columns 81 thru
- 120 are printed on the next line beginning in column position
- 32.
-
- By default output is paged with a one line header, one blank
- line, and 58 source lines per page. An optional two line header
- format or no header at all may be selected by using OPTION. Lines
- per page may be reset using the PAGE pseudo op. The page line
- fields are:
-
- First header line
-
- columns 1 - 32 64 - 83 88 - 107 112 - 120
- Title Version # Date/Time PAGE nnn
-
- Second header line
-
- columns 1 - 32 64 - 83 88 - 95 112 - 120
- Subtitle Subheading QUAL Name
-
- Source line output
-
- columns 1 - 2 3 - 8 9 - 30 31 - 120
- Error Flags Location Address Machine Code Source line
-
-
- In 80 column mode the first header line is compressed by
- dropping the date/time field and replacing it with the page
- number field.
-
- Two optional fields for the source line output are sequence
- numbers and sequence names. If selected via OPTION, these fields
- are inserted so they end in column 120. Sequence numbers are not
- always sequential with an assembler that can INCLUDE other text
- files or can generate source lines itself with MACRO or DUP. Each
- INCLUDE file or call to a macro generates a new block of code
- starting with sequence number 1. The old number sequence is
- resumed when the inserted block of code terminates. The optional
- sequence name reflects the source of the code. For source input
- or INCLUDE it is the file name, for macros it is the macro name,
- and for DUP it is DUP**.
-
-
-
- -11- MAC.68K
- MAC.68K
-
-
- When the console is used as the output device, MAC.68K will
- pause after a page is displayed on the screen and wait for a
- keyboard input character before advancing to the next page. The
- character *S* or a ctl/C character will immediately terminate the
- assembly. Any other character will cause MAC.68K to continue
- assembling until the next page is full or the assembly is
- complete. The OPTION NOPAWS will disable the pause feature and
- the output will scroll continuously until the assembly finishes.
- Note that the standard CPM-68K console control keys ctl/S and
- ctl/Q may also be used to stop and continue output.
-
- A printed symbol table must be explicitly requested via an
- OPTION. OPTION CROSSREF will generate symbol cross references
- and list these symbol references sorted by page and output line
- number when it lists the symbol table. OPTION SYMBOL will
- generate the same sorted symbol table that lists each symbol and
- its value, but not any cross references.
-
-
-
-
- VI. PROGRAM STRUCTUREVI. PROGRAM STRUCTUREVI. PROGRAM STRUCTURE
-
-
- The minimum executable program on the Macintosh is:
-
- ExitToShell ;RESTART THE FINDER APPLICATION
- .END
-
-
- MAC.68K requires all programs to end with an END card, and to
- optionally begin with an IDENT card. The IDENT/END pair brackets
- the program text and provides some guarantee of program
- completeness. Some of the MAC.68K pseudo ops are used only for
- initialization of assembly values, and must appear immediately
- following the IDENT card (if present) but prior to any
- non-initialization operation or pseudo operation code. These
- pseudo ops are:
- OPTION MODULE STEXT INCLUDES
- If they appear later in the program they are flagged with an
- error and are not processed. Pseudo op PAGE may be used anywhere
- in the program. When used to initialize page width and/or page
- length, it must appear as an initializtion pseudo op.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MAC.68K -12-
- MAC.68K
-
-
- VII. FILE NAMES AND EXTENSIONSVII. FILE NAMES AND EXTENSIONSVII. FILE NAMES AND EXTENSIONS
-
-
- File names supported by MAC.68K are limited to 8 characters
- in length with an optional extension (a . followed by up to 3
- characters). Imbedded spaces within a file name or extension are
- not supported. The input source file may have any file
- extension, although .S is recommended. The input file name, the
- object file name specified with the -O command, and the output
- file name specfied with the > command line parameter are the only
- file names that are not assigned explicit file name extensions by
- MAC.68K.
-
- If present, the program name from the IDENT card is used as
- the base file name for the generated object file. Based on
- whether it is a program, module, or definition table assembly the
- object file extension is .68K, .MOD, or .STX .
-
- File names used by the include pseudo ops may optionally
- specify device names and extension names. Included text files are
- assumed to have a blank extension. The extensions .MOD and .STX
- are assumed by INCLUDEH and INCLUDES.
-
- The console is referenced with file name CON: and the
- printer with name LST:.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -13- MAC.68K
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -13-