ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ÛÛÛÛÛ²²²²²±±±±±°°°°° -=-=-= CyberRax Programming =-=-=- °°°°°±±±±±²²²²²ÛÛÛÛÛ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ presents: $$$$$$$$ $$$$ $$$$ $$$$$$$$ $$$$ $$$$ $$$$$$ $$$$ $$$$ $$$$ $$$ $$$$$$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$ $$$$$$$$$$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$$$$$ $$$$ $$$$ $$$$$$$$$ $$$$$$$$ V E R S I O N 1 . 1 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Introduction °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ CALC is a memory resident pop-up programmer's calculator with base conversion, bit-shifting, logical operator, and mod functions, and 32-bit number representation that also supports a 2-decimal place integer arithmetic calculations. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Fore-story °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Every true programmer needs a calculator. For a while I used the one included in DTown Software Development's DTown Utilities, even if DTU had some annoying features like popping up on int3. But one day I decided to drop the V86 and continue my digital life in real mode, in other words I got rid of EMM386 and the expanded memory it provided. And suddenly DTU needed 27kB(!) of memory. Time to find another calculator! I didn't try too many, only those presented on "Free DOS Software" website (http://www.dosbin.com) Most didn't satisfy my needs: they had problems popping up, weren't TSR or needed too much memory. Until I tried CALC, written by PC Magazine's editor Douglas Boling. It wasn't as fancy as some others, actually it's quite limited, but it provided everything I wanted: it's small, has all basic math functions and is great for number conversion. So I stayed with it. Even if there was one very annoying thing: the hotkey. In practice "Alt+S" itself ain't being used that much, but Alt+x is Volkov Commander's shortcut for speed search in directory and I simply hated the fact that I couldn't use it for filenames starting with "S". After putting up with the situation for some time I said to myself one day: "What the hell!" and opened up the source code VC's internal editor. The rest is history, as the saying goes. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Differences °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ For a complete list of changes since the original PC Magazine version see CALC.HST. The most important differences: + hotkey is Ctrl+Alt+S + needs atleast a 286 CPU + conforms to Ralf Brown's Alternate Multiplex Interrupt Specification 3.5+ + is unloadable + uses XMS 2.0 memory if present to save screen ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Usage °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Simple: CALC [switches] Switches are optional, aren't case sensitive, might be preceded by hypen (-) or slash (/) and can be: I - install as TSR. This means you can't simply (double)click or press ENTER on CALC.COM in a DOS shell and expect it to go resident, you have to specify "I" on the commandline. D - disable resident program. Actually a pretty useless parameter, but if your foreground application uses Ctrl+Alt+S itself (and doesn't hook int9) then this switch can perhaps help. E - enable TSR after it has been temporarily disabled with "D" switch. U - uninstall. P - pop up. This can be used only if TSR is already installed. I can't think of any practical use for this parameter (if you're at the PC then you can simply press Ctrl+Alt+S; the program doesn't accept nor outputs any numeric data from/to command prompt, so the only usage in batch files is generating a pause, but that can be accomplished with DOS's own "pause" command). X - don't use XMS memory. CALC will automatically check for the presence of XMS 2.0 memory and use it in case you have it. With this switch you can prohibit this. When no parameters are given then, if the program ain't in memory, the help screen is shown, else TSR's status is printed. Ctrl+Alt+S brings up a window with 6 lines for calculation. The following keys can be used now: ESC - ends the session and restores the original screen 0 - 9 - numeric input A - F - numeric input in HEX mode + - addition (14 + 28 = 42) - - subtraction (15 - 7 = 8) * - multiplication (25 * 2 = 50) / - division (22 / 2 = 11) % or \ - modula (67 % 4 = 3) = or ENTER - result F1 - changes base: BIN => OCT => DEC => HEX => BIN Shift+F1 - changes base in the reversed order: HEX => DEC => OCT => BIN => HEX F2 - switches between decimal and fixed mode. In fixed mode two digits after the point can be used. This works *only* in decimal system and only point is supported as decimal separator, not comma F3 - logical AND (12 AND 5 = 4) F4 - logical OR (21 OR 3 = 23) F5 - XOR - exclusive OR (33 XOR 3 = 34) F6 - NOT - inverts the entered number F7 - SAL - shifts the bits of number to left by one (sal 19 = 38) F8 - SAR - shifts bits to right by one (sar 52 = 26) F9 - changes the sign of number (to negative or positive) F10 - clears the entry line Shift+F10 - clears the whole calculator field Mixed-base calculations are supported (d72 + b1100 - h13 = d65) ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° System requirements °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ þ MS-DOS 2.0 (or compatible) þ 80286 þ about 6kB memory during execution, 2.9 - 4kB when resident þ keyboard þ MDA (textmode) videocard/monitor þ 2kB of XMS 2.0+ memory (optional) for saving screen CALC automatically detects XMS 2.0 and CGA/EGA video and configures itself for their usage. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Tested °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ CALC has been successfully tested on following configurations: * Cyrix 486DLC/40MHz, Oak VGA/monochrome monitor, MS-DOS 6.22, QEMM 8.03 * AMD 486DX/100MHz, Cirrus SVGA/monochrome monitor, MS-DOS 6.22, HIMEM 3.10 + RDOSUMB 1.1F ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Bugs °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Known bugs and shortcomings: - the resident part ignores errors returned by the XMS manager. While the XMS problems, in case there should be any, should affect only the display it's still a shortcoming. If any problems do occur then perhaps the "X" switch can help. - as by the original PC Mag release some calculations can crash the TSR. It seems to be possible only with big fixed numbers ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Greets °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Today's greets fly to: Douglas Boling - the author of original CALC. Great job, dude! VAG and OlegPro - DeGlucker is AWESOME!!! Sen - HIEW is FAR more than just a hexeditor Ralf Brown - for IntList Linkin Park - for their AWESOME album "Hybrid Theory" which has been plying a lot in my CD player lately DOS coders world wide - we won't let DOS die! ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Validating °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ To check if all files in this archive are OK store my public PGP key into your public-key-file (PGPK -a CYBERRAX.SIG), validate CRCHECK.CRC (PGP -v CRCHECK.CRC) and then execute ROSE SWE's CrCheck (I know, I know, MD5SUM is free, more secure and comes with PGP (atleast it came with the 2.x versions), but CrCheck is faster and I happen to like it). ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³°°°°° Closing °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ So, we have come to the end. I hope you find this utility as useful as I have. If you happen to change the source then would be nice if you'd keep my name in it (if only in the first comment) and send me the new version. And even if you don't change anything, you're still welcome to mail any suggestions, thoughts and bug reports. I can be reached under the following address: cyberrax@yahoo.com Oh yeah, forgive me my not so (but almost :) perfect English... CyberRax the Hacking One of -=-=-= CyberRax Programming =-=-=- "a sick DOS maniac" December 9th, 2001 Tootsi, Parnu County, Estonia, Europe