Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 166ef152dcfa18e94d74329ff41a77bc6628297a
Author: David Goehrig <dave@dloh.org>
Date:   Fri Sep 5 19:44:41 2014 -0400

    Now builds on Linux, but image doesn't load to to address issues

commit 2d324fef65a999ca61ce1db8df498c9d40ceee92
Author: David Goehrig <dave@dloh.org>
Date:   Fri Sep 5 19:22:43 2014 -0400

    starting an unknown branch because I don't remember what I was doing
  • Loading branch information
cthulhuology committed Sep 5, 2014
1 parent f9cf9d5 commit fb03d4e
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 38 deletions.
Empty file modified COPYING
100644 → 100755
Empty file.
Empty file modified Darwin.mk
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions Linux.mk
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified README
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions dict.asm
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; create a dictionary entry (in data)
dict boot,'boot'
dict arg1,'#1'
dict arg2,'#2'
Expand Down
Empty file modified event.asm
100644 → 100755
Empty file.
Empty file modified firth.asm
100644 → 100755
Empty file.
6 changes: 4 additions & 2 deletions image.asm
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file modified net.asm
100644 → 100755
Empty file.
Empty file modified system.asm
100644 → 100755
Empty file.
Empty file modified term.asm
100644 → 100755
Empty file.
Empty file modified tools.asm
100644 → 100755
Empty file.
38 changes: 2 additions & 36 deletions vm.asm
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit fb03d4e

Please sign in to comment.