Home/Support/Support Forum/Rabbit 3000 64bit Integer math
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Rabbit 3000 64bit Integer math

+1 vote
Many, many years ago on the old Rabbit-Semi yahoo group there was a partial library someone had written that supported basic 64bit integer math. I think it was called BigNum or something along those lines.
Do any of you long-time Rabbit users remember and would you have access to it or a similar file?

Unfortunately, our move to a fancy new 32bit F4 processor has been delayed due to the chip shortage. As a result, I need to get a little more life out of our R3000 based product.
asked Aug 23 in Rabbit by skeller New to the Community (5 points)

Please log in or register to answer this question.

3 Answers

0 votes
I used jslong.c from the Mozilla Project as part of the XBee ANSI C Host Library, which was included in Dynamic C 10.

https://github.com/digidotcom/xbee_ansic_library/blob/master/src/util/jslong.c

It's a fairly decent library for working with 64-bit numbers via a struct with high/low 32-bit values. You could take a look at the Rabbit platform code in that XBee Host Library configures macros referenced by the file to work within Dynamic C 10.

You might also be able to find the original Mozilla project to obtain unmodified copies of those files. I don't think the GitHub version of the XBee Host Library repository included the full commit history, so the original versions of jslong.{c,h} are likely absent.
answered Aug 30 by TomCollins Veteran of the Digi Community (2,222 points)
0 votes
I don't know about that library.

But if you use the Small Device C Compiler (SDCC), you can just use the types ISO C99 has for that: long long, unsigned long long and the types from stdint.h, i.e. as uint64_t, uint64_fast_t, uint64_least_t.
answered Sep 4 by spth New to the Community (24 points)
0 votes
Thanks for the suggestions.
I will look into jslong.c and see what I can do.

In my searches for an answer, I found SDCC, I had not heard of that before. However, this is an existing codebase written in DynamicC that is fairly large I don't really want to re-write everything to support a new compiler.
answered Sep 7 by skeller New to the Community (5 points)
...