home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / bootflag.lzh / BootFlag22 / man / BootFlag.doc
Encoding:
Text File  |  1992-04-30  |  6.4 KB  |  146 lines

  1. Manual for BootFlag version 2.1 for the Amiga (FreeWare) by John Mosley
  2.  
  3.     This is a no-frills manual for this program.  It's quite simple, and
  4. should be easy to use.  So what's this thing do?  Well, it uses a small,
  5. 4-byte file (sys:s/BootFlags) to store 32 bits of information, namely "flags"
  6. that can be either turned on or off.  The program allows you to set, clear,
  7. toggle, etc. these flags so that you may check for a specific pattern in the
  8. 4-byte register.  If your given pattern matches the flags in the register,
  9. BootFlag will set the Amiga's script status to "Warn" (5) to be used by If
  10. statements, or whatever checks the status thingy.  If the program fails, it
  11. will set the return status to 10.  Provided in this archive are example
  12. Startup-Sequences which make use of this program.
  13.     So how do you use it?  All you need is BootFlag in your C: directory.
  14. If you haven't used it yet, you won't have a "BootFlags" file in your S:
  15. directory, so type "BootFlag = 0".  This will create the status register,
  16. setting all the flags to 0 (OFF).  At any time, "=" will erase all the
  17. current flag settings and replace them with the given flag pattern. Below
  18. is the general usage:
  19.  
  20. BootFlag: Wrong number of arguments
  21. BootFlag version 2.1 for the Amiga (FreeWare) by John Mosley 2-17-1992
  22. USAGE: BootFlag <check|print|set|clear|tog|=> <flags> [-f<file>]
  23.     flags : specifier representing 32 binary flags to manipulate
  24.         Syntax: [+|-][$|&|%]<digits>[<+|->[$|&|%]<digits>]
  25.         +: check if flags are ON, -: check if flags are OFF
  26.         $hexadecimal#, &octal#, %binary#, or (none)decimal#
  27.     check : compare flags, return Warn if the given pattern matches
  28.     print : print out current flag settings
  29.         Use [$|&|%] in place of <flags> for output format.
  30.     The commands below only use the + flag value:
  31.     set   : set given flags to ON state
  32.     clear : set given flags to OFF state
  33.     tog   : toggle given flags
  34.     =     : set entire 32-bit register equal to given flags
  35.     File option(s):
  36.     -f    : use a different register file (<file> required)
  37.     file  : path and filename of the register file to use
  38.  
  39. To clarify a couple of commands, I'll give examples.  First of all, it was
  40. difficult to explain the full usage without using all the above garbage
  41. and making BootFlag print out three screenfulls of text, so here's how to
  42. decypher it:  Anything within [] is optional; it doesn't have to be typed.
  43. Anything within <> is required; you must give that information.  Things
  44. separated by | means that any ONE (and only one) of the options may be
  45. specified.  Here are the examples:
  46.  
  47. Let's say you want to "turn on" the third bit, which is %100 in binary.
  48. Note that the register, and any reference to the flag values is just a
  49. regular good-old number which can be represented in decimal, hex, octal,
  50. or binary.  To turn on the third flag, you can use one of the following:
  51. 1> BootFlag s %100
  52. 1> BootFlag s $4
  53. 1> BootFlag s 4
  54. 1> BootFlag s &4
  55. It just so happens that "4" is the same in decimal, hex, and octal.
  56.  
  57. If you'd like to see what the current flag settings are, use the "print"
  58. command.  You may also specify what format (hex, binary, etc.) to print
  59. out the answer (let's say the register has the value of 42):
  60. 1> BootFlag p
  61. Boot flags are set at 42.
  62. 1> BootFlag p %
  63. Boot flags are set at %101010.
  64. 1> BootFlag p $
  65. Boot flags are set at $2A.
  66.  
  67. If you haven't noticed, each command may be specified by their first
  68. letter, with the exception of "check" which must be completely spelled out.
  69.  
  70. OK, now the biggie - how do you check the flags?  Use the "check" command.
  71. The word "check" must be completely spelled out, or BootFlag will gripe.
  72. Here's an explanation about the <flags> field of the command-line.  To
  73. check which flags are on or off, the program must know which ones you want
  74. to compare.  Let's say the register has 42 (decimal) in it, and you want
  75. to see if the fifth flag is on (1).  You'd do this in a script file:
  76.  
  77. BootFlag check %10000
  78. If Warn
  79.   {do something}
  80. EndIf
  81.  
  82. Now, let's say that you actually DON'T want to perform the operation inside
  83. the If statement if the first flag is on, so you'd use this instead:
  84.  
  85. BootFlag check %10000-%1
  86.  
  87. The minus (-) sign indicates "don't return true if %1 is on" or "make sure
  88. flag %1 is off".  You can also reverse the order of the two flag
  89. specifiers like this:
  90.  
  91. BootFlag check -%1+%10000
  92.  
  93. It does the same thing.  Note that if you are using two flag specifiers,
  94. you HAVE to separate them with either a plus (+) or a minus (-) sign.
  95. Also, more than one flag can be checked simultaneously.  For instance,
  96. if you wanted to make sure the register is EXACTLY 42, you could do this:
  97.  
  98. BootFlag check %101010-%11111111111111111111111111010101
  99.  
  100. This is a bit (haha) tiresome to type out, though, so you can use hex instead:
  101.  
  102. BootFlag check 42-$FFFFFFD5
  103.  
  104. The highest number that can be used as a flag's value is $80000000, since
  105. that is a "1" in the 32nd bit (from the end), followed by 31 "0"s.  The
  106. highest number possible to use is $FFFFFFFF (all 32 flags set).
  107.  
  108. OK, so as if that's not enough for ya, you can also specify your own
  109. register file!  The default register file is sys:s/BootFlags, but you may
  110. specify any valid path and filename with the -f file option.  Let's say
  111. you want a separate register set for your C compiler.  You could tell
  112. BootFlag to look at this register instead of the default one by using:
  113.  
  114. BootFlag check $2A -fsys:lc/LCflags
  115.  
  116. Notice that the pathname MUST immediately follow the "-f" as the LAST
  117. argument in the command line.  Also, remember that to "initiate" a new
  118. register file, you must use the "=" operator and give it a value:
  119.  
  120. BootFlag = 0 -fsome_new_flag_file
  121.  
  122. Please make note of the example script files that are included.  They are
  123. the following:
  124.  
  125. Startup-Sequence    Example startup script that makes its decisions
  126.                 of what to invoke upon boot
  127. StartupII        An additional script that is used instead of
  128.                 Startup-Sequence if lots of memory will
  129.                 need to be reserved
  130. BootFlags.log        A text file I always edit which helps me remember
  131.                 what flags do what in the startup
  132. Log            A simple script that just types out the log file
  133. IsSet            Script file that, given a standard flag pattern,
  134.                 will print out "true" if the pattern 
  135.                 matches, or "false" if not
  136.  
  137. Also with this acrhive is this file (BootFlag.doc), the program (BootFlag),
  138. and the register file used in the examples (BootFlags).
  139.  
  140. If you find any use for this program, feel free to contact me!  I'd like
  141. to hear any comments or suggestions!
  142.  
  143. Internet address: jem3@engr.uark.edu
  144.           (This address is guaranteed at least until May of 1994.)
  145. -Moz
  146.