all repos — xyw @ 875f8bc84268a02c4ea122b43b182e3f019bb689

A minimal virtual machine and assembler for terminals.

Added upcase subroutine
h3rald h3rald@h3rald.com
Sat, 08 Aug 2026 17:08:18 +0200
commit

875f8bc84268a02c4ea122b43b182e3f019bb689

parent

ff2041e3ed78ca47d3fd347c8b65e7927e1c6bd1

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