Added upcase subroutine
h3rald h3rald@h3rald.com
Sat, 08 Aug 2026 17:08:18 +0200
1 files changed,
22 insertions(+),
0 deletions(-)
jump to
A
examples/lib/upcase.xyw
@@ -0,0 +1,22 @@
+;.include "lib/macros.xyw" + +; Convert a string to uppercase +; a16 -[xw]- +.label upcase + ; store index + POPxw + .label upcase.loop + LDBxw $00 EQU upcase.end JCNw + ; check if a lowercase letter + LDBxw $60 GTH + LDBxw $7B LTH + AND upcase.change JCNw + ; continue + INCxw upcase.loop JMPw + .label upcase.change + ; convert to uppercase + LDBxw $20 SUB STBxw + ; continue + INCxw upcase.loop JMPw + .label upcase.end + RTS