diff options
| author | kitty <nepeta@canaglie.net> | 2026-02-14 23:18:50 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-02-14 23:18:50 +1100 |
| commit | f7174a6c09335d1c03d927594f7e7630364dac6d (patch) | |
| tree | 86b9e3dd4dd8245c8fac88ef61381f871a7f1a9b | |
| parent | 7ff5ac1840a86e4f70a945e11bc54fa9246cf000 (diff) | |
[compile] and '
| -rw-r--r-- | jefs.fs | 10 | ||||
| -rw-r--r-- | jefs.s | 12 |
2 files changed, 19 insertions, 3 deletions
@@ -1,12 +1,16 @@ +: [compile] parse find drop >cfa compile, ; immediate +: ' parse find drop >cfa [compile] lit ; immediate \ note: no error handling (yet) + : begin here @ ; immediate -: again branch here @ 4 + - d, ; immediate +: again branch here @ 4 + - d, ; immediate \ add 4 to get to beginning of the next instruction +\ : if 0branch here @ 0 d, ; immediate ( I: -- a ) +\ : then dup here @ 4 + swap - swap d! ; immediate : / /mod swap drop ; : mod /mod drop ; : syswrite ( u c-addr fd -- n ) 1 syscall3 ; : say ( c-addr u -- ) swap 1 syswrite drop ; -\ : saying begin TESTSTR say again ; -\ HEREDUMP +\ : saying 0 if TESTSTR say then ; \ saying bye TESTSTR say bye @@ -103,6 +103,18 @@ defword "!", store, 0 mov qword [r11], r12 ret +defword "d!", dstore, 0 + pspop r11 + pspop r12 + mov dword [r11], r12d + ret + +defword "w!", wstore, 0 + pspop r11 + pspop r12 + mov word [r11], r12w + ret + defword "c!", cstore, 0 pspop r11 pspop r12 |
