Multibyte arithmetic on a PIC microcontroller

Hello,

A word of warning - shameless plug follows below. If you are not interested in PIC microcontrollers, please ignore this.

Thing is, I couldn't find a microcontroller-only group and I'm positively itching to get some feedback on something... Ok, here it comes...

On the remote chance that somebody else beside me finds madness such as multibyte long division in assembly language useful, I just put a simple page with an assembly code generator for doing some basic math with Microchip PIC microcontrollers:

formatting link

The lib has addition, subtraction, multiplication, division, modulus, logical operations with arbitrary (well, depends on how much memory you have to spare) precision. On the page there is a form where you set the precision, tell it what operations you need, press a button and get the code. Or an error message.

Any feedback, comments, suggestions, flames, killing threats, etc. are welcome.

Thanks,

- Alex

Reply to
Alexander Avtanski
Loading thread data ...

formatting link

Dave.

Reply to
David L. Jones

comp.arch.embedded.

--
Tim Wescott
Wescott Design Services
 Click to see the full signature
Reply to
Tim Wescott

and

Thanks Dave and Tim,

- Alex

Reply to
Alexander Avtanski

Square root function (32-bit input, 16-bit output on an 8-bit controller)

formatting link

Frank

Reply to
Frank Raffaeli

On a sunny day (Tue, 7 Oct 2008 17:47:46 -0700 (PDT)) it happened Alexander Avtanski wrote in :

Nice, thank you.

Reply to
Jan Panteltje

On a sunny day (Tue, 7 Oct 2008 22:10:15 -0700 (PDT)) it happened Frank Raffaeli wrote in :

One remark, I did use some routines 'from the internet' in the past. However some gave really weird results for some special cases, this one is probably OK, but you better always double check the code.

Reply to
Jan Panteltje

Here are some MPASM macros I wrote that generate arbitrary width mult and div on pic18f chips:

formatting link

One of the weirdest macro languages I've ever seen!

--
Ben Jackson AD7GD

http://www.ben.com/
Reply to
Ben Jackson

I'm sure that

formatting link
would love to have your code to post in the techref section. It's a pretty large community (>2000).

Reply to
Anthony Fremont

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.