Go to advanced search

by RichardRussell
Tue Nov 30, 2021 2:03 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

If anyone wants to live dangerously, the code in my "Unstable" branch will now run Eric's "Day 1" code , and padding a REM statement at the end no longer affects execution time: I'm not across this (as I keep saying, I do not receive notifications of posts to this thread) but it...
by RichardRussell
Tue Nov 30, 2021 10:55 am
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Also, my repository now includes sub-modules so you need to ensure that these are also fetched. I see. I think that at least explains the compilation failure I was seeing resulting from a missing header file, because it looks like that file is now in a 'sub-module'. I think that the following comma...
by RichardRussell
Mon Nov 29, 2021 8:56 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Memotech Bill wrote:
Mon Nov 29, 2021 8:47 pm
The significant difference is the value of ACCSLEN, which prevents me from just using Richard's version of that file.
So what value of ACCSLEN are you using? I thought we'd long ago settled on 1024 for the Pico build.
by RichardRussell
Mon Nov 29, 2021 8:51 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Without knowing what OS you are building on it is difficult to help. It's a Raspberry Pi, but the instructions I was given (scroll down to "Here's a complete log of the commands I needed") are significantly different from yours. The thing is that they did previously work with your repo, s...
by RichardRussell
Mon Nov 29, 2021 7:02 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

My GitHub repository now has two branches: I can't successfully build it from your repo (although it has worked before). This is the error I am getting: CMake Error at CMakeLists.txt:18 (pico_sdk_init): Unknown CMake command "pico_sdk_init". The trouble is I have no idea what I am doing o...
by RichardRussell
Mon Nov 29, 2021 6:18 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

there is nothing wrong with having a binary that doesn't correspond to the available open source. But if the 'official' version that people are encouraged to download and use (i.e. the binary linked from bbcbasic.co.uk ) - or something close - cannot be built from a publicly available repository, I...
by RichardRussell
Mon Nov 29, 2021 2:13 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

If the compilation is done on a Raspberry Pi, it is not that difficult: I think you're looking at things from the perspective of a C developer. For many BBC BASIC users it's the only programming language they know well. Indeed that's pretty much the case even with me: I can (at a pinch, and badly) ...
by RichardRussell
Mon Nov 29, 2021 10:00 am
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Github.com, of course. Or maybe Gitlab.com for it's non affiliation with MS. Sorry, I was imprecise. It was not so much where but under whose account and control ? We currently have a situation in which my upstream GitHub repository contains the files necessary to build all the SDL 2.0 and console ...
by RichardRussell
Sun Nov 28, 2021 9:33 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Typed arrays, both integer and double pack so that if the first value is aligned then all the subsequent values are also aligned. Yes, which is one reason why my BASICs do align LOCAL arrays, so if you particularly want an array to be aligned make it LOCAL. Even if I do manage to get this to work i...
by RichardRussell
Sun Nov 28, 2021 2:32 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

even for processors which can do unaligned access in hardware there must be a performance hit when doing so. Not significantly (on x86 anyway, which is all I know about). If it's in a local cache, I don't think there's any speed penalty at all (and of course forcing alignment can cause a reduction ...
by RichardRussell
Sun Nov 28, 2021 12:48 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 810
Views: 154807

Re: Introduction to BBC BASIC

Does BBCSDL support arrays of 40-bit variants (type code 0x45) in any way, or are they only in BBC BASIC for Windows? 40-bit arrays are not supported in BBC BASIC for SDL 2.0 or in BBC BASIC for Windows (post version 6.00), support for them was removed when 80-bit variants were introduced. That's b...
by RichardRussell
Sat Nov 27, 2021 11:43 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Have they changed it so it's no longer user-editable? Answering my own question, my RC login still worked so I've changed the BBC BASIC MD5/Implementation solution to use PTR() rather than !^. There are bound to be many other BBC BASIC examples there which would need attention to work in 64-bits.
by RichardRussell
Sat Nov 27, 2021 10:04 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Does anyone want to try convincing the maintainers of Rosetta Code to update their MD5 example so it works on both 32 and 64-bit architectures? Have they changed it so it's no longer user-editable? Back when most of the BBC BASIC solutions were submitted (admittedly several years ago), anybody coul...
by RichardRussell
Sat Nov 27, 2021 6:23 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

