home *** CD-ROM | disk | FTP | other *** search
- Manual for BootFlag version 2.1 for the Amiga (FreeWare) by John Mosley
-
- This is a no-frills manual for this program. It's quite simple, and
- should be easy to use. So what's this thing do? Well, it uses a small,
- 4-byte file (sys:s/BootFlags) to store 32 bits of information, namely "flags"
- that can be either turned on or off. The program allows you to set, clear,
- toggle, etc. these flags so that you may check for a specific pattern in the
- 4-byte register. If your given pattern matches the flags in the register,
- BootFlag will set the Amiga's script status to "Warn" (5) to be used by If
- statements, or whatever checks the status thingy. If the program fails, it
- will set the return status to 10. Provided in this archive are example
- Startup-Sequences which make use of this program.
- So how do you use it? All you need is BootFlag in your C: directory.
- If you haven't used it yet, you won't have a "BootFlags" file in your S:
- directory, so type "BootFlag = 0". This will create the status register,
- setting all the flags to 0 (OFF). At any time, "=" will erase all the
- current flag settings and replace them with the given flag pattern. Below
- is the general usage:
-
- BootFlag: Wrong number of arguments
- BootFlag version 2.1 for the Amiga (FreeWare) by John Mosley 2-17-1992
- USAGE: BootFlag <check|print|set|clear|tog|=> <flags> [-f<file>]
- flags : specifier representing 32 binary flags to manipulate
- Syntax: [+|-][$|&|%]<digits>[<+|->[$|&|%]<digits>]
- +: check if flags are ON, -: check if flags are OFF
- $hexadecimal#, &octal#, %binary#, or (none)decimal#
- check : compare flags, return Warn if the given pattern matches
- print : print out current flag settings
- Use [$|&|%] in place of <flags> for output format.
- The commands below only use the + flag value:
- set : set given flags to ON state
- clear : set given flags to OFF state
- tog : toggle given flags
- = : set entire 32-bit register equal to given flags
- File option(s):
- -f : use a different register file (<file> required)
- file : path and filename of the register file to use
-
- To clarify a couple of commands, I'll give examples. First of all, it was
- difficult to explain the full usage without using all the above garbage
- and making BootFlag print out three screenfulls of text, so here's how to
- decypher it: Anything within [] is optional; it doesn't have to be typed.
- Anything within <> is required; you must give that information. Things
- separated by | means that any ONE (and only one) of the options may be
- specified. Here are the examples:
-
- Let's say you want to "turn on" the third bit, which is %100 in binary.
- Note that the register, and any reference to the flag values is just a
- regular good-old number which can be represented in decimal, hex, octal,
- or binary. To turn on the third flag, you can use one of the following:
- 1> BootFlag s %100
- 1> BootFlag s $4
- 1> BootFlag s 4
- 1> BootFlag s &4
- It just so happens that "4" is the same in decimal, hex, and octal.
-
- If you'd like to see what the current flag settings are, use the "print"
- command. You may also specify what format (hex, binary, etc.) to print
- out the answer (let's say the register has the value of 42):
- 1> BootFlag p
- Boot flags are set at 42.
- 1> BootFlag p %
- Boot flags are set at %101010.
- 1> BootFlag p $
- Boot flags are set at $2A.
-
- If you haven't noticed, each command may be specified by their first
- letter, with the exception of "check" which must be completely spelled out.
-
- OK, now the biggie - how do you check the flags? Use the "check" command.
- The word "check" must be completely spelled out, or BootFlag will gripe.
- Here's an explanation about the <flags> field of the command-line. To
- check which flags are on or off, the program must know which ones you want
- to compare. Let's say the register has 42 (decimal) in it, and you want
- to see if the fifth flag is on (1). You'd do this in a script file:
-
- BootFlag check %10000
- If Warn
- {do something}
- EndIf
-
- Now, let's say that you actually DON'T want to perform the operation inside
- the If statement if the first flag is on, so you'd use this instead:
-
- BootFlag check %10000-%1
-
- The minus (-) sign indicates "don't return true if %1 is on" or "make sure
- flag %1 is off". You can also reverse the order of the two flag
- specifiers like this:
-
- BootFlag check -%1+%10000
-
- It does the same thing. Note that if you are using two flag specifiers,
- you HAVE to separate them with either a plus (+) or a minus (-) sign.
- Also, more than one flag can be checked simultaneously. For instance,
- if you wanted to make sure the register is EXACTLY 42, you could do this:
-
- BootFlag check %101010-%11111111111111111111111111010101
-
- This is a bit (haha) tiresome to type out, though, so you can use hex instead:
-
- BootFlag check 42-$FFFFFFD5
-
- The highest number that can be used as a flag's value is $80000000, since
- that is a "1" in the 32nd bit (from the end), followed by 31 "0"s. The
- highest number possible to use is $FFFFFFFF (all 32 flags set).
-
- OK, so as if that's not enough for ya, you can also specify your own
- register file! The default register file is sys:s/BootFlags, but you may
- specify any valid path and filename with the -f file option. Let's say
- you want a separate register set for your C compiler. You could tell
- BootFlag to look at this register instead of the default one by using:
-
- BootFlag check $2A -fsys:lc/LCflags
-
- Notice that the pathname MUST immediately follow the "-f" as the LAST
- argument in the command line. Also, remember that to "initiate" a new
- register file, you must use the "=" operator and give it a value:
-
- BootFlag = 0 -fsome_new_flag_file
-
- Please make note of the example script files that are included. They are
- the following:
-
- Startup-Sequence Example startup script that makes its decisions
- of what to invoke upon boot
- StartupII An additional script that is used instead of
- Startup-Sequence if lots of memory will
- need to be reserved
- BootFlags.log A text file I always edit which helps me remember
- what flags do what in the startup
- Log A simple script that just types out the log file
- IsSet Script file that, given a standard flag pattern,
- will print out "true" if the pattern
- matches, or "false" if not
-
- Also with this acrhive is this file (BootFlag.doc), the program (BootFlag),
- and the register file used in the examples (BootFlags).
-
- If you find any use for this program, feel free to contact me! I'd like
- to hear any comments or suggestions!
-
- Internet address: jem3@engr.uark.edu
- (This address is guaranteed at least until May of 1994.)
- -Moz
-