senior_falcon Posted August 2 Share Posted August 2 (edited) i have been playing around with Cortex BASIC to get an idea of what it is capable of doing. Here is a video showing it running a LINES program. It appears that the Cortex interpreter is contained within expansion ram. If so, it may be possible to save a Cortex BASIC program as an EA5 program. If that is possible, then it may be possible to save a Cortex program as a cartridge. But that is a lot of ifs and only time will tell. Edited August 2 by senior_falcon 10 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted August 2 Share Posted August 2 Impressive. This BASIC implementation of Lines appears around only half as fast the assembler version which runs in the MiniMemory. Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 2 Share Posted August 2 I believe there is also a ROM version of Cortex BASIC, frees up all that memory for code Quote Link to comment Share on other sites More sharing options...
Asmusr Posted August 2 Share Posted August 2 1 hour ago, Tursi said: I believe there is also a ROM version of Cortex BASIC, frees up all that memory for code Unfortunately it only frees up 14K. Quote Link to comment Share on other sites More sharing options...
apersson850 Posted August 2 Share Posted August 2 You shouldn't have shown this. Now I wonder how it would run in Pascal? 1 4 Quote Link to comment Share on other sites More sharing options...
Reciprocating Bill Posted August 2 Share Posted August 2 4 hours ago, Asmusr said: Unfortunately it only frees up 14K. Cortex BASIC includes a system command ("NEW sys(7)") that frees an additional 1K of RAM, leaving a total of 15,446 bytes free when running from FinalGROM, 6358 bytes when running entirely from RAM (very desirable vis performance when running on a console equipped with 16-bit RAM). Combining the latter with a SuperCart for 8K of fast integer storage opens up a lot of possibilities - successfully running the full BYTE sieve using an 8192 element array, for example, which can't be done in Extended BASIC even with expansion RAM. Also - Running Cortex is probably the fastest way to do floating point math on the TI - much faster than calling console routines in Forth or assembly. 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted August 2 Share Posted August 2 48 minutes ago, Reciprocating Bill said: Also - Running Cortex is probably the fastest way to do floating point math on the TI - much faster than calling console routines in Forth or assembly. Is it using a much smaller floating point number format Bill? Quote Link to comment Share on other sites More sharing options...
Reciprocating Bill Posted August 2 Share Posted August 2 (edited) Here's what the source for Cortex BASIC says... That makes the format six bytes, rather than the eight bytes of the TI format. Edited August 2 by Reciprocating Bill 1 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 2 Author Share Posted August 2 I cannot view that image. Quote Link to comment Share on other sites More sharing options...
Reciprocating Bill Posted August 2 Share Posted August 2 This any better? Cortex FP format pdf.pdf 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 2 Author Share Posted August 2 2 minutes ago, Reciprocating Bill said: This any better? Cortex FP format pdf.pdf 181.82 kB · 2 downloads Can't open file. Quote Link to comment Share on other sites More sharing options...
Reciprocating Bill Posted August 2 Share Posted August 2 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 2 Author Share Posted August 2 (edited) Three times is a charm! When I looked at it with the debugger, it looked like a normal TI format number, but of course, I wasn't paying attention to how many bytes were used. Is this Radix 100 like the TI uses, but with 6 bytes total instead of 8? Edited August 2 by senior_falcon Quote Link to comment Share on other sites More sharing options...
Reciprocating Bill Posted August 2 Share Posted August 2 (edited) From the manual: So it's a binary format (right?) Edited August 2 by Reciprocating Bill Quote Link to comment Share on other sites More sharing options...
Stuart Posted August 2 Share Posted August 2 I actually found the 'maths' a bit surprising. If you print powers of 2 you get: 2 4 8.0000000001 16 32 64 128 256 512.00000001 1024 2048 4096.0000001 8192.0000001 16384 32768.000001 65535.999999 Although the errors are very small, I'm just used to the values being correct as per TI BASIC. 1 Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted August 2 Share Posted August 2 25 minutes ago, Stuart said: I actually found the 'maths' a bit surprising. If you print powers of 2 you get: Are you multiplying by constant 2, or taking 2^n? 2 has an exact representation: it's just exponent 1 and mantissa 1. But 2^n is likely done by a power series approximation of log2. Can you show the source for ^ / pow /exp? It may be the decimal format: if it prints more decimal digits than the mantissa implies. It happens when the last remainder that is partly beyond the precision. . Quote Link to comment Share on other sites More sharing options...
Stuart Posted August 2 Share Posted August 2 13 minutes ago, FarmerPotato said: Are you multiplying by constant 2, or taking 2^n? 2 has an exact representation: it's just exponent 1 and mantissa 1. But 2^n is likely done by a power series approximation of log2. Can you show the source for ^ / pow /exp? It may be the decimal format: if it prints more decimal digits than the mantissa implies. It happens when the last remainder that is partly beyond the precision. . I was doing 2^n. Source says "Raise (R1) to the power (R2) using log and exponential functions" and I can see a hard-coded value for log2 in the source. So would TI BASIC do it the same way? Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 2 Author Share Posted August 2 One of the great things about BASIC on the TI99 is the numerical accuracy. 10 X=0 20 X=X+.1 30 PRINT X 40 IF X=1 THEN 60 50 GOTO 20 60 END On the TI this stops when X=1. On the TRS80 this does not stop because X never equals 1 exactly. I think this is true for Apple 2 and the Commodores as well. I haven't tested Cortex yet to see how it behaves. 2 Quote Link to comment Share on other sites More sharing options...
+RXB Posted August 2 Share Posted August 2 XB does exactly the same thing as TI Basic and does better in some math. Quote Link to comment Share on other sites More sharing options...
+mizapf Posted August 2 Share Posted August 2 25 minutes ago, senior_falcon said: One of the great things about BASIC on the TI99 is the numerical accuracy. ... On the TI this stops when X=1. On the TRS80 this does not stop because X never equals 1 exactly. I think this is true for Apple 2 and the Commodores as well. This is the usual IEEE 754 disease. People are often surprised to hear that all the single-decimal numbers 0.1, ... 0.9 are approximations with the exception of 0.5 which is precisely representable ... and that our TI, in contrast, can encode all of them exactly. While the radix 100 format is utterly slow, it allows us to encode all interesting numbers without approximation - interesting in the sense that I'd like to use them as a numerical constant in the program. I'm not interested in 0.02734375, although this can be done with IEEE, but rather in 0.1 or 3.21 or the like. 3 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 3 Author Share Posted August 3 In my post above, the program stops when X=1, just like in TI BASIC/XB. However, if you remove line 40 so the program does not stop, by the time you get to 2, the value printed is 1.999999999 Interesting... Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted August 3 Share Posted August 3 7 minutes ago, senior_falcon said: In my post above, the program stops when X=1, just like in TI BASIC/XB. However, if you remove line 40 so the program does not stop, by the time you get to 2, the value printed is 1.999999999 Interesting... How did that happen? Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 3 Author Share Posted August 3 (edited) Looks like you are running in TI BASIC or XB. The reference was to Cortex BASIC. Edited August 3 by senior_falcon 4 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 3 Author Share Posted August 3 (edited) Here is the listing for LINES. Running on Cortex, it is much faster than the same program running under The Missing Link Edited August 3 by senior_falcon 3 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted August 3 Share Posted August 3 1 hour ago, senior_falcon said: The reference was to Cortex BASIC. DOH! I read it as testing in XB. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.