3.2.1.3 Run 2

Prepare the next run by resetting the run information. The run information is now as follows.

 Control byte: 0x00
 Control bit:  0x01
 Token offset: 0x00
 Token buffer: 00 0a 00 72 63 70 67 31-32 00 00 00 00 00 00 00

Note that there is no need to overwrite data in the token buffer; that will be done as tokens are added.

 Current Dictionary (WritePosition=229):
       0         1         2         3         4         5         6
       01234567890123456789012345678901234567890123456789012345678901234
 0000: {\rtf1\ansi\mac\deff0\deftab720{\fonttbl;}{\f0\fnil \froman \fswi
 0065: ss \fmodern \fscript \fdecor MS Sans SerifSymbolArialTimes New Ro
 0130: manCourier{\colortbl\red0\green0\blue0__\par \pard\plain\f0\fs20\
 0195: b\i\u\tab\tx{\rtf1\ansi\ansicpg125
  
 Nonprintable characters:
  Position:0168 Byte:0x0d
  Position:0169 Byte:0x0a

Input data is "2\pard hello world}<CR><LF>".

Add literal '2'; run information is as follows.

 Control byte: 0x00
 Control bit:  0x02
 Token offset: 0x01
 Token buffer: 32 0a 00 72 63 70 67 31-32 00 00 00 00 00 00 00

Input data is now "\pard hello world}<CR><LF>".

Add a dictionary reference (0x0af3) for the match of length 5 at offset 175 (matching "\pard"); the run information is as follows.

 Control byte: 0x02
 Control bit:  0x04
 Token offset: 0x03
 Token buffer: 32 0a f3 72 63 70 67 31-32 00 00 00 00 00 00 00

Input data is now " hello world}<CR><LF>".

Add literal ' '; the run information is as follows.

 Control byte: 0x02
 Control bit:  0x08
 Token offset: 0x04
 Token buffer: 32 0a f3 20 63 70 67 31-32 00 00 00 00 00 00 00

Input data is now "hello world}<CR><LF>".

Add a literal 'h'; the run information is as follows.

 Control byte: 0x02
 Control bit:  0x10
 Token offset: 0x05
 Token buffer: 32 0a f3 20 68 70 67 31-32 00 00 00 00 00 00 00

Input data is now "ello world}<CR><LF>".

Add a literal 'e'; the run information is as follows.

 Control byte: 0x02
 Control bit:  0x20
 Token offset: 0x06
 Token buffer: 32 0a f3 20 68 65 67 31-32 00 00 00 00 00 00 00

Input data is now "llo world}<CR><LF>".

Add literal 'l'; the run information is as follows.

 Control byte: 0x02
 Control bit:  0x40
 Token offset: 0x07
 Token buffer: 32 0a f3 20 68 65 6c 31-32 00 00 00 00 00 00 00

Input data is "lo world}<CR><LF>".

Add dictionary reference (0x0900) for a match of length 2 at offset 144 (matching "lo"); the run information is as follows.

 Control byte: 0x42
 Control bit:  0x80
 Token offset: 0x09
 Token buffer: 32 0a f3 20 68 65 6c 09-00 00 00 00 00 00 00 00

Input data is now " world}<CR><LF>".

Add literal ' '. Because the control bit is 0x80, the run is now complete. The run information is as follows.

 Control byte: 0x42
 Control bit:  0x80
 Token offset: 0x0a
 Token buffer: 32 0a f3 20 68 65 6c 09-00 20 00 00 00 00 00 00

Write the run to the output, which is now as follows.

 Output cursor: 0x26
  
 000000: 00 00 00 00 00 00 00 00-4c 5a 46 75 00 00 00 00
 000010: 03 00 0a 00 72 63 70 67-31 32 35 42 32 0a f3 20
 000020: 68 65 6c 09 00 20 00 00-00 00 00 00 00 00 00 00
 000030: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00