123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654 |
- # big program test, should test if many symbols fit into the symbol table, if
- # big addresses in bytecode are handled well etc.
- 1
- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ --
- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ --
- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ --
- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ --
- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ --
- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ --
- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ -- ++ --
- ^
- # push many constants and pop them
- 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4
- ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
- 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4
- ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
- # create a few pointers:
- ~testVarA ~testVarB ~testVarC ~testVarD ~testVarE ~testVarF ~testVarG
- ~testVarH ~testVarI ~testVarJ ~testVarK ~testVarL ~testVarM ~testVarN
- ~testVarO ~testVarP ~testVarQ ~testVarR ~testVarS ~testVarT ~testVarU
- ~testVarV ~testVarW ~testVarX ~testVarY ~testVarZ
- ~bigVar:1000
- 999 @'
- $>bigVar
- 300 $:bigVar
- --
- .
- ^
- # create a few functions:
- testFuncA: $testVarA + .
- testFuncB: $testVarB + .
- testFuncC: $testVarC + .
- testFuncD: $testVarD + .
- testFuncE: $testVarE + .
- testFuncF: $testVarF + .
- testFuncG: $testVarG + .
- testFuncH: $testVarH + .
- testFuncI: $testVarI + .
- testFuncJ: $testVarJ + .
- testFuncK: $testVarK + .
- testFuncL: $testVarL + .
- testFuncM: $testVarM + .
- testFuncN: $testVarN + .
- testFuncO: $testVarO + .
- testFuncP: $testVarP + .
- testFuncQ: $testVarQ + .
- testFuncR: $testVarR + .
- testFuncS: $testVarS + .
- testFuncT: $testVarT + .
- testFuncU: $testVarU + .
- testFuncV: $testVarV + .
- testFuncW: $testVarW + .
- testFuncX: $testVarX + .
- testFuncY: $testVarY + .
- testFuncZ: $testVarZ + .
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- # random comment random comment random comment random comment random comment #
- testChainFunc:
- 10
- testFuncA testFuncB testFuncC testFuncD testFuncE testFuncF testFuncG
- testFuncH testFuncI testFuncJ testFuncK testFuncL testFuncM testFuncN
- testFuncO testFuncP testFuncQ testFuncR testFuncS testFuncT testFuncU
- testFuncV testFuncW testFuncX testFuncY testFuncZ
- .
- ~:randomLabel
- ~:randomLabel2
- ~:randomLabel3
- ~:randomLabel4
- ~:randomLabel5
- testChainFunc # do we survive this?
- 0 10 "big program" -->
- printNum:
- ?'
- $0
- 0
- ><
- @' # reverse push the chars
- $0
- 10
- %
- "0"
- +
- ><
- 10
- /
- .
- ^
- @' # print
- ->
- .
- ^
- ; # zero
- "0" ->
- .
- ^
- .
- PI: 3216 .
- sin:
- 1 # stack: x sign
- $1 0 << ?
- ^
- -1 * # x *= -1
- -1 # sign = -1
- .
- >< # stack: sign x
- 2 PI * % # x %= 2 * PI
- $0 PI > ? # x > PI ?
- PI - # x -= PI
- >< -1 * >< # sign *= -1
- .
- ~:randomLabelX
- PI $1 - * # x *= PI - x
- $0 16 * # 16 * x
- $1 4 * # 4 * x
- 5 PI * PI * # 5 * PI * PI
- >< - # 5 * PI * PI - 4 * x
- 1024 / # (5 * PI * PI - 4 * x) / 1024
- / >< ^ * # (16 * x) / ((5 * PI * PI - 4 * x) / 1024)
- .
- factorial:
- ?'
- $0 -- factorial *
- ;
- ^ 1
- .
- .
- min:
- $1 $1 > ?
- ><
- .
- ^
- .
- average:
- + 2 /
- .
- myFunc: # takes 2 nums, just computes some arbitrary expression
- min 10 % factorial 100 average
- .
- 0 "random expression (should be 53): " -->
- 123 654 myFunc printNum 10 ->
- # print "ab"s in a weird way:
- 100 @'
- $0 2 % ?
- "a" ->
- ;
- "b" ->
- .
- --
- .
- ^
- 10 ->
- ~myVar
- 300 $:myVar
- 1000 @' # apply sine 1000 times
- $myVar sin $:myVar
- --
- .
- ^
- $myVar
- 0 "sine (should be 222): " --> printNum 10 ->
- 0 10 "now print 200 in different type envs:" -->
- # -------------- ENV 8 ----------------
- ~8
- ~ptr8_a ~ptr8_b ~ptr8_c ~ptr8_d ~ptr8_e ~ptr8_f ~ptr8_g ~ptr8_h
- juggleNumber8:
- $:ptr8_a
- $ptr8_a $:ptr8_b
- $ptr8_b $:ptr8_c
- $ptr8_c $:ptr8_d
- $ptr8_d $:ptr8_e
- $ptr8_e $:ptr8_f
- $ptr8_f $:ptr8_g
- $ptr8_g $:ptr8_h
- $ptr8_h
- .
- 200 juggleNumber8 >0 printNum 10 ->
- 3 @'
- $ptr8_a=ptr8_b
- ?'
- ?'
- ?'
- ?'
- ?'
- ?'
- 0 10 "good" -->
- .
- .
- .
- .
- .
- .
- ^
- --
- .
- ^
- @'
- !@ # don't execute the following
- + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - -
- * * * * * * * * * * * * * * * *
- / / / / / / / / / / / / / / / /
- .
- # ------------- ENV 16 ----------------
- ~16
- ~ptr16_a ~ptr16_b ~ptr16_c ~ptr16_d ~ptr16_e ~ptr16_f ~ptr16_g ~ptr16_h
- juggleNumber16:
- $:ptr16_a
- $ptr16_a $:ptr16_b
- $ptr16_b $:ptr16_c
- $ptr16_c $:ptr16_d
- $ptr16_d $:ptr16_e
- $ptr16_e $:ptr16_f
- $ptr16_f $:ptr16_g
- $ptr16_g $:ptr16_h
- $ptr16_h
- .
- 200 juggleNumber16 >0 printNum 10 ->
- 3 @'
- $ptr16_a=ptr16_b
- ?'
- ?'
- ?'
- ?'
- ?'
- ?'
- 0 10 "good" -->
- .
- .
- .
- .
- .
- .
- ^
- --
- .
- ^
- @'
- !@ # don't execute the following
- + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - -
- * * * * * * * * * * * * * * * *
- / / / / / / / / / / / / / / / /
- .
- # ------------- ENV 32 ----------------
- ~32
- ~ptr32_a ~ptr32_b ~ptr32_c ~ptr32_d ~ptr32_e ~ptr32_f ~ptr32_g ~ptr32_h
- juggleNumber32:
- $:ptr32_a
- $ptr32_a $:ptr32_b
- $ptr32_b $:ptr32_c
- $ptr32_c $:ptr32_d
- $ptr32_d $:ptr32_e
- $ptr32_e $:ptr32_f
- $ptr32_f $:ptr32_g
- $ptr32_g $:ptr32_h
- $ptr32_h
- .
- 200 juggleNumber32 >0 printNum 10 ->
- 3 @'
- $ptr32_a=ptr32_b
- ?'
- ?'
- ?'
- ?'
- ?'
- ?'
- 0 10 "good" -->
- .
- .
- .
- .
- .
- .
- ^
- --
- .
- ^
- @'
- !@ # don't execute the following
- + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - -
- * * * * * * * * * * * * * * * *
- / / / / / / / / / / / / / / / /
- ??
- ? ? ? ? ? ? . . . . . .
- .
- # -------------- ENV 0 ----------------
- ~0
- >myEndLabel # skip the following
- 0 10 "THIS SHOULDN'T BE PRINTED" -->
- @
- ?
- 1 2 =
- ?
- @
- @
- 0 "abcdefghijklmnop" -->
- !.
- .
- !@
- .
- ++
- ;
- 7
- @@
- ?'
- ;
- @'
- !@
- .
- !@
- .
- --
- .
- 0 = ?'
- 3 +
- .
- .
- ;
- ++
- @
- ?
- ++
- ?
- ?
- ++
- .
- .
- .
-
- @
- <-
- ++
- .
- .
- .
- .
- ~:myEndLabel
- 0 "another random expression (should be 1280): " -->
- 1 2 + 20 * 30 min ++ ++ ++ ++ -- 11 // 20 + 16 *
- 3 4 + 12 * 10 min ++ ++ -- ++ -- 12 // 30 + 15 * +
- 5 6 + 13 * 20 min -- ++ ++ ++ -- 10 // 31 + 14 * +
- printNum 10 ->
- testChainFunc # try this again
- testChainFunc
- testChainFunc
- testChainFunc
- testChainFunc
- testChainFunc
- functionWeWontCall:
- 123456789
- "abcdefghijk"
- // || *
- ?
- @
- ?
- @@
- ?
- factorial
- # >myEndLabel #
- .
- .
- .
- .
- .
- min
- min
- testChainFunc
- factorial
- testFuncA
- testFuncB
- testFuncC
- testFuncD
- testFuncE
- testFuncF
- testFuncG
- testFuncH
- testFuncI
- testFuncJ
- testFuncK
- average
- .
- 0 10 "print some letters:" -->
- #------------- ENV 8 --------------
- ~8
- 64 # print 64 "a"s
- @@
- "a"
- ><
- --
- ?'
- ;
- !@
- .
- .
- ^
- 64 # pop them
- @@
- ><
- ->
- --
- ?'
- ;
- !@
- .
- .
- ^
- 10 ->
- #------------- ENV 16 -------------
- ~16
- 64 # print 64 "a"s
- @@
- "a"
- ><
- --
- ?'
- ;
- !@
- .
- .
- ^
- 64 # pop them
- @@
- ><
- ->
- --
- ?'
- ;
- !@
- .
- .
- ^
- 10 ->
- #------------- ENV 32 -------------
- ~32
- 1 ^ 2 ^ 3 ^ # just push and pop
- 4 ^ 5 ^ 6 ^
- 7 ^ 8 ^ 9 ^
- 64 # print 64 "a"s
- @@
- "a"
- ><
- --
- ?'
- ;
- !@
- .
- .
- ^
- 64 # pop them
- @@
- ><
- ->
- --
- ?'
- ;
- !@
- .
- .
- ^
- 10 ->
- #------------- ENV 0 --------------
- ~0
- # some weird expression
- +xf +b011 - * 11 / -d02 // 50 + -10 4 %% + 1000 >< / -b100 +x3 != + $0 -1 << +
- +b111 |! 1 + 0 1 2 ?? +
- isPrime:
- $0 1 <=
- ?
- ^ 0
- ;
- $0 2 /
- @@
- $0 1 <=
- ?
- ^ ^ 1 !@
- .
- $1 $1 % 0 =
- ?
- ^ ^ 0 !@
- .
- --
- .
- .
- .
- # push many constants and pop them
- 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4
- ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
- 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0 1 2 3 4
- ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
- 0 10 "primes from 1000: " -->
- 1000 @'
- $0 isPrime ?
- $0 printNum " " ->
- .
- --
- .
- 10 ->
- 0 10 "END" -->
- !. # now skip everything else
- 1 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 2 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 3 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 4 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 5 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 6 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 7 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 8 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 9 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 10 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 11 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 12 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 13 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 14 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 15 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 16 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 17 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 18 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 19 ++ -- * / = + - ?? && || // %% * * * * + + + +
- 20 ++ -- * / = + - ?? && || // %% * * * * + + + +
- +xbeeface
- -b10101
- 9999223
- "test"
- -101010
- "test2"
- @
- ?
- ++ --
- !@
- !.
- .
- ?'
- ?
- ++
- .
- .
- .
- 0 10 "THIS SHOULDN'T BE PRINTED" -->
|