pTAL Conversion Guide

pTAL Built-In Routines
pTAL Conversion Guideβ€”527302-002
18-36
$MOVEANDCXSUMBYTES
checksum input,output
uINT:variable
contains an initial value for the checksum. When $MOVEANDCXSUMBYTES
completes, checksum contains the newly computed checksum.
destaddr input,output
EXTADDR:variable
is the extended memory address to which $MOVEANDCXSUMBYTES moves
data. When $MOVEANDCXSUMBYTES completes, destaddr points to the
memory location following the last byte written.
srcaddr input,output
EXTADDR:variable
is the extended memory address from which bytes are read. When
$MOVEANDCXSUMBYTES completes, srcaddr points to the memory location
following the last byte read.
count input
uINT:value
is the number of bytes to move.
$MOVEANDCXSUMBYTES transfers count bytes from srcaddr to destaddr and
computes a checksum (bytewise exclusive β€œor”) on the data moved. When
$MOVEANDCXSUMBYTES completes, srcaddr points to the immediate right of the
last byte read, destaddr points to the immediate right of the last byte written, and
checksum holds the newly computed checksum.
$MOVEANDCXSUMBYTES does not ensure that the source and destination buffers
do not overlap.
Figure 18-14. TAL Code Equivalent to $MOVEANDCXSUMBYTES Routine
CODE(STRP 7);
STACK checksum, dest, source, count;
CODE(MBXX);
CODE(STRP 4);
STORE source, dest, checksum;