RosettaCodeData/Task/Stack-traces/Uxntal/stack-traces.uxnatl

52 lines
618 B
Plaintext

%\n { 0a }
%\s { 20 }
%\0 { 00 }
%DBG { [ LIT2 -True -System/debug ] DEO }
%newline { [ LIT2 \n -Console/write ] DEO }
|1 @True
|0e @System/debug $1
|18 @Console/write $1
|100
foo
DBG
BRK
@foo ( -- )
#c0de
;msgs/foo print/dbg
DBG newline
bar
JMP2r
@bar ( -- )
#cafe
;msgs/bar print/dbg
DBG newline
baz
JMP2r
@baz ( -- )
#f00d
;msgs/baz print/dbg
DBG newline
JMP2r
@print/str ( str* -- )
LDAk .Console/write DEO
INC2 LDAk ?/str
POP2 JMP2r
@print/dbg ( str* -- )
;msgs/inside /str
( str* ) !/str
@msgs [
&inside "Inside \s "of: \s \0
&foo "foo. \n \0
&bar "bar. \n \0
&baz "baz. \n \0 ]