![]() ZBasic System Library
244
ZBasic Microcontrollers
Type
Subroutine
Invocation
PutNibble(var, nibbleNumber, val)
Parameter
Method
Type
Description
var
ByRef
any type
The variable to which the nibble will be written.
nibbleNumber
ByVal
int8/16
The nibble number to write.
val
ByVal
Byte
The nibble value.
Discussion
This routine writes a single nibble (four bits) to memory beginning at the location of the specified variable.
Nibble numbers 0-1 are written to the byte at the specified location, nibble numbers 2-3 are written to the
subsequent byte, etc. In each case, the lower nibble number corresponds to the least significant four bits
of the byte while the higher nibble number corresponds to the most significant four bits of the byte.
Only the least significant four bits of the val parameter is used; the remaining bits are ignored.
Caution
If you specify a nibble number beyond the number of nibbles in the specified variable, a byte in memory
following the variable will be modified, perhaps with undesirable results.
Compatibility
This routine is not available in BasicX compatibility mode.
See Also
|