source: CLRX/CLRadeonExtender/trunk/doc/ClrxAsmPseudoOps.md @ 3632

Last change on this file since 3632 was 3632, checked in by matszpk, 3 years ago

CLRadeonExtender: Asm: Tentative implementation of '.while' pseudo-op (repetition).

File size: 26.1 KB
Line 
1## CLRadeonExtender Assembler Pseudo-Operations
2
3The CLRX assembler accepts the almost pseudo-operations from GNU assembler.
4This chapter lists and explains standard pseudo-operations.
5
6A CLRX assembler stores values greater than byte in the little-endian ordering.
7
8## List of the pseudo-operations
9
10### .32bit
11
12This pseudo-operation should to be at begin of source.
13Choose 32-bit binaries (it have meaningful for the AMD Catalyst and GalliumCompute
14binary format). For AMD Catalyst OpenCL 1.2 and 2.0 format, it determines
15bitness of address. For GalliumCompute, it determines bitness of inner ELF binary.
16For ROCm binary format, bitness is ignored.
17
18### .64bit
19
20This pseudo-operation should to be at begin of source.
21Choose 64-bit binaries (it have meaningful for the AMD Catalyst and GalliumCompute
22binary format). For AMD Catalyst OpenCL 1.2 and 2.0 format, it determines
23bitness of address. For GalliumCompute, it determines bitness of inner ELF binary.
24For ROCm binary format, bitness is ignored.
25
26### .abort
27
28Aborts compilation.
29
30### .align, .balign
31
32Syntax: .align ALIGNMENT[, [VALUE] [, LIMIT]] 
33Syntax: .balign ALIGNMENT[, [VALUE] [, LIMIT]]
34
35Align current position to value of the first expression.
36Value of that expression must be a power of two.
37By default if section is writeable, fill 0's.
38Second expression determines byte value that will be stored inside filling.
39If third expression is not given, assembler accepts any length of the skip.
40Third expression limits skip to own value. If any alignment needs to skip number
41of the bytes greater than that value, then alignment will not be done.
42If aligment will be done in `.text` section and second expresion will not be given, then
43assembler fills no-operation instructions in that hole.
44
45### .altmacro
46
47Enable alternate macro syntax. This mode enables following features:
48
49* new macro substitution without backslash:
50
51```
52.macro test1 a b
53    .int a, b
54.endm
55test1 12,34     # put 12 and 34 integer value
56```
57
58* evaluating expression as string in macro arguments:
59
60```
61.macro stringize a,b,c
62    .string "a, b, c"
63.endm
64stringize %12|33, %43*5, %12-65 # generate string "45, 215, -53"
65```
66
67* new string quoting in macro arguments (by triagular brackets '<' and '>' or by single
68quote ' or double quote "). Also, enables new string escaping by '!'.
69
70```
71test1 <this is test !<!>>  # put "this is test <>" string to first macro argument
72test1 "this is test <>"  # put "this is test <>" string to first macro argument
73test1 'this is test !''  # put "this is test '" string to first macro argument
74```
75
76* local symbol names. 'local name' defines new unique symbol name for name. If any name
77will be occurred then that unique name will substituted.
78
79```
80local myName    # myName substitutes new unique name
81myName:     # define new label with unique name
82```
83
84An alternate macro syntax does not disable any standard macro syntax features likes
85macro substitution via backslashes, '\@'.
86
87### .amd
88
89This pseudo-operation should to be at begin of source.
90Choose AMD Catalyst OpenCL 1.2 program binary format.
91
92### .amdcl2
93
94This pseudo-operation should to be at begin of source.
95Choose AMD Catalyst new (introduced for OpenCL 2.0 support) program binary format.
96
97### .arch
98
99Syntax: .arch ARCHITECTURE
100
101This pseudo-operation should to be at begin of source. Set GPU architecture.
102One of following architecture can be set:
103SI, VI, CI, VEGA, GFX6, GFX7, GFX8, GFX9, GCN1.0, GCN1.1, GCN1.2 and GCN1.4.
104
105### .ascii
106
107Syntax: .ascii "STRING",....
108
109Emit ASCII string. This pseudo-operations does not add the
110null-terminated character. If more than one string will be given then all given
111string will be concatenated.
112
113### .asciz
114
115Syntax: .asciz "STRING",....
116
117Emit ASCII string. This pseudo-operations adds the
118null-terminated character. If more than one string will be given then all given
119string will be concatenated.
120
121### .balignw, .balignl
122
123Syntax: .balignw ALIGNMENT[, [VALUE] [, LIMIT]] 
124Syntax: .balignl ALIGNMENT[, [VALUE] [, LIMIT]]
125
126Refer to `.align`. `.balignw` treats fill value as 2-byte word. `.balignl` treats
127fill value as 4-byte word.
128
129### .buggyfplit
130
131Enable old and buggy behavior for floating point literals and constants.
132
133### .byte
134
135Syntax: .byte ABS-EXPR,....
136
137Emit byte values. If any expression is empty then an assembler stores
1380 and warns about empty expression. If expression will give a value that can not be stored
139in byte then an assembler warn about that.
140
141### .data
142
143Go to `.data` section. If this section doesn't exist assembler create it.
144
145### .double
146
147Syntax: .double DOUBLE-VAL,...
148
149Put double-precision floating point values into current section.
150If no value between comma then an assembler stores 0 and warn about no value.
151This pseudo-operation accepts only double precision floating point literals.
152
153### .else
154
155Part of the if-endif clause. Refer to `.if` pseudo-operation.
156Code between `.else` and `.endif` will be performed if all previous conditions was not
157satisified. Otherwise code will be skipped.
158
159### .elseifXXX
160
161Syntax: .elseif ABS-EXPR 
162Syntax: .elseif32 
163Syntax: .elseif64 
164Syntax: .elseifarch ARCHITECTURE 
165Syntax: .elseifb STRING 
166Syntax: .elseifc STRING1, STRING2 
167Syntax: .elseifdef SYMBOL 
168Syntax: .elseifeq ABS-EXPR 
169Syntax: .elseifeqs "STRING1","STRING2" 
170Syntax: .elseiffmt BINFMT 
171Syntax: .elseifge ABS-EXPR 
172Syntax: .elseifgpu GPUDEVICE 
173Syntax: .elseifgt ABS-EXPR 
174Syntax: .elseifle ABS-EXPR 
175Syntax: .elseiflt ABS-EXPR 
176Syntax: .elseifnarch ARCHITECTURE 
177Syntax: .elseifnb STRING 
178Syntax: .elseifnc STRING1, STRING2 
179Syntax: .elseifndef SYMBOL 
180Syntax: .elseifne ABS-EXPR 
181Syntax: .elseifnes "STRING1","STRING2" 
182Syntax: .elseifnfmt BINFMT 
183Syntax: .elseifngpu GPUDEVICE 
184Syntax: .elseifnotdef SYMBOL
185
186Part of the if-endif clause. Refer to `.if` pseudo-operation.
187Code between `.else` and `.endif` will be performed if all previous conditions was not
188satisified and condition to this pseudo-operation was satisfied. Otherwise code will be
189skipped.
190
191### .end
192
193Ends source code compilation at this point.
194
195### .endif
196
197Finish if-endif clause.
198
199### .endm, .endmacro
200
201Finish macro definition
202
203### .endr, .endrept
204
205Finish code of repetition.
206
207#### .ends, .endscope
208
209Close visibility's scope.
210
211### .equ, .set
212
213Syntax: .equ SYMBOL, EXPR 
214Syntax: .set SYMBOL, EXPR
215
216Define symbol with specified value of the expression given in second operand. Symbol
217defined by using these pseudo-operations can be redefined many times.
218
219### .equiv
220
221Syntax: .equiv SYMBOL, EXPR
222
223Define symbol with specified value of the expression given in second operand.
224Symbol defined by using `.equiv` can not be redefined. If symbol was already defined
225this pseudo-operations causes an error.
226
227### .eqv
228
229Syntax: .eqv SYMBOL, EXPR
230
231Define symbol with specified expression given in second operand.
232Symbol defined by using `.eqv` can not be redefined.
233If symbol was already defined this pseudo-operations causes an error.
234The expression of symbol will be evaluated any time when symbol will be used.
235This feature allow to change value of symbol indirectly by changing value of the symbols
236used in expression. Example:
237
238```
239a = 3
240b = 5
241.eqv currentValue, a+b  # now currentValue is equal to 8
242.int currentValue
243b = 7
244.int currentValue  # we changed b to 7, so we put 10
245```
246
247### .err
248
249This pseudo-operation causes error at point where is encountered.
250
251### .error
252
253Syntax: .error "STRING"
254
255This pseudo-operation causes error and print error given in string.
256
257### .exitm
258
259This pseudo-operation can be used only inside macro definitions. It does early exiting
260from macro. Useful while using conditions inside a macros.
261
262### .extern
263
264Syntax: .extern SYMBOL,...
265
266Set symbol as external. Ignored by GNU as and CLRX assembler.
267
268### .fail
269
270Syntax: .fail ABS-EXPR
271
272If value of the expression is greater or equal to 500 then assembler print warnings.
273Otherwise assembler print error and fails.
274
275### .file
276
277This pseudo-operation is ignored by CLRX assembler.
278
279### .fill, .fillq
280
281Syntax: .fill REPEAT[, [SIZE] [, VALUE]] 
282Syntax: .fillq REPEAT[, [SIZE] [, VALUE]]
283
284Emit value many times. First expression defines how many times value will be stored.
285Second expression defines how long is value. Third expression defines value to be stored.
286If second expression is not given, then assembler assumes that is byte value.
287If third expression is not given then assembler stores 0's. Assembler takes only
288lowest 4-bytes of the value, and if size of value is greater than 4 then more significant
289bytes will be assumed to be 0. The `.fillq` takes all bytes of the 64-bit value.
290If value doesn't fit to size of value then it will be truncated.
291Size of value can be 0. First expression too.
292
293### .float, .single
294
295Syntax: .float FLOAT-VAL,... 
296Syntax: .single FLOAT-VAL,...
297
298Emit single-precision floating point values. If no value between comma then an
299assembler stores 0 and warn about no value.
300This pseudo-operation accepts only single precision floating point literals.
301
302### .for
303
304Syntax: .for SYMBOL=INITVALUE, COND-EXPR, NEXT-EXPR
305
306Open 'for' repetition. Before repetition, SYMBOL is initialized by INITVALUE.
307For every repetition SYMBOL value will be replaced by value evaluted by NEXT-EXPR.
308The code between this pseudo-operation and `.endr` will be repeated
309until COND-EXPR returns zero. Example:
310
311```
312.for x=1,x<16,x+x
313    .int x
314.endr
315```
316
317generates:
318
319```
320.int x      # x=1
321.int x      # x=2
322.int x      # x=4
323.int x      # x=8
324```
325
326### .format
327
328Syntax: .format BINFORMAT
329
330This pseudo-operation should to be at begin of source.
331Choose binary format. Binary can be one of following list:
332
333* `amd`, `catalyst` - AMD Catalyst OpenCL 1.2 binary format
334* `amdcl2` - AMD Catalyst new (introduced for OpenCL 2.0) binary format
335* `gallium` - the GalliumCompute binary format
336* `rocm` - the ROCm binary format
337* `raw` - rawcode (raw program instructions)
338
339### .gallium
340
341This pseudo-operation should to be at begin of source.
342Choose GalliumCompute OpenCL program binary format.
343
344### .get_64bit
345
346Syntax: .get_64bit SYMBOL
347
348Store 64-bitness in specified symbol. Store 1 to symbol if 64-bit mode enabled.
349
350### .get_arch
351
352Syntax: .get_arch SYMBOL
353
354Store GPU architecture identifier to symbol. List of architecture ids:
355
356Id | Description
357---|-------------------------------------------
358 0 | GCN1.0 (Pitcairn, Tahiti)
359 1 | GCN1.1 (Bonaire, Hawaii)
360 2 | GCN1.2 (Tonga, Fiji, Ellesmere)
361 3 | VEGA (AMD RX VEGA)
362
363### .get_format
364
365Syntax: .get_format SYMBOL
366
367Store binary format identifier to symbol. List of format ids:
368
369Id | Description
370---|-------------------------------------------
371 0 | AMD OpenCL 1.2 binary format
372 1 | Gallium Compute binary format
373 2 | Raw code
374 3 | AMD OpenCL 2.0 (new driver) binary format
375 4 | ROCm binary format
376
377### .get_gpu
378
379Syntax: .get_gpu SYMBOL
380
381Store GPU device identifier to symbol. List of GPU device ids:
382
383Id  | Description
384----|-------------------------------------------
385 0  | Cape Verde (Radeon HD 7700)
386 1  | Pitcairn (Radeon HD 7850)
387 2  | Tahiti  (Radeon HD 7900)
388 3  | Oland
389 4  | Bonaire  (Radeon R7 260)
390 5  | Spectre
391 6  | Spooky
392 7  | Kalindi
393 8  | Hainan
394 9  | Hawaii (Radeon R9 290)
395 10 | Iceland
396 11 | Tonga (Radeon R9 285)
397 12 | Mullins
398 13 | Fiji (Radeon Fury)
399 14 | Carrizo
400 15 | Dummy
401 16 | Goose
402 17 | Horse
403 18 | Stoney
404 19 | Ellesmere (Radeon RX 470/480)
405 20 | Baffin (Radeon 460)
406 21 | Gfx804
407 22 | Gfx900 (Radeon RX VEGA)
408
409### .get_version
410
411Syntax: .get_version SYMBOL
412
413Store CLRadeonExtender version to symbol. Version stored as integer in form:
414`major_version*10000 + minor_version*100 + micro_version`.
415
416### .global, .globl
417
418Syntax: .global SYMBOL,... 
419Syntax: .globl SYMBOL,...
420
421Indicates that symbols will be a global. Global symbol can be used
422across many object files. The CLRX assembler can expose global symbols at output binary if
423adding sybols will be enabled.
424
425### .gpu GPUDEVICE
426
427Syntax: .gpu GPUDEVICE
428
429This pseudo-operation should to be at begin of source. Set GPU device.
430One of following device type can be set:
431CapeVerde, Pitcairn, Tahiti, Oland, Bonaire, Spectre, Spooky, Kalindi,
432Hainan, Hawaii, Iceland, Tonga, Mullins, Fiji, Carrizo, Goose, Horse, Stoney,
433Ellesmere, and Baffin.
434
435### .half
436
437Syntax: .half HALF-VAL,...
438
439Emit half-precision floating point values.
440If no value between comma then an assembler stores 0 and warn about no value.
441This pseudo-operation accepts only half precision floating point literals.
442
443### .hword, .short
444
445Syntax: .hword ABS-EXPR,....
446Syntax: .short ABS-EXPR,....
447
448Emit 2-byte word values. If any expression is empty then an assembler
449stores 0 and warns about empty expression. If expression will give a value that can not be
450stored in 2-byte word then an assembler warn about that.
451
452### .ifXXX
453
454Syntax: .if ABS-EXPR 
455Syntax: .if32 
456Syntax: .if64 
457Syntax: .ifarch ARCHITECTURE 
458Syntax: .ifb STRING 
459Syntax: .ifc STRING1, STRING2 
460Syntax: .ifdef SYMBOL 
461Syntax: .ifeq ABS-EXPR 
462Syntax: .ifeqs "STRING1","STRING2" 
463Syntax: .iffmt BINFMT 
464Syntax: .ifge ABS-EXPR 
465Syntax: .ifgpu GPUDEVICE 
466Syntax: .ifgt ABS-EXPR 
467Syntax: .ifle ABS-EXPR 
468Syntax: .iflt ABS-EXPR 
469Syntax: .ifnarch ARCHITECTURE 
470Syntax: .ifnb STRING 
471Syntax: .ifnc STRING1, STRING2 
472Syntax: .ifndef SYMBOL 
473Syntax: .ifne ABS-EXPR 
474Syntax: .ifnes "STRING1","STRING2" 
475Syntax: .ifnfmt BINFMT 
476Syntax: .ifngpu GPUDEVICE 
477Syntax: .ifnotdef SYMBOL
478
479Open if-endif clause. After that pseudo-op can encounter `.elseifXX` or `.else`
480pseudo-operations. If condition of that pseudo-operations is satisfied then
481code will be performed.
482
483List of the `.if` kinds:
484
485* `.if` - perform code if value is not zero.
486* `.if32` - perform code if 32-bit binary.
487* `.if64` - perform code if 64-bit binary.
488* `.ifarch` - perform code if specified architecture was set.
489* `.ifb` - perform code if all character after name of this pseudo-op is blank.
490* `.ifc` - compare two unquoted strings. If are equal then perform code.
491* `.ifdef` - perform code if symbol was defined
492* `.ifeq` - perform code if value is zero.
493* `.ifeqs` - perform code if two quoted string are equal.
494* `.iffmt` - perform code if specified binary format was set.
495* `.ifge` - perform code if value is greater or equal to zero.
496* `.ifgpu` - perform code if specified GPU device type was set.
497* `.ifgt` - perform code if value is greater than zero.
498* `.ifle` - perform code if value is less or equal to zero.
499* `.iflt` - perform code if value is less than zero.
500* `.ifnarch` - perform code if specified architecture was not set.
501* `.ifnb` - perform code if any character after name of this pseudo-op is not blank.
502* `.ifnc` - compare two unquoted strings. If are not equal then perform code.
503* `.ifndef` - perform code if symbol was not defined.
504* `.ifne` - perform code if value is not zero.
505* `.ifnes` - perform code if two quoted string are not equal.
506* `.ifnfmt` - perform code if specified binary format was not set.
507* `.ifngpu` - perform code if specified GPU device type was not set.
508* `.ifnotdef` - perform code if symbol was not defined.
509
510### .incbin
511
512Syntax: .incbin FILENAME[, [OFFSET] [, COUNT]]
513
514Append the binary file into currenct section. If file not found in the current directory
515then assembler searches file in the include paths. If file not found again then assembler
516prints error. Second optional argument defines offset (how many bytes should to be skipped).
517By default assembler begin appending from first byte.
518Third argument defines maximum number bytes to append. By default all data from binary
519will be appended.
520
521### .include
522
523Syntax: .include "FILENAME"
524
525Include new source code file and begins assemblying from this file.
526An assembler automatically returns to previous file if encounters end of the that file.
527If file not found in the current directory then assembler searches file in the
528include paths. If file not found again then assembler prints error.
529
530### .irp
531
532Syntax: .irp NAME, STRING,... 
533Syntax: .irp NAME STRING ...
534
535Begin repetition with the named variable. Nth occurrence of name will be replaced by
536nth string. The name of variable must be preceded by `\` character.
537
538Sample usage:
539
540```
541.irp reg v0,v1,v4,v5
542    v_mul_f32 v10,\reg
543.endr
544```
545
546produces:
547
548```
549    v_mul_f32 v10,v0
550    v_mul_f32 v10,v1
551    v_mul_f32 v10,v4
552    v_mul_f32 v10,v5
553```
554
555Alternate syntax does not require a comma separator between strings and variable name.
556Rules regarding to substituting variables are same as in macro substitution. Refer to
557`.macro` pseudo-operation.
558
559### .irpc
560
561Syntax: .irpc NAME, STRING
562
563Begin repetition with the named variable.Nth occurrence of name will be replaced by
564nth character of the string (second operand).
565The name of variable must be preceded by `\` character.
566
567```
568.irp reg 0145
569    v_mul_f32 v10,v\reg
570.endr
571```
572
573produces:
574
575```
576    v_mul_f32 v10,v0
577    v_mul_f32 v10,v1
578    v_mul_f32 v10,v4
579    v_mul_f32 v10,v5
580```
581
582Rules regarding to substituting variables are same as in macro substitution. Refer to
583`.macro` pseudo-operation.
584
585### .int, .long
586
587Syntax: .int ABS-EXPR,.... 
588Syntax: .long ABS-EXPR,....
589
590Emit 4-byte word values. If any expression is empty then an assembler
591stores 0 and warns about empty expression. If expression will give a value that can not be
592stored in 4-byte word then an assembler warn about that.
593
594### .kernel
595
596Syntax: .kernel KERNELNAME
597
598Create new kernel with default section or move to an existing kernel and
599its default section. Types of section which can to be belonging to kernel depends on
600the binary format.
601
602### .lflags
603
604This pseudo-operation is ignored by CLRX assembler.
605
606### .ln, .line
607
608These pseudo-operations are ignored by CLRX assembler.
609
610### .local
611
612Syntax: .local SYMBOL,...
613
614Indicates that symbols will be a local. Local symbol are not visible in other
615binary objects and they can be used only locally.
616
617### .macro
618
619Syntax: .macro MACRONAME, ARG,... 
620Syntax: .macro MACRONAME ARG ...
621
622Begin macro definition. The macro is recorded code that can be used later in source code.
623Macro can accepts one or more arguments that will be substituted in its body.
624Occurrence of the argument must be preceded by `\` character.
625
626Special case of substitution is `\@` that replaced by number of the macro substitution.
627Sometimes substitution must be joined with other name. In this case '\()` can be used to
628split argument occurrence and other name. Example:
629
630```
631.macro macro1, x
632.set \x\()Symbol, 10 # set symbol Xsymbol to value 10
633.endm
634macro1 Linux # define LinuxSymbol=10
635```
636
637That substitution is useful to create labels and symbols that can not be redefined.
638Value of the argument is string. Optionally, argument can have the default value
639which will be used if no argument value is not given in a macro call.
640
641List of the argument definition:
642
643* `arg1` - simple argument
644* `arg1=value` - argument with default value
645* `arg1:req` - required argument
646* `arg:vararg` - variadic argument, get rest of the arguments and treats them as
647single (must be last)
648* `arg1:vararg:req` - required argument and variadic argument
649
650A macro calling is easy:
651
652```
653somemacro
654somemacro1 1,2,4
655somemacro1 1 2 3
656/* use variadic argument */
657.macro putHeaderAndData x,data:vararg
658    .byte \x&0x3f, \data
659.endm
660putHeaderAndData 0xfe,1,4,6,7,110
661```
662
663Some simple examples:
664
665```
666.macro putTwoBytes value1,value2
667    .byte \value1+\value2, \value2-\value1
668.endm
669putTwoBytes 4,7 # generates .byte 11,3
670.macro putTwoBytes2 value1=100,value2
671    .byte \value1+\value2, \value2-\value1
672.endm
673putTwoBytes2 ,7 # generates .byte 107,93
674```
675
676The argument substitution works inside double-quoted strings:
677
678```
679.macro putVersionInfo major,minor,micro
680.ascii "CLRadeonExtender \major\().\minor\().\micro"
681.endm
682putVersionInfo 1,2,3 # generates string "CLRadeonExtender 1.2.3"
683```
684
685It is possible to create the nested definitions like that:
686
687```
688.macro generators m,value1,value2
689    .macro gen\m x1,x2  # define genM with two arguments
690        /* use first and second operand of parent macro, and use two
691         * operands from this macro */
692        .int (\x1+\x2)*(\value1+\value2)
693    .endm   
694.endm
695/* define genF1 */
696generators F1,2,3
697/* use genF1, generates (10+12)*(2+3) -> 22*5 -> 110 */
698genF1 10,12
699```
700
701If macro argument starts with '\%' then rest of macro argument will be evaluated as
702expression and its results will be stored in string form (likewise '%EXPR' evaluation if
703alternate macro syntax is enabled).
704
705### .macrocase
706
707Enable ignoring letter's case in macro names (default behaviour).
708
709### .main
710
711Go to main binary over binary of the kernel.
712
713### .noaltmacro
714
715Disables alternate macro syntax.
716
717### .nobuggyfplit
718
719Disable old and buggy behavior for floating point literals and constants.
720
721### .nomacrocase
722
723Disable ignoring letter's case in macro names.
724
725### .nooldmodparam
726
727Disable old modifier parametrization that accepts only 0 and 1 values (to 0.1.5 version).
728
729### .octa
730
731Syntax: .octa OCTA-LITERAL,...
732
733Emit 128-bit word values. If no value between comma then an assembler stores 0 and warn
734about no value. This pseudo-operation accepts only 128-bit word literals.
735
736### .offset, .struct
737
738Syntax: .offset ABS-EXPR 
739Syntax: .struct ABS-EXPR
740
741Set the output counter to some place in absolute section. Useful to defining
742fields of the structures.
743
744### .oldmodparam
745
746Enable old modifier parametrization that accepts only 0 and 1 values (to 0.1.5 version)
747for compatibility.
748
749### .org
750
751Syntax: .org EXPRESSION
752
753Set the output counter to place defined by expression. Expression can point to some
754place in the code or some place to absolute section (absolute value). If a expression
755points to some place of a code, moving backwards is illegal.
756
757### .p2align
758
759Syntax: .p2align POWOF2ALIGN[, [VALUE] [, LIMIT]]
760
761Refer to `.align`. First argument is power of two of the alignment instead of
762same alignment.
763
764### .print
765
766Syntax: .print "STRING"
767
768Print string into standard output (or defined print output).
769
770### .purgem
771
772Syntax: .purgem MACRONAME
773
774Undefine macro MACRONAME.
775
776### .quad
777
778Syntax: .quad ABS-EXPR,....
779
780Emit 8-byte word values. If any expression is empty then an assembler
781stores 0 and warns about empty expression.
782
783### .rawcode
784
785This pseudo-operation should to be at begin of source.
786Choose raw code (same processor's instructions).
787
788### .regvar
789
790Syntax: .regvar REGVAR:REGTYPE:REGSNUM, ...
791
792Define new register variable (UNIMPLEMENTED).
793
794### .rept
795
796Syntax: .rept ABS-EXPR
797
798Open repetition. The code between this pseudo-operation and `.endr` will be repeated
799number given in first argument. Zero value is legal in first argument. Example:
800
801```
802.rept 3
803v_nop
804.endr
805```
806
807generates:
808
809```
810v_nop
811v_nop
812v_nop
813```
814
815### .rocm
816
817This pseudo-operation should to be at begin of source.
818Choose ROCm program binary format.
819
820### .rodata
821
822Go to `.rodata` section. If this section doesn't exist assembler create it.
823
824### .sbttl, .tittle, .version
825
826Syntax: .sbttl "STRING" 
827Syntax: .title "STRING" 
828Syntax: .version "STRING"
829
830These pseudo-operations are ignored by CLRX assembler.
831
832### .scope
833
834Syntax .scope [SCOPENAME]
835
836Open visbility's scope (if no name specified, then temporary scope).
837The labels (except local labels), symbols, scopes and regvars are defined
838inside scopes and visible inside them. The assembler create always global scope at begin.
839If scope doesn't exists then will be created. The nested scopes are allowed even
840if parent scope is temporary scope. The opened scope have parent that is previous scope.
841Temporary scopes exists until first close.
842
843### .section
844
845Syntax: .section SECTIONNAME[, "FLAGS"[, @TYPE]] [align=ALIGN]
846
847Go to specified section SECTIONNAME. If section doesn't exist assembler create it.
848Second optional argument set flags of the section. Can be from list:
849
850* `a` - allocatable section
851* `w` - writeable section in file
852* `x` - executable section
853
854Third optional argument set type of the section. Default section's type depends on
855the binary format. Type can be one of following type:
856
857* `progbits` - program data
858* `note` - informations about program or other things
859* `nobits` - doesn't contain data (only occupies space)
860
861The last attribute called 'align' set up section aligmnent.
862
863### .size
864
865Syntax: .size SYMBOL, ABS-EXPR
866
867Set size of symbol SYMBOL. Currently, this feature of symbol is not used by
868the CLRX assembler.
869
870### .skip, .space
871
872Syntax: .skip SIZE-EXPR[, VALUE-EXPR]
873Syntax: .space SIZE-EXPR[, VALUE-EXPR]
874
875Likewise as `.fill`, this pseudo-operation emits value (but byte) many times.
876First expression determines how many values should to be emitted, second expression
877determines what byte value should to be stored. If second expression is not given
878then assembler stores 0's.
879
880### .string, .string16, .string32, .string64
881
882Syntax: .string "STRING",.... 
883Syntax: .string16 "STRING",.... 
884Syntax: .string32 "STRING",.... 
885Syntax: .string64 "STRING",....
886
887Emit ASCII string. This pseudo-operations adds the
888null-terminated character. If more than one string will be given then all given
889string will be concatenated.
890`.string16` emits string with 2-byte characters.
891`.string32` emits string with 4-byte characters.
892`.string64` emits string with 8-byte characters.
893Characters longer than 1 byte will be zero expanded.
894
895### .text
896
897Go to `.text` section. If this section doesn't exist assembler create it.
898
899### .undef
900
901Syntax: .undef SYMBOL
902
903Undefine symbol. If symbol already doesn't exist then assembler warns about that.
904
905### .unusing
906
907Syntax: .unusing [SCOPEPATH]
908
909Stop using all objects (labels, symbols, regvar) in the specified scope or all
910previously used scopes (by '.using').
911
912### .using
913
914Syntax: .using SCOPEPATH
915
916Start use all objects (labels, symbols, scopes, regvar) in the specified scope.
917All objects (if they names is not hidden by object in current scope) will be visible
918directly including usings from specified scope. Searching object in current level of
919scope's stack is recursive and it traverse through 'usings' until object will be found.
920Assembler start searching object begins from the last declared 'using' to first 'using'.
921
922### .warning
923
924Syntax: .warning "STRING"
925
926Print warning message specified in first argument.
927
928### .weak
929
930Syntax: .weak SYMBOL,...
931
932Indicates that symbols will be a weak. Currently, unused feature of the symbol by
933the CLRX assembler.
934
935### .while
936
937Syntax: .while COND-EXPR
938
939Open 'while' repetition.The code between this pseudo-operation and `.endr` will be repeated
940until COND-EXPR returns zero. Example:
941
942```
943x=1
944.while x<16
945    .int x
946    x=x+1
947.endr
948```
949
950generates:
951
952```
953.int x      # x=1
954.int x      # x=2
955.int x      # x=4
956.int x      # x=8
957```
958
959### .word
960
961Syntax: .word ABS-EXPR,....
962
963Emit processor's word values. If any expression is empty then
964an assembler stores 0 and warns about empty expression. If expression will give a value
965that can not be stored in processor's word then an assembler warn about that.
966
967Processor's word have always 4 bytes.
Note: See TracBrowser for help on using the repository browser.