ctr_VertexShaderAssembler

Table of Contents

Introduction

ctr_VertexShaderAssembler assembles assembler files written in assembler language, conforming to proprietary PICA specifications, and outputs the corresponding object files.

How to Use

Commands

% ctr_VertexShaderAssembler32 <input file name> [options...]

An input file name must be specified. Options can be omitted. Help is displayed if the assembler is executed without any arguments.

Input Files

Specify the assembler files to be input in place of <input file name>.
Files encoded in Shift-JIS and UTF-8 (byte-order marked) are supported.
CRLF is supported for newline codes.
For the file name, specify a string of 128 or fewer characters that contains no spaces, by using ASCII alphanumeric characters and symbols other than \ / : * ? " < > and |.
* ?

Options

The following options can be specified in place of [options...].

Options Description
-O <File Name> Specifies the output filename.
The file name "input_file_name.obj" is used, if no output file name is specified.
-I<file path> Specifies the file path of the input file.
Specify a file path that contains both the assembler file and files included in the assembler file.
The input file and include files are detected in the order in which directories are specified using this option.
-D<key>[=<value>] Defines a macro.
Specify the macro name in <key> and the macro value in <value>. <value> can be omitted.
-debug Creates an object file with debug information.
If this option is not specified, the output object file will not include the full path of the input file.
-nowarning Sets execution so that warning messages are not output.
-preprocess Executes preprocessing only.
This option executes preprocessing on the input assembler file and outputs the result of deleting inactive text, such as blank lines and comments, to the standard output.
File information is added to output results in the form "# line_number file_name." Assembler macro instructions are replaced with expanded instructions. Note, however, that macros are not replaced with expanded instructions if there is a syntax error in the macro instruction itself.
-dependency Outputs assembler file dependencies.
This option executes only preprocessing on the input assembler file, and outputs the names of all input files and include files referenced in input files to the standard output.
The -preprocess option is ignored if specified along with the -preprocess option.
-? or -help Displays help.

Debug Build

Specifying the -debug option to the ctr_VertexShaderAssembler results in a debug build.
Debug build assembler objects can be debugged using the shader debugger, but the operation speed on POD decreases.


If the -debug option is not specified, the file path of the input files is removed from object files.

If the full path of input files is unknown, the shader debugger might not be able to locate the source file.

Error Codes (Assembler)

Error Message Format

This page describes error messages output by the assembler. Errors are saved in the following format.

    Input file name (line number of error): Error level (error code): Error description

Errors have an error level of either "warning" or "error." Execution can continue in the case of a "warning" level error. The input file name and/or error line number may not be displayed, depending on the type of error.

Error Message

This table gives the error codes output by the assembler and their description.

8001xxxx

Error Code Message / Description
80010001The -O option cannot be specified more than once.
The -O option can be specified only once.
80010003 Definition key is not specified with -D option
A key defined for the -D option has not been specified.
Specify this option using the format -Dkey or -Dkey=value.
80010004 Definition value is not specified with ‘parameter name’ macro.
The value of the defined macro for the -D option has not been set correctly.
Specify this option using the format -Dkey or -Dkey=value.
80010005 ‘parameter name’ includes illegal character.
An attempt was made to use the -D option to define a macro that uses illegal characters.
Macro names must consist of ASCII alphanumeric characters and may include an underscore ("_").
80010006 ‘macro name’ macro is redefined.
Two or more macros having the same name have been defined using the -D option.
80010007 Only one assembler file can be specified as input.
Two or more assembler files have been specified as input. Only one assembler file can be specified.
80010008 Input file is not specified.
No assembler file has been specified as input.
8001000b ‘macro name’ macro name cannot start from number.
The macro name defined with the -D option cannot start with a number.
8001000d Unknown options are specified.
An unknown option was specified.

8003xxxx

