═══ 1. Uses of KATCalc ═══ KATCalc is a programmable, graphing calculator for the OS/2 Presentation Manager. It performs most trigonometric functions including cosine, sine, and tangent. Also available are many programmer functions including hexadecimal arithmetic, and decimal-hexadecimal conversions. For information on registering your copy of KATCalc please see the topic Ordering KATCalc You should see the main KATCalc calculator body window and its two control windows. To the left of KATCalc is its memory storage window. You may store one value in each of the ten register entryfields. To put a value into memory push the button on the calculator. Next mouse over to the memory window and push the button next to the entryfield you wish to fill. Since these are entryfields you may also type directly into them. To use the values press the button and then push the memory register button whose value you want. This number is then placed in the calculator's display. To the calculator's right is its ticker-tape window. This is a "hard-copy" of all your calculations. It has resizable borders if you wish to see more or less. Scroll bars allow traverse through the tape. You may erase the contents of either of these two windows. To reset all of the memory registers to zero push the button. The button erases the ticker-tape window. Most of the buttons on KATCalc should would as you would expect. A few explanations follow. The button will create a window with your current program list. This new window has choices of Create, Delete, Edit, Help, Rename and Run. For more information see the topic Program Listing The button is used to graph a function. A dialog box will pop-up asking for the function and its domain. For more help see the topic Graphing a Function The button will allow hexadecimal calculations. The button will return to decimal mode. The <> button functions as a backspace. ═══ 2. Ordering KATCalc ═══ KATCalc is distributed by shareware. This means you may freely pass this program, in its entirety, to your friends and associates. They must, however, register their respective copies if they intend to use the calculator. The price of registering KATCalc is $30.00 U.S. funds. If you are a Texas resident please add $1.80 for Texas State Sales Tax. Please make a check or money order payable to The KAT Works. Send your payment, name, and mailing address to : The KAT Works PO Box 820748 North Richland Hills, TX 76118-0748 Your registration fee allows you 1. free technical support for KATCalc via mail correspondence, 2. notification of KATCalc software updates 3. notification of new products from The KAT Works at reduced prices After you register your copy of KATCalc make as many backup copies of KATCalc as you need. You may also copy KATCalc to all of your personal computers. If you have a desktop and a portable please feel free to make use of KATCalc on both of them. ═══ 3. Creating and Editing a Program ═══ KATCalc's language consists of the mathematical manipulation and comparing of internal registers. The registers you use in your program are numbered R0 through R19. These twenty registers are internal to the program and do not change the values in the calculator's memory window. Why would you want to progarm? A program is good for a repeated number of calculations that can be made easier by prompts to automatic calculations. For example, a person could run a program that asks for an angle in degrees and gets back that angle in radians. A rather simple example but the theory is sound. A program should make a person's life easier by saving him time and effort. There are several demo programs that come with KATCalc. Edit them to get inspiration and ideas for what constitutes a program. Following this is a the list of the function you may use in writing a program. In the syntax of the functions the following symbols are used: a single character ex. A, k, 1, @, ",  the value in this particular memory register a character, word, or sentence ex. Now is the time A 123.55 is the purchase cost! a floating point number ex. -123.44 +123.45492 .12345 The programming functions are: * Comment Code A programmer's comment. The asterisk must be the first character in the line. None of the text following the asterisk is executed. : Define Label Declares a label. Any characters may be used, but the first colon is not part of the label. Also the label is case-insensitive so Begin, BEGin, and bEgIn are the same. Spaces are not allowed in the label; for clarity try the underscore character. :Initialize :BEGIN :Loop1 :loop_for_printing_response :ERROR!!! ADD Addition You may add two memory registers together, or add a value to a register. Examples of the two possiblites are: ADD R1, R2 = plus ADD R1, 339.23 = plus CLRM Clear Memory Set all of the memory registers to zero. CLRM CLRS Clear Screen The output window is immediately cleared. CLRS DIV Division You may divide a memory register into another, or divide a register by a value. DIV R0, R19 = Ў DIV R0, 56 = Ў J Jump Unconditionaly execute another part of this program by jumping to a label. J Quit jump to JE Jump if Equal Compare a register with another register or a value, if they are equal then jump to a label. JE R1, R2, BEGIN if = jump to JE R1, 23, BEGIN if = jump to JG Jump if Greater Compare a register with another register or a value, if the first register is greater then jump to a label. JG R0, R13, QUIT if > jump to JG R0, 1.3, INIT if > jump to JL Jump if Less Compare a register with another register or a value, if the first register is less then jump to a label. JL R4, R3, Done if < jump to JL R2, 39, loop_1 if < jump to LN Natural Logarithm Return the logarithm base 2 of the number in a register. LN R0 = Log2 LOG Logarithm Base 10 Return the lagarithm base 10 of the number in a register. LOG R0 = Log10 MOV Move Move the contents of a register or a value into a memory register. MOV R1, R5 = MOV R10, 783.2 = MUL Multiplication Multiply a register by the contents of another register or a value. MUL R3, R12 = * MUL R3, 893 = * POW Exponential Raise a register to the power of another register or a value. POW R1, R2 = to the power of POW R1, 3 = to the power ot RD Read Read a value and place it into a memory register. If the input was a character or symbol the ASCII value of that character is placed into the register. RD R15 = or SUB Subtraction Subtract a register from another register, or subtract a value from a register. SUB R1, R2 = - SUB R1, 23421 = - WD Write to Device Writes the contents of a or a to the output window. Examples WD R0 WD R1 WD [A] for choice alpha WD Relate this to him! ═══ 4. Graphing a Function ═══ Enter a function involving X in the Я ( x ) entryfield . Your function may contain the following arithmetical operations : + Addition - Subtraction * Multiplication / Division sqrt The square root of X ^ Exponential ~ ( tilde ) The opposite of ( ) Parens - order of precedence The following trig functions may also be used : cos The cosine of X sin The sine of X tan The tangent of X Keep the following rules in mind when composing a function : 1 . The functions and operations listed above may be freely mixed in an equaltion . 2 . Please be sure to explicitly list the multiplication symbol . 5 * X not 5X 3. Parens may be used at will to denote the precedence of your function. As you would guess please be sure to match an open paren with a close paren. 4. The only variable you may use is X. The domain of X is described in the three entryfields Start, End, By under the Domain heading of the dialog box. 5. The physical dimensions of the window provide for the Y-Axis to have coordinates from 78 to -78 and the X-axis from -100 to 100. Using the Zoom factor you can effectivly increase, or decrease, these dimensions. As you increase the number in Zoom you decrease the dimensions of the axis, likewise the smaller the number the larger the dimensions of the axis. Some examples of graphing functions: X^2 X squared X^3 X cubed X^.5 the square root of X sin(x + 1) the sine of the quantity X plus one sin(x) + 1 the sine of X, plus one cosx * (x + 1) the cosine of X, times the quantity X plus one When you have generated a graph you like you may "rip-off" the graph by positioning your mouse pointer over the display window and pressing the left button down. You may now grab and pull the window to a clear position on the desktop. Releasing the left mouse button drops the window. You may change any of the graph's attributes by double-clicking the left mouse button on the graph window. The Graph Я(x) dialog will appear. Make any changes you want, press the graph button, and the graph will change accordingly. ═══ 5. The ASCII Chart ═══ Dec Hex Ch Dec Hex Ch Dec Hex Ch Dec Hex Ch ┌─────┬────┬───┐ ┌─────┬────┬───┐ ┌─────┬────┬───┐ ┌─────┬────┬───┐ │ 0 │ 0 │ │ │ 32 │ 20 │ │ │ 64 │ 40 │ @ │ │ 96 │ 60 │ ` │ │ 1 │ 1 │  │ │ 33 │ 21 │ ! │ │ 65 │ 41 │ A │ │ 97 │ 61 │ a │ │ 2 │ 2 │  │ │ 34 │ 22 │ " │ │ 66 │ 42 │ B │ │ 98 │ 62 │ b │ │ 3 │ 3 │  │ │ 35 │ 23 │ # │ │ 67 │ 43 │ C │ │ 99 │ 63 │ c │ │ 4 │ 4 │  │ │ 36 │ 24 │ $ │ │ 68 │ 44 │ D │ │ 100 │ 64 │ d │ │ 5 │ 5 │  │ │ 37 │ 25 │ % │ │ 69 │ 45 │ E │ │ 101 │ 65 │ e │ │ 6 │ 6 │  │ │ 38 │ 26 │ & │ │ 70 │ 46 │ F │ │ 102 │ 66 │ f │ │ 7 │ 7 │  │ │ 39 │ 27 │ ' │ │ 71 │ 47 │ G │ │ 103 │ 67 │ g │ │ 8 │ 8 │  │ │ 40 │ 28 │ ( │ │ 72 │ 48 │ H │ │ 104 │ 68 │ h │ │ 9 │ 9 │ │ │ 41 │ 29 │ ) │ │ 73 │ 49 │ I │ │ 105 │ 69 │ i │ │ 10 │ A │ │ │ 42 │ 2A │ * │ │ 74 │ 4A │ J │ │ 106 │ 6A │ j │ │ 11 │ B │ │ │ 43 │ 2B │ + │ │ 75 │ 4B │ K │ │ 107 │ 6B │ k │ │ 12 │ C │ │ │ 44 │ 2C │ , │ │ 76 │ 4C │ L │ │ 108 │ 6C │ l │ │ 13 │ D │ │ │ 45 │ 2D │ - │ │ 77 │ 4D │ M │ │ 109 │ 6D │ m │ │ 14 │ E │  │ │ 46 │ 2E │ . │ │ 78 │ 4E │ N │ │ 110 │ 6E │ n │ │ 15 │ F │  │ │ 47 │ 2F │ / │ │ 79 │ 4F │ O │ │ 111 │ 6F │ o │ │ 16 │ 10 │  │ │ 48 │ 30 │ 0 │ │ 80 │ 50 │ P │ │ 112 │ 70 │ p │ │ 17 │ 11 │  │ │ 49 │ 31 │ 1 │ │ 81 │ 51 │ Q │ │ 113 │ 71 │ q │ │ 18 │ 12 │  │ │ 50 │ 32 │ 2 │ │ 82 │ 52 │ R │ │ 114 │ 72 │ r │ │ 19 │ 13 │  │ │ 51 │ 33 │ 3 │ │ 83 │ 53 │ S │ │ 115 │ 73 │ s │ │ 20 │ 14 │  │ │ 52 │ 34 │ 4 │ │ 84 │ 54 │ T │ │ 116 │ 74 │ t │ │ 21 │ 15 │  │ │ 53 │ 35 │ 5 │ │ 85 │ 55 │ U │ │ 117 │ 75 │ u │ │ 22 │ 16 │  │ │ 54 │ 36 │ 6 │ │ 86 │ 56 │ V │ │ 118 │ 76 │ v │ │ 23 │ 17 │  │ │ 55 │ 37 │ 7 │ │ 87 │ 57 │ W │ │ 119 │ 77 │ w │ │ 24 │ 18 │  │ │ 56 │ 38 │ 8 │ │ 88 │ 58 │ X │ │ 120 │ 78 │ x │ │ 25 │ 19 │  │ │ 57 │ 39 │ 9 │ │ 89 │ 59 │ Y │ │ 121 │ 79 │ y │ │ 26 │ 1A │ │ │ 58 │ 3A │ : │ │ 90 │ 5A │ Z │ │ 122 │ 7A │ z │ │ 27 │ 1B │  │ │ 59 │ 3B │ ; │ │ 91 │ 5B │ [ │ │ 123 │ 7B │ { │ │ 28 │ 1C │  │ │ 60 │ 3C │ < │ │ 92 │ 5C │ \ │ │ 124 │ 7C │ | │ │ 29 │ 1D │  │ │ 61 │ 3D │ = │ │ 93 │ 5D │ ] │ │ 125 │ 7D │ } │ │ 30 │ 1E │  │ │ 62 │ 3E │ > │ │ 94 │ 5E │ ^ │ │ 126 │ 7E │ ~ │ │ 31 │ 1F │  │ │ 63 │ 3F │ ? │ │ 95 │ 5F │ _ │ │ 127 │ 7F │  │ └─────┴────┴───┘ └─────┴────┴───┘ └─────┴────┴───┘ └─────┴────┴───┘ Dec Hex Ch Dec Hex Ch Dec Hex Ch Dec Hex Ch ┌─────┬────┬───┐ ┌─────┬────┬───┐ ┌─────┬────┬───┐ ┌─────┬────┬───┐ │ 128 │ 80 │ А │ │ 160 │ A0 │ а │ │ 192 │ C0 │ └ │ │ 224 │ E0 │ р │ │ 129 │ 81 │ Б │ │ 161 │ A1 │ б │ │ 193 │ C1 │ ┴ │ │ 225 │ E1 │ с │ │ 130 │ 82 │ В │ │ 162 │ A2 │ в │ │ 194 │ C2 │ ┬ │ │ 226 │ E2 │ т │ │ 131 │ 83 │ Г │ │ 163 │ A3 │ г │ │ 195 │ C3 │ ├ │ │ 227 │ E3 │ у │ │ 132 │ 84 │ Д │ │ 164 │ A4 │ д │ │ 196 │ C4 │ ─ │ │ 228 │ E4 │ ф │ │ 133 │ 85 │ Е │ │ 165 │ A5 │ е │ │ 197 │ C5 │ ┼ │ │ 229 │ E5 │ х │ │ 134 │ 86 │ Ж │ │ 166 │ A6 │ ж │ │ 198 │ C6 │ ╞ │ │ 230 │ E6 │ ц │ │ 135 │ 87 │ З │ │ 167 │ A7 │ з │ │ 199 │ C7 │ ╟ │ │ 231 │ E7 │ ч │ │ 136 │ 88 │ И │ │ 168 │ A8 │ и │ │ 200 │ C8 │ ╚ │ │ 232 │ E8 │ ш │ │ 137 │ 89 │ Й │ │ 169 │ A9 │ й │ │ 201 │ C9 │ ╔ │ │ 233 │ E9 │ щ │ │ 138 │ 8A │ К │ │ 170 │ AA │ к │ │ 202 │ CA │ ╩ │ │ 234 │ EA │ ъ │ │ 139 │ 8B │ Л │ │ 171 │ AB │ л │ │ 203 │ CB │ ╦ │ │ 235 │ EB │ ы │ │ 140 │ 8C │ М │ │ 172 │ AC │ м │ │ 204 │ CC │ ╠ │ │ 236 │ EC │ ь │ │ 141 │ 8D │ Н │ │ 173 │ AD │ н │ │ 205 │ CD │ ═ │ │ 237 │ ED │ э │ │ 142 │ 8E │ О │ │ 174 │ AE │ о │ │ 206 │ CE │ ╬ │ │ 238 │ EE │ ю │ │ 143 │ 8F │ П │ │ 175 │ AF │ п │ │ 207 │ CF │ ╧ │ │ 239 │ EF │ я │ │ 144 │ 90 │ Р │ │ 176 │ B0 │ ░ │ │ 208 │ D0 │ ╨ │ │ 240 │ F0 │ Ё │ │ 145 │ 91 │ С │ │ 177 │ B1 │ ▒ │ │ 209 │ D1 │ ╤ │ │ 241 │ F1 │ ё │ │ 146 │ 92 │ Т │ │ 178 │ B2 │ ▓ │ │ 210 │ D2 │ ╥ │ │ 242 │ F2 │ Є │ │ 147 │ 93 │ У │ │ 179 │ B3 │ │ │ │ 211 │ D3 │ ╙ │ │ 243 │ F3 │ є │ │ 148 │ 94 │ Ф │ │ 180 │ B4 │ ┤ │ │ 212 │ D4 │ ╘ │ │ 244 │ F4 │ Ї │ │ 149 │ 95 │ Х │ │ 181 │ B5 │ ╡ │ │ 213 │ D5 │ ╒ │ │ 245 │ F5 │ ї │ │ 150 │ 96 │ Ц │ │ 182 │ B6 │ ╢ │ │ 214 │ D6 │ ╓ │ │ 246 │ F6 │ Ў │ │ 151 │ 97 │ Ч │ │ 183 │ B7 │ ╖ │ │ 215 │ D7 │ ╫ │ │ 247 │ F7 │ ў │ │ 152 │ 98 │ Ш │ │ 184 │ B8 │ ╕ │ │ 216 │ D8 │ ╪ │ │ 248 │ F8 │ ° │ │ 153 │ 99 │ Щ │ │ 185 │ B9 │ ╣ │ │ 217 │ D9 │ ┘ │ │ 249 │ F9 │ ∙ │ │ 154 │ 9A │ Ъ │ │ 186 │ BA │ ║ │ │ 218 │ DA │ ┌ │ │ 250 │ FA │ · │ │ 155 │ 9B │ Ы │ │ 187 │ BB │ ╗ │ │ 219 │ DB │ █ │ │ 251 │ FB │ √ │ │ 156 │ 9C │ Ь │ │ 188 │ BC │ ╝ │ │ 220 │ DC │ ▄ │ │ 252 │ FC │ № │ │ 157 │ 9D │ Э │ │ 189 │ BD │ ╜ │ │ 221 │ DD │ ▌ │ │ 253 │ FD │ ¤ │ │ 158 │ 9E │ Ю │ │ 190 │ BE │ ╛ │ │ 222 │ DE │ ▐ │ │ 254 │ FE │ ■ │ │ 159 │ 9F │ Я │ │ 191 │ BF │ ┐ │ │ 223 │ DF │ ▀ │ │ 255 │ FF │ │ └─────┴────┴───┘ └─────┴────┴───┘ └─────┴────┴───┘ └─────┴────┴───┘ ═══ 6. Program Listing ═══ This is a list of all your programmed functions. The pushbuttons at the bottom of this window show your available actions. You will notice that the programs are not in the usual filename.extension format. Instead KATCalc uses a new feature of OS/2 1.2 called extended attributes. Extended attributes (EAs) allow a program like KATCalc to keep extra information tagged to a file. KATCalc uses EAs to allow you to give your program files a longer and more meaningful title. This title may be up to 128 characters. If you look in KATCalc's Working directory you will see your programs. They have filenames that look like Kxxxxxxx.PGM. If you wish to copy these program files to floppy disk for transportation to a machine other than an OS/2 1.2 machine (for instance DOS, CMS, or UNIX) you will have to use the OS/2 command EAUTIL to preserve your titles. This is because OS/2 manages the extended attributes of a file in a special, hidden, system file instead of "in" the actual data files themselves. The EAUTIL command tells OS/2 to place the EAs into a file which you will can copy with the programs. When when you later place the programs on a target OS/2 computer use EAUTIL again to rejoin the files with their respective EAs. An example of this might be sending your programs to a friend in another state over your companies mainframe network. 1. From your OS/2 PC EAUTIL k0000001.pgm k1.ea /p /s 2. Upload the files k0000001.pgm and k1.ea to your host mainframe. 3. Send the two files over the network. 4. Your friend downloads them to his KATCalc subdirectory on his OS/2 PC. 5. Your friend types: EAUTIL k0000001.pgm k1.ea /j Your friend can now run the program from the Program Directory in KATCalc. If you are backing up your programs or transporting them to another OS/2 machine via floppy disk merely: COPY *.pgm a: Since it is an OS/2 to OS/2 migration the EAs will be stored on the floppy by the source machine and recognize and read by the target machine. The EAUTIL command is not needed. ═══ 7. Installation of KATCalc ═══ There is not much extra to do to install KATCalc. Simply add KATCALC.EXE to your favorite Group. Be sure to specify a Working directory so the calculator can find its help file and programs (KATCALC.HLP and *.PGM). Where you place the executable and the programs does not matter, but a new directory would be the most obvious choice. If you write a large amount of programs a separate, dedicated KATCalc subdirectory would be a good organization tool. When you install KATCalc in whatever Group you choose the following is a suggested Properties list: Required Program title: Programmable Calculator Path and file name : e:\utils\calc\katcalc.exe Optional Parameters: Working directory: e:\utils\calc Program type ■ Presentation Manager ∙ Other In the subdirectory e:\utils\calc the following files should be placed: o KATCALC.EXE o KATCALC.HLP o K*.PGM KATCalc requires OS/2 Extended Edition version 1.2 or higher.