ELFT44 (TTT2B^^w)|WPٍI܀hxpP HXX̀^forth vector: key vector ; vector: emit vector ; vector: type vector ; vector: clear vector ; vector: cr 10 emit ; vector: space 32 emit ; vector: spaces 0; dup 0 here 14 + x: literal c: reclass x: ;; ; loc: : (does) state @ if swap literal, compile ;then execute ; here ] x: class> here 14 + literal, ['] (does) compile x: ;; ; ;loc alias does> forth : #! lnparse 2drop ; : # vector >string type ; : . dup 0 1024 384 * + constant 128 variable: <#blocks> variable: b0 variable current-block : there b0 @ ; : #-of-blocks <#blocks> @ ; : new there #-of-blocks 512 * 32 fill 0 current-block ! ; new : \f there #-of-blocks 512 * eval ; : (block) @current-block : block 512 * there + ; : (line) 32 * (block) + ; true variable: shadow : p @shadow [[ 2 ]] [[ 1 ]] t/f current-block -! ; : n @shadow [[ 2 ]] [[ 1 ]] t/f current-block +! ; : d (line) 32 32 fill ; : x (block) 512 32 fill ; : eb (block) 512 eval ; : el (line) 32 eval ; : e 16 for 16 r - el next ; : s !current-block ; : i 0 swap : ia (line) + lnparse rot swap move ; : \ 1 s e ; : --> n e ; loc: : | '| emit ; loc: : & space '& emit space ; : which ." Editing: " @current-block # & @current-block 1+ # ; : num ." out of " #-of-blocks 1- . ." total blocks" ; here ] which space num cr .s ; ;loc alias status : row dup 32 type 32 + ; : left# -16 + negate dup @base if @ execute cr ;then nope ; : error dup 0 =if 2drop ." Use: help " cr ;then word? ; here ] x' if >entry :doc dup @ t/f ;then error ; ;loc is help : docstring: x' if drop here @which :doc ! ] ;then word? ; voc: syscalls syscalls : read 3 3 syscall ; : write 3 4 syscall ; : exit 1 1 syscall ; : open 3 5 syscall ; : close 1 6 syscall ; variable buffer ^ here default: key ] syscalls 1 buffer 0 read drop buffer @ ^ ; here default: type ] syscalls swap 1 write drop ^ ; here default: emit ] syscalls buffer c! buffer 1 ^ type ; here default: bye ] syscalls 0 exit ^ ; here default: clear ] 27 emit s" [2J" type 27 emit s" [1;1H" type ; : choose vector ; : use vector wsparse choose ; : reload vector ; : save vector ; loc: variable file create fname 256 allot : erase fname 256 0 fill ; here is choose ] erase fname swap move ; : open 420 66 fname syscalls open ^ file ! ; : close file @ syscalls close drop ^ ; : read-contents #-of-blocks 512 * there file @ syscalls read drop ^ ; here is reload ] open read-contents close ; : write-contents #-of-blocks 512 * there file @ syscalls write drop ^ ; here is save ] open write-contents close ; ;loc : load new use reload ; : -f load \f ; loc: : adjust @b0 64 512 * - 1024 - b0 ! 64 !<#blocks> ; here ] @b0 >r @<#blocks> >r adjust new -f r> !<#blocks> r> !b0 ; ;loc is include cmdline #args loc: : to-filename 1+ repeat dup c@ 0 =if 1+ ;then 1+ again ; : clean 1+ repeat dup c@ 0 =if 32 over c! ;then 1+ again ; : change >r to-filename dup r> 1- for clean next ; [[ dup 1 >if change over - eval ;then 2drop ]] ;loc execute }НV)r 8==­=tԭ=ut@Q= L9 OWG GV=^YSPVƊ0ʋt/{f;WuVQY^uCC^[^ȃ[RWT1509v'O uT)_Z511Ҋ-uCI#wȝCIC/ru؃À=t9v _Ar0:rQ=t8:u=u B+_4؛Ã$$ʉupt t{ uË  tY=? u ? uG=)v uHx uHĝíĝ555ĝr&= ĝ)AOA>H+=XFX1LX X XX  inline : dup [ $fc4689 3, $fc768d 3, ] ; : 1+ [ $40 1, ] ; : 1- [ $48 1, ] ; : swap [ $0687 2, ] ; : drop [ $ad 1, ] ; : nip [ $04c683 3, ] ; : 2drop [ $adad 2, ] ; : and [ $0623 2, ] nip ; : or [ $060b 2, ] nip ; : xor [ $0633 2, ] nip ; forth : @ [ $008b 2, ] ; : ! [ $adc289 3, $ad0289 3, ] ; : w@ @ $ffff and ; : w! [ $adc289 3, $ad028966 , ] ; : c@ @ $ff and ; : c! [ $adc289 3, $ad0288 3, ] ; : + [ $0603 2, ] nip ; : * [ $26f7 2, ] nip ; : - [ $ad0629 3, ] ; : /mod [ $c389 2, $99ad 2, $fbf7 2, ] dup [ $d089 2, ] swap ; : >> [ $c189 2, $d3ad 2, $e8 1, ] ; : << [ $c189 2, $d3ad 2, $e0 1, ] ; : not -1 xor ; : negate -1 * ; : / /mod nip ; : mod /mod drop ; : wsparse 32 parse ; : lnparse 10 parse ; : x' wsparse lookup ; : ' x' drop ; : here h0 @ ; : :link ; : :xt 4 + ; : :class 8 + ; : :doc 12 + ; : :name 16 + ; : reclass last @ :class ! ; : reclass: ' drop which @ :class ! ; macro : x: ' compile ; : ['] ' x: literal ; : c: x: ['] ['] compile compile ; : as ' x: literal c: reclass ; : >r $ad50 2, ; : r> c: dup $58 1, ; : r x: r> $50 1, ; : rdrop $5b 1, ; : repeat here ; : again compile x: ;; ; : next x: r> $48 1, $8f0f 2, here - 4 - , $ad 1, ; : for here x: >r ; : (if) $063b 2, $adad 2, 2, here 0 , ; : <>if $840f x: (if) ; : =if $850f x: (if) ; : if $8d0f x: (if) ; : if 0 x: literal x: <>if ; : then dup here swap - 4 - swap ! $90 1, ; : ;then x: ;; x: then ; : if; x: if x: ;then ; : vector $e9 1, 0 , ; forth : literal, x: literal ; : literal? state @ if literal, ;then ; : execute >r ; : cells 4 * ; : cell+ 4 + ; : cell- 4 - ; : word+ 2 + ; : word- 2 - ; : rot >r swap r> swap ; : -rot swap >r swap r> ; : over >r dup r> swap ; : tuck dup -rot ; : 2dup over over ; : later r> r> swap >r >r ; : 0; dup 0 =if rdrop drop then ; : t/f >r >r if r> rdrop execute ;then rdrop r> execute ; : t swap if execute ;then drop ; : f swap not if execute ;then drop ; : create: wsparse entry ; : create create: as .data ; : macro: create: as .macro ] ; : forth: create: as .forth ] ; : self: create: as .self ] ; : class: create: as .class ] ; : vector: create: ] x: vector ; : variable 0 : variable: create , ; : constant create last @ cell+ ! ; : +! dup @ rot + swap ! ; : -! dup @ rot - swap ! ; : allot h0 +! ; : alias create: last @ cell+ ! ; create list 5 cells allot : loc: 1 list +! list @ cells list + last @ swap ! ; : ;loc list @ cells list + @ last ! 1 list -! ; : fill swap dup 0 =if 2drop drop ;then for swap 2dup c! 1+ swap next 2drop ; : move for swap 2dup c@ swap c! 1+ swap 1+ next 2drop ; : copy 2dup >r >r move r> r> ; : pad here 1024 + ; : " '" parse pad swap copy ; : z" " over + 0 swap c! ; : devector 0 ' 1+ ! ; loc: here : change dup >r - 5 - r> 1+ ! ; : make entry x: vector compile x: ;; ; here ] x' if change ;then make ; ;loc alias is alias (is) macro: is: x' if literal, c: (is) ;then word? ; : default: vector x' if dup >r - 10 - r> 6 + ! ;then word? ; macro: d: x' if 5 + literal, c: execute ;then word? ; : now 1+ dup @ 4 + + ; loc: : .string dup r> + dup >r over - swap ; here ] dup literal, dup >r here 5 + swap move c: .string r> allot ; ;loc is $, macro: s" " $, ; macro: { '} parse $, c: eval ; self: [[ vector ; self: ]] vector ; loc: create list 5 cells allot : push 1 list +! list @ cells list + state @ swap ! ; : pop list @ cells list + @ state ! 1 list -! ; here ] push state @ if $e9 1, here 0 , ] ;then here ] ; ; is [[ here ] pop state @ if dup $c3 1, x: then 4 + literal, ;then $c3 1, ; is ]] ;loc : hex 16 base ! ; : decimal 10 base ! ; : binary 2 base ! ; : octal 8 base ! ; : >entry last repeat @ 0; 2dup cell+ @ =if nip ;then again ; : unpack 1+ dup 1- c@ ; 0 constant false -1 constant true loc: variable size : make dup -rot here dup >r swap move dup allot 0 1, 1+ size +! r> ; : free size @ negate allot 0 size ! ; here ] make later free ; ;loc is zt : on -1 swap ! ; : off 0 swap ! ; : toggle dup @ not swap ! ; : = =if true ;then false ; : <> <>if true ;then false ; : > >if true ;then false ; : < string7O>numberO ]gcompiley, 1,2,%3,ɯܜevalܯ parse:reset]lastmtib2}word?Fޘޘ.class\ޘ.datasޘ.forth ޘ.selfޘ.macro8ޘ.inlineͰh0base>in class!state7whichM whitespacec0;~:[J;;literal (ͱ :߱cmdline#args syscallbbootP7