Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
24 May, 2013, 18:10:48 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: FOR ASM/AXE CODERS: BaseCalc -  (Read 3064 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Topic starter
Total Post Ratings: +706

View Profile WWW
« on: 14 October, 2010, 01:51:46 »
+5

Long time since I've touched TI-BASIC again (yes, Axe is that addicting Grin). I made a quick program that's becoming really useful for ASM: a program that calculates anything in binary, octal, decimal, hex, or any combination of the four. In other words, type in something like "b10110101+o571-x1E+241" and it'll output the answer as 769. Since it calculates using the expr( command, you can put literally any numerical expression in and it'll solve correctly, including exponents, trig, and other functions. Shot below Smiley

EDIT: New version uses all uppercase letters. Also, I changed hex to H. In other words, replace b with B, o with O, and x with H.

EDIT2: Even newer version changes it back -- sorry.

http://www.omnimaga.org/index.php?action=downloads;sa=view;down=591


* basecalc.gif (9.83 KB, 192x128 - viewed 564 times.)
« Last Edit: 05 December, 2010, 08:13:10 by Deep Thought » Logged




SirCmpwn
Guest
« Reply #1 on: 14 October, 2010, 01:52:14 »
0

Nice!
Logged
Hot_Dog
If you can't find a cat, look for its tail.
Support Staff
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 21:08:05
Date Registered: 28 December, 2009, 18:47:54
Location: Midland, Washington
Posts: 2940


Total Post Ratings: +428

View Profile
« Reply #2 on: 14 October, 2010, 01:52:42 »
0

Holy, that's awesome!
Logged

There are people who can speak two languages, and they are called bilingual.  There are people who speak three languages and are therefore trilingual.  Then there are people who speak one language, and these people are called Americans.

Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Topic starter
Total Post Ratings: +706

View Profile WWW
« Reply #3 on: 14 October, 2010, 01:54:10 »
0

And so far, it's a nice, reasonable 295 bytes.

Anyone who finds any optimizations, feel free to post it!
Logged




nemo
LV9 Veteran (Next: 1337)
*********
Offline Offline

Last Login: 04 April, 2013, 01:12:57
Date Registered: 16 May, 2010, 03:55:30
Posts: 1198

Total Post Ratings: +83

View Profile
« Reply #4 on: 14 October, 2010, 01:55:05 »
0

does it take into account the base? like if i put in b0012, would it tell me that 2 won't work? or would it just calculate it as 4?
Logged


Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Topic starter
Total Post Ratings: +706

View Profile WWW
« Reply #5 on: 14 October, 2010, 02:10:44 »
0

does it take into account the base? like if i put in b0012, would it tell me that 2 won't work? or would it just calculate it as 4?

It would actually calculate it as 22. Kinda weird, but let me explain:

All the program does is convert numbers of other bases to decimal for the OS to resolve. It uses a While loop for each number to detect when the number ends. In this case, the program knows that the number ends at that 2. So it inserts 2 into the final equation instead of b001, and it becomes 22.

I'm probably gonna change this. I've already decided what I'm going to do: I'm going to add parentheses around the number to be inserted, so that it becomes b0012=(b001)2=(2)2=4.
Logged




nemo
LV9 Veteran (Next: 1337)
*********
Offline Offline

Last Login: 04 April, 2013, 01:12:57
Date Registered: 16 May, 2010, 03:55:30
Posts: 1198

Total Post Ratings: +83

View Profile
« Reply #6 on: 14 October, 2010, 02:18:00 »
0

but what if the user mistypes b0011 into b0012? you mean your program will just convert this into 2*b001? then that begs the question, what if you have a string like b10201012? wouldn't your program mark it as 2*(b10) + 1012? i'd suggest getting the program to recognize that the given amount exceeds that of the maximum number possible, and then telling the user. regardless, it's a great program if you put in what you meant to (:
Logged


Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Topic starter
Total Post Ratings: +706

View Profile WWW
« Reply #7 on: 14 October, 2010, 02:19:36 »
0

Hmm, good point. It would add ~50 bytes and make each pass a lot slower, though Sad

Anyway, story behind the program:

It was horrible.

I'd made a program that I thought was brilliant (or at least very, very useful Grin). I wanted to share it on Omni, but (1) I lost my link cable; (2) WabbitEmu's Export feature was broken; and (3) SourceCoder still had bugs, which gave the program random syntax errors.

So I made the program with SourceCoder and started debugging it with Wabbit. Then I realized that even if I fixed it, I couldn't export it. So I opened up a hex editor (yes, on the comp, and yes, I'm suicidal, apparently). And so I began the task of individually editing hex codes to make it work.

That's when I got BSoD'd. It was horrible.
« Last Edit: 14 October, 2010, 15:26:57 by Deep Thought » Logged




DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #8 on: 14 October, 2010, 05:43:35 »
0

Nice utility!
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Topic starter
Total Post Ratings: +706

View Profile WWW
« Reply #9 on: 14 October, 2010, 05:46:30 »
0

Thanks, and I just realized something: It works almost the same way as Calcalca. Maybe I could combine them...
Logged




DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #10 on: 14 October, 2010, 05:55:38 »
0

Mhmm idk. Calcalca is more math-oriented. Programmers might prefer to just have the base conversion to save as much space as possible. In my case I haven't needed math programs since the last time I had maths was 7 years ago Grin
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Topic starter
Total Post Ratings: +706

View Profile WWW
« Reply #11 on: 14 October, 2010, 05:59:35 »
0

Good point. Well, I'll change it a bit, add a readme, and hopefully release this tomorrow Smiley
Logged




DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 15:43:59
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50232


Total Post Ratings: +2615

View Profile WWW
« Reply #12 on: 14 October, 2010, 06:01:21 »
0

Ok. Feel free to upload in the dl section Cheesy
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 03:26:33
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Topic starter
Total Post Ratings: +706

View Profile WWW
« Reply #13 on: 14 October, 2010, 06:03:15 »
0

A question: Would people rather use lowercase letters for binary, octal, and hex at the cost of having an extra ASM sub, or just use uppercase?
« Last Edit: 14 October, 2010, 06:17:23 by Deep Thought » Logged




Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 12:50:02
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5642


Total Post Ratings: +589

View Profile
« Reply #14 on: 14 October, 2010, 06:56:00 »
0

Uppercase most deffinetaly, i can never keep my lowercase on, even with multiple apps that enable it on my calc.
Logged

Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.228 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.