Error Code Message / Description
80030001 Cannot open ‘file name’
The specified assembler file cannot be opened.
80030002 Include file name is not specified.
The file name has not been specified in an #include statement.
Specify the file name using the format:
#include "file name"
80030003 Syntax error in #include
The format of the #include statement is incorrect.
Specify the file name using the format:
#include "file name"
80030004 Cannot open the include file “file name”.
The include file cannot be opened.
Specify an include path using the -I option.
80030005 Definition key is not specified.
The format of the #define statement is incorrect.
Specify using the format:
#define key value.
80030006 Definition key includes an illegal character.
Macro names defined using #define must consist of ASCII alphanumeric characters and may include an underscore ("_").
80030007 ‘macro name’ macro is redefined.
A macro defined using #define has been redefined elsewhere.
80030008 Definition key is not specified.
The format of the #undef statement is incorrect.
Specify using the format:
#undef key.
8003000b Correspondent “#ifdef” is not found.
The assembler could not find the #ifdef statement that corresponds to the #endif statement.
8003000c Undefined directive.
An unsupported pre-processor pseudo instruction has been specified.
8003000d #ifdef is not closed.
The assembler could not find the #endif statement that corresponds to the #ifdef statement.
8003000e Syntax error. Macro is not specified.
A macro has not been defined for the #ifdef statement.
Specify using the format:
#ifdef macro.
8003000f Syntax error. Invalid string is detected after macro.
The format of the #ifdef statement is incorrect.
Specify using the format:
#ifdef macro.
80030010 Syntax error. Macro is not specified.
A macro has not been defined for the #ifndef statement.
Specify using the format:
#ifndef macro.
80030011 Syntax error. Invalid string is detected after macro.
The format of the #ifndef statement is incorrect.
Specify using the format:
#ifndef macro.
80030012 Syntax Error. Invalid string is detected after directive.
Macro names defined using #if, #ifdef, or #ifndef must consist of ASCII alphanumeric characters and may include an underscore ("_").
80030013 Syntax Error. Invalid string is detected after directive.
An illegal string was detected after an #else statement.
80030014 Correspondent “#ifdef” is not found.
The assembler could not find the #ifdef statement that corresponds to the #else statement.
80030015 Syntax error. Invalid expression is detected.
The format of the #if statement is incorrect.
80030017 Syntax error. Invalid expression is detected.
The macro listed after the #if statement includes illegal characters.
Macro names specified using #if must consist of ASCII alphanumeric characters and may include an underscore ("_").
80030018 #error
This error is output intentionally by an #error statement.
80030019 The top character of the definition key must not be a number.
The first character of the macro name defined using #define must not be a number.
8003001a Macro parentheses have not been closed properly.
Parentheses using in a #define definition have not been paired properly.
8003001b Invalid character is detected in macro argument.
A function macro argument includes an illegal string.
Macro names must consist of ASCII alphanumeric characters and may include an underscore ("_").
8003001c Duplicate macro argument is detected.
More than one function macro argument uses the same string.
8003001d Invalid macro argument is specified.
An attempt was made to use a macro function defined using illegal code.
8003001e pragma command bind_symbol is invalid format.
The #pragma bind_symbol statement is invalid.
8003001f Undefined pragma command.
An unsupported pragma command has been specified.
80030020 Start index should be less than or equal to end index.
The start register index of the #pragma bind_symbol statement is greater than the end register index.
80030021 Binding symbol name is duplicated.
The symbol name used in the #pragma bind_symbol statement is defined again elsewhere.
80030022 Invalid register index is specified.
An invalid register index has been defined by a #pragma bind_symbol statement.
(Exceeds the maximum number of registers.))
80030023 Specified registers are already bound to other symbol.
The same input register has been bound to more than one symbol by a #pragma bind_symbol statement.
Only one symbol name can be bound to an input register.
80030024 Pragma command output_map is invalid format.
The #pragma output_map statement is invalid.
80030025 Invalid data name is specified for pragma command output_map.
An invalid data attribute name has been specified in a #pragma output_map statement.
8003002c Specified register is already mapped.
The register specified in a #pragma output_map statement has already been specified for another output_map.
8003002d Specified attribute is already mapped.
The data attribute name specified in a #pragma output_map statement has already been specified for another output_map.
80030033 If all textures are mapped, texture1 and texture2 need to be mapped to same register.
When all textures have been defined using a #pragma output_map statement, texture1 and texture2 must be mapped to the same register.
80030034 comment /* */ is not closed.
A comment of the form /* ... */ has not been terminated correctly.

8004xxxx

