]
peri R1, R2
store R1, [ ]
peri R1, R2
store R1, [ ]
store r1, [r2]
peri r1, r2 } }
let sleep(n) be
{ let endtime = seconds() + n;
until seconds() >= endtime do
assembly { pause 100 } }
let datetime(t, v) be
{ let p = vec 3;
if t = -1 then
t := seconds();
p ! 1 := t;
p ! 2 := v;
assembly
{ load R1, $DATETIME
load R2, [ ]
store R1, [R2]
peri R1, R2 } }
let datetime2(tsec, tusec, v) be
{ let p = vec 3, x = vec 7, now = vec 2;
if tsec = -1 then
{ useconds(now);
tsec := now ! 0;
tusec := now ! 1 }
p ! 1 := tsec;
p ! 2 := x;
assembly
{ load R1, $DATETIME
load R2, [ ]
store R1, [R2]
peri R1, R2 }
dt2_year of v := x ! 0;
dt2_month of v := x ! 1;
dt2_day of v := x ! 2;
dt2_dow of v := x ! 3;
dt2_hour of v := x ! 4;
dt2_minute of v := x ! 5;
dt2_second of v := x ! 6;
dt2_millisec of v := tusec / 1000 }
let random(max) be
{ static { seed = 872364821 };
if max < 0 then
{ seed := seconds();
return }
seed := seed * 628191 + 361;
resultis (seed bitand 0x7FFFFFFF) rem (max + 1) }