3 ms·
Back in the day we used to use OR 0x20 for tolower, and AND 0xBF as a quick toupper (straight up bit masking). It saved a bunch of clock ticks by not having to
by ksaj 8y ago
Back in the day we used to use OR 0x20 for tolower, and AND 0xBF as a quick toupper (straight up bit masking). It saved a bunch of clock ticks by not having to compare each character and jump past an ADD or SUB every time the letter was already in the desired state.
Of course you could XOR 0x20 if you wanted tO rEVERSE tHE cASE, but I'm not sure how useful that is.