SHELL V2.11 (C)Copyright 1986-88, Matthew Dillon, All Rights Reserved. Freely distributable for non-profit only. old users: Please read the version history at the bottom of this document for changes and additions. (A) Compiling (B) Overview (C) Quicky tech notes on implimentation. (D) Command pre-processor (E) Command-list (F) special SET variables (G) Version history See also EXAMPLES.TXT NEW FEATURES THIS VER (Taken from the history below): an IPC implementation, ENV: variable support, many commands enhanced, some bugs fixed. COMPILATION The SHELL will compile only under AZTEC C and requires my support library (SUP32.LIB) to link as well as a precompiled symbol table of all AMIGA .H files. A Makefile is included. Note that the shell must be compiled using 32 bit integers (+L) option and linked with SUP32.LIB and C32.LIB. Additionaly, my dres.library must be present in order to use the IPC facility. NOTE that converting the shell to use 16 bit integers does not make it significantly smaller or faster. Do not waste your time. OVERVIEW Matthew Dillon 891 Regal Rd. Berkeley, California 94708 USA ..!ucbvax!dillon dillon@ucbvax.Berkeley.EDU dillon@cory.Berkeley.EDU This is not a shareware program. My basic philosophy is to write software for myself and distribute it if I think it will benefit others (that is, unless I start going broke). Contribute if you want to. IT IS SUGGESTED THAT YOU USE CONMAN OR THE NEW 1.3 ENHANCED CONSOLE DEVICE. CONMAN does to my shell what Steve did in his Manxfied (old term) 16 bit version of my shell, and more. It isn't required, but CONMAN (shareware) complements the functionality of the shell quite well. PROBLEMS -Make sure you give the SHELL a big enough stack, especially if you intend on running shell scripts which source other scripts. 8192 is suggested. Remember, STACK must be run BEFORE you run the shell. Running it from the shell does not effect the shell's stack. -You should not redirect the RUN command. to redirect the command the RUN command is running, embed a standard CLI redirection in the command string: RUN ">file" command -Append '>>' does NOT work with BCPL programs. It does work with all internal and non-bcpl (read C) programs. OVERVIEW of the major features: -History mechanism (complements conman quite nicely, in fact) -Redirection -Piping (sort of) -Command search path by name and by CLI path list -Aliases -Variables & variable handling (embedded variables), and enviroment variables -Automatic file name expansion via '?' and '*' -Conditionals -Shell Scripts -many built in commands to speed things up COMMAND PREPROCESSOR preprocessing is done on the command line before it is passed on to an internal or external routine: ^c where c is a character is converted to that control character. Thus, say '^l' for control-l. $name where name is a variable name. Variable names can consist of 0-9, a-z, A-Z, and underscore (_). The contents of the specified variable is used. If the variable doesn't exist, the specifier is used. That is, if the variable 'i' contains 'charlie', then '$i' -> 'charlie'. If the variable 'i' doesn't exist, then '$i'->'$i' . ; delimits commands. echo charlie ; echo ben. ' ' (a space). Spaces delimit arguments. "string" a quoted string. For instance, if you want to echo five spaces and an 'a': echo a -> a echo " a" -> a \c overide the meaning of special characters. '\^a' is a circumflex and an a rather than control-a. To get a backslash, you must say '\\'. also used to overide alias searching for commands. >file specify output redirection. All output from the command is placed in the specified file. >>file specify append redirection (Does not work with BCPL programs). exp take MSB byte of an expression BINARY 19 * multiplication 19 / division 19 % mod 18 + addition 18 - subtraction 17 >>,<< shift right, shift left 16 >,>= greater, greater equal 16 <,<= smaller, smaller equal 15 == equal to. Try to use this instead of = 15 = exactly the same as == (exists compatibility) 15 != not equal to 14 & logical and 13 ^ logical xor 12 | logical or 11 && left expression is true AND right expression is true 10 || left expression is true OR right expression is true 9 ? if left expression is true, result is right expression, else result is 0. [10 ? 20] returns 20 8 [] group expressions 7 , separate expressions in list (also used in addressing mode resolution, BE CAREFUL! Constants: nnn decimal 0nnn octal %nnn binary $nnn hex 'c character "cc.." string (NOT zero terminated if in DC/DS/DV) [exp]d the constant expressions is evaluated and it's decimal result turned into an ascii string. Symbols: ... -holds CHECKSUM so far (of actual-generated stuff) .. -holds evaluated value in DV pseudo op .name -represents a temporary symbol name. Temporary symbols may be reused inside MACROS and between SUBROUTINES, but may not be referenced across macros or across SUBROUTINEs. . -current program counter (as of the beginning of the instruction). name -beginning with an alpha character and containing letters, numbers, or '_'. Represents some global symbol name. WHY codes: Each bit in the WHY word (verbose option 1) is a reason (why the assembler needs to do another pass), as follows: bit 0 expression in mnemonic not resolved 1 - 2 expression in a DC not resolved 3 expression in a DV not resolved (probably in DV's EQM symbol) 4 expression in a DV not resolved (could be in DV's EQM symbol) 5 expression in a DS not resolved 6 expression in an ALIGN not resolved 7 ALIGN: Relocatable origin not known (if in RORG at the time) 8 ALIGN: Normal origin not known (if in ORG at the time) 9 EQU: expression not resolved 10 EQU: value mismatch from previous pass (phase error) 11 IF: expression not resolved 12 REPEAT: expression not resolved 13 a program label has been defined after it has been referenced (forward reference) and thus we need another pass 14 a program label's value is different from that of the previous pass (phase error) Certain errors will cause the assembly to abort immediately, others will wait until the current pass is other. The remaining allow another pass to occur in the hopes the error will fix itself. VERSIONS: V2.11 -Fixed exp bug, exp MSB (it used to be reversed). -Fixed many bugs in macros and other things -Added automatic checksumming ... no more doing checksums manually! -Added several new processors, including 6502. -Source is now 16/32 bit int compatible, and will compile on an IBM-PC (the ultimate portability test) V2.01 -can now have REPEAT/REPEND's within macros -fill field for DS.W is a word (used to be a byte fill) -fill field for DS.L is a long (used to be a byte fill) ff ¤e file saves by crunching spaces to tabs. The default is OFF. SET var str -create/modify an internal variable SETENV var str -create/modify an enviroment variable (1.3 ENV:) SWAPMARK -PUSHMARK, swap top two marks on stack, POPMARK SCANF ctlstr -scan the string at the current text position (C scanf) example: (scanf %s) SEE BELOW SCREENBOTTOM -Move cursor to the bottom of the screen. SCREENTOP -Move cursor to the top of the screen SCROLLUP -Scroll up without moving cursor SCROLLDOWN -Scroll down without moving cursor SETFONT font sz -Set the window's font. ex: (setfont topaz.font 11) SETTOGGLE N -set toggle array entry N (0..255) SOURCE file -source a script file. '#' in first column for comment SPLIT -Split line at cursor TAB -forward tab TABSTOP N -Set tab stops every N. does not effect text load TLATE [+/-]N -translate character by +N or -N, or set character to exactly N if no + or -. (e.g. TLATE +65 TLATE 3) TMPHEIGHT N -set window height for next window only, pixels TMPWIDTH N -set window width for next window only, pixels TOGGLE N -flip toggle array entry N (0..255) (See IF) TOMOUSE -moves cursor to mouse position TOP -Move to Top of File TOPEDGE N -set topedge in the screen in PIXELS for any new window UNBLOCK -clear the block markers for the current window UNDO -undo current line (must be mapped to a key to work) UNMAP key -unmap a key UP -cursor up UNSET var -delete an internal variable