System Debug Reference Manual (32650-90888)

364 Chapter10
System Debug Standard Functions
func bitx
Deposit the value 0 into the last two bits of XX.
$nmdebug > wl bitd(3,-#1,2,xx)
$c015381f
Deposit the value 3 (11) into XX, ENDING at bit position 1.
$nmdebug > wl bitd(2d,-#9,6,xx)
$4b55381f
Deposit the value 2d (101101) into XX, ending at bit position 9 with a length of 6 (start
position would be 4).
Limitations, Restrictions
The value to be deposited is truncated as necessary on the left to fit within the field width
of
length
.
If an extended address
target
is passed, the deposit location must fall entirely within the
64-bit offset part. Since EADDR types have a total of 96 bits, the valid bit positions are 32
through 95.
func bitx
Bit extract. Extracts a range of bits from an expression.
Syntax
bitx (
source position length
)
Formal Declaration
bitx:any (
source
:any
position
:s16
length
:u16)
Parameters
source
The value from which to extract a range of bits. Its type is restricted to the
INT and PTR classes.
position
This parameter specifies the starting bit position (positive value), or the
ending bit position (negative value) of the extraction. Regardless of the
size of the
source
value, bit positions are always numbered from left to
right. The leftmost bit of the
source
is bit 0.
length
The number of bits to extract. This value may not exceed 64.
This function is sensitive to the type of the
source
parameter. If a S32 or U32 value is
passed, the format of the word (start/end positions) is as follows:
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1