repo.or.cz
/
voodoo-lang.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
allocate fewer local variable slots
[voodoo-lang.git]
/
test
/
set-byte.voo
blob
eba8116f63bcef1ae01c8f4a3f484841acd2bc59
1
#### Test program for set-byte
2
3
section data
4
format:
5
string "%d\x0a\x00"
6
7
data:
8
byte 0
9
byte 1
10
byte 3
11
byte 4
12
13
section functions
14
import printf
15
export main
16
17
main:
18
function argc argv
19
let x get-byte data 0
20
call printf format x
21
set x get-byte data 1
22
call printf format x
23
24
set-byte data 0 12
25
set x 42
26
set-byte data 1 x
27
let n 2
28
set-byte data n 117
29
set n 3
30
set x 120
31
set-byte data n x
32
33
set x get-byte data 0
34
call printf format x
35
set x get-byte data 1
36
call printf format x
37
set x get-byte data 2
38
call printf format x
39
set x get-byte data 3
40
call printf format x
41
42
return 0
43
end function