interplane.Get Omega
Read in your language

spark-connector

aien-dev/spark-connector

Brought by drakestapleton

branch main Branches Tags History

spark-connector / gates / celldrv.om

41 lines · 963 bytes Raw Blame History
1note gates/celldrv.om -- test tool (never shipped): run the runner's own cell code (runner/30cell.om,
2note r_check) on one job directory, as a job would.
3note Composed: om2, om/tls sha2, runner/00base.om, runner/30cell.om, this unit.
4note argv: job directory holding source.om and stdin. The compiler is <state>/bin/omc
5note (state = $INTERPLANE_RUNNER_HOME). Prints "exit <outcome> binary <hex> stdout <hex>".
6text cdusage "usage: celldrv JOBDIR\n"
7text cdex "exit "
8text cdbin " binary "
9text cdout " stdout "
10text cdfail "celldrv: a stage could not be started\n"
11
12fn main to int
13p = new uchar 4096 0
14if ne argcnt 2
15r_say cdusage
16ret 2
17end
18if not r_home
19ret 2
20end
21n = argread 1 p 0 4000
22if le n 0
23ret 2
24end
25for i ulong ulong n bound 4096
26put rjd i get p i
27end
28put rgv rjdl ulong n
29if not r_check
30r_say cdfail
31ret 3
32end
33r_say cdex
34w = write 1 rjf rfexit get rgv rexl
35r_say cdbin
36w = write 1 rjf rfbin 64
37r_say cdout
38w = write 1 rjf rfout 64
39r_say rtnl
40ret 0
41end