File: echo.ssa

package info (click to toggle)
qbe 1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,004 kB
  • sloc: ansic: 13,368; yacc: 843; ml: 466; sh: 379; python: 232; makefile: 100
file content (33 lines) | stat: -rw-r--r-- 574 bytes parent folder | download
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
export
function w $main(w %argc, l %argv) {
@start
	%fmt =l alloc8 8
	storel 1663398693, %fmt             # "%s%c"
	%av0 =l add %argv, 8
	%ac0 =w sub %argc, 1
@loop
	%av =l phi @start %av0, @loop2 %av1
	%ac =w phi @start %ac0, @loop2 %ac1
	%c0 =w ceqw %ac, 0
	jnz %c0, @end, @loop1
@loop1
	%c1 =w ceqw %ac, 1
	jnz %c1, @last, @nolast
@last
	jmp @loop2
@nolast
	jmp @loop2
@loop2
	%sep =w phi @last 10, @nolast 32
	%arg =l loadl %av
	%r =w call $printf(l %fmt, ..., l %arg, w %sep)
	%av1 =l add %av, 8
	%ac1 =w sub %ac, 1
	jmp @loop
@end
	ret 0
}

# >>> output
# a b c
# <<<