-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfftk.asm
53 lines (45 loc) · 1.21 KB
/
fftk.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
52
53
format elf
section '.flat' writeable executable
public _start
cmpl: file "cmpl"
;; perform header, ebp, and eax init same as ff.asm
;; overwrite values at beginning of image with
;; values specific to this build or run
_start:
mov esi,heads ; relocate headers
mov edi,H0
mov ecx,headers_size/4
rep movsd
mov ebp,ebp0 ; compilation pointer
lea eax,[esp-4096] ; allocate CALLstack
mov [cmpl],dword H0 ; set H to H0
mov [cmpl+4],dword ebp0 ; set anon to ebp0
mov [cmpl+8],esp ; save for argv
mov ecx,-4
add ecx,eax
mov [cmpl+12],ecx ; depth fix
mov ecx,[cmpl+16] ; _boot
mov [cmpl+20],dword 0 ; zero libc value, must run dlopen
xor ebx,ebx
xor edx,edx
jmp ecx
;; convince linker to provide dl*
extrn dlopen
extrn dlsym
extrn dlerror
_dummy:
call dlopen
call dlsym
call dlerror
;; no inline boot code for this version
align 4
heads: file "dict"
align 4
headers_size = $-heads
section '.bss'
ebp0 = heads
bss rb 1024*488
tib rb 1024*256
eob rb 1024
bssend:
H0 = tib-headers_size