all repos — xyw @ ff2041e3ed78ca47d3fd347c8b65e7927e1c6bd1

A minimal virtual machine and assembler for terminals.

Implemented lowcase utility.
h3rald h3rald@h3rald.com
Sat, 08 Aug 2026 14:40:56 +0000
commit

ff2041e3ed78ca47d3fd347c8b65e7927e1c6bd1

parent

a9215ea544b6ef9fbced607b89569ae8a887357e

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 +