BBC BASIC for SDL 2.0 version 1.25a released

for discussion of bbc basic for windows/sdl, brandy and more
User avatar
Richard Russell
Posts: 2524
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.24a released

Post by Richard Russell »

Comment deleted.
Last edited by Richard Russell on Sun Sep 26, 2021 10:28 pm, edited 1 time in total.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
nicolagiacobbe
Posts: 77
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: BBC BASIC for SDL 2.0 version 1.24a released

Post by nicolagiacobbe »

Well. iOS is not my preferite platform but would be interesting to hear (in plain terms) why it won't work and what did apple do to render a difficult situation even worse.
User avatar
baz4096
Posts: 210
Joined: Sat Apr 10, 2021 3:51 pm
Location: Baildon, West Yorkshire
Contact:

Re: BBC BASIC for SDL 2.0 version 1.24a released

Post by baz4096 »

I've had issues with SDL on iOS before. Commonly used functions, in my case for keyboard entry in a game, were suddenly classified as "potential keyloggers", and threw up FUD warnings to our users. Updates weren't accepted until we refactored and used different input functions. IIRC.
User avatar
Richard Russell
Posts: 2524
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.24a released

Post by Richard Russell »

I've released version 1.25a 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:
  1. BASIC Interpreter / Run Time Engine

    PAGE may now be lowered without generating an error. This is dangerous in general, but in limited memory environments (e.g. the Raspberry Pi Pico) it can be useful, as it was on the original BBC Micro.

    Implemented a new SUM operator which performs modulo-2^64 addition, i.e. overflows are ignored. Using this operator modulo-2^64 subtraction and multiplication functions can be written:

    Code: Select all

          DEF FNsub64(a%%,b%%)=a%%SUMNOTb%%SUM1
          DEF FNmul64(a%%,b%%)LOCALA%,B%:A%=a%%AND&7FFFFFFF:B%=b%%AND&7FFFFFFF
          =A%*B%SUM((a%%>>31)*B%<<<31)SUM(A%*(b%%>>31)<<<31)SUM((a%%>>31AND3)*(b%%>>31AND3)<<<62)
    
  2. IDEs and Utilities

    No changes (other than the version number of SDLIDE.bbc being updated).

  3. Libraries

    stringlib.bbc modified so that FN_binary() and FN_tobase() accept 64-bit integers.

  4. Example Programs

    There are no changes to the example programs in this release.
This version may be downloaded, for all the supported platforms, from the usual location. The GitHub repository has been updated (used to build the MacOS, Raspberry Pi, Android, iOS, 64-bit Linux and in-browser editions, currently).
Last edited by Richard Russell on Fri Oct 08, 2021 11:17 pm, edited 2 times in total.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
BigEd
Posts: 4446
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: BBC BASIC for SDL 2.0 version 1.25a released

Post by BigEd »

> Using this operator modulo-2^64 subtraction and multiplication functions can be written

Hurrah!
User avatar
Richard Russell
Posts: 2524
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.25a released

Post by Richard Russell »

BigEd wrote:
Fri Oct 08, 2021 6:02 pm
> Using this operator modulo-2^64 subtraction and multiplication functions can be written
Hurrah!
I've managed to simplify the modulo-264 multiplication routine a little:

Code: Select all

      DEF FNmul64(a%%,b%%)LOCALA%,B%:A%=a%%AND&7FFFFFFF:B%=b%%AND&7FFFFFFF:a%%=a%%>>31:b%%=b%%>>31
      =A%*B%SUM(a%%*B%<<<31)SUM(A%*b%%<<<31)SUM((a%%AND3)*(b%%AND3)<<<62)
Can anybody do any better?
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
Richard Russell
Posts: 2524
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.25a released

Post by Richard Russell »

Richard Russell wrote:
Fri Oct 08, 2021 11:28 pm
Can anybody do any better?
This is the program I used to verify my version, by comparing the result from FNmul64() with the equivalent x86-64 instruction:

Code: Select all

      DIM ]^P% 100,]^L% -1
      [OPT 11
      .mul64
      mov rax,[REL ^b%%]
      mul qword [REL ^c%%]
      mov [REL ^a%%],rax
      ret
      ]

      *hex 64
      REPEAT
        b%% = RND EOR RND <<< 32
        c%% = RND EOR RND <<< 32
        CALL mul64
        IF a%% <> FNmul64(b%%,c%%) PRINT "Failed: should be &";~a%% " but was &";~FNmul64(b%%,c%%)
        WAIT 0
      UNTIL FALSE
      END

      DEF FNmul64(a%%,b%%)LOCALA%,B%:A%=a%%AND&7FFFFFFF:B%=b%%AND&7FFFFFFF:a%%=a%%>>31:b%%=b%%>>31
      =A%*B%SUM(a%%*B%<<<31)SUM(A%*b%%<<<31)SUM((a%%AND3)*(b%%AND3)<<<62)
The *hex64 is present only so the 64-bit values can be printed in the event of a failure; the function works in *hex32 mode as well.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
Post Reply

Return to “modern implementations of classic programming languages”