diff options
| author | kitty <nepeta@canaglie.net> | 2026-02-21 20:15:42 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-02-21 20:15:42 +1100 |
| commit | 62831f626f1f04562b3a8a93ae9004a30e3c9abc (patch) | |
| tree | 95f66ae23857b38bd52312c2f2f8208e8d661f37 /jefs.fs | |
| parent | 8ea14c863401f19e602132192e2b8d776669ce5d (diff) | |
execute, ?
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 |
