MC68000/..332 Calculator

Reply

Join Date: Mar 2007
Posts: 1
Reputation: ronivek is an unknown quantity at this point 
Solved Threads: 0
ronivek ronivek is offline Offline
Newbie Poster

MC68000/..332 Calculator

 
0
  #1
Mar 27th, 2007
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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC