diff options
Diffstat (limited to 'jefs.fs')
| -rw-r--r-- | jefs.fs | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -23,10 +23,6 @@ hex : ret, c3 c, ; decimal : constant create [compile] lit ret, ; : variable 1 cells allot create [compile] lit ret, ; -\ TODO interpret mode strings? -: s" [ char " ] literal 1 >in +! ( skip spc ) [compile] litstring ; immediate -: ." [compile] s" ' say compile, ; immediate \ lol this word breaks the highlighting, here have another " - \ jump helpers from forth83 (got them from pforth tho ehehe) \ < backward jump > forward jump \ adding/subtracting 4 gets to the next instruction. @@ -46,6 +42,11 @@ hex : ret, c3 c, ; decimal : ?dup dup 0<> if dup then ; +\ TODO interpret mode strings? +\ : s" [ char " ] literal 1 >in +! ( skip spc ) [compile] litstring ; immediate +: s" 1 >in +! [ char " ] literal cparse branch >mark >r 2dup cmove, r> >resolve swap [compile] lit [compile] lit ; immediate +: ." [compile] s" ' say compile, ; immediate \ lol this word breaks the highlighting, here have another " + \ https://wiki.osdev.org/X86-64_Instruction_Encoding \ see dusk os asm/x86.fs \ my idea is that operands are given in the reverse order that @@ -156,6 +157,13 @@ variable hld : bytes-allocated hend @ h0 @ - ; : bytes-used here @ h0 @ - ; : bytes-free bytes-allocated bytes-used - ; -: .free bytes-free u. ." of " bytes-allocated u. ." bytes free (used " bytes-used (.) say ." )" cr ; \ segfaults +\ there is some issue with ." that causes a segfault. strange +\ it seems to happen if multiple strings appear. +\ purrhaps something isn't being reset?? +\ it only seems to happen if the called word is a builtin or a number????? +\ : .free bytes-free u. ." of " bytes-allocated u. ." bytes free (used " bytes-used (.) say ." )" cr ; \ segfaults + +\ .free bye +\ : t s" eue eu eo o eu" drop say .s s" euoe" ; -.free bye +t bye |
