added shared library support to AMD64 and i386
[voodoo-lang.git] / test / at.voo
blobf677638f6c1f79426c684a3af3e443428a81e880
1 #### Test case for at-expressions
3 section data
4 p:
5 word 12
7 q:
8 word r
11 word 42
13 array:
14 word 1
15 word 2
16 word 3
18 array_ptr:
19 word array
21 str:
22 string "xyzzy"
24 str_ptr:
25 word str
27 format:
28 string "%d\n\x00"
30 char_format:
31 string "%c\n\x00"
33 section functions
34 import printf
35 export main
37 main:
38 function argc argv
39     let x @q
40     call printf format @p
41     call printf format @x
43     set x get-word @array_ptr 1
44     call printf format x
46     set-word @array_ptr 2 4
47     set x get-word @array_ptr 2
48     call printf format x
50     set x get-byte @str_ptr 4
51     call printf char_format x
53     set-byte @str_ptr 1 65
54     set x get-byte @str_ptr 1
55     call printf char_format x
57     return 0
58 end function