-
Notifications
You must be signed in to change notification settings - Fork 9
/
fflin.asm
51 lines (34 loc) · 1.31 KB
/
fflin.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;;; fflin.asm FreeForth kernel, Linux specific port
;;; $Id: fflin.asm,v 1.3 2006-12-12 01:33:56 lavarenn Exp $
;;; -------------------------------------------------------
;;; Typical compile command (with http://flatassembler.net):
;;; if ffdl ; i.e. with dynamic-link-library support
;;; fasm fflin.asm ff.o
;;; gcc ff.o -o ff -s -rdynamic -nostartfiles -ldl
;;; # or: ld -o ff ff.o -ldl --dynamic-linker /lib/ld-linux.so.2 -s
;;; else
;;; fasm fflin.asm ff
;;; end if
;;; -----------------------------------------------------------------------
;;; OSFORMAT specifies the Operating-System specific executable file format
macro OSFORMAT {
ffdl=1 ; withDynamicLinkLibrary support; commented=without
if defined ffdl
format elf
section '.flat' writeable executable
public _start
else
format elf executable ; no extrn with this format
entry _start
end if
}
;;; -----------------------------------------------------
;;; OSINCLUDE defines OS-specific ASM source to "include"
macro OSINCLUDE { include "fflinio.asm" }
;;; -----------------------------------------------------
;;; OSFILE defines OS-specific FF source to "file"
macro OSFILE { file "fflin.boot" }
;;; -----------------------------------------------------
;;; all macros ready: compile all:
include "ff.asm"
;;; That's all folks!!