Implemented lowcase utility.
h3rald h3rald@h3rald.com
Sat, 08 Aug 2026 14:40:56 +0000
1 files changed,
23 insertions(+),
0 deletions(-)
jump to
A
examples/lib/lowcase.xyw
@@ -0,0 +1,23 @@
+;.include "lib/macros.xyw" + +; Convert a string to lowercase +; a16 -[xw]- +.label lowcase + ; store index + POPxw + .label lowcase.loop + LDBxw $00 EQU lowcase.end JCNw + ; check if an uppercase letter + LDBxw $40 GTH + LDBxw $5B LTH + AND lowcase.change JCNw + ; continue + INCxw lowcase.loop JMPw + .label lowcase.change + ; convert to lowercase + LDBxw $20 ADD STBxw + ; continue + INCxw lowcase.loop JMPw + .label lowcase.end + RTS +