I am trying to convert from lower case to upper case. I know it can easily be done by,
SUB AL, 20H
But I am have been given another solutio
Look at the bit patterns:
0100 0001
0110 0001
0100 1101
0110 1101
0101 1010
0111 1010
Lower case ASCII is upper case ASCII + 0x20 (0010 0000
) - i.e. the same bit pattern with the sixth bit set.
0xdf is 1101 1111
in binary. AND:ing AL with that will set the sixth bit to zero but preserve the other bit values.