This chapter describes the Motorola syntax module, mostly used for the M68k and ColdFire families of CPUs, which is available with the extension @code{mot}. @section Legal This module is written in 2002-2019 by Frank Wille and is covered by the vasm copyright without modifications. @section Additional options for this module This syntax module provides the following additional options: @table @option @item -align Enables natural alignment for data (e.g. @code{dc.?}, @code{ds.?}) and offset directives (@code{rs.?}, @code{so.?}, @code{fo.?}). @item -allmp Makes all 35 macro arguments available. Default is 9 (@code{\1} to @code{\9}). More arguments can be accessed through @code{\a} to @code{\z}) which may conflict with escape characters or named arguments, therefore they are not enabled by default. @item -cnop= Sets a two-byte code used for alignment padding with CNOP. Defaults to 0x4e71 on M68k. @item -devpac Devpac-compatibility mode. Only directives known to Devpac are recognized. @itemize @minus @item Enables natural alignment for data and structure offsets (see option @option{-align}). @item Predefines offset symbols @code{__RS}, @code{__SO} and @code{__FO} as @code{0}, which otherwise are undefined until first referenced. @item Disable escape codes handling in strings (see @option{-noesc}). @item Enable dots within identifiers (see @option{-ldots}). @item Up to 35 macro arguments. @item Do not use @code{NOP} instructions when aligning code. @end itemize @item -ldots Allow dots (@code{.}) within all identifiers. @item -localu Local symbols are prefixed by @code{'_'} instead of @code{'.'}. For Devpac compatibility, which offers a similar option. @item -phxass PhxAss-compatibility mode. Only directives known to PhxAss are recognized. 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 Enable escape codes handling in strings (see @option{-esc}). @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_} with value 2 (to differentiate from the real PhxAss with value 1). @item When no output file name is given, construct it from the input name. @end itemize @item -spaces Allow blanks in the operand field. Otherwise a blank would start the comment field there. @item -warncomm Warn about all lines, which have comments in the operand field, introduced by a blank character. For example in: @code{dc.w 1 + 2}. @end table @section General Syntax Labels must either start at the first column of a line or have to be terminated by a colon (@code{:}). In the first case the mnemonic has to be separated from the label by whitespace (not required in any case, e.g. with the @code{=} directive). A double colon (@code{::}) automatically makes the label externally visible (refer to @code{xdef}). 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} can't be defined. 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. 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{,}). In this syntax module, the operand field must not contain any whitespace characters, as long as the option @option{-spaces} was not specified. Comments can be introduced everywhere by the characters @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 (unless @option{-spaces}). 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 =.s Equivalent to @code{ fequ.s }. PhxAss compatibility. @item =.d Equivalent to @code{ fequ.d }. PhxAss compatibility. @item =.x Equivalent to @code{ fequ.x }. PhxAss compatibility. @item =.p Equivalent to @code{ fequ.p }. PhxAss compatibility. @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. @item blk.b [,] 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. May fill the padding-bytes with no-operation instructions for certain cpus. @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 comm , Create a common symbol with the given size. The alignment is always 32 bits. @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 dx.b Tries to allocate space in the DataBss portion of a code or data section. Otherwise equivalent to @code{dcb.b ,0}. @item dx.d Tries to allocate space in the DataBss portion of a code or data section. Otherwise equivalent to @code{dcb.d ,0}. @item dx.l Tries to allocate space in the DataBss portion of a code or data section. Otherwise equivalent to @code{dcb.l ,0}. @item dx.q Tries to allocate space in the DataBss portion of a code or data section. Otherwise equivalent to @code{dcb.q ,0}. @item dx.s Tries to allocate space in the DataBss portion of a code or data section. Otherwise equivalent to @code{dcb.s ,0}. @item dx.w Tries to allocate space in the DataBss portion of a code or data section. Otherwise equivalent to @code{dcb.w ,0}. @item dx.x Tries to allocate space in the DataBss portion of a code or data section. Otherwise equivalent to @code{dcb.x ,0}. @item echo Prints to stdout. @item einline End a block of isolated local labels, started by @code{inline}. @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 equ.s Equivalent to @code{ fequ.s }. PhxAss compatibility. @item equ.d Equivalent to @code{ fequ.d }. PhxAss compatibility. @item equ.x Equivalent to @code{ fequ.x }. PhxAss compatibility. @item equ.p Equivalent to @code{ fequ.p }. PhxAss compatibility. @item erem Ends an outcommented block. Assembly will continue. @item even Aligns to an even address. Equivalent to @code{cnop 0,2}. @item fail Show an error message including the string. Do not generate an ouput file. @item fequ.s Define a new program symbol with the name and assign to it the floating point value of . Defining twice will cause an error. The extension is for Devpac-compatibility, but will be ignored. @item fequ.d Equivalent to @code{ fequ.s }. @item fequ.x Equivalent to @code{ fequ.s }. @item fequ.p Equivalent to @code{ fequ.s }. @item