LEX 'CASEFLIP' ID #53 MSG 0 POLL 0 ENTRY CSW$ CHAR #F KEY 'CSW$' TOKEN #19 NIBHEX 1FF ***************************************************** * * Syntax: A$=CSW$(B$) * if LC ON - toggles alphabetical characters from * uppercase to lowercase, and vice-versa * if LC OFF - then A$=B$ ***************************************************** NIBHEX 4411 CSW$ CD1EX R0=C D1=(5) #2F6DC here, the status of the LC ON/OFF flag is C=DAT1 B checked. CSW$ works only if LC ON mode! ST=C ?ST=0 2 GOYES CSWend C=R0 D1=C A=0 W GOSBVL POP1S ASRB the string length, nibbles, after POP1S ASL W ASL W ASL W LCHEX 20 the value used to convert alphabetical bytes B=C A B(A) is storage for value D1=D1- 2 CSW$20 D1=D1+ 2 A=A-1 M the string length, our loop counter GOC CSWend done. let's quit. A=DAT1 B LCHEX 41 is it an upper case, 41A B GOYES CSW$20 no, process next character, neither upper LCHEX 5A or lowercase. ?CA B below lowercase? GOYES CSW$20 yes, do next character A=A-B B it is a lowercase, convert! CSW$30 DAT1=A B store it GOTO CSW$20 and process next character CSWend C=R0 restore pointers and exit D1=C GOVLNG EXPR POP1S EQU #0BD38 EXPR EQU #0F23C END