Algorithm for Expanding ASCII Character to 320 Mode Characters on an IBM Personal Computer
Original Publication Date: 1987-Feb-01
Included in the Prior Art Database: 2005-Jan-31
This algorithm makes it possible to transform a character, such as an "A," from an ASCII code to a pel pattern in 320 mode, rapidly, simply and efficiently. This algorithm takes 1 byte and expands it into 2 bytes by doubling each bit. To accomplish this, the AL register contains one line of the bit pattern for the character. The CX register is set to all zeroes except the 15th bit (10000000 0000000). Each bit of AL is transferred to the CX register through the carry flag. As the bit is transferred to the high end of the CX register, the low end of the register is shifted out, into the carry flag. Bit 15 of the CX register, a one bit, is shifted also and eventually, when all bits are doubled, is shifted into the carry flag.