diff options
Diffstat (limited to 'jefs.fs')
| -rw-r--r-- | jefs.fs | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -10,9 +10,8 @@ : nip swap drop ; : tuck swap over ; -hex -: ret, c3 c, ; -decimal +\ https://wiki.osdev.org/X86-64_Instruction_Encoding Laterâ„¢ +hex : ret, c3 c, ; decimal : cells 8 * ; : allot here @ swap here +! ; @@ -23,12 +22,17 @@ decimal : literal [compile] lit ; immediate : constant create [compile] lit ret, ; : variable 1 cells allot create [compile] lit ret, ; +: execute [ hex + 4d c, 8b c, 1e c, \ mov r11, [r14] + 4d c, 8d c, 76 c, 08 c, \ lea r14, [r14+8] + 41 c, ff c, d3 c, \ call r11 + decimal ] ; \ 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 " -\ forth83 (got them from pforth tho ehehe) +\ jump helpers from forth83 (got them from pforth tho ehehe) \ < backward jump > forward jump \ adding/subtracting 4 gets to the next instruction. : <mark here @ ; @@ -82,6 +86,7 @@ variable hld : (.qword) hex <# # # # # # # # # # # # # # # # # #> decimal ; : .qword (.qword) say space ; -: .s sp 8 + ( skip sp itself ) begin dup s0 @ >= while dup @ .qword 8 + repeat drop cr ; +: ? @ . ; +: .s sp 8 + ( skip sp itself ) begin dup s0 @ >= while dup @ .qword 8 + repeat drop cr ; bye |
