MZ@ !L!This program cannot be run in DOS mode. $PEL N4 @@ @4K@`  H.textT  `.rsrc@@@.reloc `@B04H( }}}}*0>{o  8{ o X {?{b}*0{< (8T{,o %{X}{X{> (8{ o %{X}{rp o %{X}*0{< (8[{,o %{X}{Xo X{> (8{ o %{X}{rpo %{o X}*( }}} *0;{ s } {} {} }}*{ { }{ { }{ { } *&{X*0"{%{% Y}q*0W{i %{X% }@b {( }{{*f{{Yq*0U{{Yq {{YY{{Y( {{*0U{{q {{Y{{YY( {{Y*^{ { q*b{ { *j( } } *:( (*{*"}*{*"}*.rps z CrYp( s zo*0[  8X d  A97YZ 8%_d_ > `  oY <*0 < 8X c ?8 8X c @<9;YZ 8) _c_ >  `o Y <*:(}*0@98 {( (  @ X 8 (X *"}*0H{9(?{o< *{o((XY*0Z:o*9{( 8 {( (  @ rps z(X*:(}*f98 {(*9{(8 {(*r(}}}*0198 {( {{oX[X*0e9{(8 {( {{oX[ rp{{o( oX*V(}}*98 {({(X*059{(8 {( {(X *V(}}*98 {({(X*059{(8 {( {(X *( o(/ }}*{*"}*{*"}*{*0K{X {i>3{ib(   {{( }*0!(3{%{% X}*0>(3{%{% X}cҜ{%{% X}Ҝ*0[(3{%{% X}cҜ{%{% X}cҜ{%{% X}Ҝ*0x(3{%{% X}cҜ{%{% X}cҜ{%{% X}cҜ{%{% X}Ҝ*0R ( o iX(3{{i( {{iX%{iXX}*r?{Y>s z*J(9{*F(9{*z(9{b{X`*(9{b{Xb`{X`*(9{b{Xb`{Xb`{X`*0n s 8^(@ :o * <o &8/ Y   cXo &  _Xo &80 J{?s z{J% XT  ?  >* ?  _ 8 ?  _ 8 _ JX{>*88{JX ?  ?* b?_X X? >*JXT *0& 8{oX {?*( *.rps z.r ps z * * * * **"(N*:(B}*z{9 r-ps z}*6{o*v{: r]ps z{*F{os!*rp{: rp8 {o( *:(B}*6{o *0' |{lu :*oo*0$ |{lu :8o*0|{l:|(s'*|{lu 9-|{k9 rps zoos'*|{lu 9|{koo0Xs'*|{lu 9|{ks$*rp|{lo o ( s z *rr9p|o ( *:(B} *N{ oo *6{ s** *ZrGp{ ( *2 (a*:(B}!*{!*R%{{!X}*{! ; r[ps z}!*VX{!Xo*(`*"(a*0o  (9(c* *s*oI @rp*rpoI( *(`*"(a*0o  (:(c* *s*oI @rp*rpoI( *(`*"(a**oI*s*oI @rp*r/poI( *:(B}"*N{"o o*6{"s** *ZrEp{"( *(B*o* *s!*rYp*<<}#}$*{#*{$*6{#*f{#? {$+*{#{#@{${$+*{#{#@{${$+*u9q(+*R{#Z{$ZX*0S(:rap*(9rqp{#( *rp{#{$( *0g(9 (:*{#{#>*(9*(9*{#{$Y{#{$Y*fs%s&*0p sb ( }s })(1 s2 }+s3 }.(1 s4 }/}0s }2s }3}6rep~&cs^(&rup~&ds^(&r}p~&es^(&rp~&fs^(&rps~:-s^:~:(&rpgs^(&rp~&~;-s^;~;(&rphs^(&rpis^(&rpjs^(&rpks^(&rpls^(}rpms^(}rpns^(&r%p~<-s^<~<(&r3pos^(&rQpps^(&rspqs^(&rprs^(&rp~=-s^=~=(&rps~>-s^>~>(&rpss^(&rpts^(&rpus^(&r#pvs^(&r/pws^(&r;pxs^(&rGpys^(&rYpzs^(&r_p{s^(&rkp|s^(&rup}s^(&rp~s^(&rps^(&rps^(&rps^(&rps^(&rps^(&rps^(&rps^(&rps^(&rYps^(&rps~?-s^?~?(&rps~@-s^@~@(&rps~A-s^A~A(&r ps~B-s^B~B(&r ps~C-s^C~C(&r ps~D-s^D~D(&r# ps~E-s^E~E(&r- ps~F-s^F~F(&r7 pss^(&rps~G-s^G~G(&r; ps~H-s^H~H(&rC ps~I-s^I~I(&rG ps~J-s^J~J(&rK ps~K-s^K~K(&rQ ps~L-s^L~L(&rU ps~M-s^M~M(&r[ ps~N-s^N~N(&r_ ps~O-s^O~O(&re ps~P-s^P~P(&ri ps~Q-s^Q~Q(&ro ps~R-s^R~R(&rs ps~S-s^S~S(&ry ps~T-s^T~T(&r ps~U-s^U~U(&r ps~V-s^V~V(&r ps~W-s^W~W(&r ps~X-s^X~X(&r ps~Y-s^Y~Y(&r ps~Z-s^Z~Z(&r ps~[-s^[~[(&r ps~\-s^\~\(&r ps~]-s^]~](&r ps~^-s^^~^(&r ps~_-s^_~_(&r p~&~`-s^`~`(&r ps~a-s^a~a(&r ps~b-s^b~b(&r p~&~c-s^c~c(&r ps~d-s^d~d(&*0s  s    8zrpo : o Prp( 9-8X%i?o 8"8 o rpo :=o   <+o   Xi< X8 8& o o o   Xo    9}~9:ws   rpo!  rpo!  rpo!  rpo!  rpo!  rpo!  rpo!  rpo!  9~9 o" 9E5Z8 : :(X  9( ݣ : :(X   ~ : :(X   ,o# 8+o o >o Xi? (Xi?|o$ :(:rp o$ : rpo : s}6}7}8(% rpo& s' o9o( o) 8;(* rp(+ (, o9o( (- :o(  o. oo (/ (0 *Ad'ao>Q 0Mrp(/ rmp(/ rp(/ rp(/ rp(/ rp(/ rp(/ (0 *>~%(*0I{+o5 9r p( s zs[ oo{+o6 *0%{5% jX}5*0{( ? }(8) >Xe}( 8 {'o7  @A{(?{(  }(8 {'o7  ; }( *0^<*{(<'{( ; r% ps z}(8" ; rc ps z{(Xe}(*0{* 9 }**{)o8 8 ( <*(:88"@(*8:{)o &( ? (9({)o *80"( (9 r ps z*0( : r ps z*0~%8k( <*(:P(@2(9 (*((:*8{; (*88s  8M( <* {; };8X 8Y% :o *8 o &80    8(:~%*rp( 99~%* 8`r' p( 9#99 @  s*~%*9" :r+ p( 9 X 8X 8b0s "o &   8(< r/ ps z>I(<rc p( s z bX Y% :  o & 89[ uYE  ;8(8! 8 8(o &884";\; 8o * 8o &88rYEn;8  * * * **0Z8P( < r ps z @ r ps z(98"@*r ps z80o @o9 \;o9 *o ?o9 \@o9 x; u;-8Po @o ( ?*8Fo @o ( ?*8o @ o9 (*8r_ p( s z0>   8% o9 (<*bX X o ?*0A0? 9=0Y*A? F=7Y*a? f=WY**0K s 8;( <r p( s z@o *o &8& *0}'}(r ps^s[ s  %sN%ss }1o82{198'{%{%X} oC8*0( :{09 r ps z}1*( ( 9 9r p( s z{09V9{-o68: 9( o9 o8 {- o88 {-o7859 o 8# 9 o8r] p( s z*0{/o: &*0 (1 s2 s<  8<  o5 98 (oo6 o= X i?8qo> o"o? 87(@ oo5 9oo6 o= (A : o( oB ={69  8    oC   o%r p  o& o'(D  o&{7>rp r p(E s z o'{8>rp r p(E s z X   i?asF  oG oH 8ToI o#oJ 8(K  o.oL (M :o( oN :9o(  oO oP 8oQ o1o2XoN :9o( sR sR sS oG oH 8oI o(:(u"9rpo( s zݎoT 9>oU %%oV rQpo((E oW 8)%XoX o(oW ooX ooN :9o( oG oH !8B!oI   o(9"%X" o"oX  "o!oN :!9!o( Y#%&8%%&$$(9 rUps z&X&&%i?sY '#(oG oH *8H*oI ))o(9('oZ +)'o$()oY'+o[ *oN :*9*o( 'o\ ,#X ?rp(/ -8-.,i/8}08/0,0-o0X00,i?128+,21o,2/2o1/2X12X22,i?1.@8 1.8~rp( (] 33rpo^ 3rprpo_ 3o 5685643rp4o` 6X665i?3o 3rpo_ {2o) 888(* 73o 3rp7o_ 8(- :8o( 3o 3rpoa 3Ns99o oO oP ;8;oQ ::9oA;oN :;9;o( 3o 3rRpob 3o 3rXpoa 3Ns9,=>8=><<9-o&>X>>=i?3o 3rRpob 3o 3rpoa ?88?9 3,o 3o 3rp(?oo ?X??(i?3o 3rRpob 3o 3rpo_ 3o 3rprBpo_ 3o 3rprpo_ 3o AB88AB@3r0pr\p@(E @oC oo` BXBBAi?3o -93rprjpo_ 83rprpo_ 3o 3r& pob 3r0 po_ 3rprZ po_ sc Cod oe E8Eof DCDoU Dog EoN :E9Eo( Coh oi G8.G(j F3r33pFFoV CFok ol G(m :Go( 3r3pob {3o) I8I(* H3o 3rpHo_ I(- :Io( 393o( J,LM8LMKJK-oXJMXMMLi?N oO oP P8PoQ ONOo2XNPoN :P9Po( r4pJ(+ r5p(+ rH5p#X#(n *AT|M/j64jXo^'4[(1 # Dg  4 % * +U 0!( 9*r5p( s z0{+oo &*:ss*0(r5po 9o (*r5po 9o ((* rpo 9 o 8r7 po 9 o  r5po :r5po 9 o 8+r5po :r5po 9  o o :*  \8Mo9 (? jn?*C Z YC X Xo ? 9 C  e 9 r5ps z ( *0+(:r6po ( s z(*^{0: r@6ps z*0 s   8 o9 !?~=%; o &8 <rp6pop &8t <.r6pc `?_ `oq &8;r6p c `c?_ `?_ `or & X o ?-o r6pr6pos *0j!o  {lu:r:p( s zo ( o ( o s( o *.r<:ps zsy z0n"o  {lu : r8ps zo ( ?  >r69p( s zo{ko:*0E"o  {lu : r8ps zo{ko; ( o *"o &*:o o *"o *:o o *"o *"o *Jo (o *bo (o o *0#o  o  {lu {lu 92 9,o o@{k{kYso *(%{kY}ko *0o ( e( o *0'o ( o ( Z( o *0'o ( o ( [( o *0'$o ( o ( \( o *0'o ( o ( ]( o *0'$o ( o ( ^( o *0(o ( o ( (o *0+o ( o ( (o *0(o ( o ( (o *0+o ( o ( (o *0"%o  o  ((o *0%%o  o  ((o *0.&o  ( o  ( so *01&o  ( o  ( so *0.&o  ( o  ( so *0+$o ( o ( (o *0'$o ( o ( _( o *0'$o ( o ( `( o *0'$o ( o ( a( o *0'o ( f( o *0D(o ( ?> rv:ps zo ( _b( o *0Do ( ?> rv:ps zo ( _c( o *0D(o ( ?> rv:ps zo ( _d( o *0r:po  o (z *0;)o Y 8#r:po  o (z Y <*Fo (({ *0rpo  o (z *(| *0=*o  o o  o ( (o *"(*( *0a{( : r6ps z{{/ot 9r7p( s z{{/{(ou *0+s }{(}{: r6ps z{{s^( {{/{ot 9r7p{( s z{{/{{(ou o*r{{2{(o *r{{3{(o *0,{( : rB7ps z{( {( : r7ps z{( < r7ps z{(o s({{09{{- o68 o *0-{( : r6ps z{{09 {{.{{-ov 8 {}0{{s(}-{( : r7ps zr,8p( 99{( (: r08ps z{{-o*8 {}**0.o ( o ( o  {lu:rh8p( s zo {{09 {{.{{-ov 8 {}0{{ s(}-{{-so**0/{{0: r8ps z{{-o+ o {{+o5 9r p( s z{{+o6 {},{{.ow > {{{.ox }-8{}-{}0*{{,: r8ps z{{,o*{({{-o o6*0*{({{-o  (o=*0${({( : r6ps z{( {( 9 9r p( s z9,{{-o6{{-{o88 9X o9{{- o882{{- sso6{{-{o882{{-sso6{{-{o8*{{s-}4{{4sso *00o  o o  {lu : r8ps z{ o{ksG{{+o5 9r p( s z{{+o6 {},*0G{{4: r 9ps z{{4o2{{4sso *0b{{4: r 9ps zo ( ?  >r69p( s z{{4o4*00{({{-o  o o:*00{({{-o  o o;*r{({{-o?*r{({{-oC*r{({{-oD*r{({{-oF*r{({{-oE*r{({{-oA*r{({{-o@*r{({{-oB*{({{-o (o/*{({{-o (o.*00{( : rj9ps z{(o *0,1o ( {( {(o *0+{( < r9ps z( o *0{( sso *0o  {(*b{({}0*6{}0*00{({{-o  o o<*r{({{-o>*0%o  o  {l: %{k(X}ko 8s{lu9F{lu95{o o ( (o 8r9p( s z*( *Zr9p{( s z( * *Zr:po ( s zr:p( o} {k( **:((*~(s-((o8*{e*"}e*N({ko?*0 u 9(o+*r(}f}g}h*.r:ps z:{k(*0D:{f*>r0;p{f( *r\;p{fje,( *0K2{gjjX {hjjX  j< (( j> ((  (~ *0= j<8 X cj@88 X cj@*(* *r;p**u*V(((*j(o((*{i*"}i*{j*"}j*z(:(o(*R((o*Fr;p(( *0" u 9(o( +*>}k}l*>}k}l*n98}k}l*>}k}l*{l: {k*{lqo*{l:{k*r6po ( s z(*{l:rp{k( *{lqo*:(o*00 {lu :r:po ( s z*0T{k{k;*{l{l@*{l9 {l:*{l{lo*s*"is*s*s*s*s*s*s*"(*&(g*&(*&(h*&(*&(*"(*"(*( ((~%(*{m*"}m*{n*"}n*{o*"}o*{p*"}p*{q*"}q**Zr;p(( s z{r*"}r*s *s *.r;ps z*093( (:*(9*((Y(~ * *0\( }s}t}u}vs }ws }xsR }y}z~%(**{{*"}{*0{v; r&<ps z{z:"{w{wo Yo oH9(>{s{t{yo {wo {xo. sM ()o*&(-*{wo {xo }z*0C{u{vY {u{vYY{u{vY( {u{v*0{u{vY (0*0N4{ui %{vX% }v@b {u( }u{u{v*0{u%{v% Y}v*J{wo (0*V{wo eY(0*0(1 < rf<ps z*0(1 ? r<ps zeY*6sT(,*0k5re po 9o  8  {yo" 9(9sw(,8 s[(,8 sM(-*:sN(-*6sM(-*06{yo" 9s[(,8r<p( s z*06{yo" 9sw(,8r<p( s z*{yo 9r<p( s z{y{yo o *o:sMo(-8osN(,*2s|(,*J(2sr(,*J(2sf(,*J(2sl(,*0/(4 {wo {wo YYoE}z*(3*0"(5 {wo YYss(,*0"(5 {wo YYsg(,*0"(5 {wo YYsm(,*(}|}~s(*(}}}~s(*06{|9*{9r<p(( s z}({}ou  :r@=p({}( s zo{|}|%{~{~X}~}*o{~{|sso *07os {|o *os!o {|o0{~Xs'o s!o *((Q}(O*{*"}*{*"}*0Z1{:* 81{ :8(P(ooDX {i?}*fo(P(No*0J8os (P  8% (oF9o X i?*0J9os (P  8% (oG9o X i?*0:o(Pi   8(PoKX ? 8(P  oL X ?(Ns!o 8o X?*0Z @*;<r=p%(%%%( s z*0(;{ 9 ; 88*r>p(rp(E s z}(Pi   8  X ?    8(P  oH  u 9 (oFo%o(:rN>p(o( s z(9  8((Y o&X(   o'(   (Y(~  8 u9c @ 8F;=r>p%(%%%( s z8 oJ X(  X (~   oI9!XX%X(W&X 9(W:<%X888% }(NX X} @ e(8 e eX(((9O((:8r(?p(o (o ( s z8(}*6o%{*6o%{*B(}*J([(*6{o_*: \ `\n parse drop ; immediate \ This file defines the core non-native functions (mainly used for \ parsing words, i.e. not part of the generated output). The line above \ defines the syntax for comments. \ Define parenthesis comments. \ : ( `) parse drop ; immediate : else postpone ahead 1 cs-roll postpone then ; immediate : while postpone if 1 cs-roll ; immediate : repeat postpone again postpone then ; immediate : ['] ' ; immediate : [compile] compile ; immediate : 2drop drop drop ; : dup2 over over ; \ Local variables are defined with the native word '(local)'. We define \ a helper construction that mimics what is found in Apple's Open Firmware \ implementation. The syntax is: { a b ... ; c d ... } \ I.e. there is an opening brace, then some names. Names appearing before \ the semicolon are locals that are both defined and then filled with the \ values on stack (in stack order: { a b } fills 'b' with the top-of-stack, \ and 'a' with the value immediately below). Names appearing after the \ semicolon are not initialized. : __deflocal ( from_stack name -- ) dup (local) swap if compile-local-write else drop then ; : __deflocals ( from_stack -- ) next-word dup "}" eqstr if 2drop ret then dup ";" eqstr if 2drop 0 __deflocals ret then over __deflocals __deflocal ; : { -1 __deflocals ; immediate \ Data building words. : data: new-data-block next-word define-data-word ; : hexb| 0 0 { acc z } begin char dup `| = if z if "Truncated hexadecimal byte" puts cr exitvm then ret then dup 0x20 > if hexval z if acc 4 << + data-add8 else >acc then z not >z then again ; \ Convert hexadecimal character to number. Complain loudly if conversion \ is not possible. : hexval ( char -- x ) hexval-nf dup 0 < if "Not an hex digit: " puts . cr exitvm then ; \ Convert hexadecimal character to number. If not an hexadecimal digit, \ return -1. : hexval-nf ( char -- x ) dup dup `0 >= swap `9 <= and if `0 - ret then dup dup `A >= swap `F <= and if `A - 10 + ret then dup dup `a >= swap `f <= and if `a - 10 + ret then drop -1 ; \ Convert decimal character to number. Complain loudly if conversion \ is not possible. : decval ( char -- x ) decval-nf dup 0 < if "Not a decimal digit: " puts . cr exitvm then ; \ Convert decimal character to number. If not a decimal digit, \ return -1. : decval-nf ( char -- x ) dup dup `0 >= swap `9 <= and if `0 - ret then drop -1 ; \ Commonly used shorthands. : 1+ 1 + ; : 2+ 2 + ; : 1- 1 - ; : 2- 2 - ; : 0= 0 = ; : 0<> 0 <> ; : 0< 0 < ; : 0> 0 > ; \ Get a 16-bit value from the constant data block. This uses big-endian \ encoding. : data-get16 ( addr -- x ) dup data-get8 8 << swap 1+ data-get8 + ; \ The case..endcase construction is the equivalent of 'switch' is C. \ Usage: \ case \ E1 of C1 endof \ E2 of C2 endof \ ... \ CN \ endcase \ \ Upon entry, it considers the TOS (let's call it X). It will then evaluate \ E1, which should yield a single value Y1; at that point, the X value is \ still on the stack, just below Y1, and must remain untouched. The 'of' \ word compares X with Y1; if they are equal, C1 is executed, and then \ control jumps to after the 'endcase'. The X value is popped from the \ stack immediately before evaluating C1. \ \ If X and Y1 are not equal, flow proceeds to E2, to obtain a value Y2 to \ compare with X. And so on. \ \ If none of the 'of' clauses found a match, then CN is evaluated. When CN \ is evaluated, the X value is on the TOS, and CN must either leave it on \ the stack, or replace it with exactly one value; the 'endcase' word \ expects (and drops) one value. \ \ Implementation: this is mostly copied from ANS Forth specification, \ although simplified a bit because we know that our control-flow stack \ is independent of the data stack. During compilation, the number of \ clauses is maintained on the stack; each of..endof clause really is \ an 'if..else' that must be terminated with a matching 'then' in 'endcase'. : case 0 ; immediate : of 1+ postpone over postpone = postpone if postpone drop ; immediate : endof postpone else ; immediate : endcase postpone drop begin dup while 1- postpone then repeat drop ; immediate \ A simpler and more generic "case": there is no management for a value \ on the stack, and each test is supposed to come up with its own boolean \ value. : choice 0 ; immediate : uf 1+ postpone if ; immediate : ufnot 1+ postpone ifnot ; immediate : enduf postpone else ; immediate : endchoice begin dup while 1- postpone then repeat drop ; immediate \ C implementations for native words that can be used in generated code. add-cc: co { T0_CO(); } add-cc: execute { T0_ENTER(ip, rp, T0_POP()); } add-cc: drop { (void)T0_POP(); } add-cc: dup { T0_PUSH(T0_PEEK(0)); } add-cc: swap { T0_SWAP(); } add-cc: over { T0_PUSH(T0_PEEK(1)); } add-cc: rot { T0_ROT(); } add-cc: -rot { T0_NROT(); } add-cc: roll { T0_ROLL(T0_POP()); } add-cc: pick { T0_PICK(T0_POP()); } add-cc: + { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a + b); } add-cc: - { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a - b); } add-cc: neg { uint32_t a = T0_POP(); T0_PUSH(-a); } add-cc: * { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a * b); } add-cc: / { int32_t b = T0_POPi(); int32_t a = T0_POPi(); T0_PUSHi(a / b); } add-cc: u/ { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a / b); } add-cc: % { int32_t b = T0_POPi(); int32_t a = T0_POPi(); T0_PUSHi(a % b); } add-cc: u% { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a % b); } add-cc: < { int32_t b = T0_POPi(); int32_t a = T0_POPi(); T0_PUSH(-(uint32_t)(a < b)); } add-cc: <= { int32_t b = T0_POPi(); int32_t a = T0_POPi(); T0_PUSH(-(uint32_t)(a <= b)); } add-cc: > { int32_t b = T0_POPi(); int32_t a = T0_POPi(); T0_PUSH(-(uint32_t)(a > b)); } add-cc: >= { int32_t b = T0_POPi(); int32_t a = T0_POPi(); T0_PUSH(-(uint32_t)(a >= b)); } add-cc: = { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(-(uint32_t)(a == b)); } add-cc: <> { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(-(uint32_t)(a != b)); } add-cc: u< { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(-(uint32_t)(a < b)); } add-cc: u<= { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(-(uint32_t)(a <= b)); } add-cc: u> { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(-(uint32_t)(a > b)); } add-cc: u>= { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(-(uint32_t)(a >= b)); } add-cc: and { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a & b); } add-cc: or { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a | b); } add-cc: xor { uint32_t b = T0_POP(); uint32_t a = T0_POP(); T0_PUSH(a ^ b); } add-cc: not { uint32_t a = T0_POP(); T0_PUSH(~a); } add-cc: << { int c = (int)T0_POPi(); uint32_t x = T0_POP(); T0_PUSH(x << c); } add-cc: >> { int c = (int)T0_POPi(); int32_t x = T0_POPi(); T0_PUSHi(x >> c); } add-cc: u>> { int c = (int)T0_POPi(); uint32_t x = T0_POP(); T0_PUSH(x >> c); } add-cc: data-get8 { size_t addr = T0_POP(); T0_PUSH(t0_datablock[addr]); } add-cc: . { extern int printf(const char *fmt, ...); printf(" %ld", (long)T0_POPi()); } add-cc: putc { extern int printf(const char *fmt, ...); printf("%c", (char)T0_POPi()); } add-cc: puts { extern int printf(const char *fmt, ...); printf("%s", &t0_datablock[T0_POPi()]); } add-cc: cr { extern int printf(const char *fmt, ...); printf("\n"); } add-cc: eqstr { const void *b = &t0_datablock[T0_POPi()]; const void *a = &t0_datablock[T0_POPi()]; T0_PUSH(-(int32_t)(strcmp(a, b) == 0)); } BSJB v4.0.30319l/#~t/#Strings N ^ n ~           . > N ^ f<<(.0j4nH\<cy0<n<rv_~\y0f<\0FS`|n < P }t ]  +\!!}$"b 0k"`"h " =" B?#r P \#w - #{ - !$ P 9$ [ R$}bm$}|$ $ -$ $ -$ i o t$ {$ {@%%}% o(& i4& & t &}"& o#' t$<'}&\' o)' t* (},#( o.L( t/(}1( o3( t4 )}64)!7<)(7E) 8M) -8V)9`)/-9)6+:);-;4*A-<*G-= +M>~+W?+bA+gC+mD+tE ,{FH,G,H- I-}JJ-K--L.M.N. |O . O. OO.!O.}Q.}Q+.RJ.SX.Tv.U.U.}BU.V.W/X8/Y.0Y10YN0}-Y]0Zq0[0[0[0}[0}-[0\0\0-]0!^ 1}`1}-` 1aG1bJ1bR1b1}b1}-b1c1d1d1d1}d1}-d2|e 2e2e@2}-eO2fc2gq2gt2g2}g2g2|h2h2h2}h2 j2j2 |j2,|j 33<j137<l\3EDn}3Lo3o3XIog4`p4}pAqUppnd?nk@4orApozBoCoDoEpF pG=pHZpIwpJpKpLpM qNXqOqPqQqRqSr TDrUdrVs}W&sWU \ \ \ LU \ \`c gl gl |...cccccccc U||cUU|\||c n n x  x x               |        cc   U||  ...0|\\\\\\\\    ! .U) U1 7      : =    x ? F M ? V  A}   QYa}i}Q*y}Q*}}AQAQ }Q$ / Q3Q?QIQQQ? Qb}-/2g:QsC KP}V \!kp:vC| L`$},}4}< < 2  -Q Dg:}L}L L kT\\!k\C|L< Qd}< lt!k|\!k 2C|9C| !k}}    2 2} rLb x z    } !k 2 !k  C|<g:   Q D D 2, ,, ki}pY  T}|}} rL/   2|/ / T/ Q*Q*}.s;S;S@;`;;;A;ASa;aS;;;; ;!;A;a;;;;;;!;A;a;;;;; ;! ;A ;a ; ; ; ; ; ;! ;A ;a ; ; ; ; ; ;! ;A ;a ; ; ; ; ; ;! ;A ;a ; ; ; S! ;! SA ;A S ; S ; S ; S;S!;!SA;ASa;aS;S!;!S;;;; ;@;`;;;;;; ;@;`;;;;;; ;@;`;;;;;; ;@;`;;;;;; ;@;`;;;;;;; ;; ;@;`;";";";";#; #;@#;`#;#;#;$; $; %;@%;););*; *;'8HV).3O[4%8O]fnz0AS     %!&$)059>$HMY_lM{_l . / 0 1 2HIJY^biot!z#~%')+-//1133579;;==??AACC E!E&G'I)K*KNMOMPOQOYQZS&e(07>FNV]dk v#"$%$BlobWriterCPUFrameCodeElementCodeElementJumpCodeElementUIntCodeElementUIntExprCodeElementUIntIntCodeElementUIntUIntConstDataOpcodeOpcodeCallOpcodeConstOpcodeGetLocalOpcodeJumpOpcodeJumpIfOpcodeJumpIfNotOpcodeJumpUncondOpcodePutLocalOpcodeRetSTypeT0CompTPointerBaseTPointerBlobTPointerExprTPointerNullTPointerXTTValueWordWordBuilderWordDataWordInterpretedWordNativeNativeRunwTextWriterSystem.IOmaxLineLenindentlineLenipBufipOffstackBufstackPtrrspuppersavedIpBufsavedIpOfflocals
k__BackingFieldk__BackingFieldjumpTypetargetvalcxoffval1val2k__BackingFieldbuflennumdispdindoutUNKNOWNBLANKcurrentInputTextReaderdelayedChartokenBuilderStringBuilderSystem.TextdelayedTokenwordsIDictionary`2System.Collections.GenericlastWordwordBuildersavedWordBuildersStack`1allCCodecompilingquitRunLoopextraCodeList`1extraCodeDeferdataBlockcurrentBlobIDenableFlowAnalysisdsLimitrsLimitk__BackingFieldexprminmaxk__BackingFieldk__BackingFieldxptrk__BackingFieldk__BackingFieldk__BackingFieldk__BackingFieldk__BackingFieldTCnamecfStackcfPtrcodetoResolveDictionary`2jumpToLastblobbaseBlobNameoffsetongoingResolutionk__BackingFieldk__BackingFieldflowAnalysismaxDataStackmaxReturnStackObjectSystem.ctorWriteLineWritebByteStringget_LengthnumLocalsvArrayCopydepthCompilerGeneratedAttributeSystem.Runtime.CompilerServicesvalueExceptiononeByteCodebwUInt32FormatDebuggerBrowsableAttributeSystem.DiagnosticsDebuggerBrowsableStateInt32ctxelenMathMaxsEncodingget_UTF8GetBytesdlenIndexOutOfRangeExceptionToStringAppendcpugcodeConcatGetTypeTypeget_FullNames1s2objargs<>f__switch$map0StartsWithAddop_EqualitySubstringIndexOfToLowerInvariantTrimTryGetValueSplitStringSplitOptionsget_CountAssemblySystem.ReflectionGetExecutingAssemblyGetManifestResourceStreamStreamStreamReaderIDisposableDisposeEnumeratorGetEnumeratorget_CurrentConsoleFileOpenTextMoveNextToArrayEnvironmentExitc__AnonStorey1wliteralwcompile$thisStringComparerget_OrdinalSortedDictionary`2IComparer`1<>f__am$cache0<>f__am$cache1<>f__am$cache2<>f__am$cache3<>f__am$cache4<>f__am$cache5<>f__am$cache6<>f__am$cache7<>f__am$cache8<>f__am$cache9<>f__am$cacheA<>f__am$cacheB<>f__am$cacheC<>f__am$cacheD<>f__am$cacheE<>f__am$cacheF<>f__am$cache10<>f__am$cache11<>f__am$cache12<>f__am$cache13<>f__am$cache14<>f__am$cache15<>f__am$cache16<>f__am$cache17<>f__am$cache18<>f__am$cache19<>f__am$cache1A<>f__am$cache1B<>f__am$cache1C<>f__am$cache1D<>f__am$cache1E<>f__am$cache1F<>f__am$cache20<>f__am$cache21<>f__am$cache22<>f__am$cache23<>f__am$cache24<>f__am$cache25<>f__am$cache26<>f__am$cache27<>f__am$cache28<>f__am$cache29<>f__am$cache2AimmediatestackEffectContainsKeyset_ItemReadcset_Lengthtget_CharscttroutBasecoreRunentryPointsParamArrayAttributeQueue`1EnqueueDequeueget_ItemIEnumerator`1get_ValuesICollection`1IEnumerable`1IEnumeratorSystem.CollectionsCreateTextStreamWriterset_NewLineget_KeysKeyCollectiontttvAppendFormatReplacec__AnonStorey0<>f__ref$1PushPopcpu2xcpuvpMemberInfoget_NametpcdownerInt64MindstoprefNamewtargetlnamextsajobjectmethodcallbackresultDoNLEnterget_DepthPeekRotNRotGetLocalPutLocalget_Addressset_Addressget_LastLengthset_LastLengthSetJumpTargetGetLengthEncodeEncodeOneByteEncode7EUnsignedEncode7ESignedget_JumpOffget_IDset_IDExpandAdd8Add16Add24Add32AddStringCheckIndexSet8Read8Read16Read24Read32DecodeUTF8RunResolveTargetResolveJumpGetReferenceGetDataBlockget_MayFallThroughget_JumpDispget_StackActionToCodeElementFixUpget_DataInget_DataOutget_IsKnownget_NoExitop_InequalityEqualsGetHashCodeIsSubOf.cctorValueTypeMainUsageAddNativeNextBlobIDNextCharUnreadNextParseCCodeParseCCodeNFParseStackEffectNFParseStringSingleCharEscapeSkipNLDecodeCharConstDecHexHexValReadTermIsWSProcessInputCompileStepGetCCodeGenerateLookupLookupNFStringToBlobTryParseLiteralParseIntegerCheckCompilingEscapeCCommentm__0m__1m__2m__3m__4m__5m__6m__7m__8m__9m__Am__Bm__Cm__Dm__Em__Fm__10m__11m__12m__13m__14m__15m__16m__17m__18m__19m__1Am__1Bm__1Cm__1Dm__1Em__1Fm__20m__21m__22m__23m__24m__25m__26m__27m__28m__29m__2Am__2B<>m__0<>m__1<>m__2<>m__3<>m__4<>m__5<>m__6<>m__7<>m__8<>m__9<>m__A<>m__B<>m__C<>m__D<>m__E<>m__F<>m__10<>m__11<>m__12<>m__13<>m__14<>m__15<>m__16<>m__17<>m__18<>m__19<>m__1A<>m__1B<>m__1C<>m__1D<>m__1E<>m__1F<>m__20<>m__21<>m__22<>m__23<>m__24<>m__25ToBoolExecuteget_Blobset_BlobToCExprGetMaxBitLengthBitLengthset_Nameget_Targetset_TargetResolveget_Boolget_Intget_UIntToXTop_Implicitget_TCset_TCget_Immediateset_Immediateget_Slotset_Slotget_StackEffectset_StackEffectget_CCodeset_CCodeGetReferencesGetDataBlocksGenerateCodeElementsAnalyseFlowget_MaxDataStackget_MaxReturnStackBuildCSRollCSPickCSPushCSPopCSPushOrigCSPushDestCSPopOrigCSPopDestLiteralCallCallExtDefLocalRetAheadAheadIfAheadIfNotThenBeginAgainAgainIfAgainIfNotget_NumLocalsset_NumLocalsget_Codeset_CodeMergeSAInvokeBeginInvokeIAsyncResultAsyncCallbackEndInvokeMulticastDelegateDepthAddressLastLengthJumpOffIDLengthMayFallThroughJumpDispStackActionDataInDataOutIsKnownNoExitBlobNameTargetBoolIntUIntImmediateSlotStackEffectCCodeMaxDataStackMaxReturnStackNumLocalsCodeRuntimeCompatibilityAttributemscorlibt0-kernelT0Comp.exe0x{0:X2}{0}=Code element accepts no targetCCannot encode '{0}' over one byte)Unresolved addressesT0_INT{0}({1})#Not a call opcode#Not a jump opcode/Opcode already resolved-Unresolved call target call UNRESOLVEDECannot compile XT: non-zero offsetECannot embed constant (type = {0}) const getlocal +Jump already resolved#jumpif UNRESOLVEDjumpif disp=)jumpifnot UNRESOLVEDjumpifnot disp=jump UNRESOLVEDjump disp=putlocal retUNKNOWNin:{0},noexitin:{0},out:{1}---ooutrrunm mainnf noflow t0outt0-kernel [{0}]Qusage: T0Comp.exe [ options... ] file...options: -o file use 'file' as base for output file name (default: 't0out') -r name use 'name' as base for run function (default: same as output)) -m name[,name...]G define entry point(s)G -nf disable flow analysisadd-cc:cc:preamblepostamblemake-CXCXco:define-word;immediateliteralcompilepostpone exitvmnew-data-block!define-data-wordcurrent-datadata-add8data-set8data-get8%compile-local-read'compile-local-write ahead begin again untiluntilnotif ifnot thencs-pickcs-rollnext-word parse char'execute[](local) dropdup swap overrot -rot roll pick+neg*/u/%u%<<=>>==<>u<u<=u>u>=andorxornot<<>>u>>..s putc putscr eqstr-Word already defined: =Already two delayed characters7Cannot delay two charactersUStack effect forbidden in this declaration5Error while parsing C code)!3Unfinished literal string5not an hex digit: U+{0:X4}+EOF in literal stringGUnescaped newline in literal stringQInvalid newline escape in literal string/Invalid literal char: `7EOF reached before U+{0:X4}toplevel'EOF while compiling[Ambiguous: both defined word and literal: {0}'Unknown word: '{0}'%{0}: ds={1} rs={2}5' exceeds data stack limit9' exceeds return stack limit5No C code for native '{0}' 7Non-interpreted entry point9WARNING: more than 255 words.c /* Automatically generated code; do not modify directly. */ #include <stddef.h> #include <stdint.h> typedef struct { uint32_t *dp; uint32_t *rp; const unsigned char *ip; } t0_context; static uint32_t t0_parse7E_unsigned(const unsigned char **p) { uint32_t x; x = 0; for (;;) { unsigned y; y = *(*p) ++; x = (x << 7) | (uint32_t)(y & 0x7F); if (y < 0x80) { return x; } } } static int32_t t0_parse7E_signed(const unsigned char **p) { int neg; uint32_t x; neg = ((**p) >> 6) & 1; x = (uint32_t)-neg; for (;;) { unsigned y; y = *(*p) ++; x = (x << 7) | (uint32_t)(y & 0x7F); if (y < 0x80) { if (neg) { return -(int32_t)~x - 1; } else { return (int32_t)x; } } } } #define T0_VBYTE(x, n) (unsigned char)((((uint32_t)(x) >> (n)) & 0x7F) | 0x80) #define T0_FBYTE(x, n) (unsigned char)(((uint32_t)(x) >> (n)) & 0x7F) #define T0_SBYTE(x) (unsigned char)((((uint32_t)(x) >> 28) + 0xF8) ^ 0xF8) #define T0_INT1(x) T0_FBYTE(x, 0) #define T0_INT2(x) T0_VBYTE(x, 7), T0_FBYTE(x, 0) #define T0_INT3(x) T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0) #define T0_INT4(x) T0_VBYTE(x, 21), T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0) #define T0_INT5(x) T0_SBYTE(x), T0_VBYTE(x, 21), T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0) /* static const unsigned char t0_datablock[]; */ ?void {0}_init_{1}(void *t0ctx);5void {0}_run(void *t0ctx);[static const unsigned char t0_datablock[] = {};[static const unsigned char t0_codeblock[] = {Istatic const uint16_t t0_caddr[] = { {0}9#define T0_INTERPRETED {0}#define T0_ENTER(ip, rp, slot) do { \ const unsigned char *t0_newip; \ uint32_t t0_lnum; \ t0_newip = &t0_codeblock[t0_caddr[(slot) - T0_INTERPRETED]]; \ t0_lnum = t0_parse7E_unsigned(&t0_newip); \ (rp) += t0_lnum; \ *((rp) ++) = (uint32_t)((ip) - &t0_codeblock[0]) + (t0_lnum << 16); \ (ip) = t0_newip; \ } while (0)M#define T0_DEFENTRY(name, slot) \ void \ name(void *ctx) \ { \ t0_context *t0ctx = ctx; \ t0ctx->ip = &t0_codeblock[0]; \ T0_ENTER(t0ctx->ip, t0ctx->rp, slot); \ }+T0_DEFENTRY({0}, {1}) _init_S#define T0_NEXT(t0ipp) (*(*(t0ipp)) ++)g#define T0_NEXT(t0ipp) t0_parse7E_unsigned(t0ipp) void){0}_run(void *t0ctx){ uint32_t *dp, *rp; const unsigned char *ip; #define T0_LOCAL(x) (*(rp - 2 - (x))) #define T0_POP() (*-- dp) #define T0_POPi() (*(int32_t *)(-- dp)) #define T0_PEEK(x) (*(dp - 1 - (x))) #define T0_PEEKi(x) (*(int32_t *)(dp - 1 - (x))) #define T0_PUSH(v) do { *dp = (v); dp ++; } while (0) #define T0_PUSHi(v) do { *(int32_t *)dp = (v); dp ++; } while (0) #define T0_RPOP() (*-- rp) #define T0_RPOPi() (*(int32_t *)(-- rp)) #define T0_RPUSH(v) do { *rp = (v); rp ++; } while (0) #define T0_RPUSHi(v) do { *(int32_t *)rp = (v); rp ++; } while (0) #define T0_ROLL(x) do { \ size_t t0len = (size_t)(x); \ uint32_t t0tmp = *(dp - 1 - t0len); \ memmove(dp - t0len - 1, dp - t0len, t0len * sizeof *dp); \ *(dp - 1) = t0tmp; \ } while (0) #define T0_SWAP() do { \ uint32_t t0tmp = *(dp - 2); \ *(dp - 2) = *(dp - 1); \ *(dp - 1) = t0tmp; \ } while (0) #define T0_ROT() do { \ uint32_t t0tmp = *(dp - 3); \ *(dp - 3) = *(dp - 2); \ *(dp - 2) = *(dp - 1); \ *(dp - 1) = t0tmp; \ } while (0) #define T0_NROT() do { \ uint32_t t0tmp = *(dp - 1); \ *(dp - 1) = *(dp - 2); \ *(dp - 2) = *(dp - 3); \ *(dp - 3) = t0tmp; \ } while (0) #define T0_PICK(x) do { \ uint32_t t0depth = (x); \ T0_PUSH(T0_PEEK(t0depth)); \ } while (0) #define T0_CO() do { \ goto t0_exit; \ } while (0) #define T0_RET() goto t0_next dp = ((t0_context *)t0ctx)->dp; rp = ((t0_context *)t0ctx)->rp; ip = ((t0_context *)t0ctx)->ip; goto t0_next; for (;;) { uint32_t t0x; t0_next: t0x = T0_NEXT(&ip); if (t0x < T0_INTERPRETED) { switch (t0x) { int32_t t0off; case 0: /* ret */ t0x = T0_RPOP(); rp -= (t0x >> 16); t0x &= 0xFFFF; if (t0x == 0) { ip = NULL; goto t0_exit; } ip = &t0_codeblock[t0x]; break; case 1: /* literal constant */ T0_PUSHi(t0_parse7E_signed(&ip)); break; case 2: /* read local */ T0_PUSH(T0_LOCAL(t0_parse7E_unsigned(&ip))); break; case 3: /* write local */ T0_LOCAL(t0_parse7E_unsigned(&ip)) = T0_POP(); break; case 4: /* jump */ t0off = t0_parse7E_signed(&ip); ip += t0off; break; case 5: /* jump if */ t0off = t0_parse7E_signed(&ip); if (T0_POP()) { ip += t0off; } break; case 6: /* jump if not */ t0off = t0_parse7E_signed(&ip); if (!T0_POP()) { ip += t0off; } break;g case {0}: {{ /* {1} */ {2} }} break;? } } else { T0_ENTER(ip, rp, t0x); } } t0_exit: ((t0_context *)t0ctx)->dp = dp; ((t0_context *)t0ctx)->rp = rp; ((t0_context *)t0ctx)->ip = ip; }5code length: {0,6} byte(s)5data length: {0,6} byte(s)Gtotal words: {0} (interpreted: {1})'No such word: '{0}'"`0x0X0b0BEinvalid literal integer (overflow)!not an integer: /Not in compilation mode%{0:X2}%{0:X2}%{0:X2}+%{0:X2}%{0:X2}%{0:X2}*/ %2A/5EOF reached (missing name)1C code already set for: ?EOF reached (missing min value)?EOF reached (missing max value)-min/max in wrong order;EOF reached (while compiling)(7Invalid stack effect syntax'Not a string: '{0}'Not compiling'No word defined yet5Address is not a data area+No current data block3Byte value out of range: %No next word (EOF)/No next character (EOF)3Cannot add '{0}' to '{1}'C-only word: +'{0}' is not a string9No coroutine in compile mode'Invalid shift count {0})value is not an xt: {0}+{1}MCannot evaluate C-expr at compile time+(uint32_t)({0}) + {1}+(uint32_t)({0}) - {1} null <'{0}>Acannot run '{0}' at compile-timeCWord does not yield code elements?control-flow stack is not emptynot an origin#not a destinationno such local: 5local already defined: {0}Ccircular reference in blobs ({0})Ydata word '{0}' based on non-data word '{1}'yIn word '{0}', offset {1}: stack action mismatch ({2} / {3})9recursive call detected in 'ecall from '{0}' to '{1}' with unknown stack effects'{0}': exit stack action mismatch: {1} / {2} (offset {3})word '{0}': computed stack effect {1} does not match declared {2}q(`(JKc.KQ0t h xtX  x||,`\0     --  AM     U         Y] a a mm e  }x |x  xxmx  , x x,m, ,,,             0   0 t tt tt t          h     \             x x\ ,\  pdpdhXX  X1\ m 5  X X X  X    x 00tx  Qxxxxxmxx ,xx,m,,,xxxxxxm,,m,, xx t t       tttd ttdd tt t t  ttt xXtXtx ttdx t \  t ` , \ ,    x  `  ptttttttt ttttttt t \ X x , X 0 0 p \, \, \0 0 0x00x,00,   0xXXXX \ \X    (( ((,((x( (\(X(0TWrapNonExceptionThrowsz\V4(4>4 04_CorExeMainmscoree.dll% @0HX@4VS_VERSION_INFO?DVarFileInfo$TranslationStringFileInfo007f04b0Comments $CompanyName ,FileDescription 0FileVersion0.0.0.00InternalNameT0Comp(LegalCopyright ,LegalTrademarks @ OriginalFilenameT0Comp.exe$ProductName (ProductVersion 0 P4