Inline Assembly Language

The following listing is an inline assembly instruction in the EBNF Syntax. A short discussion on semantics and special constructs follows.

Listing: Inline Assembly Listing in EBNF Format
AsmLine       = [Label](Code | Directive).
Label         = ident :.

Code          = mnemonic [ArgList][OptParams].

Directive     = Code.

ArgList       = Argument {, Argument}.

Argument      = Imm | Expression.

Imm           = # Expression.

OptParams     = ! RegList , RegList.

RegList       = { [Reg] {, Reg} }.

Reg           = A|HX|H|X|SR.

Variable      = Identifier.

Expression    = [Term {(+|-) Term}] [, (X|X+|HX|SP)].

Term          = Factor {(*|/) Factor}.

Factor        = ( Expression )

                | - Factor

                | @ Factor

                | * Factor

                | Factor {: Factor|MSB)}

                | Number

                | TypeQualifier

                | Variable {. Field}

                | Procedure

                | Label

TypeQualifier = Type . Field {. Field}.

Procedure     = Identifier.

Label         = Identifier.

Type          = Identifier.

Field         = Identifier.

To resolve grammar ambiguities, take the longest possible match to reduce to Factor (shift is always preferred). The pseudo offset MSB designates the most significant byte of an effective address and is only allowed for memory operands. The TypeQualifier production above evaluates to the offset of the given field. Type must be the name of a struct type. All named fields must exist.

This section covers the following topic: