3 ms·
*p+++=0x20, for when you are converting an uppercase string to lowercase
- watergatorman 8y agoAssume ASCII characters: ORD('a') - ORD ('A') = 32 IF ('A' <= ch) & (ch <= 'Z') THEN ch := CHR(ORD(ch) + 32) END
- ksaj 8y agoBack 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.
- deleted 8y ago[deleted]