all repos — xyw @ c76de92129a7fdbd05ff946d569771a63b20e346

A minimal virtual machine and assembler for terminals.

Merge branch 'master' of git.sr.ht:~h3rald/xyw
h3rald h3rald@h3rald.com
Mon, 10 Aug 2026 04:43:11 +0000
commit

c76de92129a7fdbd05ff946d569771a63b20e346

parent

8aaa333e3496dd357da4457bdb2f781ae1a685c6

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