summaryrefslogtreecommitdiff
path: root/test-suite/standalone/sassy/tests/localdata4.scm
blob: a8d6d619b6422f84ff595d30e69a49d22011faf6 (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
(export _global_offset_table_)

(import foo)

(entry _start)

(macro stdout 1)

(text (label write ; fd buffer amount
	(mov ebx (& esp 4))
	(mov ecx (& esp 8))
	(mov edx (& esp 12))
	(mov eax 4)
	(int #x80)
	(ret)))

(text (label exit
	(mov eax 1)
	(mov ebx 0)
	(int #x80)))

(text (label _start
	get-got
	(push ebx)
	(push 5)
	(push (& ebx (got foo)))
	(push stdout)
	(call write)
	(add esp 12)
	(pop ebx)
	(push 5)	;fd
	(mov eax (& ebx (got foo)))
	(add eax 8)
	(push (& eax))
	(push stdout)
	(call write)
	(call exit)))