summaryrefslogtreecommitdiff
path: root/t/extern.pas
blob: f5cf6174f6d142227e6ebb1c0635e23a87e76f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
program hello_world;

extern Pascal_puts(s:string):integer;
extern Pascal_printf(s:string; ...):integer;
extern Pascal_scanf(s:string; ...):integer;

function main():integer;
var
    buf:array[0..1023] of char;
    i:integer;
begin
    Pascal_puts('Hello, World!');
    Pascal_printf('Variadic Function Test: %d, %s, %llx\n', 1, 'yes', 0x123456789abcd);
    for i:=0 to 10 do
    begin
        if i=3 then continue;
        if i=5 then break;
        Pascal_printf('say something: ');
        Pascal_scanf('%s', @buf[0]);
        Pascal_printf('round %d you said: %s\n', i, @buf[0])
    end;
end;