Function XMoBlock() Foundation
Builds a block for the XModem protocol.
XMoBlock( <cString> , ;
<nBlocknumber>, ;
[<lCRC>] , ; // Default: .F.
[<nMode>] ; // Default: 1
) --> cXModemBlock
Returns an XModem block if the block could be built or a null string ("") in case of an error.
Parameters:
1 -> 128-byte blocks
2 -> 1024-byte blocks
128-byte-blocks
----------------
Each block of the transfer in checksum mode looks like:
<SOH><blk #><255-blk #><--128 data bytes--><cksum>
in which:
<SOH> = 01 hex
<blk #> = binary number, starts at 01 increments by 1, and
wraps 0FFH to 00H (not to 01)
<255-blk #> = blk # after going thru 8080 "CMA" instr, i.e.
each bit complemented in the 8-bit block number.
Formally, this is the "ones complement".
<cksum> = the sum of the data bytes only. Toss any carry.
Each block of the transfer in CRC mode looks like:
<SOH><blk #><255-blk #><--128 data bytes--><CRC hi><CRC lo>
in which:
<SOH> = 01 hex
<blk #> = binary number, starts at 01 increments by 1, and
wraps 0FFH to 00H (not to 01)
<255-blk #> = ones complement of blk #.
<CRC hi> = byte containing the 8 high order coefficients
of the CRC.
<CRC lo> = byte containing the 8 low order coefficients
of the CRC.
1024-byte-blocks
-----------------
Each block of the transfer in checksum mode looks like:
<STX><blk #><255-blk #><--1024 data bytes--><cksum>
<STX> = 02 hex
<blk #> = binary number, starts at 01 increments by 1, and
wraps 0FFH to 00H (not to 01)
<255-blk #> = blk # after going thru 8080 "CMA" instruction, i.e.
each bit complemented in the 8-bit block number.
Formally, this is the "ones complement".
<cksum> = the sum of the data bytes only. Toss any carry.
Each block of the transfer in CRC mode looks like:
<STX><blk #><255-blk #><--1024 data bytes--><CRC hi><CRC lo>
in which:
<STX> = 02 hex
<blk #> = binary number, starts at 01 increments by 1, and
wraps 0FFH to 00H (not to 01)
<255-blk #> = ones complement of blk #.
<CRC hi> = byte containing the 8 high order coefficients
of the CRC.
<CRC lo> = byte containing the 8 low order coefficients
of the CRC.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.