lengthw.xyw
lengthw.xyw; Pushes the length of s
; s -> w
.label lengthw
POPxw ; store start address
$0000 POPyw ; counter
.label lengthw.loop
; if at end of string, go to end
LDBxw $00 EQU lengthw.end JCNw
; otherwise increment address and counter
INCxyw
lengthw.loop JMPw
.label lengthw.end
PSHyw RTS