User guide

116 CHAPTER 4. THE COMMAND LANGUAGE
hexdump FROM/A,N,P,RL/K,RLB/K,TO/K CIN:y, POS:y, NAT:y
This program dumps a file specified by FROM in a combination of hex and character
forms. If either RL or RLB is given the file is treated as a sequence of records. RL gives
the recor d length in BCPL words and RLB gives it in bytes. The P and N give the
number of the first record to dump and N specifie s how many to dum p. If neither RL
nor RLB is given P gives the number of the first by t e to dump and N gives the number
of bytes to dump. If the file bc is
#!/home/mr/distribution/BCPL/cintcode/cintsys -s
.k file/a,arg
echo "bcpl com/<file>.b to cin/<file> hdrs BCPLHDRS <arg>"
bcpl com/<file>.b to cin/<file> hdrs BCPLHDRS <arg>
then the command: hexdump bc 64 would generate the following:
Dump of bc from 0 to 63
0/ 0: 682F2123 2F656D6F 642F726D 72747369 #!/h ome/ mr/d istr
16/ 4: 74756269 2F6E6F69 4C504342 6E69632F ibut ion/ BCPL /cin
32/ 8: 646F6374 69632F65 7973746E 732D2073 tcod e/ci ntsy s -s
48/ 12: 206B2E0A 656C6966 612C612F 650A6772 ..k file /a,a rg.e
hold TASK/N/A CIN:n, POS:y, NAT:n
This is only avai l ab l e under Cintpos. It causes the sp e ci fi ed task to be put into
HOLD state to stop it being avail ab l e to run. Its inverse is unhold desc r i bed b el ow.
idvec ADDRESS/A CIN:n, POS:y, NAT:n
This Cintpos command attempts to identify the vector at a given address. Two
example call are given below:
0.000 1> idvec 23522
Stack of task 4
0.000 1> idvec 15994
Code section of task 5: MBXHAND
0.000 1>
if ,NOT/S,WARN/S,ERROR/S,FAIL/S,EQ/K,VAREQ/K,EXISTS/K: CIN:y, POS:y, NAT:y
This command normally ends wi t h a semicolon and the remainder of the line is
conditionally executed by the CLI depending on whether the if condition is sati sfi ed.
The return code and second resul t of the previ ous CLI command are hel d in the globals
cli
returncode and cli result2. If one of WARN, ERROR or FAIL was given, the
if command tests whether the previous command’s return code greater or equal to
warn(=5), error(=10) or fail(=20). If the EQ argument was given, it tests whether the
return code is the same as the first argument. If VAREQ is given, it specifies is a logical
variable name and the value of this vari abl e is compared with the first argument. The
EXISTS argument is a file nam e whose existence is tested. The NOT switch complements
the condition.