--------------------------------------------------------- | TI83 by StudioC Productions | --------------------------------------------------------- BinHex 1.0 First Public Release Created February 7, 2000 Author : Stephen Compall Systems : TI-83,TI-83+ WORD WRAP ON! Contents: :The Creation :Requirements :How to Play :Limitations :Release History :Future :Source Code :Contact $$The Creation%% As you have probably guessed, this BinHex is not the Macintosh compression scheme. Today, I was sitting in band class, when class was over, and I decided to make a utility to convert regular, boring base-10 numbers into hex (base-16) code. This has almost no potential for usefulness, but hey, anything to pass the time. A couple of hours later, I wrote another for converting base-10 to binary (base-2). I experimented with combining these two programs, prgmBIN and prgmHEX, changing where the data is displayed, setting up menus, chars per row, etc., etc. Now, BinHex is useful if: You program ASM (using HEX speeds up TASM); You want an easy way to remember a number; You want to check a bit mask; You are obsessed with the way BinHex draws. $$Requirements%% First, a TI83 or TI83 Plus. BinHex, along with the main program, uses a bunch of variables and Str0. Make sure you protect what's in Str0 if you want to keep it; also, BinHex doesn't need you to save what's in there, because it rewrites it every time. It will delete Str0 upon completion of the Hex part. Make sure you have 500 bytes free before sending; to be safe, always have 150 bytes free before running. $$How to Play%% 1. Run prgmBINHEX. 2. Put in a number, var, whatever, press ENTER. 3. BinHex will write your number to the graph screen. 4. BinHex will decode one character at a time. $$Limitations%% User variables can only have 14 remembered digits, so if you go over 1E13, you are at risk of losing exact listing. There is NO error checking! Don't put in decimals. If the Bin has to run off the screen, it will return an error. $$Release History%% 1.0 Initial release; Bin power-of-2 bug fixed. $$Future%% I hope to convert this to Ion, so that the numbers draw faster. I will probably add options like reverse-converting. $$Source Code%% Have a look! I put comments behind the classic TASM ; so you can learn how it works. NOTE: To fully understand, you must have an understanding of manual conversion to Bin and Hex. WORD WRAP OFF! FnOff :AxesOff:ClrDraw Prompt B Goto 2 Lbl 3 B->A ;Code originally used A, so to protect original, I put in this loop-around. int(ln(A)/.6931471806)->I ; The big number is the ln(2). This finds all the powers of 2 in A. 8->X:Y+6->Y ; The location of cursor. Lbl 1 For(Á,I,0,-1) ; Á is theta. If you have a number that needs 8 bin digits, it will compute from 2^7 to 2^0. int(A/2^Á)->H If H=2:Then ; This fixes a problem with the imprecision of ln. Was computing too few Digits, then assigning 2 to the first in powers of two. If you take this If:Then:End cycle out, and put in a power of 2 (like 8), it will come out as (ex. for 8) 200 instead of 1000. I+1->I Goto 1 End A-H2^Á->A Text(Y,X,H) X+4->X If X>85:Then 8->X:Y+6->Y End:End Stop Lbl 2 "0123456789ABCDEF"->Str0 ;Code indexes this later to accommodate letters. B->A int(ln(A)/2.772588722)->I Text(1,1,B) 16->X:7->Y For(Á,I,0,-1) int(A/16^Á)->H A-H16^Á->A Text(Y,X,sub(Str0,H+1,1)) X+4->X If X>79:Then 16->X:Y+6->Y End:End DelVar Str0 Goto 3 $$Contact%% Email : rushing@earthling.net AIM : S11001001 (that's 201 in dec, C9 in Hex!) The file is unprotected, so you can mess with it however you want. However, please don't put your name on it.