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

3. Source code structure


■Source code format

●Configuration and format

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


#COEF              ←Label indicating 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 the program description

●Comment (annotation text)

■Coefficient/address symbol definition

●Definition format

……………………………………………
(symbol name)=(initial value)
……………………………………………

however,

(Symbol name):
"Variable name" used as coefficient/address data while writing a DSP program. A string of up to 15 half-width alphanumeric characters.

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

Note
One symbol can be defined per line of the definition formula, and an initial value must be given to each symbol.

●Number of symbols that can be defined by the user

coefficient symbol :63 pieces
address symbol :32 pieces

●About reserved symbols

Since the coefficient symbol "ZERO" has already been defined, the user must not define a new symbol name with the same name. The initial value given to this symbol is "0", and its data is placed at the beginning of the coefficient data part of the executable program. Therefore, user-defined coefficient symbols are placed in the order of their definition in the coefficient data part.

Note
This reserved symbol "ZERO" can be used in the program part of the source code created by the user without defining it in the coefficient definition part, but its value (on the executable program or on the DSP hardware loaded with it) (above, etc.) must not be modified in any way.

●Notation mode in the coefficient/address definition part of 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
 %Notation
 [%]
 %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 " values in each notation mode → actual data ".
Conversion methods (1) , (2) , and (3) are as follows.

(1) (Coefficient value) = 4095 × (written value) / 100
(2) (Coefficient value) = 4096 × (written value)
(3) (Address constant value) = 44100 × (written value) / 100

* Please note the difference between constants ( 4095 and 4096 ) in (1) and (2).

* For all (1), (2), and (3), calculations are performed using floating point numbers, and the results are ultimately rounded toward zero.

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

 definition part
 Actual data format
 #COEF
 Hexadecimal number in 13bit 2's complement format
 #ADRS
 Hexadecimal number in 16bit linear format

●Value range and format that can be used as coefficient/address symbol initial value

 definition part
 Notation mode
 range
 Format
 #COEF
 Hexadecimal notation
 1000~0FFF[hex]
 Hexadecimal signed integer (13 bits wide)
 Decimal notation
 −4096 to +4095 [dec]
 decimal signed integer
 %Notation
 -100 to +100 [%]
 decimal signed integer
 Decimal notation
 −1.0 to +0.99975 [dec]
 Decimal signed decimal number (integer part 1 digit, decimal part up to 5 digits)
 #ADRS
 Hexadecimal notation
 0~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 number (up to 4 digits for integer part and 1 digit for decimal part)

Example: The following expression can be used 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