commit 2375fa4a5331970512a0c8871b0d5808bbd8b025
parent af1a0fb2efb6c243235162b9b442487838152d78
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Wed, 1 Jun 2022 13:51:40 -0400
add dup
road to victory right there!
Diffstat:
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -1,5 +1,5 @@
TARGETS = dusk
-WORDOBJS = $(addsuffix .o,$(addprefix words/,bye emit boot))
+WORDOBJS = $(addsuffix .o,$(addprefix words/,bye emit boot dup))
all: $(TARGETS)
diff --git a/words/boot.asm b/words/boot.asm
@@ -1,4 +1,9 @@
+EXTERN word_dup
defword 'boot', 4, word_boot, word_emit
pspush 0x66 ; 'f'
call word_emit
+ pspush 0x6f ; 'o'
+ call word_dup
+ call word_emit
+ call word_emit
ret
diff --git a/words/dup.asm b/words/dup.asm
@@ -0,0 +1,5 @@
+defword 'dup', 3, word_dup, word_boot
+ mov eax, [ebp]
+ sub ebp, 4
+ mov [ebp], eax
+ ret