SOUND ManualSCSP / DSP Assembler User's Manual
BackForward
SCSP / DSP Assembler User's Manual

3. Source code configuration


■ Source code format

● Configuration and format

The structure and format of the dAsms source code is as shown below.


#COEF ← Label indicating the start of coefficient symbol definition --------------------------

(Coefficient symbol definition formula)

--------------------------

#ADRS ← Label indicating the start of address symbol definition --------------------------

(Address symbol definition formula)

--------------------------

#PROG ← Label indicating the start of program description --------------------------

(Address symbol definition formula)

--------------------------
#END ← Label indicating the end of program description

● Comment (commentary text)

■ Definition of coefficient / address symbol

● Definition format

………………………………………………
(Symbol name) = (Initial value)
………………………………………………

However,

(Symbol name):
"Variable name" to be used as coefficient / address data in DSP program description. A character string of up to 15 single-byte alphanumeric characters.

(initial value):
The default value given to the "variable" represented by the above symbol name. Describe in one of the various notations specified separately.

caution
One symbol can be defined for each line of the definition formula, and the initial value must be given to each symbol.

● Number of user-definable symbols

Coefficient symbol : 63 pieces
Address symbol : 32 pieces

● About reservation symbols

Since the coefficient symbol "ZERO" is predefined, the user should not newly define the same symbol name. The initial value given to this symbol is "0", and that data is placed at the beginning of the coefficient data part of the executable program. Therefore, the user-defined coefficient symbols are placed in the order of definition after the second of the coefficient data part.

caution
This reserved symbol "ZERO" can be used in the program part of the source code created by the user without being defined in the coefficient definition part, but its value can be used (on the executable program or on the DSP hardware on which it is loaded). Do not change (under any circumstances, such as above).

● Notation mode in the coefficient / address definition part on the source code

The following notation modes can be used in the coefficient / address definition part.

 Definition part
 Notation mode
 Identifier
 example
 Conversion method
 Example conversion result
 #COFF
 Hexadecimal notation
 [& H]
 & HOFFF
 No conversion
 & HFFF
 Decimal notation
 None
 one two Three
 Decimal → hexadecimal
 & H007B
 %labels
 [%]
 % 50
 (1)
 & H0800
 Decimal notation
 [.]
 0.25
 (2)
 & H0400
 #ADRS
 Hexadecimal notation
 [& H]
 & H8000
 No conversion
 & H8000
 Decimal notation
 None
 one two Three
 Decimal → hexadecimal
 & H007B
 Millisecond notation
 [Ms]
 ms300.0
 (3)
 & H33AE

The " Conversion method " item shows how to convert " value in each notation mode-> actual data".
The conversion methods (1) , (2) , and (3) are as follows.

(1) (Factor value) = 4095 × (Notation value) / 100
(2) (Factor value) = 4096 × (Notation value)
(3) (Address constant value) = 44100 × (Notation value) / 100

* Note the difference between the constants (1) and (2) ( 4095 and 4096 ).

* All of (1), (2), and (3) shall be calculated in floating point, and the result shall be rounded to zero in the end.

* The format of the converted actual data (on the EXC file) is as follows.

 Definition part
 Actual data format
 #COEF
 Hexadecimal in 13bit2's complement format
 #ADRS
 Hexadecimal in 16-bit linear format

● Coefficient / address symbol Range of values that can be used as initial values, and format

 Definition part
 Notation mode
 range
 Form
 # COEF
 Hexadecimal notation
 1000 ~ 0FFF [hex]
 Hexadecimal signed integer (13 bits wide)
 Decimal notation
 −4096 to +4095 [dec]
 Decimal signed integer
 %labels
 -100 to +100 [%]
 Decimal signed integer
 Decimal notation
 −1.0 to +0.99975 [dec]
 Decimal signed decimal (up to 1 decimal digit, 5 decimal digits)
 # ADRS
 Hexadecimal notation
 0 to FFFF [hex]
 Hexadecimal unsigned integer (16-bit width)
 Decimal notation
 0 to 65535 [deci]
 Decimal unsigned integer
 Millisecond notation
 0.0 to 1486.0 [ms]
 Decimal unsigned decimal (up to 4 digits for the integer part and 1 digit for the decimal part)

Example: The following expression can be made in the coefficient / address definition part of the source code.

#COEF
CoefA = & H0FFF
CoefB = 123
CoefC =% 50
CoefD = 0.25

#ADRS
AdrsA = & H8000
AdrsB = 123
AdrsC = ms300.0


BackForward
SOUND ManualSCSP / DSP Assembler User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997