forth-riscv

My forth
git clone git://git.electrosoup.com/forth-riscv
Log | Files | Refs

commit 2e793f6c848c7b76a1c13d76b6c30815356bedeb
parent 5269bade53c7b5ac3f16211b7f8c13c61b3d6436
Author: Christian Ermann <christianermann@gmail.com>
Date:   Wed, 30 Oct 2024 12:42:12 -0700

Add 'math and logic' and 'compiler' sections

Diffstat:
Mforth.s | 20++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/forth.s b/forth.s @@ -501,12 +501,9 @@ defcode "2dup", 3, 0, 0xD330F226, two_dup, lit push w next -defcode "aligned", 7, 0, 0xC73174DF, aligned, char_comma - pop w - addi w, w, 3 - andi w, w, 0xFFFFFFFC - push w - next +# ----------------------------------------------------------------------------- +# math and logic +# ----------------------------------------------------------------------------- defcode "+", 1, 0, 0xC4ADC675, plus, align pop w @@ -515,6 +512,17 @@ defcode "+", 1, 0, 0xC4ADC675, plus, align push w next +defcode "aligned", 7, 0, 0xC73174DF, aligned, char_comma + pop w + addi w, w, 3 + andi w, w, 0xFFFFFFFC + push w + next + +# ----------------------------------------------------------------------------- +# compiler +# ----------------------------------------------------------------------------- + defword "create", 6, 0, 0x26BB595D, create, plus .int latest, fetch, comma # link .int hash, comma # hash