Constants in SH-4 Inline Assembly (Windows CE 5.0)

Send Feedback

Because the SH-4 Series assembler does not support character constants, SH-4 inline assembly supports only integer constants.

Express integer constants with a prefix that indicates the radix. The radix prefix indicates the base of the constant. The following table lists integer types and their radix prefix.

Integer Base Prefix
Binary Numbers The radix indicator B' or b' plus a binary constant
Octal Numbers The radix indicator Q' or q' or 0 plus an octal constant
Decimal Numbers The radix indicator D' or d' plus a decimal constant
Hexadecimal Numbers The radix indicator H' or h' or 0x Or OX plus a hexadecimal constant

The radix indicator and the constant value must be written with no intervening space.

The following code example shows how to define integer constants in a __asm block.

__asm("cmp/eq  #0xff, r0" );     // Hexadecimal number
__asm("cmp/eq  #H'ff, r0" );     // Hexadecimal number
__asm("cmp/eq  #255, r0" );      // Decimal number
__asm("cmp/eq  #d'255, r0" );    // Decimal number
__asm("cmp/eq  #b'10, r0" );     // Binary number
__asm("cmp/eq  #B'10, r0" );     // Binary number
__asm("cmp/eq  #Q'10, r0" );     // Octal number
__asm("cmp/eq  #010, r0" );     // Octal number

See Also

Elements of the SH-4 __asm Block

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.