summary refs log tree commit diff
path: root/lisc/test/abi3.ssa
blob: 075578397d148ecb623063b665c3e457ae5328f2 (plain) (blame)
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
# l is for long word (64bits)
# w is for word      (32bits)
# h is for half word (16bits)
# b is for byte      (8bits)

type :four = {l, b, w}

function $test() {
 @start
	%y  =w copy 0

	%s  =l alloc8 16   # allocate a :four struct
	%s1 =l add %s, 12  # get address of the w
	storel 3, %s       # set the l
	storew 4, %s1      # set the w

	# function call with the above :four
	# struct as first argument and 5 int
	# arguments

	%f  =l copy $F
	%x  =w call %f(w %y, w 1, w 2, :four %s, w 5, w 6)

	# store the result in the
	# global variable a

	%x1 =w add %y, %x
	storew %x1, $a
	ret
}