Go to advanced search

by RichardRussell
Tue Jul 16, 2019 8:08 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

I do find it strange that it truncates towards minus infinity rather than zero as is the norm. Is there something mathematical I am missing, because Python division does the same? The norm? In BASIC it is absolutely standard for the INT() function to truncate towards minus-infinity ('floor'): try i...
by RichardRussell
Tue Jul 16, 2019 5:57 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

This has, unsurprisingly, uncovered a bug in Matrix Brandy. Will this affect other versions of Brandy (Napoleon Brandy etc.), or is it in an area where you modified the code for Matrix? INT was accepting values that were out of range (which is not allowed on the BBC Micro nor RISC OS BBC BASIC impl...
by RichardRussell
Tue Jul 16, 2019 8:55 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

The classic BASIC program should automatically detect the floating-point precision and proceed accordingly. In coding that test have you assumed that floats will be either 32-bits or 64-bits? If so that might explain it failing to run on early BBC BASICs, because they all use 40-bit floats (32-bit ...
by RichardRussell
Tue Jul 16, 2019 8:37 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

Arguably DavidS is correct in his assertion that the tokenized form of BASIC is the source code in that case. Ignoring the fact that it's not what you see on the screen which is just regular text. No, I don't think so. Tokens are just shorthand for keywords, they shorten the program and speed up ex...
by RichardRussell
Mon Jul 15, 2019 7:33 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

No bug, all documentation of the INT function (parens optional) explicitly states for int real that real must be in the range of possible integers . That's still ambiguous. By "possible integers" it seems to mean "values which can be stored in an integer variable" but why should it? You can perfect...
by RichardRussell
Mon Jul 15, 2019 6:20 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

Also note that the use of the INT function requires that the result be stored as an integer at least for a moment in an ARM register. If that means you can't use INT() to truncate a value greater than 2^31 to an integer (despite BASIC 6's 64-bit float variables being able to hold much bigger intege...
by RichardRussell
Mon Jul 15, 2019 5:21 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

DavidS wrote:
Mon Jul 15, 2019 5:07 pm
Actually I am using BASIC 6 (I just think of it as BASIC V, as it is the same langage).
Right. In that case I don't think the 'classic BASIC' Fibo program should fail, because 64-bit floats can hold integers up to about 53 bits. If it is failing I don't understand why. What's the error message?
by RichardRussell
Mon Jul 15, 2019 5:18 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

DavidS wrote:
Mon Jul 15, 2019 5:02 pm
And how is my upercased RISC OS formated text version on your BBC BASIC?
I've not tried it, because it's got colons at the beginning of every line. Where have they come from? Typically they will break BBC BASIC:

Code: Select all

10 : IF FALSE THEN
20 : ENDIF
This reports 'Missing ENDIF in line 10'.
by RichardRussell
Mon Jul 15, 2019 5:03 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

It does not yet work in ARM BASIC (BBC BASIC V on RISC OS), do to getting an integer greater than 32-bits in line 8550. Though I am sure that is not a problem with Richard Russels version. I believe it requires at least double (64-bit) precision floats, so if that's the only issue try running it in...
by RichardRussell
Mon Jul 15, 2019 4:58 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

Sounds reasonable. I could have a go at fixing it, but to be sure it get's done properly would you mind doing the honors. Pretty please. I think this is it: REM fibo_bbc.bas REM This is the classic.bas Fibonacci(4784969) calculator REM with slight modifications to run under Richard Russell's BBCBas...
by RichardRussell
Mon Jul 15, 2019 4:49 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

I think there was a version of the same code for 32-bit... Ah, what you're missing is that my 32-bit interpreters still support 64-bit integer variables: you don't need a 64-bit CPU for that! It may seem superficially strange, but it's no different from C which supports the long long data type even...
by RichardRussell
Mon Jul 15, 2019 3:58 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

The line numbers are not the first thing on the line That has never been a requirement in BBC BASIC. Every implementation of the language I know, including ARM BASIC V, is happy to accept spaces before the line number. the keywords are lower case, I agree that Heater should not list a program with ...
by RichardRussell
Mon Jul 15, 2019 8:28 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

Though where is the library with PROCbigmul and PROCbigadd ? Or did you not get far enogh for those two to work? As I've said, I developed the library only far enough to allow the Fibo application to run (which it does, so obviously those procedures work!). Specifically there is no support for nege...
by RichardRussell
Mon Jul 15, 2019 8:18 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

I wonder if interpretive tokenized code is worth the effort these days? I'm not sure what point you're making here. There is obviously less "effort" involved in interpreting a program compared with compiling it (using those terms in their traditional senses) and tokenisation is simply a method of s...
by RichardRussell
Sun Jul 14, 2019 10:46 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

Ah, so that last code post is not a Fibo Challenge entry and I can forget it. Right? You are correct that I have never submitted an entry for the 'Fibo Challenge' (I don't know what the process is for doing so, or even who the challenge was organised by). My limited understanding of the rules is th...
by RichardRussell
Sun Jul 14, 2019 10:05 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

How did I miss that. I'll give it a spin and replace the Fibo Challenge entry in the repo. If that is OK with you. The issue is that it relies on my 'bigint' library which was thrown together for the challenge and never completed. I had hoped that somebody would take up the reins and develop what I...
by RichardRussell
Sun Jul 14, 2019 9:55 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

it's a lot faster than a PROC call which sets up local vars and suchlike before executing. In BBC BASIC a procedure without parameters doesn't have any 'local' variables (unless explicitly declared using LOCAL) so there is literally nothing more to 'set up' than there is with GOSUB (just pushing th...
by RichardRussell
Sun Jul 14, 2019 9:52 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

If there is a problem with the attribution there I can fix it. I can't see anything that might have led DavidS to conclude it was written by me. It says " with slight modifications to run under Richard Russell's BBCBasic " and " Written December 25, 2018 by Eric Olson " which seems perfectly clear ...
by RichardRussell
Sun Jul 14, 2019 9:43 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

Not originally by you but specially made with your mods for BBC BASIC. All I did was to provide a tiny 'preamble' to the 'classic BASIC' submission so that it would run in BBC BASIC; the whole point was to demonstrate that the legacy subset of BBC BASIC is reasonably standard (although it has to be...
by RichardRussell
Sun Jul 14, 2019 9:23 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

Well, back in the day they were a lot faster than procedures, so maybe for speed? Or just convenience? In BBC BASIC, procedure calls (without parameters) are typically faster than GOSUB. Specifically, the destination of a procedure call is looked up in the same way as variables are, in a relatively...
by RichardRussell
Sun Jul 14, 2019 9:10 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

@ RichardRussell : I am looking at a bit of BBC BASIC code by you, and it uses GOSUB a lot, as well as GOTO. I don't understand. You quote my name, but then refer to a program using GOTO and GOSUB. I haven't used either keyword in a BBC BASIC program for at least 30 years, apart from test programs ...
by RichardRussell
Sun Jul 14, 2019 9:21 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

BBC BASIC seems more like Paul Dunning's SpecBasic. There are similarities, in that both are closely based on the BASIC that was supplied with home computers of the early 1980s (the BBC Micro in the case of BBC BASIC and the ZX Spectrum in the case of SpecBAS). Both have also been greatly extended ...
by RichardRussell
Sat Jul 13, 2019 10:07 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

For me that would be like being stuck in UltraEdit and the output window and its JavaScript embedded scripting engine is my BASIC environment. SDL was conceived as a cross-platform games engine and is still graphics-dominated, so it's hardly surprising that BBC BASIC for SDL 2.0 is first and foremo...
by RichardRussell
Sat Jul 13, 2019 8:19 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

You would probably hear less complaining about being stuck in your IDE if you gave your users a console like environment to work in. I'm not sure to whom that comment was directed, but none of my users has ever complained about being 'stuck' in the IDE (why "stuck"?). Most of them are past (or curr...
by RichardRussell
Sat Jul 13, 2019 5:38 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 544
Views: 23950

Re: Introduction to BBC BASIC

DavidS wrote:
Sat Jul 13, 2019 4:07 pm
The only question is does the assembler in your BBC BASIC recognize the SWI instruction?
I've checked, it does (but only with a numeric parameter of course):

Code: Select all

0043184C EF000003             swi 3

Go to advanced search