diff options
Diffstat (limited to 'jefs.fs')
| -rw-r--r-- | jefs.fs | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -2,7 +2,7 @@ : cell+ 8 + ; : cell- 8 - ; -: say ( c-addr u -- ) swap 1 1 syscall3 drop ; +: tell ( c-addr u -- ) swap 1 1 syscall3 drop ; : emit ( chr -- ) sp cell+ 1 swap 1 1 syscall3 2drop ; : cr 10 emit ; @@ -70,7 +70,7 @@ hex : ret, c3 c, ; decimal \ TODO interpret mode strings? : s" 1 >in +! [ char " ] literal cparse branch >mark >r 2dup cmove, nip r> dup >resolve 4 + [compile] lit [compile] lit ; immediate -: ." [compile] s" ' say compile, ; immediate \ lol this word breaks the highlighting, here have another " +: ." [compile] s" ' tell compile, ; immediate \ lol this word breaks the highlighting, here have another " : z" 1 >in +! [ char " ] literal cparse branch >mark >r 2dup cmove, 0 c, nip r> dup >resolve 4 + [compile] lit drop ( 1+ [compile] lit ) ; immediate : s>z ( a u -- zstr ) here @ -rot cmove, 0 c, ; @@ -180,21 +180,21 @@ variable hld : #> drop hld @ pad over - ; : (u.) <# #s #> ; -: u. (u.) say space ; -: u.r >r (u.) r> over - spaces say ; +: u. (u.) tell space ; +: u.r >r (u.) r> over - spaces tell ; : (.) dup abs <# #s swap sign #> ; -: . (.) say space ; -: .r >r (.) r> over - spaces say ; +: . (.) tell space ; +: .r >r (.) r> over - spaces tell ; : (.byte) hex <# # # #> decimal ; -: .byte (.byte) say space ; +: .byte (.byte) tell space ; : (.word) hex <# # # # # #> decimal ; -: .word (.word) say space ; +: .word (.word) tell space ; : (.dword) hex <# # # # # # # # # #> decimal ; -: .dword (.dword) say space ; +: .dword (.dword) tell space ; : (.qword) hex <# # # # # # # # # # # # # # # # # #> decimal ; -: .qword (.qword) say space ; +: .qword (.qword) tell space ; \ }}} \ SYSCALL ERRORS {{{ @@ -240,7 +240,7 @@ decimal : mark-exec PROT_rwx bytes-allocated herestart @ mprotect errno .errno ; : grow ( n -- ) brk@ + sysbrk heremax ! mark-exec ; \ todo check error -: .free bytes-free u. ." of " bytes-allocated u. ." bytes free (used " bytes-used (.) say ." )" cr ; +: .free bytes-free u. ." of " bytes-allocated u. ." bytes free (used " bytes-used (.) tell ." )" cr ; \ }}} 6 constant #error-msgs @@ -265,7 +265,7 @@ make error-msgs #error-msgs cells allot : hide parse find drop (hide) ; \ todo error handling : hidden? ( lfa -- ? ) >ffa c@ 1 and 0<> ; -: (words) ( lfa -- ) dup hidden? not if >nfa dup w@ swap 2 + swap say 2 spaces else drop then ; +: (words) ( lfa -- ) dup hidden? not if >nfa dup w@ swap 2 + swap tell 2 spaces else drop then ; : words latest @ begin ?dup 0<> while dup (words) @ repeat cr ; : depth ( -- n ) s0 @ sp @ - 16 - ; @@ -408,7 +408,7 @@ termios TCGETS stdin ioctl ( noname ) swap execute value tty \ each change uses a different one, which is not too efficient \ Pm sequences allow multiple with ; -: CSIm ( n -- ) CSI (.) say ." m" ; +: CSIm ( n -- ) CSI (.) tell ." m" ; : foreground 30 + CSIm ; : background 40 + CSIm ; @@ -419,7 +419,7 @@ termios TCGETS stdin ioctl ( noname ) swap execute value tty : bold 1 CSIm ; : normal 0 CSIm ; -: at-xy ( x y -- ) CSI 1+ (.) say ." ;" 1+ (.) say ." H" ; +: at-xy ( x y -- ) CSI 1+ (.) tell ." ;" 1+ (.) tell ." H" ; : page CSI ." 2J" 0 0 at-xy ; 60 constant old-termios# @@ -476,9 +476,9 @@ decimal : (dumpchar) ( a -- a+1 ) dup @ >byte dup dump-colour foreground dump-char emit 1+ ; : (dumpascii) ( a -- ) 16 begin ?dup 0> while swap (dumpchar) swap 1- repeat default foreground drop ; -: (dumploc) ( a -- ) (.dword) say ." : " ; +: (dumploc) ( a -- ) (.dword) tell ." : " ; -: (d+) ( a -- a+1 ) dup @ >byte dup dump-colour foreground (.byte) say default foreground 1+ ; +: (d+) ( a -- a+1 ) dup @ >byte dup dump-colour foreground (.byte) tell default foreground 1+ ; : (dw+) ( a -- a+2 ) (d+) (d+) space ; : (dumphex) ( a -- ) (dw+) (dw+) (dw+) (dw+) (dw+) (dw+) (dw+) (dw+) drop ; |
