pTAL Conversion Guide

pTAL Built-In Routines
pTAL Conversion Guide527302-002
18-17
$CHECKSUM
The result of $BADDR_TO_WADDR is undefined if the least significant bit of
expression is 1. The least significant bit of an address is not truncated when a byte
address is converted to a word address—the address is not rounded down to the
preceding even-byte address.
$CHECKSUM
$CHECKSUM computes the checksum of data in extended memory.
checksum input,output
uINT:variable
is the initial value (“seed” value) of the checksum. When $CHECKSUM completes,
checksum holds the final checksum. checksum must be an INT variable; it
cannot be a STRING, UNSIGNED, or USE variable or a bit field.
bufferaddr input
EXTADDR:value
is the extended memory address of the first 16-bit word to include in the checksum.
wordcount input
uINT:value
is the number of 16-bit words to include in the checksum.
Example 18-9. Call to $BADDR_TO_WADDR Routine
INT .i;
STRING s;
@i := $BADDR_TO_WADDR(@s); ! @s is a BADDR address
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW No
( checksum , bufferaddr
,
) ;
VST613.vsd
wordcount
$CHECKSUM