Error Code Message / Description
80040001 No vertex shader instruction.
No shader instruction has been coded.
80040005 loop instruction is not closed by endloop.
The assembler cannot find the endloop instruction that corresponds to the given loop instruction.
80040007 if or else instruction is not closed by endif.
The assembler cannot find the endif instruction that corresponds to the given ifc or ifb instruction.
80040009 Unknown instruction.
An unknown shader instruction has been coded.
8004000c The number of operand is short.
There are not enough operands.
8004000d There are some extra operands.
An unnecessary operand or operands have been specified.
8004000e “operand” is unknown operand type.
An operand of unknown type has been specified.
8004000f “operand” is invalid format operand.
An operand has been specified in an invalid format.
80040010 “operand” is invalid offset.
The given register offset is invalid.
80040011 “operand” is invalid address register offset.
The offset given for the address register is invalid.
80040012 “operand” include unknown component.
An unknown component is specified.
80040015 break instruction is not between loop and endloop.
There is no break instruction between the given loop and endloop instructions.
80040016 loop instruction nest achieved limit.
The number of loop instructions exceeds the maximum number that can be nested.
loop instructions can be nested up to four levels deep.
80040017 Correspondent loop instruction is not found.
The assembler cannot find the loop instruction that corresponds to the given endloop instruction.
8004001a if instruction nest achieved limit.
The number of ifb or ifc instructions exceeds the maximum number that can be nested.
ifb and ifc instructions can be nested up to a total of eight times.
8004001b Correspondent if instruction is not found.
The assembler cannot find the ifc or ifb instruction that corresponds to the given else instruction.
8004001d loop instruction is not closed, but ret instruction is called.
An ret instruction cannot be placed between loop and endloop instructions.
8004001f if else instruction is not closed, but ret instruction is called.
An ret instruction cannot be placed between an ifc, ifb, or else instruction and an endif instruction.
80040021 “operand” is invalid format operand.
An operand has been specified in an invalid format.
80040022 “operand” is invalid index.
An invalid index has been specified for the operand register.
80040023 “operand” is invalid format operand.
Parentheses used to specify the offset for the operand register are not paired correctly.
80040024 “operand” is invalid offset.
An invalid offset has been specified for the operand register.
80040025 “operand” is invalid offset.
A register that cannot be used in an index specification is being used for the offset specification of the operand register.
80040026 “operand” is invalid offset.
An invalid index has been specified for the operand register.
80040027 Correspondent if instruction is not found.
The assembler cannot find the ifc or ifb instruction that corresponds to the given endif instruction.
8004002a Const register definition is duplicate.
The floating point constant register defined by the given def instruction has been defined again elsewhere.
8004002b Bool register definition is duplicate.
The boolean register defined by the given defb instruction has been defined again elsewhere.
8004002c Integer register definition is duplicate.
The integer register defined by the given defi instruction has been defined again elsewhere.
80040031 “label name” is already used label name.
The same label name is being used elsewhere.
80040032 Invalid label name is specified.
The label name includes an invalid string.
Label names must consist of ASCII alphanumeric characters and may include an underscore ("_").
80040035 Error occurred while replacing macro instruction.
An error occurred while replacing a macro instruction.
Check whether a floating point const register automatically defined by sincos (for instance) has already been defined using a def instruction.
80040039 Cannot break from if statement.
A break instruction cannot be placed in code controlled by an ifb or ifc instruction.
8004003a ret instruction cannot be used just after endloop or endif.
An ret instruction cannot be called immediately after an endloop or endif instruction.
8004003bAt least 1 instruction need to be between if and else.
At least one assembler instruction must be included between an ifb or ifc instruction and the corresponding else instruction.
8004003cAt least one instruction needs to be between else and endif.
At least one assembler instruction must be included between an else instruction and the corresponding endif instruction.
8004003ddef instruction cannot specify the register defined by pragma bind_symbol.
Registers specified in a #pragma bind_symbol statement cannot be specified in a def instruction.
8004003edefb instruction cannot specify the register defined by pragma bind_symbol.
Registers specified in a #pragma bind_symbol statement cannot be specified in a defb instruction.
8004003fdefi instruction cannot specify the register defined by pragma bind_symbol.
Registers specified in a #pragma bind_symbol statement cannot be specified in a defi instruction.
80040040At least 1 instruction need to be between loop and endloop.
At least one assembler instruction must be included between a loop instruction and the corresponding endloop instruction.
80040041mova cannot be called continuously.
The mova instruction cannot be called consecutively.
80040042 ret cannot be called just after jpb and jpc.
An ret instruction cannot be called immediately after a jpb or jpc instruction.

8005xxxx

