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
38
39
40
41
42
43
// for passing an argument and receiving a return value
uint64_t arg;


void
getui()
{
    // implementation of subprogram getui
}

void
puts()
{
    // implementation of subprogram puts
}

void
putui()
{
    // implementation of subprogram putui
}

// some string (array of characters)
char msg[] = "You typed: ";

void
main()
{
    // local variable
    uint64_t    n;

    // call subprogram getui, copy return value to local variable
    getui();
    n = arg;

    // copy pointer to string literal to arg, call puts
    arg = msg;
    puts();

    // copy local variable to arg, call putui
    arg = n;
    putui();
}