blob: f59a1f73326711b15c62f447e2fe9b65b33204af (
plain)
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
|
# uskel runtime and start; include this at the top.
.section .init
.global _start
_start:
jmp _uskel_start
.include "include/macros.s"
.section .bss
_unix_rsp:
# back-up of program entry rsp (aka the actual stack given by the
# actual OS; we might like to use it at some point, maybe)
cell 0
.include "include/gc.s"
.section .text
_uskel_start:
# we use the stack pointer for easy writing to the heap;
# back it up to memory state just if we ever needed it again.
mov %rsp, _unix_rsp
# allocate the initial chunk of memory
mov $_uskel_start_main, %rsi
jmp _uskel_gc_init
_uskel_start_main:
# push a thunk for main
pushq $0
pushq $main
mov $0, %rsi # set continuation to exit
enter %rsp # run the program
# Q: are there gonna be functions that have both the argument AND the cont?
#
# A: No, stuff is either entered as return-continuation (takes res,
# cont has to be saved) or as forward call (takes cont)
#
# (A needs validation)
|