Error Code Message / Description
80050001 Cannot open output file.
The output file cannot be opened.
Check whether there is another file having the same name with a read-only attribute.
80050003 The size of swizzle register is short.
The number of swizzling or masking patterns exceeds the upper limit.
80050005 ret instruction cannot be found for Label “label name.”
An ret instruction has not been set for the label.
An ret instruction is required for labels called as subroutines.
80050007 The number of label is too big.
The number of labels cannot exceed 65535.
8005000a The exceptional jump is detected.
An exceptional jump is being made.
See "Instructions That Cannot be Continuously Called."
8005000b Cannot jump out from if statement and loop statement.
An exceptional jump cannot be made using the jbp or jpc instructions from within a pair of ifc or ifb and endif instructions, or from within a pair of loop and endloop instructions.
8005000c breakc cannot be called just before endloop instruction.
The breakc instruction cannot be called immediately before an endloop instruction.
8005000d jpb and jpc cannot be called just before endloop instruction.
A jpb or jpc instruction cannot be called immediately before an endloop instruction.
8005000e jpb and jpc cannot be called just before endif instruction.
A jpb or jpc instruction cannot be called immediately before an endif instruction.
8005000f jpb and jpc cannot be called just before else instruction.
A jpb or jpc instruction cannot be called immediately before an else instruction.
80050010 jpb and jpc cannot jump into if statement and loop statement.
An internal jump using the jpb or jpc instruction cannot be made inside a pair of if and endif instructions or a pair of loop and endloop instructions.

8006xxxx

Error Code Message / Description
80060004 “operand” is invalid operand type.
An operand that is not supported by a shader instruction has been specified.
80060005 Value cannot be specified for “operand”.
A direct value cannot be specified for the operand.
80060006 Index cannot be specified for “operand”.
A register number cannot be specified for the operand.
80060007Component cannot be specified for “operand”.
A component cannot be specified for the operand.
80060009 ‘ - ’ cannot be specified for "operand".
"-" cannot be specified for the operand.
8006000b Offset index cannot be specified for “operand”.
An index offset cannot be specified for the operand.
8006000c Address register offset cannot be specified for “operand”.
An address register index offset cannot be specified for the operand.
8006000d Loop counter register offset cannot be specified for “operand”.
A loop counter index offset cannot be specified for the operand.
8006000e Loop counter register and address register cannot be specified together.
A loop counter register and address register cannot be specified at the same time.
8006000f Index is not specified in “operand”.
A register number has not been specified for the operand register.
80060010 Invalid index is specified in “operand”.
The register number of the operand exceeds the number of registers.
80060011 Invalid mask is specified for dest.
Masking has not been specified correctly for the operand dest.
Specify masking in the order of x, y, z, w.
80060012 Multiple constant registers cannot be specified at the same time.
More than one floating point constant register cannot be specified at the same time for an operand.
80060016 Src must have one of the following masks. .x|.y|.z|.w.
Either .x, .y, .z, or .w must be specified for swizzling for the src operand.
80060017Src0 and dest cannot be the same.
The same register cannot be specified for src0 and dest.
80060018 Src0 cannot have any swizzle except the default swizzle (.xyzw)
Swizzling other than .xyzw cannot be specified src0.
80060019 Dest must have one of the following masks. .x|.y|.z|.xy|.xz|.yz|.xyz.
Any one of .x, .y, .z, .xy, .xz, .yz, or .xyz must be specified as the masking for dest.
8006001b Dest must have “mask pattern” mask.
The masking indicated by the mask pattern must be specified for dest.
8006001f Dest and src0 cannot be the same.
The same register cannot be specified for dest and src0.
80060020 Dest and src cannot be the same.
The same register cannot be specified for dest and src.
80060021 Src0 must have one of the following masks. .x|.y|.z|.w.
Any one of .x, .y, .z, or .w must be specified as the swizzling for src0.
80060022 Src1 must have one of the following masks. .x|.y|.z|.w.
Any one of .x, .y, .z, or .w must be specified as the swizzling for src1.
80060023 Dest and src1 cannot be the same.
The same register cannot be specified for dest and src1.
80060024 All operand must be the different register.
All operands must have a different register.
80060025 Dest must have one of the following masks. .x|.y|.xy.
Any one of .x, .y, or .xy must be specified as the masking for dest.
80060026 Source modifier and swizzling cannot be specified for src1 and src2.
Swizzling and negative signs cannot be specified for src1 and src2.
80060028 Dest and src1 cannot be the same.
The same register cannot be specified for dest and src1.
80060029 Src1 cannot have any swizzle except the default swizzle (.xyzw)
Swizzling other than .xyzw cannot be specified for src1.
8006002a Dest must have one of the following masks. .x|.y|.z|.xy|.xz|.yz|.xyz.
Any one of .x, .y, .z, .xy, .xz, .yz, or .xyz must be specified as the masking for dest.
8006002c Source modifier and swizzling cannot be specified for src1.
Swizzling and negative signs cannot be specified for src1.
8006002d Source modifier and swizzling cannot be specified for src2.
Swizzling and negative signs cannot be specified for src2.
8006002e Invalid index is specified in “operand”.
An invalid register number has been specified by the operand.
The m4x4 and other instructions specify the first number of the register for the operand. Check whether the register number used after macro expansion exceeds the maximum number of registers.
8006002f Constant register cannot be used for src0.
A floating point constant register cannot be used for src0.
80060030 Compare mode must be 0 or 1, 2, 3, 4, 5.
A value from 0 through 5 must be specified for the comparison mode used by the cmp instruction.
80060031 Status register bit must be 0 or 1.
A value of 0 or 1 must be specified for the status register value.
80060032 Condition mode is 0:OR 1:AND 2:OnlyStatus0 3:OnlyStatus1.
A condition mode of 0 (OR), 1 (AND), 2 (OnlyStatus0), or 3 (OnlyStatus1) must be specified.
80060033 Address register component must be x or y.
x or y must be specified for the address register component.
80060036 Src0 and src1 cannot be the same.
The same register cannot be specified for src0 and src1.
80060037 Src1 and src2 cannot be the same.
The same register cannot be specified for src1 and src2.
80060038 Dest and src2 cannot be the same.
The same register cannot be specified for dest and src2.
8006003b Loop count must be in the range [0, 255].
The loop count for an integer register defined in a defi instruction must have a value in the range 0 through 255.
8006003c Loop counter initial value must be in the range [0, 255].
The initial loop counter register value for an integer register defined in a defi statement must have a value in the range 0 through 255.
8006003d Loop counter step must be in the range [-128, 127].
The loop counter register increment value for an integer register defined in a defi statement must have a value in the range -128 through 127.
80060040 Multiple input registers cannot be specified at the same time.
More than one input register cannot be specified for an src operand at the same time. However, the same register can be registered twice at the same time.
Example)
add r0 , v0 , v0 // Does not result in an error
add r0 , v0, v1 // Results in an error

