1 @c Copyright (C) 2018 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
7 @chapter S12Z Dependent Features
10 @node Machine Dependencies
11 @chapter S12Z Dependent Features
14 The Freescale S12Z version of @code{@value{AS}} has a few machine
19 * S12Z-Opts:: S12Z Options
20 * S12Z-Syntax:: Syntax
21 * S12Z-Directives:: Assembler Directives
22 * S12Z-opcodes:: Opcodes
37 In the S12Z syntax, the instruction name comes first and it may
38 be followed by one or by several operands.
39 In most cases the maximum number of operands is three.
40 Some instructions accept and (in certain situations require) a suffix
41 indicating the size of the operand.
42 The suffix is separated from the instruction name by a period (@samp{.})
43 and may be one of @samp{b}, @samp{w}, @samp{p} or @samp{l} indicating
44 `byte' (a single byte), `word' (2 bytes), `pointer' (3 bytes) or `long' (4 bytes)
46 Operands are separated by a comma (@samp{,}).
47 A comma however does not act as a separator if it appears within parentheses
48 (@samp{()}) or within square brackets (@samp{[]}).
49 @code{@value{AS}} will complain if too many, too few or inappropriate operands
50 are specified for a given instruction.
51 The MRI mode is not supported for this architecture.
66 @cindex line comment character, S12Z
67 @cindex S12Z line comment character
68 The presence of a @samp{;} character anywhere
69 on a line indicates the start of a comment that extends to the end of
72 A @samp{*} or a @samp{#} character at the start of a line also
73 introduces a line comment, but these characters do not work elsewhere
74 on the line. If the first character of the line is a @samp{#} then as
75 well as starting a comment, the line could also be logical line number
76 directive (@pxref{Comments}) or a preprocessor control command
77 (@pxref{Preprocessing}).
79 @cindex line separator, S12Z
80 @cindex statement separator, S12Z
81 @cindex S12Z line separator
82 The S12Z assembler does not currently support a line separator
85 @cindex S12Z addressing modes
86 @cindex addressing modes, S12Z
87 The following addressing modes are understood for the S12Z.
92 @item Immediate Bit Field
93 @samp{#@var{width}:@var{offset}}
95 Bit field instructions in the immediate mode require the width and offset to
97 The @var{width} pararmeter specifies the number of bits in the field.
98 It should be a number in the range [1,32].
99 @var{Offset} determines the position within the field where the operation
101 It should be a number in the range [0,31].
104 @samp{*@var{symbol}}, or @samp{*[+-]@var{digits}}
106 Program counter relative addresses have a width of 15 bits.
107 Thus, they must be within the range [-32768, 32767].
112 Some instructions accept a register as an operand.
113 In general, @var{reg} may be a data register (@samp{D0}, @samp{D1} @dots{}
114 @samp{D7}), the @var{X} register or the @var{Y} register.
116 A few instructions accept as an argument the stack pointer
117 register (@samp{S}), and/or the program counter (@samp{P}).
119 Some very special instructions accept arguments which refer to the
120 condition code register. For these arguments the syntax is
121 @samp{CCR}, @samp{CCH} or @samp{CCL} which refer to the complete condition code register, the condition code register high byte and the condition code register low byte respectively.
123 @item Absolute Direct
124 @samp{@var{symbol}}, or @samp{@var{digits}}
126 @item Absolute Indirect
127 @samp{[@var{symbol}}, or @samp{@var{digits}]}
130 @item Constant Offset Indexed
131 @samp{(@var{number},@var{reg})}
133 @var{Reg} may be either @samp{X}, @samp{Y}, @samp{S} or
134 @samp{P} or one of the data registers @samp{D0}, @samp{D1} @dots{}
136 If any of the registers @samp{D2} @dots{} @samp{D5} are specified, then the
137 register value is treated as a signed value.
138 Otherwise it is treated as unsigned.
139 @var{Number} may be any integer in the range [-8388608,8388607].
141 @item Offset Indexed Indirect
142 @samp{[@var{number},@var{reg}]}
144 @var{Reg} may be either @samp{X}, @samp{Y}, @samp{S} or
146 @var{Number} may be any integer in the range [-8388608,8388607].
148 @item Auto Pre-Increment/Pre-Decrement/Post-Increment/Post-Decrement
154 This addressing mode is typically used to access a value at an address,
155 and simultaneously to increment/decrement the register pointing to that
157 Thus @var{reg} may be any of the 24 bit registers @samp{X}, @samp{Y}, or
159 Pre-increment and post-decrement are not available for
160 register @samp{S} (only post-increment and pre-decrement are available).
162 @item Register Offset Direct
163 @samp{(@var{data-reg},@var{reg})}
165 @var{Reg} can be either @samp{X}, @samp{Y}, or @samp{S}.
167 must be one of the data registers @samp{D0}, @samp{D1} @dots{} @samp{D7}.
168 If any of the registers @samp{D2} @dots{} @samp{D5} are specified, then
169 the register value is treated as a signed value.
170 Otherwise it is treated as unsigned.
172 @item Register Offset Indirect
173 @samp{[@var{data-reg},@var{reg}]}
175 @var{Reg} can be either @samp{X} or @samp{Y}.
177 must be one of the data registers @samp{D0}, @samp{D1} @dots{} @samp{D7}.
178 If any of the registers @samp{D2} @dots{} @samp{D5} are specified, then
179 the register value is treated as a signed value.
180 Otherwise it is treated as unsigned.
202 @node S12Z-Directives
203 @section Assembler Directives
205 @cindex assembler directives, S12Z
211 @cindex opcodes, S12Z
212 @cindex instruction set, S12Z