Quote:
As mentionned by Olivier, the HP-85 had the same limitation, that was overcomed in the HP-86/87, together with much larger program space.
Hi J-F,
Thank you (and Olivier) for clarifying this because I was under impression that HP-86/87 used the same BASIC as HP-85.
Quote:
Great! Let us know more soon, a target specification would be very interesting to discuss :-)
I don't have the exact specifications yet because this is work in progress and I am experimenting with a lot of things in order to choose optimal solution (in terms of speed and memory consumption).
Currently I mainly have goals that I would like to achieve in the final product. I can present those goals in a separate thread if the community is interested in this subject ...
But, despite of the specifications, I can asure you that:
(1) It won't be an ordinary BASIC and in many ways it looks and behaves more like Pascal than BASIC.
(2) It will be fast, and I mean real *fast*.
(3) It will have many fancy and useful things ;-)
I executed your tests from the above link and here are the results:
REAL version (looking almost like your program):
10:REM
20:T=TIME
30:X=1
40:FOR I=X TO 1000: NEXT
50:DISP TIME-T
Time: 0.943 seconds
In regard to real numbers, Hrast BASIC-4X works internally with 15-digit mantisa/5-digit exponent, all the time. Native REAL variable type is REAL15, but it supports REAL12, as well, and automatically converts REAL15 to REAL12 when storing to REAL12 variable. It also rounds 15-digit mantissa to 12 digits when executing comparision operations.
INTEGER version (looking almost like your program):
10:REM
20:T=TIME
30:X=%1
40:FOR I=X TO 1000: NEXT
50:DISP TIME-T
Time: 0.254 seconds
Integer range is -524288..524287.
Native REAL version:
REM
T=TIME
X=1
FOR I=X TO 1000 NEXT
DISP TIME-T
Time: 0.898 seconds
Native INTEGER version:
REM
T=TIME
X=%1
FOR I=X TO 1000 NEXT
DISP TIME-T
Time: 0.208 seconds
You can also write it in more packed form:
T=TIME:X=1 FOR I=X TO 1000 NEXT DISP TIME-T
Timing is the same because FOR/NEXT is inside the same line in all versions. Notice that it doesn't need line numbers or statement separators (except before assignment if you don't use LET) and doesn't allow identifier after NEXT (so, NEXT always closes the inner FOR and FOR/NEXT crossing isn't possible).
All tests were executed on HP-48GX running Hrast BASIC-4X initial "1st step" working prototype ...
Edited: 4 Dec 2010, 11:27 a.m.