Go to advanced search

by RichardRussell
Sat Jul 20, 2019 9:18 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

I wouldn't use a BASIC that had a 64KB string length limitation. Early versions of BBC BASIC, including ARM BASIC VI which is the latest and 'best' from the Acorn stable, have a maximum string length of 255 bytes!! Can you believe it? And whilst there are various workarounds, such as using 'indirec...
by RichardRussell
Fri Jul 19, 2019 11:00 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

Richard and I have also exchanged ideas on very long strings, each producing a library for our own versions. My huge string library was never very satisfactory, and I eventually abandoned it in favour of natively supporting arbitrary-length strings (limited only by available memory) in version 6 of...
by RichardRussell
Fri Jul 19, 2019 5:13 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

2) Matrix Brandy is actually closer to BASIC VI than BASIC V !! My head is beginning to hurt, but what happens when you attempt assign the result to an integer variable: a% = -2147483647 - 2147483647 I presume that BASIC VI still sets a% to 2 in this case (if not it's less compatible with BASIC V t...
by RichardRussell
Fri Jul 19, 2019 4:31 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

Acorn BASICs all return -4294967294, only the older Brandy BASIC (and earlier unfixed Matrix Brandy) returned 2. When you say "all" which versions do you mean precisely? My genuine BBC Master, running BASIC 4 ("(C)1984 Acorn") returns 2 , BeebEm emulating BASIC 2 ("(C)1982 Acorn") returns 2 and Red...
by RichardRussell
Fri Jul 19, 2019 4:18 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

did Acorn's Basics default to single or double precision floating point? Did you miss this comment in which I enquired whether your test for precision in the classic BASIC Fibo might be confused because BBC BASIC uses neither 32-bit ('single') nor 64-bit ('double') precision but 40-bits? It's a nic...
by RichardRussell
Fri Jul 19, 2019 4:12 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

No, it toggles two different code paths, one is the (corrected) original one that pulls the float from the stack, runs TOINT() (which floor()s the number, then casts it to a signed 32-bit integer) on it and pushes it to the stack as an int. The new one pulls the float from the stack, runs floor() o...
by RichardRussell
Fri Jul 19, 2019 1:43 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

I've been having more thoughts about this. And, while it deviates from RISC OS (and BBC Micro) BBC BASIC, I've added a run-time switch to Matrix Brandy to enable this behaviour of allowing INT() to process a number that can't be stored in a standard 32-bit integer variable. Thanks. Naturally I thin...
by RichardRussell
Fri Jul 19, 2019 8:46 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

ScriptBasic takes it another level with name spaces. Brandy BASIC has that functionality (or at least is documented to have, I've never tried it) using the LIBRARY LOCAL statement. But it's the only version of BBC BASIC that does, so it's rather an outlier in that respect and if you use the feature...
by RichardRussell
Thu Jul 18, 2019 10:53 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

I am guessing that you have a different meaning of private variables than me I use the PRIVATE keyword to signify what in C would be called 'static' (I felt that STATIC was too obscure a term for a beginner). Both LOCAL and PRIVATE variables are 'local' to the FN/PROC in which they are declared, bu...
by RichardRussell
Thu Jul 18, 2019 6:45 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

Wow Richard! That is an amazing simulation. I can't take much credit for it, the shader code was originally written by somebody else and tweaked by me. But it illustrates that when you can take advantage of the GPU to do the graphics 'heavy lifting' you don't need high performance from the controll...
by RichardRussell
Thu Jul 18, 2019 4:38 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

The only of those features we are missing is structures, and we can fake that using indirection. All the features I listed are "missing" from ARM BASIC, otherwise I wouldn't have had to add them, would I?! And indirection is no substitute for structures (it's the best workaround available, but not ...
by RichardRussell
Wed Jul 17, 2019 7:23 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

If I decide to start a BBC BASIC to BBC BASIC Performance Comparison how many will contrbute for the 4 versions of BBC BASIC? My versions of BBC BASIC have never been particularly fast. I have concentrated on expanding the capabilities of the language, with speed a lower priority. Recently my effor...
by RichardRussell
Wed Jul 17, 2019 7:04 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

In that case I am surprised that a computer powerful enough to run a modern windows is that slow (about 5 times faster than a RPi 1B+ in this case) Sophie put a lot of effort into optimising the NEXT statement, and that was made easier as a result of there being only two numeric variable types that...
by RichardRussell
Wed Jul 17, 2019 5:50 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

Really? Run the statement PRINT ~x% where x% contains a value having the high bit set (will display an unsigned hexadecimal value). Hexadecimal is neither signed nor unsigned. It is simply a convenient representation of a binary number (a sequence of zeroes and ones) in a shorter, more readable for...
by RichardRussell
Wed Jul 17, 2019 5:06 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

From the manuals, and some programs that use Integer variables as unsigned. Can you quote the relevant section of the manual or list one such program? The type itself is neither signed or unsigned, it is how it is operated on that makes the difference. Nope, not true. Integer variables in BBC BASIC...
by RichardRussell
Wed Jul 17, 2019 4:46 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

In my opinion, the inconvenience of changing the meaning of LOG between Basic versions likely outweighed the advantages. I don't know how old you are, but if you are as old as me you could have argued the point in 1981! It's evident that on the balance of the evidence and advice the BBC received th...
by RichardRussell
Wed Jul 17, 2019 4:36 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

By the documentation vara, varb, varc should be integer type variables. What documentation? BBC BASIC is an explicitly-typed language; the only way the interpreter knows the type of a variable is by its suffix character(s). In my versions there are more types than there are in Acorn's: No suffix: v...
by RichardRussell
Wed Jul 17, 2019 4:06 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

While it is true that a floating point value can hold a integral value greater than 2^32-1, that is still being stored as a floating point value. You seem to like to concentrate on implementation detail, when that shouldn't matter to the programmer. Regardless of how it's stored, it's an integer! B...
by RichardRussell
Wed Jul 17, 2019 8:50 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

if it supports up to 53-bit integers (as ARM BASIC 6 and Brandy do) Unless I'm doing something wrong, they don't. You are trying to load the number into an integer-type variable a% . Obviously that is going to fail, because integer variables can hold only 32-bit integers. But ordinary (non % suffix...
by RichardRussell
Wed Jul 17, 2019 8:30 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

It would be interesting if anyone knows why the designers of BBC Basic chose to break with tradition and defined LOG as the base-10 logarithm. I've received a couple of answers at StarDot: " The original MS 1978 BASIC did indeed only support log base-e with the LOG keyword. This version was license...
by RichardRussell
Wed Jul 17, 2019 8:18 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

In BBC BASIC 6 (BBC BASIC V with 64-bit floats) it is following the definition of the language, which says that INT floors to the integer and that the integer must fit in the languages integer variable type. You really can't excuse an undesirable feature on the grounds that it follows "the definiti...
by RichardRussell
Tue Jul 16, 2019 9:57 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

According to the documentation that comes with bwBASIC the following BASIC dialects used LOG for natural logarithm I'm not sure of the relevance of that. As I said, the BBC requested of Acorn that BBC BASIC be largely compatible with the 8-bit Microsoft BASICs of the day, so what other BASICs may o...
by RichardRussell
Tue Jul 16, 2019 8:59 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

the strange notation in BBC Basic to me is using LOG to stand for base-10 logarithms. This is unique among the Basic dialects I know. I can't enlighten you on that one; although I was there at the time (1981) I don't recall any discussions on that topic. All I know is that the BBC required of Acorn...
by RichardRussell
Tue Jul 16, 2019 8:43 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

Maybe I'm out of line but I would naturally expect an int function to do this simplest thing and just throw away the bits after the decimal point. Thus producing the closest integer towards zero. The most common use to which I put the INT function is in rounding a number to the nearest integer: nea...
by RichardRussell
Tue Jul 16, 2019 8:28 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 24134

Re: Introduction to BBC BASIC

That norm is only for BASIC implementations that store integers primarily in floating point (like most older MS-BASIC implimentations). I have literally no idea what that means. The way a standard function like INT() behaves obviously should not, and must not, depend on implementation details. In B...

Go to advanced search