beautypg.com

12 preprocessor integer arithmetic, Preprocessor integer arithmetic – Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual

Page 96

background image

LeCroy Corporation

UWBTrainer Exerciser - Generation Script Language Reference Manual

88

10.12 Preprocessor Integer Arithmetic

You can declare a preprocessor DWORD variable, make arithmetic operations with it, and use it
in field and setting/parameter assignments.

Note: Arithmetic expressions are allowed only in numeric variable assignments. Some legal
expressions are.

• x = y + 2
• TX_FRAME ( Duration = (x+y)*7 )
• TX_FRAME ( x + 12 )

Examples

Main

{

x = 2

y = ( z = 12 ) + ( TX_PAYLOAD_OFFSET + 36 ) / 8

z = 0x1 << 5

s =

"Some Hex Data"

# Constants may be used in operations.

x++

y--

z += ( x + y )

x = ( ( y & 0xFF ) >> 5 ) / 12

Send

TX_FRAME ( Delay = x )

Send

TX_FRAME

{

SrcAddr = 0xEEEE

# Example of a data payload assignment that uses

# integer variables, constants, hex literals,

# and a data pattern

.

Data = { y y y

7a7a7a

"Some Hex Data"

"Some Hex Data"

8b 8b 8b

z z z [PATTERN_3] }

}

( Delay = y )

# Use an integer variable for a parameter setting.

}