943,936 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 1837
  • Assembly RSS
Mar 27th, 2007
0

MC68000/..332 Calculator

Expand Post »
Hi there,

I'm currently coding an assembly calculator program to run on an MC68332. I'm doing most of the work on a 68000 emulator for the time being until I have everything as I want it.

The program is fairly straightforward; I'll give a quick walkthrough below.

User enters a base symbol followed by a number in that base. e.g. $F3 or %1001 or 134(for decimal the base symbol is omitted)

User enters an operator for multiply, divide, subtract or add.

User once again enters a number; it can be in any of the three bases as mentioned above.

User enters an = followed by the base they would like the answer displayed in; once again using the appropriate symbol to choose.

The interface is all coded and working as it should.

The conversions work up to a point; and this is where I need a little bit of help!

I have tried to think of alternative ways to perform all the conversions; and although there seems to be some shortcuts for binary and hex; decimal is the main issue.

Currently I'm using multiply and divide commands to multiply the position digits by the corresponding base powers; this unfortunately limits the range of numbers to 2^16.

I have a 32*32->64 multiplication subroutine but in order to perform the conversion back I'm faced with coding a 64/32->64q:64r division subroutine.

The program should work for 2^64 signed integers by the way.

So the question is; is there an easier way for me to perform the conversions? Is there something I'm missing in the conversion algorithms?

Sorry if I haven't given enough information; I'm relatively new to all this.

Thanks in advance if anyone can give me any pointers!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ronivek is offline Offline
1 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Your opinion of Assembly:
Next Thread in Assembly Forum Timeline: Binary Search Tree MIPS





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC