summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--jefs.s21
2 files changed, 23 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d20ec79..e42fcd7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,12 @@
TARGET := jefs
SRCS = $(TARGET).s
-all: $(TARGET) $(TARGET).fs
+all: $(TARGET)
$(TARGET): $(TARGET).o
ld --omagic -static -o $@ $<
-$(TARGET).o: $(SRCS)
+$(TARGET).o: $(SRCS) $(TARGET).fs
nasm -g -F dwarf -O0 -f elf64 -o $@ $<
.PHONY: clean
diff --git a/jefs.s b/jefs.s
index 86893bd..b464077 100644
--- a/jefs.s
+++ b/jefs.s
@@ -533,6 +533,27 @@ defword "rdrop", rdrop, 0
pop r11
ret
+defword "+", plus, 0
+ pspop r11
+ pspop r12
+ add r11, r12
+ pspush r11
+ ret
+
+defword "-", minus, 0
+ pspop r11
+ pspop r12
+ sub r11, r12
+ pspush r11
+ ret
+
+defword "*", timess, 0
+ pspop r11
+ pspop r12
+ imul r11, r12
+ pspush r11
+ ret
+
defword "[", lbrac, immediate_mask
mov qword [state], interpreting
ret