This chapter describes the Motorola syntax module, mostly used for the M68k family of CPUs, which is available with the extension @code{mot}. @section Legal This module is copyright in 2002-2013 by Frank Wille. This archive may be redistributed without modifications and used for non-commercial purposes. Distributing modified versions and commercial usage needs my written consent. Certain modules may fall under additional copyrights. @section Additional options for this version This syntax module provides the following additional options: @table @option @item -align Enables 16-bit alignment for constant declaration (@code{dc.?}, except @code{dc.b}) directives. @item -devpac Devpac-compatibility mode. @itemize @minus @item Enables 16-bit alignment for constant declaration (@code{dc.?}, except @code{dc.b}) directives. @item Predefines offset symbols @code{__RS}, @code{__SO} and @code{__FO} as @code{0}, which in vasm are undefined until first referenced. @item Disable escape codes in strings (see @option{-noesc}). @item Enable dots within identifiers (see @option{-ldots}). @item Up to 35 macro arguments. @end itemize @item -ldots Allow dots (@code{.}) within all identifiers. @item -localu Local symbols are introduced by @code{'_'} instead of @code{'.'}. For Devpac compatbility, which offers a similar option. @item -phxass PhxAss-compatibilty mode. Enables the following features: @itemize @minus @item @code{section } starts a code section named @code{} instead of a section which also has the type @code{}. @item Macro names are treated as case-insensitive. @item Up to 35 macro arguments. @item Allow blanks in operands. @item Defines the symbol @code{_PHXASS_}. @end itemize @item -spaces Allow blanks in operands. @end table @section General Syntax Labels always start at the first column and may be terminated by a colon (@code{:}), but don't need to. In the last case the mnemonic has to be separated from the label by whitespace (not required in any case, e.g. with @code{=}). Qualifiers are appended to the mnemonic separated by a dot (if the CPU-module supports qualifiers). The operands are separated from the mnemonic by whitespace. Multiple operands are separated by comma (@code{,}). Local labels are preceded by '@code{.}' or terminated by '@code{$}'. For the rest, any alphanumeric character including '@code{_}' is allowed. Local labels are valid between two global label definitions. Otherwise dots (@code{.}) are not allowed within a label by default, unless the option @option{-ldots} or @option{-devpac} was specified. Even then, labels ending on @code{.b}, @code{.w} or @code{.l} are never possible. It is possible to refer to any local symbol in the source by preceding its name with the name of the last global symbol, which was defined before: @code{global_name\local_name}. This is for PhxAss compatibility only, and is no recommended style. Does not work in a macro, as it conflicts with macro arguments. Make sure that you don't define a label on the same line as a directive for conditional assembly (if, else, endif)! This is not supported. In this syntax module, the operand field must not contain any whitespace characters, as long as the option @option{-spaces} was not specified. Comments are introduced by the comment character @code{;} or @code{*}. The rest of the line will be ignored. Also everything following the operand field, separated by a whitespace, will be regarded as comment. Be careful with @code{*}, which is recognized as the "current pc symbol" in any operand expression Example: @code{mylabel inst.q op1,op2,op3 ;comment} In expressions, numbers starting with @code{$} are hexadecimal (e.g. @code{$fb2c}). @code{%} introduces binary numbers (e.g. @code{%1100101}). Numbers starting with @code{@@} are assumed to be octal numbers, e.g. @code{@@237}. All numbers starting with a digit are decimal, e.g. @code{1239}. @section Directives The following directives are supported by this syntax module (provided the CPU- and output-module support them): @table @code @item = Equivalent to @code{ equ }. @item align Insert as much zero bytes as required to reach an address where low order bits are zero. For example @code{align 2} would make an alignment to the next 32-bit boundary. Equivalent to @code{cnop 0,1<[,] Equivalent to @code{dcb.b ,}. @item blk.d [,] Equivalent to @code{dcb.d ,}. @item blk.l [,] Equivalent to @code{dcb.l ,}. @item blk.q [,] Equivalent to @code{dcb.q ,}. @item blk.s [,] Equivalent to @code{dcb.s ,}. @item blk.w [,] Equivalent to @code{dcb.w ,}. @item blk.x [,] Equivalent to @code{dcb.x ,}. @item bss Equivalent to @code{section bss,bss}. @item bss_c Equivalent to @code{section bss_c,bss,chip}. @item bss_f Equivalent to @code{section bss_f,bss,fast}. @item cargs [#,][.][,[.]]... Defines with the value of . Further symbols on the line, separated by comma, will be assigned the plus the size of the previous symbol. The size defaults to 2. Valid optional size extensions are: @code{.b}, @code{.w}, @code{.l}, where @code{.l} results in a size of 4, the others 2. The argument defaults to 4, when not given. @item clrfo Reset stack-frame offset counter to zero. See @code{fo} directive. @item clrso Reset structure offset counter to zero. See @code{so} directive. @item cnop , Insert as much zero bytes as required to reach an address which can be divided by . Then add zero bytes. @item code Equivalent to @code{section code,code}. @item code_c Equivalent to @code{section code_c,code,chip}. @item code_f Equivalent to @code{section code_f,code,fast}. @item comment Everything in the operand field is ignored and seen as a comment. There is only one exception, when the operand contains @code{HEAD=}. Then the following expression is passed to the TOS output module via the symbol '@code{ TOSFLAGS}', to define the Atari specific TOS flags. @item cseg Equivalent to @code{section code,code}. @item data Equivalent to @code{section data,data}. @item data_c Equivalent to @code{section data_c,data,chip}. @item data_f Equivalent to @code{section data_f,data,fast}. @item dc.b [,,"",''...] Assign the integer or string constant operands into successive bytes of memory in the current section. Any combination of integer and character string constant operands is permitted. @item dc.d [,...] Assign the values of the operands into successive 64-bit words of memory in the current section. Also IEEE double precision floating point constants are allowed. @item dc.l [,...] Assign the values of the operands into successive 32-bit words of memory in the current section. @item dc.q [,...] Assign the values of the operands into successive 64-bit words of memory in the current section. @item dc.s [,...] Assign the values of the operands into successive 32-bit words of memory in the current section. Also IEEE single precision floating point constants are allowed. @item dc.w [,...] Assign the values of the operands into successive 16-bit words of memory in the current section. @item dc.x [,...] Assign the values of the operands into successive 96-bit words of memory in the current section. Also IEEE extended precision floating point constants are allowed. @item dcb.b [,] Insert zero or bytes into the current section. @item dcb.d [,] Insert zero or 64-bit words into the current section. might also be an IEEE double precision constant. @item dcb.l [,] Insert zero or 32-bit words into the current section. @item dcb.q [,] Insert zero or 64-bit words into the current section. @item dcb.s [,] Insert zero or 32-bit words into the current section. might also be an IEEE single precision constant. @item dcb.w [,] Insert zero or 16-bit words into the current section. @item dcb.x [,] Insert zero or 96-bit words into the current section. might also be an IEEE extended precision constant. @item dr.b [,...] Calculates - and stores it into successive bytes of memory in the current section. @item dr.w [,...] Calculates - and stores it into successive 16-bit words of memory in the current section. @item dr.l [,...] Calculates - and stores it into successive 32-bit words of memory in the current section. @item ds.b Equivalent to @code{dcb.b ,0}. @item ds.d Equivalent to @code{dcb.d ,0}. @item ds.l Equivalent to @code{dcb.l ,0}. @item ds.q Equivalent to @code{dcb.q ,0}. @item ds.s Equivalent to @code{dcb.s ,0}. @item ds.w Equivalent to @code{dcb.w ,0}. @item ds.x Equivalent to @code{dcb.x ,0}. @item dseg Equivalent to @code{section data,data}. @item echo Prints to stdout. @item else Assemble the following lines if the previous @code{if} condition was false. @item end Assembly will terminate behind this line. @item endif Ends a section of conditional assembly. @item endm Ends a macro definition. @item endr Ends a repetition block. @item equ Define a new program symbol with the name and assign to it the value of . Defining twice will cause an error. @item erem Ends an outcommented block. Assembly will continue. @item even Aligns to an even address. Equivalent to @code{cnop 0,2}. @item fail Immediately break assembly with a fatal error, showing the from the operand field. @item