400xxxxx

Warning Code Warning Message / Description
40070001 Label “label name” is undefined.
The label cannot be found.
(This can be resolved through a link if another object includes the label.))
40070003 mova instruction both before else and after endif might cause hardware hang-up.
A hardware error may result if a mova instruction is included both immediately before an else instruction and immediately after an endif instruction. See "Malfunctions Caused by the mova Instruction."
40070004 mova instruction at both first and last code in loop statement might cause hardware hang-up.
A hardware error may result if a mova instruction is included both immediately after a loop instruction and immediately before an endloop instruction. See "Malfunctions Caused by the mova Instruction."
400a0001 The series of four instructions from here might cause hardware hang-up if this instruction stalled more than three clock cycles.
A series of four instructions matches conditions for a hardware malfunction. If execution stalls for three or more clock cycles on the error line, hardware may malfunction.
See "Malfunctions Caused by Executing Certain Instruction Sequences."
400a0002 The series of four instructions from here might cause hardware hang-up if this instruction stalled more than one clock cycle.
A series of four instructions matches conditions for a hardware malfunction. If execution stalls for two or more clock cycles on the error line, hardware may malfunction.
See "Malfunctions Caused by Executing Certain Instruction Sequences."
400a0003 mova instruction just before end instruction might cause hardware hang-up.
Hardware malfunction may result if a mova instruction is included immediately before an end instruction.
See "Malfunctions Caused by the mova Instruction."
400a0004 mova instruction just before the last instruction writing to output register might cause hardware hang-up.
Hardware malfunction may result if a mova instruction is followed by an instruction that writes to an output register, and then followed by an end instruction. See "Malfunctions Caused by the mova Instruction."
400a0005 mova instruction just before branch instruction might cause hardware hang-up if mova stalled for register dependency.
Hardware malfunction may result if a mova instruction is included immediately before a branch instruction, and execution stalls if a register depends on an instruction included even before that.
See "Malfunctions Caused by the mova Instruction."
400a0006 The mova instruction and the following two instructions might cause the hardware to hang if a 1-clock cycle stall occurs immediately after the mova instruction.
An illegal operation may occur if the instruction immediately after the mova instruction reads a temporary register and then the mova instruction and the following two instructions all read an input register or temporary register. For more information, see "Illegal Operations Caused by the Register Dependencies of Instructions Before and After the mova Instruction."

Revision History

2012/06/20
Added warning code 400a0006.
2011/12/20
Initial version.

CONFIDENTIAL