blob: 4252e917ffa14e5e3ca0802c6f941a6021c7d5c0 (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
~ (cat labels.e elf.e transform.e execution.e \
~ echo 131072 read-to-buffer; \
~ cat core.e core-plus.e linux.e output.e \
~ amd64.e execution-support.e log-load.e; \
~ echo pyrzqxgl; \
~ cat evoke.e) \
~ | ./quine > evoke && chmod 755 evoke && ./evoke
s" source-to-precompile" variable
~ : fooze 4 . ; fooze
1024 read-to-buffer
~ We begin by outputting the actual docol routine, the one that codewords
~ should point to. Note that this is before we've done any word header.
here @
dup L!' docol-codeword-value
:rsi pack-pushcontrol
8 :rax add-reg64-imm8
:rax :rsi mov-reg64-reg64
pack-next
8 packalign
here !
~ We can't use colon to create docol, not even the part that's a word,
~ because colon tries to dynamically invoke docol to fill in the codeword.
s" docol" create
here @
dup 8 + pack64
L@' docol-codeword-value :rax mov-reg64-imm64
:rax push-reg64
pack-next
8 packalign
here !
s" exit" create
here @
dup 8 + pack64
:rsi pack-popcontrol
here !
: foo [ crash 1 2 + ;
0 sys-exit
~ Now that we have docol, colon will work and we can define exit the normal
~ way.
~ : exit
~ [ here @
~ :rsi pack-popcontrol
~ here ! ] ;asm
pyrzqxgl
~ 0 sys-exit
s" source-to-copy-to-log" variable
~ (output memory start, current output point
~ -- output memory start, current output point)
~ (output memory start, current output point
~ -- output memory start, current output point)
~
~ Everything directly called by all-contents has this same interface.
~
: all-contents
0x08000000 L!' origin
elf-file-header
elf-program-header
output-cold-start
source-to-copy-to-log output-warm-start
source-to-precompile label-transform
0 L!' final-word-name
current-offset L!' total-size
0 L!' :
0 L!' ;
0 L!' ;asm
;
' all-contents entry-to-execution-token label-loop
swap sys-write bye
|