RosettaCodeData/Task/String-length/Uxntal/string-length.uxnatl

32 lines
474 B
Plaintext

%DBG { [ LIT2 01 -System/debug ] DEO }
|0e @System/debug
|100
@on-reset ( -> )
;my-string slen-bytes ( 0007 )
;my-string slen-chars ( 0005 )
DBG
BRK
@next-glyph ( addr* -- addr* )
INC2 LDAk #06 SFT #02 EQU ?next-glyph
JMP2r
@slen-chars ( str* -- len* )
LIT2r 0000
&>loop ( -- )
INC2r next-glyph LDAk ?&>loop
POP2 STH2r
JMP2r
@slen-bytes ( str* -- len* )
STH2k
&>loop
INC2 LDAk ?&>loop
STH2r SUB2
JMP2r
@my-string "møøse $1