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 solution which is,
AND AL, 0DFH
Please help me understand this. Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Look at the bit patterns:
0100 00010110 00010100 11010110 11010101 10100111 1010Lower case ASCII is upper case ASCII + 0x20 (
0010 0000) – i.e. the same bit pattern with the sixth bit set.0xdf is
1101 1111in binary. AND:ing AL with that will set the sixth bit to zero but preserve the other bit values.