abakus.jpg Abakus is a tiny calculator program. Yeah, right, yet another calculator - as if the world needed any more of those. Well, I didn't care - I needed one. All the calculators out there either didn't have the functionality I needed or were simply too bulky to run them in the background all the time. Remember, back then, a RAM size of 1 MB was considered large...

Many of my previous projects were written in assembly language, but this time I wanted to use Borland's excellent Turbo C compiler - which helped me to learn more about C and GEM programming. The resulting code packs all the required functionality into 9 KB:

  • Binary, decimal and hexadecimal calculations
  • "Natural" input, i.e. using standard mathematical rather than reverse Polish notation
  • Can send result as text to the active application
  • Adds, subtracts, divides and multiplies
  • Sign change, memory
  • Doubles as a program and as a GEM accessory

Yes, I'm sure you could strip this down a lot by using assembly language. But the point was to convince myself that even when using Turbo C, it was still possible to write reasonably small code.

When asked for a TWiki account, use your own or the default TWikiGuest account.

Revision: r1.2 - 07 Feb 2005 - 07:53 - ClausBrod
Atari > Abakus
Copyright © 1999-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback