The sign of the number in the control byte identifies whether the byte or bytes that follow represent a literal pattern or byte to be repeated. A positive number (1 to 127) indicates that the bytes are literal. A negative number (-1 to -127), represented by the twos complement, indicates a repeated byte. The value of the number, if positive (literal), identifies the number of pattern bytes which follow the control byte; if negative (repeated), it identifies the number of times to repeat the following byte. A pattern byte may be repeated up to 127 times; or up to 127 literal bytes may follow the control byte.

As mentioned, for a byte to be repeated, the control byte must be a negative value as represented by the twos complement. For example, to repeat a pattern three times would require the twos complement of the number 3. The twos complement is computed as follows. The binary of 3 is 00000011. Complement each bit to get 11111100, then add one to this value to produce 11111101, the twos complement. The decimal value of this number, 253, used in the control byte, produces a repetition of 3 bytes for a total of 4 occurrences of the pattern.

The range of numbers for the control byte is shown below.

Literal Pattern Values

 

 

# of Bytes

Binary value

Decimal value

 

1

0000 0000

1

 

to

to

to

127

0111 1111

127

No Operation Value

 

 

NOP value

Binary value

Decimal value

128

(-128)

1000 0000

128

Repeated Pattern

 

 

Values

 

 

# of Repetitions

Binary value*

Decimal value

1

(-1)

1111 1111

255

 

to

to

to

127

(-127)

1000 0001

129

*These negative values are represented by taking the twos complement of the value of the number.

6-22 Raster Graphics

EN

Page 142
Image 142
HP L 5 manual # of Bytes Binary value Decimal value 0000 127 0111