Asmj syntax

Last revised: 30-Apr-2004
Syntax of 68xx-family comments

A comment line consists of some number of white-space characters (possibly zero), followed by an asterisk, followed by anything else. The entire line is discarded. Blank lines are also discarded, and can be considered as comment lines.

        spaces ::= " " ...
        commentline ::= <spaces> '*' <anything>

Syntax of 68xx-family hexadecimal numbers

For 68xx processors, numbers can be specified with a prefix that indicates the base. The prefix is a single character.

  1. Decimal numbers

    A decimal number needs no prefix; lack of any special prefix indicates that the number is decimal.

    	decimal_digit ::= "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
            decimal_number ::= <decimal_digit>...

  2. Hexadecimal numbers

    A hexadecimal number is indicated by a dollar-sign prefix. This is exactly equivalent to the processor-neutral form in which "0x" is used as the prefix. (This does not displace the processor-neutral syntax; either prefix may be used to the same effect.)

    	hex_digit ::= <decimal_digit>|"A"|"B"|"C"|"D"|"E"|"F"
            hex_number ::= "$" <hex_digit>...

  3. Octal numbers

    An octal number is indicated by an at-sign prefix.

    	octal_digit ::= "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"
            octal_number ::= "@" <octal_digit>...

  4. Binary numbers

    A binary number is indicated by a percent-sign prefix.

    	binary_digit ::= "0"|"1"
            binary_number ::= "%" <binary_digit>...

Syntax of 68xx-family pseudo-ops

  1. fcb

    "Form constant bytes" allows for leaving initialized byte data in memory. Its argument is a comma-separated list of numeric values, each stored in a single byte. Any value which is too large to fit in a single byte is shortened to its least-significant byte, except for strings in quotes which are treated as if each character was a distinct value in the list.

  2. fcc

    "Form constant characters" is just the same as "fcb".

  3. fdb

    "Form double bytes" is like "fcb", except that each value is stored in a pair of bytes, most-significant byte first. Just as for "fcb", characters of quoted strings are treated as if they were specified as individual values, which now means that they get two bytes each.

  4. rmb

    This pseudo-op lets you "reserve a memory block" of a specified length. The contents of the block of memory are unspecified, and your program cannot depend on them to be initialized. The argument is a numeric expression telling how many bytes to reserve.

    Because the value of the expression determines the placement in memory of the following code, and therefore the value of the symbols defined there, the expression cannot contain forward references to those symbols; all symbols used in the expression must have values defined before the 'rmb' itself.