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. |
| 5 | This 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. |
| 10 | Choose 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. |
| 13 | Choose 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. |
| 18 | Choose AMD Catalyst OpenCL program binary format.</p> |
| 19 | <h3>.align, .balign</h3> |
| 20 | <p>Syntax: .align ALIGNMENT[, [VALUE] [, LIMIT]]<br /> |
| 21 | Syntax: .balign ALIGNMENT[, [VALUE] [, LIMIT]]</p> |
| 22 | <p>Align current position to value of the first expression. |
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 |
| 29 | If aligment will be done in <code>.text</code> section and second expresion will not be given, then |
| 30 | assembler 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. |
| 34 | One 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 |
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 |
| 44 | string will be concatenated.</p> |
| 45 | <h3>.balignw, .balignl</h3> |
| 46 | <p>Syntax: .balignw ALIGNMENT[, [VALUE] [, LIMIT]]<br /> |
| 47 | Syntax: .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 |
| 49 | fill 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 |
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 |
| 61 | This 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. |
| 64 | Code between <code>.else</code> and <code>.endif</code> will be performed if all previous conditions was not |
| 65 | satisified. Otherwise code will be skipped.</p> |
| 66 | <h3>.elseifXXX</h3> |
| 67 | <p>Syntax: .elseif ABS-EXPR<br /> |
| 68 | Syntax: .elseif32<br /> |
| 69 | Syntax: .elseif64<br /> |
| 70 | Syntax: .elseifarch ARCHITECTURE<br /> |
| 71 | Syntax: .elseifb STRING<br /> |
| 72 | Syntax: .elseifc STRING1, STRING2<br /> |
| 73 | Syntax: .elseifdef SYMBOL<br /> |
| 74 | Syntax: .elseifeq ABS-EXPR<br /> |
| 75 | Syntax: .elseifeqs "STRING1","STRING2"<br /> |
| 76 | Syntax: .elseiffmt BINFMT<br /> |
| 77 | Syntax: .elseifge ABS-EXPR<br /> |
| 78 | Syntax: .elseifgpu GPUDEVICE<br /> |
| 79 | Syntax: .elseifgt ABS-EXPR<br /> |
| 80 | Syntax: .elseifle ABS-EXPR<br /> |
| 81 | Syntax: .elseiflt ABS-EXPR<br /> |
| 82 | Syntax: .elseifnarch ARCHITECTURE<br /> |
| 83 | Syntax: .elseifnb STRING<br /> |
| 84 | Syntax: .elseifnc STRING1, STRING2<br /> |
| 85 | Syntax: .elseifndef SYMBOL<br /> |
| 86 | Syntax: .elseifne ABS-EXPR<br /> |
| 87 | Syntax: .elseifnes "STRING1","STRING2"<br /> |
| 88 | Syntax: .elseifnfmt BINFMT<br /> |
| 89 | Syntax: .elseifngpu GPUDEVICE<br /> |
| 90 | Syntax: .elseifnotdef SYMBOL</p> |
| 91 | <p>Part of the if-endif clause. Refer to <code>.if</code> pseudo-operation. |
| 92 | Code between <code>.else</code> and <code>.endif</code> will be performed if all previous conditions was not |
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. |
| 94 | skipped.</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 /> |
| 105 | Syntax: .set SYMBOL, EXPR</p> |
| 106 | <p>Define symbol with specified value of the expression given in second operand. Symbol |
| 107 | defined 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. |
| 111 | Symbol defined by using <code>.equiv</code> can not be redefined. If symbol was already defined |
| 112 | this 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. |
| 116 | Symbol defined by using <code>.eqv</code> can not be redefined. |
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 |
| 134 | from 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. |
| 141 | Otherwise 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 /> |
| 146 | Syntax: .fillq REPEAT[, [SIZE] [, VALUE]]</p> |
| 147 | <p>Emit value many times. First expression defines how many times value will be stored. |
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 |
| 160 | This 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. |
| 164 | Choose 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. |
| 172 | Choose GalliumCompute OpenCL program binary format.</p> |
| 173 | <h3>.global, .globl</h3> |
| 174 | <p>Syntax: .global SYMBOL,...<br /> |
| 175 | Syntax: .globl SYMBOL,...</p> |
| 176 | <p>Indicates that symbols will be a global. Global symbol can be used |
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` |
| 195 | stored in 2-byte word then an assembler warn about that.</p> |
| 196 | <h3>.ifXXX</h3> |
| 197 | <p>Syntax: .if ABS-EXPR<br /> |
| 198 | Syntax: .if32<br /> |
| 199 | Syntax: .if64<br /> |
| 200 | Syntax: .ifarch ARCHITECTURE<br /> |
| 201 | Syntax: .ifb STRING<br /> |
| 202 | Syntax: .ifc STRING1, STRING2<br /> |
| 203 | Syntax: .ifdef SYMBOL<br /> |
| 204 | Syntax: .ifeq ABS-EXPR<br /> |
| 205 | Syntax: .ifeqs "STRING1","STRING2"<br /> |
| 206 | Syntax: .iffmt BINFMT<br /> |
| 207 | Syntax: .ifge ABS-EXPR<br /> |
| 208 | Syntax: .ifgpu GPUDEVICE<br /> |
| 209 | Syntax: .ifgt ABS-EXPR<br /> |
| 210 | Syntax: .ifle ABS-EXPR<br /> |
| 211 | Syntax: .iflt ABS-EXPR<br /> |
| 212 | Syntax: .ifnarch ARCHITECTURE<br /> |
| 213 | Syntax: .ifnb STRING<br /> |
| 214 | Syntax: .ifnc STRING1, STRING2<br /> |
| 215 | Syntax: .ifndef SYMBOL<br /> |
| 216 | Syntax: .ifne ABS-EXPR<br /> |
| 217 | Syntax: .ifnes "STRING1","STRING2"<br /> |
| 218 | Syntax: .ifnfmt BINFMT<br /> |
| 219 | Syntax: .ifngpu GPUDEVICE<br /> |
| 220 | Syntax: .ifnotdef SYMBOL</p> |
| 221 | <p>Open if-endif clause. After that pseudo-op can encounter <code>.elseifXX</code> or <code>.else</code> |
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 |
| 223 | code 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 |
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 |
| 264 | include paths. If file not found again then assembler prints error.</p> |
| 265 | <h3>.irp</h3> |
| 266 | <p>Syntax: .irp NAME, STRING,...<br /> |
| 267 | Syntax: .irp NAME STRING ...</p> |
| 268 | <p>Begin repetition with the named variable. Nth occurrence of name will be replaced by |
| 269 | nth 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 |
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 /> |
| 299 | Syntax: .long ABS-EXPR,....</p> |
| 300 | <p>Emit 4-byte word values. If any expression is empty then an assembler |
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. |
| 307 | the 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 |
| 315 | binary objects and they can be used only locally.</p> |
| 316 | <h3>.macro</h3> |
| 317 | <p>Syntax: .macro MACRONAME, ARG,...<br /> |
| 318 | Syntax: .macro MACRONAME ARG ...</p> |
| 319 | <p>Begin macro definition. The macro is recorded code that can be used later in source code. |
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 |
| 331 | which 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 |
| 338 | single (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 |
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) -> 22*5 -> 110 */ |
| 375 | genF1 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 |
| 381 | about no value. This pseudo-operation accepts only 128-bit word literals.</p> |
| 382 | <h3>.offset, .struct</h3> |
| 383 | <p>Syntax: .offset ABS-EXPR<br /> |
| 384 | Syntax: .struct ABS-EXPR</p> |
| 385 | <p>Set the output counter to some place in absolute section. Useful to defining |
| 386 | fields 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 |
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 |
| 391 | points 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 |
| 395 | same 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 |
| 405 | stores 0 and warns about empty expression.</p> |
| 406 | <h3>.rawcode</h3> |
| 407 | <p>This pseudo-operation should to be at begin of source. |
| 408 | Choose 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 |
| 412 | number given in first argument. Zero value is legal in first argument. Example:</p> |
| 413 | <p><code>.rept 3 |
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. |
| 419 | v_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 /> |
| 424 | Syntax: .title "STRING"<br /> |
| 425 | Syntax: .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. |
| 430 | Second 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 |
| 437 | the 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 |
| 446 | the CLRX assembler.</p> |
| 447 | <h3>.skip, .space</h3> |
| 448 | <p>Syntax: .skip SIZE-EXPR[, VALUE-EXPR] |
| 449 | Syntax: .space SIZE-EXPR[, VALUE-EXPR]</p> |
| 450 | <p>Likewise as <code>.fill</code>, this pseudo-operation emits value (but byte) many times. |
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 |
| 453 | then assembler stores 0's.</p> |
| 454 | <h3>.string, .string16, .string32, .string64</h3> |
| 455 | <p>Syntax: .string "STRING",....<br /> |
| 456 | Syntax: .string16 "STRING",....<br /> |
| 457 | Syntax: .string32 "STRING",....<br /> |
| 458 | Syntax: .string64 "STRING",....</p> |
| 459 | <p>Emit ASCII string. This pseudo-operations adds the |
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. |
| 465 | Characters 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 |
| 477 | the 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 |