[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integer Basic integers



datajerk wrote:
Is there a hack, tip, or trick to get Integer Basic to use 0 - 65535
for the integer range instead of -32768 - 32767.  I would expect 255 *
256 to produce a negative number instead of an error.

Thanks.

The short answer is: no.

The Integer Basic multiply routine starts at E222. It jumps around to subroutines elsewhere in the ROM.
The instructions you care about occur at the bottom of
the multiply loop:
E23F- 10 E4 BPL $E225 Has the result exceeded the limit?
                                    (If not, continue processing)
E2411   4C 7E E7   JMP $E77E      Yes, display '>32767' error.

Of course, there are other ways to get that error.  You would have to
find and adjust all of them, and when you got done you would have a
version of Integer Basic that could represent only positive numbers.

Someone seems to have posted a source listing at
http://home.comcast.net/~mjmahon/AP1BASIC.txt
but you have to supply your own comments.

I think using the floating point Basic (AppleSoft?) would be easier.

Chris Beall