diff --git a/COPYING b/COPYING old mode 100644 new mode 100755 diff --git a/Darwin.mk b/Darwin.mk old mode 100644 new mode 100755 diff --git a/Linux.mk b/Linux.mk old mode 100644 new mode 100755 index 8bd59f9..989f198 --- a/Linux.mk +++ b/Linux.mk @@ -4,3 +4,13 @@ SYSCALLS = cat /usr/include/asm/unistd_64.h | grep -v "old " | grep "^#define" | ASM = yasm -f elf64 LD = ld -o firth -e open_image + + +syscall.asm: /usr/include/asm/unistd_64.h + cat /usr/include/asm/unistd_64.h | grep "__NR_" | sed 's%.* __NR_%%g' | grep -v '#define' | grep -v SYSCALL | grep -v ifndef | grep -v endif | grep -v '\*' | awk '{ print "%define", $$1, $$2 }' > syscall.asm + +firth.o : firth.asm syscall.asm + yasm -f elf64 firth.asm -D Linux + +firth : firth.o + ld -o firth -e open_image firth.o diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README b/README old mode 100644 new mode 100755 diff --git a/dict.asm b/dict.asm old mode 100644 new mode 100755 index 9b8a8e7..138ab52 --- a/dict.asm +++ b/dict.asm @@ -1,3 +1,4 @@ +; create a dictionary entry (in data) dict boot,'boot' dict arg1,'#1' dict arg2,'#2' diff --git a/event.asm b/event.asm old mode 100644 new mode 100755 diff --git a/firth.asm b/firth.asm old mode 100644 new mode 100755 diff --git a/image.asm b/image.asm old mode 100644 new mode 100755 index aaa051b..e291568 --- a/image.asm +++ b/image.asm @@ -92,12 +92,14 @@ def create ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Constants, Variables, and Values -dictionary_free: dq dictionary_end +;dictionary_last: dq word_create ;; last word in dict.asm +;dictionary_free: dq dictionary_end + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; The dictionary dictionary: -%include "dict.asm" +;; %include "dict.asm" dictionary_end: dq 0 diff --git a/net.asm b/net.asm old mode 100644 new mode 100755 diff --git a/system.asm b/system.asm old mode 100644 new mode 100755 diff --git a/term.asm b/term.asm old mode 100644 new mode 100755 diff --git a/tools.asm b/tools.asm old mode 100644 new mode 100755 diff --git a/vm.asm b/vm.asm old mode 100644 new mode 100755 index 91f1017..babe5ce --- a/vm.asm +++ b/vm.asm @@ -393,8 +393,8 @@ rstack equ 8*17 ; %macro divide 0 xor rdx,rdx - mov r11,[nos] - idiv tos,r11 + mov tmp1,[nos] + idiv tos,tmp1 nip %endmacro @@ -524,38 +524,4 @@ rstack equ 8*17 ; jmp $$ %endmacro -; words -%macro create 0 ; create a dictionary entry ( c-addr u a-addr u -- ) - lea r11, [dictionary_free + bp] ; load dictionary free pointer - swap - mov [r11], tos ; save definition address - lea r11, [r11 + 8] - drop - mov [r11], tos ; save definition length - lea r11, [r11 + 8] - drop - mov rcx, tos ; copy count - mov [r11], tos ; save string length - lea r11, [r11 + 8] - drop - mov rdi, r11 - mov rsi, tos - rep movsb ; copy string - add r11,7 - and r11, ~7 ; align r11 - mov [dictionary_free +bp], r11 ; update dictionary free pointer -%endmacro - -; variables -%macro variable 0 - -%endmacro - -%macro constant 0 - -%endmacro - -%macro value 0 - -%endmacro