Changes between Version 1 and Version 2 of ClrxAsmPseudoOps


Ignore:
Timestamp:
10/27/15 20:41:43 (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ClrxAsmPseudoOps

    v1 v2  
    11{{{
    2 #!Markdown
    3 ## CLRadeonExtender Assembler Pseudo-Operations
    4 
    5 The CLRX assembler accepts the almost pseudo-operations from GNU as.
    6 This chapter lists and explains standard pseudo-operations.
    7 
    8 A CLRX assembler stores values greater than byte in the little-endian ordering.
    9 
    10 ## List of the pseudo-operations
    11 
    12 ### .32bit
    13 
    14 This pseudo-operation should to be at begin of source.
    15 Choose 32-bit binaries (it have meaningful for the AMD Catalyst binary format)
    16 
    17 ### .64bit
    18 
    19 This pseudo-operation should to be at begin of source.
    20 Choose 64-bit binaries (it have meaningful for the AMD Catalyst binary format)
    21 
    22 ### .abort
    23 
    24 Aborts compilation.
    25 
    26 ### .amd
    27 
    28 This pseudo-operation should to be at begin of source.
    29 Choose AMD Catalyst OpenCL program binary format.
    30 
    31 ### .align, .balign
    32 
    33 Syntax: .align ALIGNMENT[, [VALUE] [, LIMIT]] 
    34 Syntax: .balign ALIGNMENT[, [VALUE] [, LIMIT]]
    35 
    36 Align current position to value of the first expression.
     2#!html
     3<h2>CLRadeonExtender Assembler Pseudo-Operations</h2>
     4<p>The CLRX assembler accepts the almost pseudo-operations from GNU as.
     5This chapter lists and explains standard pseudo-operations.</p>
     6<p>A CLRX assembler stores values greater than byte in the little-endian ordering.</p>
     7<h2>List of the pseudo-operations</h2>
     8<h3>.32bit</h3>
     9<p>This pseudo-operation should to be at begin of source.
     10Choose 32-bit binaries (it have meaningful for the AMD Catalyst binary format)</p>
     11<h3>.64bit</h3>
     12<p>This pseudo-operation should to be at begin of source.
     13Choose 64-bit binaries (it have meaningful for the AMD Catalyst binary format)</p>
     14<h3>.abort</h3>
     15<p>Aborts compilation.</p>
     16<h3>.amd</h3>
     17<p>This pseudo-operation should to be at begin of source.
     18Choose AMD Catalyst OpenCL program binary format.</p>
     19<h3>.align, .balign</h3>
     20<p>Syntax: .align ALIGNMENT[, [VALUE] [, LIMIT]]<br />
     21Syntax: .balign ALIGNMENT[, [VALUE] [, LIMIT]]</p>
     22<p>Align current position to value of the first expression.
    3723Value of that expression must be a power of two.
    3824By default if section is writeable, fill 0's.
     
    4127Third expression limits skip to own value. If any alignment needs to skip number
    4228of the bytes greater than that value, then alignment will not be done.
    43 If aligment will be done in `.text` section and second expresion will not be given, then
    44 assembler fills no-operation instructions in that hole.
    45 
    46 ### .arch
    47 
    48 Syntax: .arch ARCHITECTURE
    49 
    50 This pseudo-operation should to be at begin of source. Set GPU architecture.
    51 One of following architecture can be set: GCN1.0, GCN1.1, GCN1.2.
    52 
    53 ### .ascii
    54 
    55 Syntax: .ascii "STRING",....
    56 
    57 Emit ASCII string. This pseudo-operations does not add the
     29If aligment will be done in <code>.text</code> section and second expresion will not be given, then
     30assembler fills no-operation instructions in that hole.</p>
     31<h3>.arch</h3>
     32<p>Syntax: .arch ARCHITECTURE</p>
     33<p>This pseudo-operation should to be at begin of source. Set GPU architecture.
     34One of following architecture can be set: GCN1.0, GCN1.1, GCN1.2.</p>
     35<h3>.ascii</h3>
     36<p>Syntax: .ascii "STRING",....</p>
     37<p>Emit ASCII string. This pseudo-operations does not add the
    5838null-terminated character. If more than one string will be given then all given
    59 string will be concatenated.
    60 
    61 ### .asciz
    62 
    63 Syntax: .asciz "STRING",....
    64 
    65 Emit ASCII string. This pseudo-operations adds the
     39string will be concatenated.</p>
     40<h3>.asciz</h3>
     41<p>Syntax: .asciz "STRING",....</p>
     42<p>Emit ASCII string. This pseudo-operations adds the
    6643null-terminated character. If more than one string will be given then all given
    67 string will be concatenated.
    68 
    69 ### .balignw, .balignl
    70 
    71 Syntax: .balignw ALIGNMENT[, [VALUE] [, LIMIT]] 
    72 Syntax: .balignl ALIGNMENT[, [VALUE] [, LIMIT]]
    73 
    74 Refer to `.align`. `.balignw` treats fill value as 2-byte word. `.balignl` treats
    75 fill value as 4-byte word.
    76 
    77 ### .byte
    78 
    79 Syntax: .byte ABS-EXPR,....
    80 
    81 Emit byte values. If any expression is empty then an assembler stores
     44string will be concatenated.</p>
     45<h3>.balignw, .balignl</h3>
     46<p>Syntax: .balignw ALIGNMENT[, [VALUE] [, LIMIT]]<br />
     47Syntax: .balignl ALIGNMENT[, [VALUE] [, LIMIT]]</p>
     48<p>Refer to <code>.align</code>. <code>.balignw</code> treats fill value as 2-byte word. <code>.balignl</code> treats
     49fill value as 4-byte word.</p>
     50<h3>.byte</h3>
     51<p>Syntax: .byte ABS-EXPR,....</p>
     52<p>Emit byte values. If any expression is empty then an assembler stores
    82530 and warns about empty expression. If expression will give a value that can not be stored
    83 in byte then an assembler warn about that.
    84 
    85 ### .data
    86 
    87 Go to `.data` section. If this section doesn't exist assembler create it.
    88 
    89 ### .double
    90 
    91 Syntax: .double DOUBLE-VAL,...
    92 
    93 Put double-precision floating point values into current section.
     54in byte then an assembler warn about that.</p>
     55<h3>.data</h3>
     56<p>Go to <code>.data</code> section. If this section doesn't exist assembler create it.</p>
     57<h3>.double</h3>
     58<p>Syntax: .double DOUBLE-VAL,...</p>
     59<p>Put double-precision floating point values into current section.
    9460If no value between comma then an assembler stores 0 and warn about no value.
    95 This pseudo-operation accepts only double precision floating point literals.
    96 
    97 ### .else
    98 
    99 Part of the if-endif clause. Refer to `.if` pseudo-operation.
    100 Code between `.else` and `.endif` will be performed if all previous conditions was not
    101 satisified. Otherwise code will be skipped.
    102 
    103 ### .elseifXXX
    104 
    105 Syntax: .elseif ABS-EXPR 
    106 Syntax: .elseif32 
    107 Syntax: .elseif64 
    108 Syntax: .elseifarch ARCHITECTURE 
    109 Syntax: .elseifb STRING 
    110 Syntax: .elseifc STRING1, STRING2 
    111 Syntax: .elseifdef SYMBOL 
    112 Syntax: .elseifeq ABS-EXPR 
    113 Syntax: .elseifeqs "STRING1","STRING2" 
    114 Syntax: .elseiffmt BINFMT 
    115 Syntax: .elseifge ABS-EXPR 
    116 Syntax: .elseifgpu GPUDEVICE 
    117 Syntax: .elseifgt ABS-EXPR 
    118 Syntax: .elseifle ABS-EXPR 
    119 Syntax: .elseiflt ABS-EXPR 
    120 Syntax: .elseifnarch ARCHITECTURE 
    121 Syntax: .elseifnb STRING 
    122 Syntax: .elseifnc STRING1, STRING2 
    123 Syntax: .elseifndef SYMBOL 
    124 Syntax: .elseifne ABS-EXPR 
    125 Syntax: .elseifnes "STRING1","STRING2" 
    126 Syntax: .elseifnfmt BINFMT 
    127 Syntax: .elseifngpu GPUDEVICE 
    128 Syntax: .elseifnotdef SYMBOL
    129 
    130 Part of the if-endif clause. Refer to `.if` pseudo-operation.
    131 Code between `.else` and `.endif` will be performed if all previous conditions was not
     61This pseudo-operation accepts only double precision floating point literals.</p>
     62<h3>.else</h3>
     63<p>Part of the if-endif clause. Refer to <code>.if</code> pseudo-operation.
     64Code between <code>.else</code> and <code>.endif</code> will be performed if all previous conditions was not
     65satisified. Otherwise code will be skipped.</p>
     66<h3>.elseifXXX</h3>
     67<p>Syntax: .elseif ABS-EXPR<br />
     68Syntax: .elseif32<br />
     69Syntax: .elseif64<br />
     70Syntax: .elseifarch ARCHITECTURE<br />
     71Syntax: .elseifb STRING<br />
     72Syntax: .elseifc STRING1, STRING2<br />
     73Syntax: .elseifdef SYMBOL<br />
     74Syntax: .elseifeq ABS-EXPR<br />
     75Syntax: .elseifeqs "STRING1","STRING2"<br />
     76Syntax: .elseiffmt BINFMT<br />
     77Syntax: .elseifge ABS-EXPR<br />
     78Syntax: .elseifgpu GPUDEVICE<br />
     79Syntax: .elseifgt ABS-EXPR<br />
     80Syntax: .elseifle ABS-EXPR<br />
     81Syntax: .elseiflt ABS-EXPR<br />
     82Syntax: .elseifnarch ARCHITECTURE<br />
     83Syntax: .elseifnb STRING<br />
     84Syntax: .elseifnc STRING1, STRING2<br />
     85Syntax: .elseifndef SYMBOL<br />
     86Syntax: .elseifne ABS-EXPR<br />
     87Syntax: .elseifnes "STRING1","STRING2"<br />
     88Syntax: .elseifnfmt BINFMT<br />
     89Syntax: .elseifngpu GPUDEVICE<br />
     90Syntax: .elseifnotdef SYMBOL</p>
     91<p>Part of the if-endif clause. Refer to <code>.if</code> pseudo-operation.
     92Code between <code>.else</code> and <code>.endif</code> will be performed if all previous conditions was not
    13293satisified and condition to this pseudo-operation was satisfied. Otherwise code will be
    133 skipped.
    134 
    135 ### .end
    136 
    137 Ends source code compilation at this point.
    138 
    139 ### .endif
    140 
    141 Finish if-endif clause.
    142 
    143 ### .endm
    144 
    145 Finish macro definition
    146 
    147 ### .endr
    148 
    149 Finish code of repetition.
    150 
    151 ### .equ, .set
    152 
    153 Syntax: .equ SYMBOL, EXPR 
    154 Syntax: .set SYMBOL, EXPR
    155 
    156 Define symbol with specified value of the expression given in second operand. Symbol
    157 defined by using these pseudo-operations can be redefined many times.
    158 
    159 ### .equiv
    160 
    161 Syntax: .equiv SYMBOL, EXPR
    162 
    163 Define symbol with specified value of the expression given in second operand.
    164 Symbol defined by using `.equiv` can not be redefined. If symbol was already defined
    165 this pseudo-operations causes an error.
    166 
    167 ### .eqv
    168 
    169 Syntax: .eqv SYMBOL, EXPR
    170 
    171 Define symbol with specified expression given in second operand.
    172 Symbol defined by using `.eqv` can not be redefined.
     94skipped.</p>
     95<h3>.end</h3>
     96<p>Ends source code compilation at this point.</p>
     97<h3>.endif</h3>
     98<p>Finish if-endif clause.</p>
     99<h3>.endm</h3>
     100<p>Finish macro definition</p>
     101<h3>.endr</h3>
     102<p>Finish code of repetition.</p>
     103<h3>.equ, .set</h3>
     104<p>Syntax: .equ SYMBOL, EXPR<br />
     105Syntax: .set SYMBOL, EXPR</p>
     106<p>Define symbol with specified value of the expression given in second operand. Symbol
     107defined by using these pseudo-operations can be redefined many times.</p>
     108<h3>.equiv</h3>
     109<p>Syntax: .equiv SYMBOL, EXPR</p>
     110<p>Define symbol with specified value of the expression given in second operand.
     111Symbol defined by using <code>.equiv</code> can not be redefined. If symbol was already defined
     112this pseudo-operations causes an error.</p>
     113<h3>.eqv</h3>
     114<p>Syntax: .eqv SYMBOL, EXPR</p>
     115<p>Define symbol with specified expression given in second operand.
     116Symbol defined by using <code>.eqv</code> can not be redefined.
    173117If symbol was already defined this pseudo-operations causes an error.
    174118The expression of symbol will be evaluated any time when symbol will be used.
    175119This feature allow to change value of symbol indirectly by changing value of the symbols
    176 used in expression. Example:
    177 
    178 ```
    179 a = 3
     120used in expression. Example:</p>
     121<p><code>a = 3
    180122b = 5
    181123.eqv currentValue, a+b  # now currentValue is equal to 8
    182124.int currentValue
    183125b = 7
    184 .int currentValue  # we changed b to 7, so we put 10
    185 ```
    186 
    187 ### .err
    188 
    189 This pseudo-operation causes error at point where is encountered.
    190 
    191 ### .error
    192 
    193 Syntax: .error "STRING"
    194 
    195 This pseudo-operation causes error and print error given in string.
    196 
    197 ### .exitm
    198 
    199 This pseudo-operation can be used only inside macro definitions. It does early exiting
    200 from macro. Useful while using conditions inside a macros.
    201 
    202 ### .extern
    203 
    204 Syntax: .extern SYMBOL,...
    205 
    206 Set symbol as external. Ignored by GNU as and CLRX assembler.
    207 
    208 ### .fail
    209 
    210 Syntax: .fail ABS-EXPR
    211 
    212 If value of the expression is greater or equal to 500 then assembler print warnings.
    213 Otherwise assembler print error and fails.
    214 
    215 ### .file
    216 
    217 This pseudo-operation is ignored by CLRX assembler.
    218 
    219 ### .fill, .fillq
    220 
    221 Syntax: .fill REPEAT[, [SIZE] [, VALUE]] 
    222 Syntax: .fillq REPEAT[, [SIZE] [, VALUE]]
    223 
    224 Emit value many times. First expression defines how many times value will be stored.
     126.int currentValue  # we changed b to 7, so we put 10</code></p>
     127<h3>.err</h3>
     128<p>This pseudo-operation causes error at point where is encountered.</p>
     129<h3>.error</h3>
     130<p>Syntax: .error "STRING"</p>
     131<p>This pseudo-operation causes error and print error given in string.</p>
     132<h3>.exitm</h3>
     133<p>This pseudo-operation can be used only inside macro definitions. It does early exiting
     134from macro. Useful while using conditions inside a macros.</p>
     135<h3>.extern</h3>
     136<p>Syntax: .extern SYMBOL,...</p>
     137<p>Set symbol as external. Ignored by GNU as and CLRX assembler.</p>
     138<h3>.fail</h3>
     139<p>Syntax: .fail ABS-EXPR</p>
     140<p>If value of the expression is greater or equal to 500 then assembler print warnings.
     141Otherwise assembler print error and fails.</p>
     142<h3>.file</h3>
     143<p>This pseudo-operation is ignored by CLRX assembler.</p>
     144<h3>.fill, .fillq</h3>
     145<p>Syntax: .fill REPEAT[, [SIZE] [, VALUE]]<br />
     146Syntax: .fillq REPEAT[, [SIZE] [, VALUE]]</p>
     147<p>Emit value many times. First expression defines how many times value will be stored.
    225148Second expression defines how long is value. Third expression defines value to be stored.
    226149If second expression is not given, then assembler assumes that is byte value.
    227150If third expression is not given then assembler stores 0's. Assembler takes only
    228151lowest 4-bytes of the value, and if size of value is greater than 4 then more significant
    229 bytes will be assumed to be 0. The `.fillq` takes all bytes of the 64-bit value.
     152bytes will be assumed to be 0. The <code>.fillq</code> takes all bytes of the 64-bit value.
    230153If value doesn't fit to size of value then it will be truncated.
    231 Size of value can be 0. First expression too.
    232 
    233 ### .float, .single
    234 
    235 Syntax: .float FLOAT-VAL,... 
    236 Syntax: .single FLOAT-VAL,...
    237 
    238 Emit single-precision floating point values. If no value between comma then an
     154Size of value can be 0. First expression too.</p>
     155<h3>.float, .single</h3>
     156<p>Syntax: .float FLOAT-VAL,...<br />
     157Syntax: .single FLOAT-VAL,...</p>
     158<p>Emit single-precision floating point values. If no value between comma then an
    239159assembler stores 0 and warn about no value.
    240 This pseudo-operation accepts only single precision floating point literals.
    241 
    242 ### .format
    243 
    244 Syntax: .format BINFORMAT
    245 
    246 This pseudo-operation should to be at begin of source.
    247 Choose binary format. Binary can be one of following list:
    248 
    249 * `amd`, `catalyst` - AMD Catalyst OpenCL binary format
    250 * `gallium` - the GalliumCompute binary format
    251 * `raw` - rawcode (raw program instructions)
    252 
    253 ### .gallium
    254 
    255 This pseudo-operation should to be at begin of source.
    256 Choose GalliumCompute OpenCL program binary format.
    257 
    258 ### .global, .globl
    259 
    260 Syntax: .global SYMBOL,... 
    261 Syntax: .globl SYMBOL,...
    262 
    263 Indicates that symbols will be a global. Global symbol can be used
     160This pseudo-operation accepts only single precision floating point literals.</p>
     161<h3>.format</h3>
     162<p>Syntax: .format BINFORMAT</p>
     163<p>This pseudo-operation should to be at begin of source.
     164Choose binary format. Binary can be one of following list:</p>
     165<ul>
     166<li><code>amd</code>, <code>catalyst</code> - AMD Catalyst OpenCL binary format</li>
     167<li><code>gallium</code> - the GalliumCompute binary format</li>
     168<li><code>raw</code> - rawcode (raw program instructions)</li>
     169</ul>
     170<h3>.gallium</h3>
     171<p>This pseudo-operation should to be at begin of source.
     172Choose GalliumCompute OpenCL program binary format.</p>
     173<h3>.global, .globl</h3>
     174<p>Syntax: .global SYMBOL,...<br />
     175Syntax: .globl SYMBOL,...</p>
     176<p>Indicates that symbols will be a global. Global symbol can be used
    264177across many object files. The CLRX assembler can expose global symbols at output binary if
    265 adding sybols will be enabled.
    266 
    267 ### .gpu GPUDEVICE
    268 
    269 Syntax: .gpu GPUDEVICE
    270 
    271 This pseudo-operation should to be at begin of source. Set GPU device.
     178adding sybols will be enabled.</p>
     179<h3>.gpu GPUDEVICE</h3>
     180<p>Syntax: .gpu GPUDEVICE</p>
     181<p>This pseudo-operation should to be at begin of source. Set GPU device.
    272182One of following device type can be set:
    273183CapeVerde, Pitcairn, Tahiti, Oland, Bonaire, Spectre, Spooky, Kalindi,
    274 Hainan, Hawaii, Iceland, Tonga, Mullins, Fiji and Carrizo.
    275 
    276 ### .half
    277 
    278 Syntax: .half HALF-VAL,...
    279 
    280 Emit half-precision floating point values.
     184Hainan, Hawaii, Iceland, Tonga, Mullins, Fiji and Carrizo.</p>
     185<h3>.half</h3>
     186<p>Syntax: .half HALF-VAL,...</p>
     187<p>Emit half-precision floating point values.
    281188If no value between comma then an assembler stores 0 and warn about no value.
    282 This pseudo-operation accepts only half precision floating point literals.
    283 
    284 ### .hword, .short
    285 
    286 Syntax: .hword ABS-EXPR,....
    287 Syntax: .short ABS-EXPR,....
    288 
    289 Emit 2-byte word values. If any expression is empty then an assembler
     189This pseudo-operation accepts only half precision floating point literals.</p>
     190<h3>.hword, .short</h3>
     191<p>Syntax: .hword ABS-EXPR,....
     192Syntax: .short ABS-EXPR,....</p>
     193<p>Emit 2-byte word values. If any expression is empty then an assembler
    290194stores 0 and warns about empty expression. If expression will give a value that can not be
    291 stored in 2-byte word then an assembler warn about that.
    292 
    293 ### .ifXXX
    294 
    295 Syntax: .if ABS-EXPR 
    296 Syntax: .if32 
    297 Syntax: .if64 
    298 Syntax: .ifarch ARCHITECTURE 
    299 Syntax: .ifb STRING 
    300 Syntax: .ifc STRING1, STRING2 
    301 Syntax: .ifdef SYMBOL 
    302 Syntax: .ifeq ABS-EXPR 
    303 Syntax: .ifeqs "STRING1","STRING2" 
    304 Syntax: .iffmt BINFMT 
    305 Syntax: .ifge ABS-EXPR 
    306 Syntax: .ifgpu GPUDEVICE 
    307 Syntax: .ifgt ABS-EXPR 
    308 Syntax: .ifle ABS-EXPR 
    309 Syntax: .iflt ABS-EXPR 
    310 Syntax: .ifnarch ARCHITECTURE 
    311 Syntax: .ifnb STRING 
    312 Syntax: .ifnc STRING1, STRING2 
    313 Syntax: .ifndef SYMBOL 
    314 Syntax: .ifne ABS-EXPR 
    315 Syntax: .ifnes "STRING1","STRING2" 
    316 Syntax: .ifnfmt BINFMT 
    317 Syntax: .ifngpu GPUDEVICE 
    318 Syntax: .ifnotdef SYMBOL
    319 
    320 Open if-endif clause. After that pseudo-op can encounter `.elseifXX` or `.else`
     195stored in 2-byte word then an assembler warn about that.</p>
     196<h3>.ifXXX</h3>
     197<p>Syntax: .if ABS-EXPR<br />
     198Syntax: .if32<br />
     199Syntax: .if64<br />
     200Syntax: .ifarch ARCHITECTURE<br />
     201Syntax: .ifb STRING<br />
     202Syntax: .ifc STRING1, STRING2<br />
     203Syntax: .ifdef SYMBOL<br />
     204Syntax: .ifeq ABS-EXPR<br />
     205Syntax: .ifeqs "STRING1","STRING2"<br />
     206Syntax: .iffmt BINFMT<br />
     207Syntax: .ifge ABS-EXPR<br />
     208Syntax: .ifgpu GPUDEVICE<br />
     209Syntax: .ifgt ABS-EXPR<br />
     210Syntax: .ifle ABS-EXPR<br />
     211Syntax: .iflt ABS-EXPR<br />
     212Syntax: .ifnarch ARCHITECTURE<br />
     213Syntax: .ifnb STRING<br />
     214Syntax: .ifnc STRING1, STRING2<br />
     215Syntax: .ifndef SYMBOL<br />
     216Syntax: .ifne ABS-EXPR<br />
     217Syntax: .ifnes "STRING1","STRING2"<br />
     218Syntax: .ifnfmt BINFMT<br />
     219Syntax: .ifngpu GPUDEVICE<br />
     220Syntax: .ifnotdef SYMBOL</p>
     221<p>Open if-endif clause. After that pseudo-op can encounter <code>.elseifXX</code> or <code>.else</code>
    321222pseudo-operations. If condition of that pseudo-operations is satisfied then
    322 code will be performed.
    323 
    324 List of the `.if` kinds:
    325 
    326 * `.if` - perform code if value is not zero.
    327 * `.if32` - perform code if 32-bit binary.
    328 * `.if64` - perform code if 64-bit binary.
    329 * `.ifarch` - perform code if specified architecture was set.
    330 * `.ifb` - perform code if all character after name of this pseudo-op is blank.
    331 * `.ifc` - compare two unquoted strings. If are equal then perform code.
    332 * `.ifdef` - perform code if symbol was defined
    333 * `.ifeq` - perform code if value is zero.
    334 * `.ifeqs` - perform code if two quoted string are equal.
    335 * `.iffmt` - perform code if specified binary format was set.
    336 * `.ifge` - perform code if value is greater or equal to zero.
    337 * `.ifgpu` - perform code if specified GPU device type was set.
    338 * `.ifgt` - perform code if value is greater than zero.
    339 * `.ifle` - perform code if value is less or equal to zero.
    340 * `.iflt` - perform code if value is less than zero.
    341 * `.ifnarch` - perform code if specified architecture was not set.
    342 * `.ifnb` - perform code if any character after name of this pseudo-op is not blank.
    343 * `.ifnc` - compare two unquoted strings. If are not equal then perform code.
    344 * `.ifndef` - perform code if symbol was not defined.
    345 * `.ifne` - perform code if value is not zero.
    346 * `.ifnes` - perform code if two quoted string are not equal.
    347 * `.ifnfmt` - perform code if specified binary format was not set.
    348 * `.ifngpu` - perform code if specified GPU device type was not set.
    349 * `.ifnotdef` - perform code if symbol was not defined.
    350 
    351 ### .incbin
    352 
    353 Syntax: .incbin FILENAME[, [OFFSET] [, COUNT]]
    354 
    355 Append the binary file into currenct section. If file not found in the current directory
     223code will be performed.</p>
     224<p>List of the <code>.if</code> kinds:</p>
     225<ul>
     226<li><code>.if</code> - perform code if value is not zero.</li>
     227<li><code>.if32</code> - perform code if 32-bit binary.</li>
     228<li><code>.if64</code> - perform code if 64-bit binary.</li>
     229<li><code>.ifarch</code> - perform code if specified architecture was set.</li>
     230<li><code>.ifb</code> - perform code if all character after name of this pseudo-op is blank.</li>
     231<li><code>.ifc</code> - compare two unquoted strings. If are equal then perform code.</li>
     232<li><code>.ifdef</code> - perform code if symbol was defined</li>
     233<li><code>.ifeq</code> - perform code if value is zero.</li>
     234<li><code>.ifeqs</code> - perform code if two quoted string are equal.</li>
     235<li><code>.iffmt</code> - perform code if specified binary format was set.</li>
     236<li><code>.ifge</code> - perform code if value is greater or equal to zero.</li>
     237<li><code>.ifgpu</code> - perform code if specified GPU device type was set.</li>
     238<li><code>.ifgt</code> - perform code if value is greater than zero.</li>
     239<li><code>.ifle</code> - perform code if value is less or equal to zero.</li>
     240<li><code>.iflt</code> - perform code if value is less than zero.</li>
     241<li><code>.ifnarch</code> - perform code if specified architecture was not set.</li>
     242<li><code>.ifnb</code> - perform code if any character after name of this pseudo-op is not blank.</li>
     243<li><code>.ifnc</code> - compare two unquoted strings. If are not equal then perform code.</li>
     244<li><code>.ifndef</code> - perform code if symbol was not defined.</li>
     245<li><code>.ifne</code> - perform code if value is not zero.</li>
     246<li><code>.ifnes</code> - perform code if two quoted string are not equal.</li>
     247<li><code>.ifnfmt</code> - perform code if specified binary format was not set.</li>
     248<li><code>.ifngpu</code> - perform code if specified GPU device type was not set.</li>
     249<li><code>.ifnotdef</code> - perform code if symbol was not defined.</li>
     250</ul>
     251<h3>.incbin</h3>
     252<p>Syntax: .incbin FILENAME[, [OFFSET] [, COUNT]]</p>
     253<p>Append the binary file into currenct section. If file not found in the current directory
    356254then assembler searches file in the include paths. If file not found again then assembler
    357255prints error. Second optional argument defines offset (how many bytes should to be skipped).
    358256By default assembler begin appending from first byte.
    359257Third argument defines maximum number bytes to append. By default all data from binary
    360 will be appended.
    361 
    362 ### .include
    363 
    364 Syntax: .include "FILENAME"
    365 
    366 Include new source code file and begins assemblying from this file.
     258will be appended.</p>
     259<h3>.include</h3>
     260<p>Syntax: .include "FILENAME"</p>
     261<p>Include new source code file and begins assemblying from this file.
    367262An assembler automatically returns to previous file if encounters end of the that file.
    368263If file not found in the current directory then assembler searches file in the
    369 include paths. If file not found again then assembler prints error.
    370 
    371 ### .irp
    372 
    373 Syntax: .irp NAME, STRING,... 
    374 Syntax: .irp NAME STRING ...
    375 
    376 Begin repetition with the named variable. Nth occurrence of name will be replaced by
    377 nth string. The name of variable must be preceded by `\` character.
    378 
    379 Sample usage:
    380 
    381 ```
    382 .irp reg v0,v1,v4,v5
     264include paths. If file not found again then assembler prints error.</p>
     265<h3>.irp</h3>
     266<p>Syntax: .irp NAME, STRING,...<br />
     267Syntax: .irp NAME STRING ...</p>
     268<p>Begin repetition with the named variable. Nth occurrence of name will be replaced by
     269nth string. The name of variable must be preceded by <code>\</code> character.</p>
     270<p>Sample usage:</p>
     271<p><code>.irp reg v0,v1,v4,v5
    383272    v_mul_f32 v10,\reg
    384 .endr
    385 ```
    386 
    387 produces:
    388 
    389 ```
    390     v_mul_f32 v10,v0
     273.endr</code></p>
     274<p>produces:</p>
     275<p><code>v_mul_f32 v10,v0
    391276    v_mul_f32 v10,v1
    392277    v_mul_f32 v10,v4
    393     v_mul_f32 v10,v5
    394 ```
    395 
    396 Alternate syntax does not require a comma separator between strings and variable name.
     278    v_mul_f32 v10,v5</code></p>
     279<p>Alternate syntax does not require a comma separator between strings and variable name.
    397280Rules regarding to substituting variables are same as in macro substitution. Refer to
    398 `.macro` pseudo-operation.
    399 
    400 ### .irpc
    401 
    402 Syntax: .irpc NAME, STRING
    403 
    404 Begin repetition with the named variable.Nth occurrence of name will be replaced by
     281<code>.macro</code> pseudo-operation.</p>
     282<h3>.irpc</h3>
     283<p>Syntax: .irpc NAME, STRING</p>
     284<p>Begin repetition with the named variable.Nth occurrence of name will be replaced by
    405285nth character of the string (second operand).
    406 The name of variable must be preceded by `\` character.
    407 
    408 ```
    409 .irp reg 0145
     286The name of variable must be preceded by <code>\</code> character.</p>
     287<p><code>.irp reg 0145
    410288    v_mul_f32 v10,v\reg
    411 .endr
    412 ```
    413 
    414 produces:
    415 
    416 ```
    417     v_mul_f32 v10,v0
     289.endr</code></p>
     290<p>produces:</p>
     291<p><code>v_mul_f32 v10,v0
    418292    v_mul_f32 v10,v1
    419293    v_mul_f32 v10,v4
    420     v_mul_f32 v10,v5
    421 ```
    422 
    423 Rules regarding to substituting variables are same as in macro substitution. Refer to
    424 `.macro` pseudo-operation.
    425 
    426 ### .int, .long
    427 
    428 Syntax: .int ABS-EXPR,.... 
    429 Syntax: .long ABS-EXPR,....
    430 
    431 Emit 4-byte word values. If any expression is empty then an assembler
     294    v_mul_f32 v10,v5</code></p>
     295<p>Rules regarding to substituting variables are same as in macro substitution. Refer to
     296<code>.macro</code> pseudo-operation.</p>
     297<h3>.int, .long</h3>
     298<p>Syntax: .int ABS-EXPR,....<br />
     299Syntax: .long ABS-EXPR,....</p>
     300<p>Emit 4-byte word values. If any expression is empty then an assembler
    432301stores 0 and warns about empty expression. If expression will give a value that can not be
    433 stored in 4-byte word then an assembler warn about that.
    434 
    435 ### .kernel
    436 
    437 Syntax: .kernel KERNELNAME
    438 
    439 Create new kernel with default section or move to an existing kernel and
     302stored in 4-byte word then an assembler warn about that.</p>
     303<h3>.kernel</h3>
     304<p>Syntax: .kernel KERNELNAME</p>
     305<p>Create new kernel with default section or move to an existing kernel and
    440306its default section. Types of section which can to be belonging to kernel depends on
    441 the binary format.
    442 
    443 ### .lflags
    444 
    445 This pseudo-operation is ignored by CLRX assembler.
    446 
    447 ### .ln, .line
    448 
    449 These pseudo-operations are ignored by CLRX assembler.
    450 
    451 ### .local
    452 
    453 Syntax: .local SYMBOL,...
    454 
    455 Indicates that symbols will be a local. Local symbol are not visible in other
    456 binary objects and they can be used only locally.
    457 
    458 ### .macro
    459 
    460 Syntax: .macro MACRONAME, ARG,... 
    461 Syntax: .macro MACRONAME ARG ...
    462 
    463 Begin macro definition. The macro is recorded code that can be used later in source code.
     307the binary format.</p>
     308<h3>.lflags</h3>
     309<p>This pseudo-operation is ignored by CLRX assembler.</p>
     310<h3>.ln, .line</h3>
     311<p>These pseudo-operations are ignored by CLRX assembler.</p>
     312<h3>.local</h3>
     313<p>Syntax: .local SYMBOL,...</p>
     314<p>Indicates that symbols will be a local. Local symbol are not visible in other
     315binary objects and they can be used only locally.</p>
     316<h3>.macro</h3>
     317<p>Syntax: .macro MACRONAME, ARG,...<br />
     318Syntax: .macro MACRONAME ARG ...</p>
     319<p>Begin macro definition. The macro is recorded code that can be used later in source code.
    464320Macro can accepts one or more arguments that will be substituted in its body.
    465 Occurrence of the argument must be preceded by `\` character.
    466 
    467 Special case of substitution is `\@` that replaced by number of the macro substitution.
    468 Sometimes substitution must be joined with other name. In this case '\()` can be used to
    469 split argument occurrence and other name. Example:
    470 
    471 ```
    472 .macro macro1, x
     321Occurrence of the argument must be preceded by <code>\</code> character.</p>
     322<p>Special case of substitution is <code>\@</code> that replaced by number of the macro substitution.
     323Sometimes substitution must be joined with other name. In this case '()` can be used to
     324split argument occurrence and other name. Example:</p>
     325<p><code>.macro macro1, x
    473326.set \x\()Symbol, 10 # set symbol Xsymbol to value 10
    474327.endm
    475 macro1 Linux # define LinuxSymbol=10
    476 ```
    477 
    478 That substitution is useful to create labels and symbols that can not be redefined.
     328macro1 Linux # define LinuxSymbol=10</code></p>
     329<p>That substitution is useful to create labels and symbols that can not be redefined.
    479330Value of the argument is string. Optionally, argument can have the default value
    480 which will be used if no argument value is not given in a macro call.
    481 
    482 List of the argument definition:
    483 
    484 * `arg1` - simple argument
    485 * `arg1=value` - argument with default value
    486 * `arg1:req` - required argument
    487 * `arg:vararg` - variadic argument, get rest of the arguments and treats them as
    488 single (must be last)
    489 * `arg1:vararg:req` - required argument and variadic argument
    490 
    491 A macro calling is easy:
    492 
    493 ```
    494 somemacro
     331which will be used if no argument value is not given in a macro call.</p>
     332<p>List of the argument definition:</p>
     333<ul>
     334<li><code>arg1</code> - simple argument</li>
     335<li><code>arg1=value</code> - argument with default value</li>
     336<li><code>arg1:req</code> - required argument</li>
     337<li><code>arg:vararg</code> - variadic argument, get rest of the arguments and treats them as
     338single (must be last)</li>
     339<li><code>arg1:vararg:req</code> - required argument and variadic argument</li>
     340</ul>
     341<p>A macro calling is easy:</p>
     342<p><code>somemacro
    495343somemacro1 1,2,4
    496344somemacro1 1 2 3
    497345/* use variadic argument */
    498346.macro putHeaderAndData x,data:vararg
    499     .byte \x&0x3f, \data
    500 .endm
    501 putHeaderAndData 0xfe,1,4,6,7,110
    502 ```
    503 
    504 Some simple examples:
    505 
    506 ```
    507 .macro putTwoBytes value1,value2
     347    .byte \x&amp;0x3f, \data
     348.endm
     349putHeaderAndData 0xfe,1,4,6,7,110</code></p>
     350<p>Some simple examples:</p>
     351<p><code>.macro putTwoBytes value1,value2
    508352    .byte \value1+\value2, \value2-\value1
    509353.endm
     
    512356    .byte \value1+\value2, \value2-\value1
    513357.endm
    514 putTwoBytes2 ,7 # generates .byte 107,93
    515 ```
    516 
    517 The argument substitution works inside double-quoted strings:
    518 
    519 ```
    520 .macro putVersionInfo major,minor,micro
     358putTwoBytes2 ,7 # generates .byte 107,93</code></p>
     359<p>The argument substitution works inside double-quoted strings:</p>
     360<p><code>.macro putVersionInfo major,minor,micro
    521361.ascii "CLRadeonExtender \major\().\minor\().\micro"
    522362.endm
    523 putVersionInfo 1,2,3 # generates string "CLRadeonExtender 1.2.3"
    524 ```
    525 
    526 It is possible to create the nested definitions like that:
    527 
    528 ```
    529 .macro generators m,value1,value2
     363putVersionInfo 1,2,3 # generates string "CLRadeonExtender 1.2.3"</code></p>
     364<p>It is possible to create the nested definitions like that:</p>
     365<p><code>.macro generators m,value1,value2
    530366    .macro gen\m x1,x2  # define genM with two arguments
    531367        /* use first and second operand of parent macro, and use two
     
    536372/* define genF1 */
    537373generators F1,2,3
    538 /* use genF1, generates (10+12)*(2+3) -> 22*5 -> 110 */
    539 genF1 10,12
    540 ```
    541 
    542 ### .main
    543 
    544 Go to main binary over binary of the kernel.
    545 
    546 ### .octa
    547 
    548 Syntax: .octa OCTA-LITERAL,...
    549 
    550 Emit 128-bit word values. If no value between comma then an assembler stores 0 and warn
    551 about no value. This pseudo-operation accepts only 128-bit word literals.
    552 
    553 ### .offset, .struct
    554 
    555 Syntax: .offset ABS-EXPR 
    556 Syntax: .struct ABS-EXPR
    557 
    558 Set the output counter to some place in absolute section. Useful to defining
    559 fields of the structures.
    560 
    561 ### .org
    562 
    563 Syntax: .org EXPRESSION
    564 
    565 Set the output counter to place defined by expression. Expression can point to some
     374/* use genF1, generates (10+12)*(2+3) -&gt; 22*5 -&gt; 110 */
     375genF1 10,12</code></p>
     376<h3>.main</h3>
     377<p>Go to main binary over binary of the kernel.</p>
     378<h3>.octa</h3>
     379<p>Syntax: .octa OCTA-LITERAL,...</p>
     380<p>Emit 128-bit word values. If no value between comma then an assembler stores 0 and warn
     381about no value. This pseudo-operation accepts only 128-bit word literals.</p>
     382<h3>.offset, .struct</h3>
     383<p>Syntax: .offset ABS-EXPR<br />
     384Syntax: .struct ABS-EXPR</p>
     385<p>Set the output counter to some place in absolute section. Useful to defining
     386fields of the structures.</p>
     387<h3>.org</h3>
     388<p>Syntax: .org EXPRESSION</p>
     389<p>Set the output counter to place defined by expression. Expression can point to some
    566390place in the code or some place to absolute section (absolute value). If a expression
    567 points to some place of a code, moving backwards is illegal.
    568 
    569 ### .p2align
    570 
    571 Syntax: .p2align POWOF2ALIGN[, [VALUE] [, LIMIT]]
    572 
    573 Refer to `.align`. First argument is power of two of the alignment instead of
    574 same alignment.
    575 
    576 ### .print
    577 
    578 Syntax: .print "STRING"
    579 
    580 Print string into standard output (or defined print output).
    581 
    582 ### .purgem
    583 
    584 Syntax: .purgem MACRONAME
    585 
    586 Undefine macro MACRONAME.
    587 
    588 ### .quad
    589 
    590 Syntax: .quad ABS-EXPR,....
    591 
    592 Emit 8-byte word values. If any expression is empty then an assembler
    593 stores 0 and warns about empty expression.
    594 
    595 ### .rawcode
    596 
    597 This pseudo-operation should to be at begin of source.
    598 Choose raw code (same processor's instructions).
    599 
    600 ### .rept
    601 
    602 Syntax: .rept ABS-EXPR
    603 
    604 Open repetition. The code between this pseudo-operation and `.endr` will be repeated
    605 number given in first argument. Zero value is legal in first argument. Example:
    606 
    607 ```
    608 .rept 3
     391points to some place of a code, moving backwards is illegal.</p>
     392<h3>.p2align</h3>
     393<p>Syntax: .p2align POWOF2ALIGN[, [VALUE] [, LIMIT]]</p>
     394<p>Refer to <code>.align</code>. First argument is power of two of the alignment instead of
     395same alignment.</p>
     396<h3>.print</h3>
     397<p>Syntax: .print "STRING"</p>
     398<p>Print string into standard output (or defined print output).</p>
     399<h3>.purgem</h3>
     400<p>Syntax: .purgem MACRONAME</p>
     401<p>Undefine macro MACRONAME.</p>
     402<h3>.quad</h3>
     403<p>Syntax: .quad ABS-EXPR,....</p>
     404<p>Emit 8-byte word values. If any expression is empty then an assembler
     405stores 0 and warns about empty expression.</p>
     406<h3>.rawcode</h3>
     407<p>This pseudo-operation should to be at begin of source.
     408Choose raw code (same processor's instructions).</p>
     409<h3>.rept</h3>
     410<p>Syntax: .rept ABS-EXPR</p>
     411<p>Open repetition. The code between this pseudo-operation and <code>.endr</code> will be repeated
     412number given in first argument. Zero value is legal in first argument. Example:</p>
     413<p><code>.rept 3
    609414v_nop
    610 .endr
    611 ```
    612 
    613 generates:
    614 
    615 ```
     415.endr</code></p>
     416<p>generates:</p>
     417<p><code>v_nop
    616418v_nop
    617 v_nop
    618 v_nop
    619 ```
    620 
    621 ### .rodata
    622 
    623 Go to `.rodata` section. If this section doesn't exist assembler create it.
    624 
    625 ### .sbttl, .tittle, .version
    626 
    627 Syntax: .sbttl "STRING" 
    628 Syntax: .title "STRING" 
    629 Syntax: .version "STRING"
    630 
    631 These pseudo-operations are ignored by CLRX assembler.
    632 
    633 ### .section
    634 
    635 Syntax: .section SECTIONNAME[, "FLAGS"[, @TYPE]]
    636 
    637 Go to specified section SECTIONNAME. If section doesn't exist assembler create it.
    638 Second optional argument set flags of the section. Can be from list:
    639 
    640 * `a` - allocatable section
    641 * `w` - writeable section in file
    642 * `x` - executable section
    643 
    644 Third optional argument set type of the section. Default section's type depends on
    645 the binary format. Type can be one of following type:
    646 
    647 * `progbits` - program data
    648 * `note` - informations about program or other things
    649 * `nobits` - doesn't contain data (only occupies space)
    650 
    651 ### .size
    652 
    653 Syntax: .size SYMBOL, ABS-EXPR
    654 
    655 Set size of symbol SYMBOL. Currently, this feature of symbol is not used by
    656 the CLRX assembler.
    657 
    658 ### .skip, .space
    659 
    660 Syntax: .skip SIZE-EXPR[, VALUE-EXPR]
    661 Syntax: .space SIZE-EXPR[, VALUE-EXPR]
    662 
    663 Likewise as `.fill`, this pseudo-operation emits value (but byte) many times.
     419v_nop</code></p>
     420<h3>.rodata</h3>
     421<p>Go to <code>.rodata</code> section. If this section doesn't exist assembler create it.</p>
     422<h3>.sbttl, .tittle, .version</h3>
     423<p>Syntax: .sbttl "STRING"<br />
     424Syntax: .title "STRING"<br />
     425Syntax: .version "STRING"</p>
     426<p>These pseudo-operations are ignored by CLRX assembler.</p>
     427<h3>.section</h3>
     428<p>Syntax: .section SECTIONNAME[, "FLAGS"[, @TYPE]]</p>
     429<p>Go to specified section SECTIONNAME. If section doesn't exist assembler create it.
     430Second optional argument set flags of the section. Can be from list:</p>
     431<ul>
     432<li><code>a</code> - allocatable section</li>
     433<li><code>w</code> - writeable section in file</li>
     434<li><code>x</code> - executable section</li>
     435</ul>
     436<p>Third optional argument set type of the section. Default section's type depends on
     437the binary format. Type can be one of following type:</p>
     438<ul>
     439<li><code>progbits</code> - program data</li>
     440<li><code>note</code> - informations about program or other things</li>
     441<li><code>nobits</code> - doesn't contain data (only occupies space)</li>
     442</ul>
     443<h3>.size</h3>
     444<p>Syntax: .size SYMBOL, ABS-EXPR</p>
     445<p>Set size of symbol SYMBOL. Currently, this feature of symbol is not used by
     446the CLRX assembler.</p>
     447<h3>.skip, .space</h3>
     448<p>Syntax: .skip SIZE-EXPR[, VALUE-EXPR]
     449Syntax: .space SIZE-EXPR[, VALUE-EXPR]</p>
     450<p>Likewise as <code>.fill</code>, this pseudo-operation emits value (but byte) many times.
    664451First expression determines how many values should to be emitted, second expression
    665452determines what byte value should to be stored. If second expression is not given
    666 then assembler stores 0's.
    667 
    668 ### .string, .string16, .string32, .string64
    669 
    670 Syntax: .string "STRING",.... 
    671 Syntax: .string16 "STRING",.... 
    672 Syntax: .string32 "STRING",.... 
    673 Syntax: .string64 "STRING",....
    674 
    675 Emit ASCII string. This pseudo-operations adds the
     453then assembler stores 0's.</p>
     454<h3>.string, .string16, .string32, .string64</h3>
     455<p>Syntax: .string "STRING",....<br />
     456Syntax: .string16 "STRING",....<br />
     457Syntax: .string32 "STRING",....<br />
     458Syntax: .string64 "STRING",....</p>
     459<p>Emit ASCII string. This pseudo-operations adds the
    676460null-terminated character. If more than one string will be given then all given
    677461string will be concatenated.
    678 `.string16` emits string with 2-byte characters.
    679 `.string32` emits string with 4-byte characters.
    680 `.string64` emits string with 8-byte characters.
    681 Characters longer than 1 byte will be zero expanded.
    682 
    683 ### .text
    684 
    685 Go to `.text` section. If this section doesn't exist assembler create it.
    686 
    687 ### .undef
    688 
    689 Syntax: .undef SYMBOL
    690 
    691 Undefine symbol. If symbol already doesn't exist then assembler warns about that.
    692 
    693 ### .warning
    694 
    695 Syntax: .warning "STRING"
    696 
    697 Print warning message specified in first argument.
    698 
    699 ### .weak
    700 
    701 Syntax: .weak SYMBOL,...
    702 
    703 Indicates that symbols will be a weak. Currently, unused feature of the symbol by
    704 the CLRX assembler.
    705 
    706 ### .word
    707 
    708 Syntax: .word ABS-EXPR,....
    709 
    710 Emit processor's word values. If any expression is empty then
     462<code>.string16</code> emits string with 2-byte characters.
     463<code>.string32</code> emits string with 4-byte characters.
     464<code>.string64</code> emits string with 8-byte characters.
     465Characters longer than 1 byte will be zero expanded.</p>
     466<h3>.text</h3>
     467<p>Go to <code>.text</code> section. If this section doesn't exist assembler create it.</p>
     468<h3>.undef</h3>
     469<p>Syntax: .undef SYMBOL</p>
     470<p>Undefine symbol. If symbol already doesn't exist then assembler warns about that.</p>
     471<h3>.warning</h3>
     472<p>Syntax: .warning "STRING"</p>
     473<p>Print warning message specified in first argument.</p>
     474<h3>.weak</h3>
     475<p>Syntax: .weak SYMBOL,...</p>
     476<p>Indicates that symbols will be a weak. Currently, unused feature of the symbol by
     477the CLRX assembler.</p>
     478<h3>.word</h3>
     479<p>Syntax: .word ABS-EXPR,....</p>
     480<p>Emit processor's word values. If any expression is empty then
    711481an assembler stores 0 and warns about empty expression. If expression will give a value
    712 that can not be stored in processor's word then an assembler warn about that.
    713 
    714 Processor's word have always 4 bytes.
    715 }}}
     482that can not be stored in processor's word then an assembler warn about that.</p>
     483<p>Processor's word have always 4 bytes.</p>}}}