Skip to content

Commit

Permalink
Added target nlina64 nlina32 , nasm assembles 64 bit Forth.
Browse files Browse the repository at this point in the history
  • Loading branch information
albert committed Jan 23, 2016
1 parent 4ddd3e1 commit 37f5240
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,9 @@ LINA64ZIP : $(RELEASELINA64) ;\
releaseproof : ; for i in $(RELEASECONTENT); do rcsdiff -w $$i ; done

ci86.lina32.o : ci86.lina32.asm ; nasm $+ -felf -g -o $@ -l $(@:.o=.lst)
ci86.lina64.o : ci86.lina64.asm ; nasm $+ -felf64 -g -o $@ -l $(@:.o=.lst)

ci86.%.o : ci86.%.asm ; nasm $+ -felf -o $@ -l $(@:.o=.lst)
ci86.%.o : ci86.%.asm ; nasm $+ -o $@ -l $(@:.o=.lst)

# The tricky `link.script' has been dispensed with.
# However, now we need _fini and _init in ciforth.c and
Expand All @@ -440,6 +441,9 @@ ciforthc : ciforth.o ci86.linux.o

# Linux native forth by nasm. FIXME the linking doesn't work.
nlina32 : ci86.lina32.o ; ld $+ -melf_i386 -N -o $@
nlina64 : ci86.lina64.o ; \
export LDEMULATION=elf_x86_64 ;\
ld $+ -N -o $@

# Linux native forth by gnu tools
glina32 : ci86.lina32.s ; as --32 $+; ld a.out -melf_i386 -N -o $@
Expand Down
7 changes: 5 additions & 2 deletions nasm.m4
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ _PC_({
; documentation of nasm.
_BOOTED_({; See again the generic system manual for more information how to install
; booting versions.
})})
})
})

dnl Directives ignored by NASM.
define({ASSUME},;)dnl Turn ASSUME into comment.
Expand Down Expand Up @@ -81,13 +82,15 @@ define({_BYTE_PTR},{BYTE $1})
define({_CALL_FAR_INDIRECT},{CALL FAR [$1]})
define({_FAR_ADDRESS},{[$1:$2]})
define({_CELL_PTR},{ CELL_M4})dnl Make it specify SIZE only.
define({_OFFSET})dnl Ignore this design error altogether.
define({_OFFSET},)dnl Ignore this design error altogether.
define({QUAD},{QWORD})

dnl Handling large blocks of comment
define({_COMMENT},{%if 0})
define({_ENDCOMMENT},{%endif})
define({SET_16_BIT_MODE},{BITS 16})
define({SET_32_BIT_MODE},{BITS 32})
define({SET_64_BIT_MODE},{BITS 64})
define({_ALIGN},{ALIGN M4_CELLWIDTH})
define({DSS},{DB})
dnl A nobits section takes no place in the object file.
Expand Down

0 comments on commit 37f5240

Please sign in to comment.