Implemented trimend subroutine.
h3rald h3rald@h3rald.com
Sat, 15 Aug 2026 16:27:40 +0000
1 files changed,
22 insertions(+),
0 deletions(-)
jump to
A
examples/lib/trimend.xyw
@@ -0,0 +1,22 @@
+; .include "lib/oneof.xyw" + +; Remeve space chats at end of string +; a16 -> +.label trimend + ; save string address + POPxw + .label trimend.toend + LDBxw $00 EQU trimend.loop JCNw + ; increment till end + INCxw trimend.toend JMPw + .label trimend.loop + DECxw PSHxw trimend.spaces oneof JSRw + ; if space, remove and decrement + trimend.remove JCNw + ; otherwise return + RTS + .label trimend.remove + $00 STBxw trimend.loop JMPw + +.label trimend.spaces + .byte $20 $09 $0A $0D $00