|
|
1.1 ! root 1: .TH BITE 1 local ! 2: .SH NAME ! 3: bite \- Basic Interpreter for Testing & Engineering ! 4: .SH SYNOPSIS ! 5: .B bite ! 6: [ - ] [prog1 prog2 prog3 .....] ! 7: .SH DESCRIPTION ! 8: .I Bite ! 9: is a BASIC language interpreter. ! 10: Its virtues are in that it is written in the Bell System 'C' ! 11: compiler language which lends itself to ! 12: .I portability ! 13: and ! 14: .I readability. ! 15: One of the most important aspects is that the interpreter is ! 16: .I interfaced ! 17: with the ! 18: .I system shell via the '!' command. ! 19: Shell commands can be executed inmmediately or actually typed into ! 20: the BASIC program itself! ! 21: "bite" may also be invoked by a shell script and when given an argument ! 22: (a program name) will automatically cause the BASIC program to be ! 23: executed. In that case the BASIC program should be terminated with ! 24: a "bye" statement. ! 25: The inclusion of the '-' option, along with a BASIC program name will ! 26: cause "bite" to start and then "load" the BASIC program ! 27: .I without ! 28: running it. ! 29: .PP ! 30: .I Bite ! 31: is designed so that BASIC language programs ! 32: of the original Dartmouth syntax will be loadable ! 33: with little or no incompatibility and extra features that do not ! 34: follow common standards will be ! 35: .I additions ! 36: to, rather than ! 37: .I exceptions ! 38: to the syntax rules of BASIC. ! 39: ! 40: The commands and functions in this interpreter ! 41: are implemented by entries into ! 42: tables and the procedure for implementing new ! 43: commands will be documented as another virtue of the ! 44: configuration of this interpreter. ! 45: .PP ! 46: .I Bite ! 47: was implemented ! 48: with ! 49: .I instrument control ! 50: and ! 51: .I data collection ! 52: in mind ! 53: for the purpose of controlling an ! 54: .I Automated Test System (ATS). ! 55: These functions will be available as an extended instruction set. ! 56: Another version of "bite" is being configured for this purpose ! 57: which will reside (initially) on an PDP-11/03 (subsequently on ! 58: a PDP-11/23). ! 59: .PP ! 60: A standard string capability is implemented on the BASIC interpreter ! 61: BITE. ! 62: .TP 4 ! 63: .I Conventions ! 64: .TP 8 ! 65: .I THIS DOCUMENT ! 66: All things enclosed in [] are optional. ! 67: .TP 8 ! 68: .I EDITING ! 69: Editing is accomplished as it is in any BASIC language intepreter ! 70: in that line-numbers are entered by typing a line-number followed ! 71: by the statement and removed or deleted by merely typing the line-number. ! 72: Listing is accomplished with the "list" command (explained under "COMMANDS"). ! 73: In addition to the above, it is possible to list single lines by typing ! 74: the return-key in which case the program is listed one line-at-a-time, ! 75: starting at the first. When the last one is reached, the sequence starts ! 76: at the first line again. ! 77: At any time it is also possible to type the '-' symbol to "backup" a line- ! 78: at-a-time. ! 79: Other editing facilities are "s", "delete", and "reseq" also explained ! 80: under "COMMANDS". ! 81: .TP 8 ! 82: .I EXPR ! 83: Any algebraic expression which could be a constant, variable, math ! 84: function or a combination of same, seperated by arithmetic operators ! 85: as in: a+b*3.14*(4.4+c2*sin(b+s))+a(2,2) ! 86: See "variables" and "math functions" below. ! 87: .TP 8 ! 88: .I OPERATORS ! 89: +,-,*,/ or ^ for addition, subtraction, multiplication, division or ! 90: exponentiation in order of lowest to highest precidence. + and - have ! 91: the same precidence and * and / have the same precidence. ! 92: .TP ! 93: .I RELATIONALS ! 94: <, >, =, <=, >=, <> for less than, greater than, equality, less or equal, ! 95: greater than or equal and not equal. ! 96: .TP 8 ! 97: .I SOURCE PATH ! 98: When reference is made to a "bite" source file (i.e. the "old" and "load" ! 99: command), at least two directories are searched, the first being the current ! 100: directory and then /usr/lib/bites which is a "pool" where shared programs ! 101: should be stored. The /usr/lib/bites directory is analogous to the ! 102: /usr/bin directory in UNIX. ! 103: The user may specify extra paths to be searched by defining them in ! 104: BITEPATH and then exporting BITEPATH like: ! 105: .br ! 106: BITEPATH=:$HOME/BASIC:/usr/local/lib/: ! 107: .br ! 108: which adds the two pathnames between the ':' delimiters to the ! 109: other paths. In this way, one may have private BITE programs ! 110: and execute them from any directory. ! 111: .TP 8 ! 112: .I SOURCE PROGRAM NAME ! 113: The source program name is twelve or less characters suffixed by a .b . ! 114: .TP 8 ! 115: .I STATEMENT ! 116: A basic statement consists of a line number (integer value between 1 and ! 117: 32767) followed by a command, space and operand which follows the ! 118: syntax governed by the command as in: 100 print "hello world" ! 119: A statement can be typed without a line number in which case it will ! 120: execute immediately. This is true for all commands, but doesn't make ! 121: sense for all commands such as "for". Immediate execution is handy ! 122: for diagnostic purposes such as: print a, to find out what the value ! 123: of a. ! 124: .TP 8 ! 125: .I VARIABLES ! 126: All variable names are either a lower case alpha character (a-z) ! 127: or a lower-case alpha character followed by an integer (0-9). ! 128: Array have the same name convention as regular variables and take ! 129: the form varname(D1,D2,D3....D10) where D1-D10 are the dimension ! 130: attributes of the array and can take the form of any legal expression ! 131: (including another array) as in a(b(2,2),x). ! 132: .TP 8 ! 133: .I STRING VARIABLE ! 134: A string variable is any single lower case alpha character (a-z) ! 135: followed by a '$' or any single alpha character followed by a single digit ! 136: (1-9) then followed by a '$' like a$ or z9$. ! 137: .TP 8 ! 138: .I STRING ARRAY VARIABLE ! 139: A string array variable has the same naming convention as a regular string ! 140: variable and contains one or two "subscripts" enclosed in parenthesis ! 141: as in: ! 142: .br ! 143: x1$(x,y) ! 144: ! 145: Like other array variables in BASIC string arrays must be declared ! 146: in a dimension statement prior to their use: e.g. dim a$(20) or ! 147: d$(100,3). ! 148: .TP 8 ! 149: .I STRING EXPRESSION ! 150: A string expression is any combination of string variables and ! 151: literals added together by a '+' operator which indicates concatenation. ! 152: An example of an assignment statement for string variables is: ! 153: ! 154: b$="Joan"+a1$+c2$+"John"+x$(20) ! 155: .SH COMMANDS ! 156: .TP 8 ! 157: .I bye or q ! 158: Exit ! 159: the interpreter. ! 160: .TP 8 ! 161: .I com[mon] ! 162: Preserve ! 163: variables for subsequent "run". Issue of the run command ! 164: otherwise de-allocates all variables. ! 165: .TP 8 ! 166: .I con \fR[line#] ! 167: Continue normal execution from single step mode. See "sing" command. ! 168: .TP 8 ! 169: .I data \fR(expr),(expr),(expr),.......... ! 170: The data statement is a string of defined constants or expressions referred ! 171: to by the "read" statement. Unlike most BASIC interpreters, the data is ! 172: stored only in the form of text strings which allows the read statement to ! 173: evaluate expressions as well as constants. ! 174: .TP 8 ! 175: .I del[ete] \fRlownum [, highnum] ! 176: Delete line-number specified if only lownum given. Delete all lines ! 177: between lownum and highnum if both are specified. ! 178: See the "undo" command. ! 179: .TP 8 ! 180: .I dim \fRvariable(expr1,expr2,....,expr10) ! 181: Allocate space and define the dimensional characteristics of ! 182: subscripted variable. ! 183: .TP 8 ! 184: .I end ! 185: Define logical end of program. Cause termination or current "run". ! 186: .TP 8 ! 187: .I expunge ! 188: Force all variable space, including subscripted variables to be freed. ! 189: Or de-allocate used varriable space. ! 190: .TP 8 ! 191: .I f ! 192: Identify current file. Typing "f" causes the currently referenced ! 193: file (if any) to be displayed. ! 194: .TP 8 ! 195: .I for - next ! 196: Cause code enclosed by this combination to be executed under the ! 197: conditions specified in the ! 198: .I for ! 199: statement as in: for variable = expr1 to expr2 [step expr]. ! 200: .TP 8 ! 201: .I gosub \fRline# ! 202: Goto subroutine, resume from following statement after "return" encountered. ! 203: .TP 8 ! 204: .I goto \fRline# ! 205: Force execution to continue starting at the line# specified. ! 206: .TP 8 ! 207: .I if \fR(expr1) relational (expr2) \fIthen \fRline# ! 208: Redirect program flow to line# if expr1 is related to expr2 by the ! 209: specified relational. ! 210: String expressions are also compared by the "if" statement as in: ! 211: .br ! 212: if a$ < "jim" goto 100 ! 213: .br ! 214: The results of the comparison are based on alphabetical order ! 215: of the two objects being compared. ! 216: The "then" in the "if" statement can be optionally replaced with "goto" ! 217: "go to" or "gosub". The "if" statement can also take the form: ! 218: .br ! 219: .I if \fR(expr) relatioanl (expr) \fIthen \fRvar = (expr) ! 220: .TP 8 ! 221: .I if \fRmore _fd \fI then \fRline# ! 222: Direct program flow to line# if there are more lines to be read ! 223: from the file associated with fd where fd is the file designator ! 224: between 1 and 4 inclusive. This type if statement is used to detect ! 225: EOF (End Of File) condition. ! 226: .br ! 227: Example: 100 if more _2 then 200 ! 228: .br ! 229: Note that "gosub" can be used in place of "then" in which case ! 230: the subroutine would be one for reading another line. ! 231: .TP 8 ! 232: .I input \fR[_fildes]var1[,var2,var3,....] ! 233: Prompt for input and assign inputed value to variable. ! 234: If 's' is typed program is halted. ! 235: String variables may be specified in the "input" statement. The ! 236: variables can be mixed like: ! 237: .br ! 238: input a$,a,b$(2,2) ! 239: .br ! 240: which will interpret the first input as a string, require the second ! 241: input to be numerical and interpret the third as a string input. ! 242: .TP 8 ! 243: .I [let] \fRvariable = expr ! 244: Assign the value of expr to variable. ! 245: The let is optional. ! 246: The let or assignment statement also allows the assignment of ! 247: string expressions to string variables like: ! 248: .br ! 249: b$="Joan"+a1$+c2$+"John"+x$(20) ! 250: .TP 8 ! 251: .I l[ist] \fR[lownum [, highnum]] ! 252: List the text in working storage. If lownum is given then only that number ! 253: is listed, if lownum and highnum are specified, then a listing is ! 254: displayed between the given statement numbers. ! 255: .TP 8 ! 256: .I load \fR[prog-name] ! 257: Same as the "old" command, except working storage is not cleared. ! 258: .TP 8 ! 259: .I ls \foptions ! 260: List directory. Same as UNIX "ls" command. ! 261: .TP 8 ! 262: .I mov \fRstartnum,endnum,newnum [,increm] ! 263: The mov command causes the lines beginning with ! 264: .I startnum ! 265: and ending with ! 266: .I endnum ! 267: to be moved (ie. resequenced) to the line beginning with ! 268: .I newnum ! 269: and incremented by ! 270: .I increm \fR. ! 271: The default value for ! 272: .I increm ! 273: is 10. ! 274: All references to the moved lines are updated. The user is responsible to ! 275: see that line numbers associated with moved lines do not conflict with ! 276: existing lines which will cause loss of program text. ! 277: .I mov ! 278: is similar to ! 279: .I reseq ! 280: (see below) except that only the specified lines are resequenced. ! 281: .TP 8 ! 282: .I n ! 283: List the next 23 lines. Useful for paging through a listing on a CRT. ! 284: .TP 8 ! 285: .I new ! 286: Clear program working storage for new program to be typed. ! 287: .TP 8 ! 288: .I old \fR[prog-name] ! 289: Clear user space and load program. If old is typed with no argument ! 290: it will prompt the user for a program name if not defined or load ! 291: the last defined program name. ! 292: .TP 8 ! 293: .I on \fR(expr) \fIgoto \fRline#,line#,....... ! 294: Is a selective goto with multiple line number targets. The target ! 295: branched to depends on the value of expr which is truncated. ! 296: Control is passed to the first line# specified after goto if the ! 297: value of the expression is 1. Control passes to the second line# ! 298: if the value is 2, the third if 3 and so on. ! 299: .TP 8 ! 300: .I on \fR(expr) \fIgosub \fRline#,line#,....... ! 301: Same action as on-goto, except action taken is that of "gosub". ! 302: .TP 8 ! 303: .I pause ! 304: Causes execution to be suspended until a "newline" or "return" is typed. ! 305: This is useful for programs which need to be continuously in "run", but ! 306: need to allow a time for user action i.e. unit insertion. ! 307: .TP 8 ! 308: .I pr[int] \fR[_fildes](expr's,quoted strings or tab operators) ! 309: The print statment is a limited format display statement in which ! 310: expressions are evaluated and displayed along with quoted literals. ! 311: The tab(expr) operator causes the print head to move to the absolute ! 312: column position computed by expr provided the current head position ! 313: is less. The specifiers must be seperated by onee or more commas ! 314: or semicolons. ! 315: String expressions are also expanded by the print statement. ! 316: .TP 8 ! 317: .I printf \fR[_fildes]"format string"[,expr1,expr2,.....,expr10] ! 318: This is an interpretive implementation of the UNIX 'C' library ! 319: routine, printf. It is, however restricted to only the floating ! 320: point format control specifiers 'f' and 'g'. Use of any of the ! 321: other specifiers such as 'o', 'd' or 's' will give erroneous results. ! 322: Print controls such as \\b (backspace), \\n (newline), \\r (return) ! 323: or \\t can also be used. The printf format was chosen in lieu ! 324: of the usual "print using" command because it was felt that ! 325: printf is not only a 'C' language standard but easier to use ! 326: than "print using". ! 327: .br ! 328: Usage Example: ! 329: .br ! 330: 100 printf "Variable a=%2.2f\\tVariable b=%g.\\n",a,b ! 331: .TP 8 ! 332: .I randomize ! 333: Causes "rnd" statement to start at an "unpredictable" value. ! 334: .TP 8 ! 335: .I read \fRvar1,var2,var3,.............. ! 336: The "read" statement causes data to be assigned to each variable in the ! 337: list from the constants or expressions contained in "data" statements. The ! 338: reading starts where-ever the data pointer is currently at. The data pointer ! 339: points to the last data field accessed, if a read was done, the first ! 340: data field in the first data statment if the "restore" statment is issued ! 341: or the program is re-run. ! 342: The "read" statement will also assign values to string variables or ! 343: expressions in the "data" statement. ! 344: .TP 8 ! 345: .I rem ! 346: The remark statement causes no operation in ! 347: .I bite ! 348: but may be followed by any string of characters for the purpose of commenting ! 349: a program. Unlike compiler languages, remarks do take up program buffer space, ! 350: however, they are of paramount importance in making a program readable by ! 351: human beings and are therefore strongly recommended. ! 352: .TP 8 ! 353: .I reseq \fR[startnum [, increm]] ! 354: The resequence command causes the statement numbers and all references ! 355: to them (such as if's goto's, gosub's, etc) to be resequenced starting ! 356: at ! 357: .I startnum ! 358: and incremented by ! 359: .I increm. ! 360: If startnum and/or increm are omitted, the default values are 10 and ! 361: 10 respectively. ! 362: .TP 8 ! 363: .I restore ! 364: Restores the data pointer to the first field of the first "data" statment. ! 365: .TP 8 ! 366: .I return ! 367: Return from subroutine called by "gosub" statement. ! 368: .TP 8 ! 369: .I rm \ffilename(s) ! 370: Remove file(s). Same as UNIX "rm" command. ! 371: .TP 8 ! 372: .I run \fR[prog-name] ! 373: Run basic program specified. If no argument is given, "run" attempts to ! 374: execute whatever is currently in working storage. ! 375: .TP 8 ! 376: .I s \fRline#/old-string/new-string[/] ! 377: Substitute in line line# the new-string for the old-string. The last delimiter ! 378: is optional, unless new-string is null in which case it is desired that ! 379: old-string merely be removed. ! 380: See the "undo" command. ! 381: .TP 8 ! 382: .I sing \fR[line#] ! 383: Enter the single step mode starting at the line# specified or at ! 384: the first line of the program if no line# is specified. ! 385: In single step mode an instruction is executed and then the prompt '^' ! 386: is displayed. ! 387: At this time the user may enter ! 388: any command (i.e. print) or hit the "return" key to execute the next ! 389: instruction. ! 390: See the "con" instruction. ! 391: .TP 8 ! 392: .I size ! 393: Causes amount of storage used and remaining or free space in ! 394: decimal number of bytes. ! 395: .TP 8 ! 396: .I stop ! 397: Stop execution of program. ! 398: .TP 8 ! 399: .I save \fR[prog-name] ! 400: Save the contents of working storage in file-name specified by progname. ! 401: If no progname is given last referenced file-name is used. If no file ! 402: name was referenced, the user is prompted for a name. ! 403: .TP 8 ! 404: .I undo ! 405: Undo last "s" command or ! 406: .I single line deletion. ! 407: .TP 8 ! 408: .I ! (any shell command string) ! 409: Unix shell command invocation allows system commands to be ! 410: executed from the interpreter. ! 411: Not available in restricted version. ! 412: .SH FILE COMMANDS ! 413: The file commands: append, openi, and openo are followed by one or more ! 414: file-names seperated by commas, each file-name being no more that ! 415: 14 characters long. Files are assigned to designators (integer values ! 416: between 1 and 8 inclusive) in the order that they are open. ! 417: All commands ! 418: such as "print" and "input" which refer to a file use the designator ! 419: number preceded by a '_' character to refer to that file ! 420: as in: 100 print _1"hello world" or 100 input _3a(x,y) . ! 421: .TP 8 ! 422: .I append \fRfile1[,file2,.....,file8] ! 423: If file exists open for output cause new data to be appended. If file ! 424: does not exist, the named file is created. ! 425: .TP 8 ! 426: .I openi \fRfile1[,file2,.....,file8] ! 427: Open file for input. File must exist. ! 428: .TP 8 ! 429: .I openo \fRfile1[,file2,.....,file8] ! 430: Create named file(s) and open for output. If named files exist, the old ! 431: data is destroyed. ! 432: .TP 8 ! 433: .I seek \fR_fildes, offset, mode ! 434: Seek to a line whose position in the file is offset. If mode = 0 the ! 435: offset is from the beginning, if mode = 1 then the offset is relative ! 436: to the current file pointer. ! 437: .br ! 438: Usage Example: 101 seek _1, 33, 0 ! 439: .br ! 440: would cause the file pointer to the 33rd line. ! 441: .TP 8 ! 442: .I rewind \fR_fildes ! 443: Rewind the file specified by fildes to the beginning (first line). ! 444: This is effectively the same as seek _fildes, 0, 0. ! 445: .TP 8 ! 446: .I close \fR_fildes ! 447: Close file associated with file designator. ! 448: .TP 8 ! 449: .I closeall ! 450: Close all files input and output. ! 451: .SH MATH FUNCTIONS ! 452: .TP 8 ! 453: .I abs\fR(expr) ! 454: Absolute value. ! 455: .TP 8 ! 456: .I atn\fR(expr) ! 457: Arc-tangent. ! 458: .TP 8 ! 459: .I cos\fR(expr) ! 460: Cosine. ! 461: .TP 8 ! 462: .I exp\fR(expr) ! 463: Natural exponential. ! 464: .TP 8 ! 465: .I fact\fR(expr) ! 466: Factorial. (Truncates fractions i.e. fact(3.22) interpreted as fact(3)) ! 467: .TP 8 ! 468: .I int\fR(expr) ! 469: Integerize or truncate fractional part of result of expr. ! 470: .TP 8 ! 471: .I log\fR(expr) ! 472: Natural log. ! 473: .TP 8 ! 474: .I rnd\fR(expr) ! 475: Return random number between 0 and evaluated expr. ! 476: .TP 8 ! 477: .I sin\fR(expr) ! 478: Sine. ! 479: .TP 8 ! 480: .I sqr\fR(expr) ! 481: Square root. ! 482: .SH STRING FUNCTIONS ! 483: .TP 8 ! 484: .I asc(string) ! 485: Returns ASCII value of first character in string. ! 486: .TP 8 ! 487: .I chr$(expr) ! 488: Return the character corresponding to the value of expr where expr ! 489: is a numerical expression. If the value of the expression exceeds ! 490: octal 177 the least significant 7 bits are used. ! 491: .TP 8 ! 492: .I ext$(string,pos,len) ! 493: The ext$ "extract" string function returns a substring of the ! 494: string expression string starting at position "pos" having length "len". ! 495: If attempt is made to extract a string beyond the end of "string" the result ! 496: will be truncated and an error message will be displayed. ! 497: .TP ! 498: .I len(string) ! 499: Return the length of the string expression "string". ! 500: .TP ! 501: .I left$(string,n) ! 502: Return the leftmost n characters of the string. If the string length is ! 503: less than n, then the string itself is returned. ! 504: .TP ! 505: .I loc$(string) ! 506: Converts all upper case alphabetic characters in the string to lower case. ! 507: .br ! 508: EX: a$=loc$("ABCdef123#$^&*") ! 509: .br ! 510: returns abcdef123#$^&* to a$ ! 511: .TP ! 512: .I mid$(string,pos,len) ! 513: Does exactly same as ext$. Included because it is part of another ! 514: popular dialect of BASIC. ! 515: .TP ! 516: .I right$(string,n) ! 517: Return rightmost n characters of string. If string length is less than ! 518: n the string itself is returned. ! 519: .TP ! 520: .I str$(expr) ! 521: Returns value of expr (numerical expression) as an ASCII string. ! 522: .TP ! 523: .I string$(n,string) ! 524: Returns n occurrences of the first character in string. ! 525: .TP ! 526: .I upc$(string) ! 527: Converts all lower case alphabetic characters in the string to upper case. ! 528: .TP ! 529: .I val(string) ! 530: Return numerical value represented by ASCII number. ! 531: .br ! 532: Ex: a=val("100.2") ! 533: .br ! 534: assigns the value 100.2 to variable a. This function is good for ! 535: converting ASCII tabulations of numbers. ext$ or mid$ can be used ! 536: to select the column. ! 537: .SH ATS INSTRUMENT COMMANDS ! 538: .TP 8 ! 539: .I buspr \fR'busadr(text and expressions) ! 540: Buspr is merely an extension of the print statement which allows ! 541: the print string which would otherwise be displayed on the tty ! 542: to be sent via the IBV-11 bus to the bus address specified by "busadr". ! 543: The ' preceding busadr distinguishes the following character from anything ! 544: other than a single character to be interpreted as an address. ! 545: .br ! 546: Usage Example: 100 buspr '6"F2R";r ! 547: .TP 8 ! 548: .I cmd "string" ! 549: Send character string over IBV-11 command lines. ! 550: .TP 8 ! 551: .I delay num ! 552: Causes a delay of num 60ths of a second where num is an integer. ! 553: .br ! 554: Usage Example: 100 delay 120 (delay 2 minutes or 120/60ths sec) ! 555: .TP 8 ! 556: .I dvminit ! 557: Initialize Digital Voltmeter. ! 558: .TP 8 ! 559: .I dvms \fRfunction, range ! 560: Digital voltmeter set command, where: function is "ac", "dc" or "ohms" ! 561: and range is .1, 1, 10, 100, 1k, 10k or "aut". i.e. ! 562: .br ! 563: Usage Example: 100 dvms dc,1k ! 564: .TP 8 ! 565: .I hprintf \fR"format text"[,expr1,expr2,...,expr10] ! 566: Formatted print to strip printer. Syntax rules are the same as ! 567: . I printf. ! 568: Strip printer is 20 columns wide, anything past the 20th column is ! 569: truncated. ! 570: .TP 8 ! 571: .I lodset \fRlodnum,mode,value ! 572: Set load. Where lodnum an integer describing which load referred to, ! 573: mode is the manner in which the load is set and value is an expression ! 574: describing the current or resistance the load was set to depending on the ! 575: mode. Mode is a single character 'r', 'R', 'i' or 'I' where 'r' is resistance ! 576: mode (value in ohms) and 'i' is current mode (value in amperes). Small ! 577: letter causes a hunt for the value and capital causes set on first try. ! 578: .TP 8 ! 579: .I relay \fRfunction, relnum1[, relnum2, relnum3,... ] ! 580: Set multiprogrammer relays. Function is m (make), b (break) or c (clear). ! 581: Function is followed by all relay numbers to be acted upon which may ! 582: be expressions or variables. The clear function when not followed by ! 583: anything, simply means open all relays. When followed by relay numbers, ! 584: clear means all relays are open EXCEPT the ones specified. ! 585: .br ! 586: Usage Example: 100 relay m,10,20,21,a,b,rnd(10) ! 587: .TP 8 ! 588: .I ps \fRpsno, voltage, current limit, overvoltage ! 589: Set power supply parameters. Psno is an integer representing the ! 590: power supply number describing which power supply is to be used, ! 591: voltage, current limit and overvoltage are self explanatory. Each ! 592: one of the parameters may be a legal algebraic expression so that ! 593: they may be controlled by the program. ! 594: .br ! 595: Usage Example: 100 dvms 1,10,1,11 or 100 dvms n,v1,i1,v1+1 ! 596: .SH INSTRUMENT FUNCTIONS ! 597: .TP 8 ! 598: .I btn\fR(expr) ! 599: Button function returns non-zero if control button number (expr) is ! 600: depressed. ! 601: .TP 8 ! 602: .I dvmr() ! 603: Return digital voltmeter reading. ! 604: .TP 8 ! 605: .I error() ! 606: Return 1 if last instrument command caused instrument error, otherwise ! 607: return 0. ! 608: ! 609: .SH AUTHORS ! 610: Richard B. Drake & James P. Hawkins ! 611: .SH FILES ! 612: source.b ! 613: .br ! 614: /usr/lib/bites/<source> ! 615: .br ! 616: .SH "SEE ALSO" ! 617: sh(1),bstring(1) ! 618: BASIC Programming and Applications, C. Joseph Sass 1972 ! 619: .br ! 620: .br ! 621: BITE Users Guide, J.P.Hawkins, Bell Labs, TM-79-2425-4 ! 622: .SH DIAGNOSTICS ! 623: Diagnostic error messages are issued by the interpreter ! 624: which indicate syntax errors , system failure, illegal commands or expressions,etc. ! 625: The ! 626: .I LSI-11/03 ! 627: Version of ! 628: .I bite ! 629: does not issue explicit error messages, but displays an error number ! 630: in which the meanings are listed below. This is done to regain approx. ! 631: 2Kb memory in an already tight LSI-11/03 memory. ! 632: .nf ! 633: .I Standard Error Messages ! 634: ! 635: NUMBER MESSAGE TEXT ! 636: -------------------- ! 637: 0 REFERS TO A NON EXISTING LINE NUMBER ! 638: 1 UNRECOGNIZABLE OPERATION ! 639: 2 CANNOT OPEN FILE ! 640: 3 ILLEGAL VARIABLE NAME ! 641: 4 BAD FILENAME ! 642: 5 WORKING STORAGE AREA EMPTY ! 643: 6 RUNS NESTED TOO DEEPLY ! 644: 7 UNASSIGNED VARIABLE ! 645: 8 EXPRESSION SYNTAX ! 646: 9 BAD KEYWORD IN STATEMENT ! 647: 10 IMPROPER OR NO RELATIONAL OPERATOR ! 648: 11 UNBALANCED QUOTES ! 649: 12 FILE EDITING NOT PERMITTED IN SINGLE STEP MODE ! 650: 13 MISSING OR ILLEGAL DELIMITER ! 651: 14 GOSUB WITH NO RETURN ! 652: 15 IS FATAL ! 653: 16 UNBALANCED PARENTHESIS ! 654: 17 UNKNOWN MATH FUNCTION ! 655: 18 NEXT WITH NO OR WRONG FOR IN PROGRESS ! 656: 19 CANNOT PROCESS IMAGINARY NUMBER ! 657: 20 WHAT ? ! 658: 21 BAD DIMENSION SYNTAX ! 659: 22 TOO MANY DIMENSIONS ! 660: 23 REDUNDANT DIM STATEMENT ! 661: 24 NOT ENOUGH WORKING STORAGE SPACE ! 662: 25 VARIABLE NOT DIMENSIONED ! 663: 26 WRONG NUM OF DIMS ! 664: 27 ONE OR MORE DIMS LARGER THAN ASSIGNED ! 665: 28 NEG. OR ZERO DIMENSION ILLEGAL ! 666: 29 DIVIDE BY ZERO ! 667: 30 BAD TAB SPEC. IN PRINT ! 668: 31 SYS CALL FAILED ! 669: 32 BAD FILE DECLARE SYNTAX ! 670: 33 OUT OF DATA ! 671: 34 FILE-NAME TOO LONG ! 672: 35 FILE DES. USED UP ! 673: 36 FILE NOT OPEN FOR OUTPUT ! 674: 37 FILE NOT OPEN FOR INPUT ! 675: 38 EXPRESSION YIELDS AN IMPOSSIBLE VALUE ! 676: 39 PRINTF: ARG COUNT MISMATCH ! 677: 40 PRINTF: MORE THAN 10 ARGS ! 678: 41 LINE TOO LONG FOR STRIP PRINTER ! 679: 42 MOV REQUIRES 3 LINE #'s SPACING IS OPTIONAL ! 680: .I String error messages ! 681: 49 STRING VARIABLE IN NUMERICAL EXPR. ! 682: 50 NON-STRING IN STRING ASSIGNMENT ! 683: 51 NUMERIC IN STRING EXPRESSION ! 684: 52 INVALID STRING OPERATOR ! 685: 53 CANNOT COMPARE STRING WITH NUM. TYPES ! 686: 54 UNKNOWN STRING FUNCTION ! 687: 55 OUT OF STRING RANGE ! 688: ! 689: .I Test Set and Instrument Error Messages ! 690: ! 691: 100 MISSING ' DELIMITER BEFORE BUS ADDR ! 692: 101 PS: VOLTAGE OUT OF RANGE ! 693: 102 PS: CURRENT OUT OF RANGE ! 694: 103 PS: OVERVOLTAGE OUT OF RANGE ! 695: 104 RELAY ERR ! 696: 105 RELAY: INVALID FUNC. ! 697: 106 RELAY: INVALID NUMBER ! 698: 107 DVM: INVALID MODE ! 699: 108 DVM: INVALID RANGE ! 700: 109 LODSET: IMPROPER NUMBER OF ARGUMENTS ! 701: 110 LODSET: IMPROPER MODE ! 702: 111 LODSET: UNABLE TO SET LOAD ! 703: .fi ! 704: .SH BUGS ! 705: There are more or less common features not yet available such as ! 706: .I string variables, multiple statment lines, matrix statements ! 707: and the ! 708: .I def ! 709: statement. ! 710: Array variables do not accept reference to 0th elements. ! 711: Bugs will be found as local users write and execute programs and report ! 712: their problems.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.