SourcePoint AMD Help

Table of Contents

Constants

Integer Constants

Integer constants are of the form:

[0y | 0Y]{0-1}+[y | Y] ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // binary constant

[0o | 0O]{0-7}+[q | Q] ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // octal constant

[0n | 0N]{0-9}+[t | T] ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // decimal constant

[0x | 0X]{0-9 | a-f | A-F}+[h | H] ย ย ย ย ย // hex constant

{0-9}+{k | K} ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // Kb

{0-9}+{m | M} ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // Mb

In the absence of an explicit base prefix or suffix, the default number base is specified by the base control variable.

Examples

10t ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // constant is decimal and has value 10

0n10 ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // constant is decimal and has value 10

10y ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // constant is binary and has value 2

ย 

base = hex

10 ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // constant has value 16 decimal

ย 

base = dec

10 ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // constant has value 10 decimal

Floating Point Constants

Floating point constants are of the form:

[+ | -]{Digit}+.{Digit}*[Exp]

[+ | -]{Digit}*.{Digit}+[Exp]

[+ | -]{Digit}+[Exp]

Where:

ย ย Digit ย ย ย ย ย ย ย ย ย ย ย ย [0-9]

ย ย Exp ย ย ย ย ย ย ย ย ย ย ย ย ย [E | e][- | +]{Digit}+

Examples

.234

-1.1234

123.45e3

10e-5

Character Constants

Character constants follow the C language convention.

Examples

โ€™aโ€™ ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // value = 0x61

โ€™\tโ€™ ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // tab character

โ€™\\โ€™ ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // backslash character

โ€™\377โ€™ ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // octal value 377 = 255 decimal

String Constants

String constants follow the C language convention. ย Constants longer than 256 characters are truncated.

Examples

โ€abcdโ€ ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // abcd

โ€ab\\cdโ€ ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // ab\cd

โ€abcd\nโ€ ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย // abcd + newline character