This quote is only referring to how string variables are stored in memory. The address returned by the ^ operator is the full 64-bit address. I've replied to this query at the Introduction to BBC BASIC thread. Although I am subscribed to email notifications for this topic, I am not receiving them (...
by RichardRussell
Sat Nov 27, 2021 5:45 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 810
Views: 154807

Re: Introduction to BBC BASIC

I have updated the Console Mode editions of BBC BASIC to version 0.39. The changes in this version are: Fixed an off-by-one bug which resulted in a crash if the response to an INPUT LINE statement was a maximum length string (255 characters). Added a new example program patience.bbc which is a simpl...
by RichardRussell
Fri Nov 26, 2021 9:54 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 810
Views: 154807

Re: Introduction to BBC BASIC

My understanding is that the loop... segfaults the interpreter because strings are addressed using a 32-bit offset to a base address. All my current versions of BBC BASIC (whether 32-bits or 64-bits) support using the PTR function to return a pointer to a string: sptr%% = PTR(string$) So if you enc...
by RichardRussell
Fri Nov 19, 2021 1:52 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 810
Views: 154807

Re: Introduction to BBC BASIC

I've released version 1.26a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspberry Pi OS, Android, iOS and in-browser. The changes in this version are as follows: BASIC Interpreter / Run Time Engine Changed the behaviour of VDU 127 (DEL) in VDU 5 mode...
by RichardRussell
Mon Nov 08, 2021 5:02 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Woohoo! Same speed with 75 percent memory savings sure sold me. Is the tail call in the refactored version of item() optimised the way one would expect? The same code base is used for BBC BASIC for SDL 2.0 and the other BBC BASIC Console Mode editions, which are far more important to me, so unless ...
by RichardRussell
Sun Nov 07, 2021 10:42 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

Although I doubt Richard will accept it, I have also considered re-writing item(), replacing each of the case blocks by separate subroutines. Needless to say I wouldn't accept it. But in any case it would be unlikely to help, because the optimiser would probably inline those functions and you'd be ...
by RichardRussell
Sun Nov 07, 2021 6:54 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

ejolson wrote:
Sun Nov 07, 2021 5:51 pm
I'm not sure a 6 percent worst case performance loss is significant.
Well, in that case we disagree dramatically. I've pored for hours over the code of the assembler version, going back a few years, to achieve much smaller performance gains than that!
by RichardRussell
Sun Nov 07, 2021 2:45 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

I'm afraid I forgot why the second test was added The second test was added so it would run, without faulting, on platforms where the stack is allocated in memory below BASIC's heap. That's surprisingly common - it often happens in Windows for example - and without the second test it just fails ins...
by RichardRussell
Sat Nov 06, 2021 11:15 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

When creating a stack frame, the stack pointer can be decreased by a large amount, which may jump over the guard block. Yes, but exactly the same argument should apply to the on-demand paging used by more sophisticated operating systems with virtual memory. Typically they only create one guard page...
by RichardRussell
Sat Nov 06, 2021 3:33 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

I think the problem is that ARM considers a HardFault on the v6M to be non-recoverable. Which is reasonable, but not helpful when debugging (either the interpreter itself or a BASIC program) and you want to find the cause! There's rather a difference between being 'non-recoverable' and 'non-reporta...
by RichardRussell
Sat Nov 06, 2021 2:30 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

As best as I can tell the double-fault is implicit in the ARM v6M design. The pushing of the context to the stack is part of the exception entry process. It happens before software gets any chance to process the exception. Does it not switch to an alternative (e.g.kernel) stack first? I thought it ...
by RichardRussell
Sat Nov 06, 2021 2:25 pm
Forum: General
Topic: BBC BASIC on the Raspberry Pi Pico?
Replies: 1067
Views: 50469

Re: BBC BASIC on the Raspberry Pi Pico?

It looks like we have discovered, over at the StarDot forum , the reason why compiling with -Os breaks the Pico version of BBC BASIC, but is fine on every other platform tested. It appears to be a compiler/optimiser bug, because seemingly one or more of the Global Register Variables is being trashed...

Go to advanced search