1. 03 Oct, 2022 1 commit
  2. 23 Jun, 2021 2 commits
    • ROOL's avatar
      Build fix · a9076d55
      ROOL authored
      Version 1.84. Not tagged
    • Robert Sprowson's avatar
      Use VFP transcendentals when FPOINT=2 · ba89c118
      Robert Sprowson authored
      Get table of double precision VFP elementary functions at startup. Since BASICVFP isn't offered as a standalone module, we use the error causing SWI, as the corresponding VFPSupport will be in ROM.
      Shrink VFPFLAGS to 1 byte, to allow VFPTRANSCENDENTALS addition to workspace without needing to move PAGE.
      Replace the keywords using FPAop with VFP ones, and their use in ELLIPSE.
      Version 1.84. Tagged as 'BASIC-1_84'
  3. 16 Jun, 2021 1 commit
    • Jeffrey Lee's avatar
      Add missing VLD alignment options to the assembler · 9df2806c
      Jeffrey Lee authored
      * "VLD single element to all lanes" had the alignment options listed
      incorrectly, preventing them from working. Fix by adding a dummy option
      for 8 bit alignment, like "VLD single element to all lanes".
      * "VLD single 4-element structure to all lanes" was missing support for
      32 bit elements with 64 bit alignment.
      * Add extra instructions to TestVFP to test all the different "single to
      all lanes" alignment options.
      Version 1.83. Tagged as 'BASIC-1_83'
  4. 03 May, 2021 1 commit
  5. 26 Sep, 2020 1 commit
    • Robert Sprowson's avatar
      Help correction · f7d3d75f
      Robert Sprowson authored
      The help for the two forms of POINT both pointed to the same message, so POINT( was wrong.
      Version 1.81. Tagged as 'BASIC-1_81'
  6. 02 Apr, 2020 4 commits
    • Jeffrey Lee's avatar
      Improve handling of "#0" in VFP/NEON assembler · 7f397afc
      Jeffrey Lee authored
      Where an instruction/encoding only allows a zero value, matching against
      the assembly line is performed by looking for an actual "#0" character
      sequence. This means that, unlike other locations where literals are
      parsed, it's impossible to use a variable, function, or any other kind
      of expression to provide the value.
      Change the assembler to detect when a "#0" sequence is being looked for,
      and use the numeric expression parser instead. This will make it much
      easier to use the zero-shift synonym instructions, since it's common for
      programs to use expressions to specify/calculate shift amounts (which
      may evaluate to zero in some circumstances)
      Version 1.80. Tagged as 'BASIC-1_80'
    • Jeffrey Lee's avatar
      Support NEON zero-shift synonyms · 981c1591
      Jeffrey Lee authored
      The ARM ARM lists several NEON shift instructions which have
      special-case synonyms for shifts of zero. Improve the assembler to
      support them (instead of throwing a "bad shift" error):
      * VQRSHRN x,y,#0 -> VQMOVN x,y
      * VQRSHRUN x,y,#0 -> VQMOVUN x,y
      * VRSHR x,y,#0 -> VMOV x,y
      * VRSHRN x,y,#0 -> VMOVN x,y
      * VSHR x,y,#0 -> VMOV x,y
      * VSHRN x,y,#0 -> VMOVN x,y
    • Jeffrey Lee's avatar
      Be careful with the VFPData file in standalone builds · 960ab450
      Jeffrey Lee authored
      Give the file a unique name in ResourceFS, so that we don't hide/replace
      a version of the file that's being used by a different BASIC
    • Jeffrey Lee's avatar
      Fix double-word VUZP.32 & VZIP.32 · 7ceb96c9
      Jeffrey Lee authored
      There's no valid instruction encoding for these. Instead, assemblers are
      expected to treat them as synonyms for VTRN.32 and use that encoding
      instead. Fix BASIC to do this, and add a couple of examples to TestVFP.
  7. 29 Feb, 2020 1 commit
    • Jeffrey Lee's avatar
      Fix multi-parameter messages · b7877e1f
      Jeffrey Lee authored
      Incorrect stack offsets caused multi-parameter messages to use the wrong
      parameter values, e.g. "HELP" reporting incorrect program size and free
      memory values.
      Version 1.79. Tagged as 'BASIC-1_79'
  8. 17 Dec, 2019 1 commit
    • Kevin Swinton's avatar
      WHILE/ACS bug fix · 43eba9c9
      Kevin Swinton authored
      Minor fix to prevent an ACS token from being mistaken for another WHILE token, whilst in an existing WHILE construct.
      Fixes ticket #465.
      Version 1.78. Tagged as 'BASIC-1_78'
  9. 08 Jun, 2019 1 commit
    • Robert Sprowson's avatar
      Assemble the later ARMv8 AArch32 opcodes · 4e05249d
      Robert Sprowson authored
      ARM have added SETPAN, ESB, TSB, CSDB, PSSBB, SSBB since the earlier ARM ARM that BASIC covered. Add these.
      Raise the limit of 16 on the table that decodes 'pure' 3 character opcodes (+condition) in CASMTB2 since the offset into the jump table can be inferred from the offset into the opcode table (both are 1 word/entry), so removing the 4 bit limit. Move SMC/SMI/SVC into CASMTB2.
      Help updated in CmdHelp.
      Version 1.77. Tagged as 'BASIC-1_77'
  10. 05 Jan, 2019 1 commit
    • ROOL's avatar
      Fix to ranged cache sync when using offset assembly · a85663de
      ROOL authored
        BASIC 1.75 switched to syncing the range { old P% - new P% } at the end of assembly instead of all memory. However, this didn't take into account offset assembly in the rare case where the offset assembled code was then run directory (the sources to FSLock-1_22 and earlier were susceptible).
        Fix by storing both old P% and O% at the start of assembly and choose the appropriate range based on the OPT value.
        ADR's to CASMTB3 extended to account for larger routine.
        Submission from Timothy Baldwin.
      Version 1.76. Tagged as 'BASIC-1_76'
  11. 12 Apr, 2018 1 commit
  12. 03 Mar, 2018 1 commit
    • Jeffrey Lee's avatar
      Avoid global OS_SynchroniseCodeAreas · e7cf5fba
      Jeffrey Lee authored
        s/Assembler - Have the inline assembler keep track of the original P% value, so the OS_SynchroniseCodeAreas call that's made on exit can be a ranged op instead of a global one
        Tested on iMX6
        Resolves some performance issues with SMP ROM, where global OS_SynchroniseCodeAreas actually does a ranged clean of RMA + AppSpace due to lack of global D-cache clean
      Version 1.75. Tagged as 'BASIC-1_75'
  13. 25 Feb, 2018 1 commit
    • Jeffrey Lee's avatar
      VFP/NEON assembler improvements · 67bec6e0
      Jeffrey Lee authored
       - Makefile - Add hdr.VFPMacros as a dependency of VFPData
       - Tests/VFP/TestVFP,ffb - Add some assembly tests for the new instructions
       - VFPLib/VFPLib - Remove some non-standard patterns ('D' and 'F' used as data type specifiers). Add the ARMv8 (AArch32) VFP/NEON instructions, and VFPv3 half-precision VCVTB/VCVTT
       - hdr/VFPMacros - Save a few KB of ROM space by changing some tables to use halfword elements instead of words
       - s/VFP - Add VFP_LDRH macro to deal with the compressed tables. Fix VMRS of MVFRn registers (erroneously attempted to convert the digit to upper-case), and add MVFR2
        Tested on Raspberry Pi 3
      Version 1.74. Tagged as 'BASIC-1_74'
  14. 18 Sep, 2017 2 commits
    • Jeffrey Lee's avatar
      Adjust VFP error handling · b2180b60
      Jeffrey Lee authored
        s/ErrorMsgs - Give the VFP "invalid operation" error a more useful error number, and correct the embedded text to match what's in the Resources file. Add VFPExcetion_SQRT, to allow "negative root" errors to be generated by FSQRTD error checks.
        hdr/Definitions - Update FPSCRCheck macro to allow alternate error handlers to be specified
        s/Array, s/Factor - Update FSQRTD error checks to use VFPException_SQRT, so that they say "negative root" instead of "invalid operation"
        Tested on Raspberry Pi
      Version 1.73. Tagged as 'BASIC-1_73'
    • Robert Sprowson's avatar
      Renumber 'Bad MODE' for beeb compatibility · 3c1ecfa0
      Robert Sprowson authored
      Bad MODE is ERR=25 on the BBC Micro, follow suit here, and correct the message file token number (should be 13 to match earlier reorganisation).
      Version 1.72. Not tagged
  15. 07 Sep, 2017 1 commit
    • Robert Sprowson's avatar
      Automatically pick the best FP model for the hosting CPU · 0cc1f65e
      Robert Sprowson authored
      Have BASIC V pick either BASICVFP or BASIC VI as appropriate for the current CPU, so if there's VFP hardware don't emulate everything as FPA opcodes.
      The BASIC64 command (moved to BASIC V) will now automatically RMEnsure then enter the respective module. If there's something depending on the internal workings of BASIC VI and wishes to explicitly select that even when VFP is present a new command, *BASICFPA, forces BASIC VI to start.
      By having BASIC V manage this selection we in effect remove the requirement to remember to RMEnsure the floating point version, which is usually either forgotten about or wrong anyway.
      Compatibility wise
        RISC OS 5 includes all 3 variants (2 if no VFP) and will adopt the new logic.
        Existing RISC OS 5 stable releases have always included BASIC V and VI, so will work as before (through emulating FPA).
        Soft loaded modules inside !System will be handled by a disc based update.
      Changed files
        CmdHelp: adds the new BASIC64 help/syntax message
        Basic.s: qualify the FPA version in it's startup banner
        ModHead.s: add the new selection logic, and move the 'VFP' help to be a suffix so the module names line up nicely in *Modules again
      Tested in both ROM and disc based guises on ARMs with and without VFP hardware.
      Version 1.72. Tagged as 'BASIC-1_72'
  16. 27 Jul, 2017 1 commit
    • Robert Sprowson's avatar
      Suppress help on TWIN/TWINO · e3290ce2
      Robert Sprowson authored
      The TWIN & TWINO commands were changed to cause 'Mistake' in BASIC 1.54, but because we retain the tokens in the token table (so that programs which include the tokens can still be read) they still appeared in response to HELP. Notch then out of the HELP.
      In removing the HTWIN and HTWINO tokenised HELP lookup this revealed that the end of table marker was wrong and BASIC kept scanning until it fell off the end of memory - the code expects a terminator of 127.
      In fixing that it turned out that in BASIC 1.23 the token for 'HELPTOKENNO' was accidentally turned into an error message, and subsequently into token 'E13', when in fact it's only ever looked up as text (not an error).
      Put this back as string shorter 'HHELPNO' and use the slot for E13 for the new 'Bad MODE' error from BASIC 1.70; delete HTWIN and HTWINO.
      Version 1.71. Tagged as 'BASIC-1_71'
  17. 22 Jul, 2017 1 commit
    • Jeffrey Lee's avatar
      MODE improvements · c5db9c42
      Jeffrey Lee authored
        1. MODE <string> now uses OS_ScreenMode 15 rather than *WimpMode, to avoid programs which use it (likely unintentionally) altering the Wimp mode or having to worry about preserving it
        2. If OS_ScreenMode 15 isn't supported, use our own mode string parsing code that provides a similar level of functionality to the host system's *WimpMode
        3. For all MODE variants which use OS_ScreenMode, detect any "SWI not known" error and replace it with "Bad MODE" (under the assumption the user is running pre-OS 3.5)
        4. Add a new variant, MODE <x>,<y>,<modeflags>,<ncolour>,<log2bpp>[,<hz>] to allow specification of the three parameters necessary for selecting the new screen modes introduced by RISC OS Select/5
        Files: Resources/UK/CmdHelp, Resources/UK/Messages, s/ErrorMsgs, s/ModHead, s/Stmt2
        Tested on RISC OS 3.1, 3.7, and latest 5.23
      Version 1.70. Tagged as 'BASIC-1_70'
  18. 21 Jul, 2017 2 commits
    • Robert Sprowson's avatar
      Debugger symmetry, assembler fixes, and add AArch32 ARMv8 instructions · 2789c2ee
      Robert Sprowson authored
      SRS changed to accept R13 as a synonym for SP.
      Fix stack imbalance in CHKCOPRO, CHKREG1 expected R14 & R1 to be stacked but only R1 was, so a copro number not starting CP
        CDP 5,0,C1,C2,C3
      for example led to a abort on instruction fetch when returning from CHKREG.
      The syntax help for STC and LDC was missing the <cpreg> source/dest register.
      Fix for LDREXH & STREXH rejecting odd numbered Rt. The check for -EXD was only looking at 1 of the 2 size bits in the output instruction, so -EX and -EXB allowed odd Rt, but -EXH inherited the checks intended for only -EXD.
      ARMv8: Added ISHLD/NSHLD/OSHLD/LD options to DMB & DSB; HLT #imm16; SEVL; CRC32; LDA[B|H]; LDAEX[B|H|D], STL[B|H]; STLEX[B|H|D].
      This completes the review of all the opcodes (see also BASIC-1_63).
      Tests/ARMv6v7/TestARMv8 has samples of the new opcodes in action.
      Version 1.69. Tagged as 'BASIC-1_69'
    • Robert Sprowson's avatar
      Avoid unpredictable behaviour on old ARMs · 8d0cec67
      Robert Sprowson authored
      Swapped IntVectorVectorOp order of $op registers to avoid Rd=Rm being unpredictable for MUL.
  19. 13 Jun, 2017 3 commits
    • Robert Sprowson's avatar
      Follow the ARM ARM for VFP opcode VDUP despite a tokens clash · 8aa04a28
      Robert Sprowson authored
      Earlier versions of the VFP assembler extensions cooked up VDPL as a way to dodge the problem of opcode VDUP being tokenised as VDUPRINT when used in its scalar or unconditional form (ie. VDUP.<size> <regs>).
      This can be handled with an exception in the tokeniser in a similar manner to MOVEQ and ORR in the conventional ARM instruction set.
      VFPLib: change the tables to use VDUP rather than VDPL.
      Lexical.s: watch out for specifically VDUP. and tokenise it as VDU followed by a P in memory.
      Assembler.s: watch out for token VDU followed by a P and take it to be VDUP.
      VFP.s: when matching, allow the token for VDU to expand as though VDU was seen, also, add support for backslash and REM comments (previously only semicolon was allowed).
      Tests/VFP/TestVFP: update the test case and 3 other failing tests from earlier fixes.
      Tests/Match/TokVDUP: brute force trial of all combinations of VDU and PRINT, to check only VDUP. is caught.
      Version 1.68. Tagged as 'BASIC-1_68'
    • Robert Sprowson's avatar
      Macro and SWI swap outs · 2ebecdac
      Robert Sprowson authored
      Use uppercasing macros from Hdr:Macros rather than local copies.
      Use OS_NewLine instead of OS_WriteC 13+OS_WriteC 10.
      Simplify VFPGet4Char by rolling the loop the other way.
    • Robert Sprowson's avatar
      Tidy source to conventional columns · 1d7c3850
      Robert Sprowson authored
      Run through AsmTidy to make it more readable, aligned to columns 9 & 17.
      Builds the same binary, not tested.
  20. 03 Jun, 2017 1 commit
    • Jeffrey Lee's avatar
      Add "BASICVFP", a VFP version of BASIC64 · b3332e2b
      Jeffrey Lee authored
        See Doc/BASICVFP for overall design/specification
        File changes:
        - !Mk,fd7, !MkClean,fd7, !MkRom,fd7, Makefile - update build scripts to support BASICVFP target
        - Resources/UK/Messages - Add a few new messages
        - hdr/Definitions - Define BASICVFP register usage and a few utility macros
        - hdr/WorkSpace - Define BASICVFP workspace adjustments. Add a few asserts to check some workspace constraints are maintained.
        - s/* - Lots of changes to add support for BASICVFP variant of the module
        Tested on Raspberry Pi 1/2/3, BB-xM
      Version 1.67. Tagged as 'BASIC-1_67'
  21. 13 Apr, 2017 1 commit
    • Jeffrey Lee's avatar
      Restore old number formatting logic · db8c7df0
      Jeffrey Lee authored
        The BASIC64 number formatting code was found to be significantly different to the BASIC105 formatting code, and a potential source of compatibility issues due to the various bugs and quirks it seemed to contain
        To resolve this, the BASIC105 number formatting code has been resurrected and adapted to allow it to be used by both BASIC105 and BASIC64
        The formatting code still uses BCD internally, so accuracy will be the same as BASIC 1.65. It's just the formatting discrepancies (for both BASIC versions) which will have been affected.
        MAXDIGS has also been revised again; the +2 is no longer required (was a BASIC64 quirk), so BASIC105 is down to 11 (up from 10 in pre-1.65 versions) and BASIC64 has reverted to the historic value of 18 (which is technically one more than necessary)
        File changes:
        s/fp2 - Updated as described above
        Tests/Math/AtPercent,ffb - New test program which compares the E/F/G number formatting code against a (BASIC105-style) reference model for the number formatting implemented in BASIC
        Tested on Raspberry Pi
        Fixes issue reported on forums:
      Version 1.66. Tagged as 'BASIC-1_66'
  22. 30 Mar, 2017 1 commit
    • Jeffrey Lee's avatar
      Increase accuracy of 5-byte float to string conversion · 99e7d120
      Jeffrey Lee authored
        This change rewrites the BASIC105 version of the FCONA routine so that it converts the value to FPA packed decimal format, with ~16 decimal digits of accuracy. To avoid adding an FPA dependency to BASIC105 this is done via a new, custom routine.
        Apart from improving the accuracy of the result, converting to packed decimal allows the rest of the function body to be shared with the BASIC64 variant of the routine.
        File changes:
        s/fp2 - Updated as above. New FACCtoBCD function added to perform the BCD/packed decimal conversion. MAXDIGS for BASIC105 increased to 11+2. Minor FRDFPEXPBIN optimisation.
        Tested on BB-xM
        Although the new FCONA implementation is known not to be fully accurate, testing with Test.Math.Decimal shows a marked improvement over the previous implementation, with ~100m random float -> string -> float conversions being performed without any loss of accuracy
      Version 1.65. Tagged as 'BASIC-1_65'
  23. 20 Mar, 2017 1 commit
    • Jeffrey Lee's avatar
      Improve CALL tester · 78e98596
      Jeffrey Lee authored
        - Make compatible with (at least) RISC OS 3.1, for checking behaviour of old BASICs
        - Allow checking for stack usage
        - Mark fewer FPA registers as clobbered, to match the registers BASIC actually uses
        - Implement tests for the untested CALL routines
        Tested against current BASIC/BASIC64 and BASIC/BASIC64 1.05
      Version 1.64. Retagged as 'BASIC-1_64'
  24. 04 Mar, 2017 1 commit
    • Jeffrey Lee's avatar
      Fixes and improvements · 4fa98950
      Jeffrey Lee authored
        s/Expr - Clean up some confusing code relating to l-value address offsets in LOOKU5. The old code looked like it contained a bug for BASIC64 (two TEQs back-to-back), but the situations LOOKU5 is called in meant it was fine and the TEQs were actually unnecessary.
        s/HelpMsgs - Fix MSGPRNXXX and friends corrupting R1. Was causing LVAR to crash/malfunction when listing functions/procedures.
        s/Stmt2 - Fix rotated ellipses being completely broken in BASIC64. Looks like this has been broken forever (bug appears to be present in BASIC64 1.05, as supplied with RISC OS 3)
        s/fp2 - Increase MAXDIGS by one for BASIC64, to allow for accurate float -> string conversion for numbers of the form 0.0XXXX when using G format.
        s/fp2 - Rewrite BASIC64's string -> float conversion code. Although the old code was believed to be sufficiently accurate, excessive use of FPA instructions made it rather slow, and a poor fit for any future VFP version of BASIC (the code relied on extended precision for accuracy, which VFP lacks). The new version converts to packed decimal and then relies on FPEmulator to perform the decimal -> float conversion via LDFP (to mirror float -> string conversion via STFP). The reduction in FP instructions makes it many times faster than the original ("Decimal" test runs 5x faster)
        Tests/CALL,ffb, Tests/Math/Array,ffb, Tests/Math/Decimal,ffb, Tests/Math/ELLIPSE,ffb - Add a handful of new test programs.
        Tested on BB-xM
      Version 1.64. Tagged as 'BASIC-1_64'
  25. 25 Jan, 2017 1 commit
    • Robert Sprowson's avatar
      Assembler encoding of MRS and MSR of banked register · 3c79de36
      Robert Sprowson authored
      The 'S' of SP was being picked up by CHKPSR as a possible match for SPSR, and setting bit 22 of the output opcode. For banked MRS and MSR this turned
        MRS R9,SP_hyp into MRS R9,SPSR_hyp
        MSR SP_hyp,R1 into MSR SPSR_hyp,R1
      rather than change CHKPSR to set bit 22 only when it was sure a PSR was seen, just clear the bit for the banked register case.
      Updated TestARMv6v7 to fewer mismatches, and eyeballed the remaining as being presentational only, rather than wrong encoding.
      Retagged as BASIC-1_63.
  26. 24 Jan, 2017 1 commit
    • Robert Sprowson's avatar
      Assembler/Debugger round trip improvements · 70705e18
      Robert Sprowson authored
      Review of opcodes of the form
        OP<c> {#}imm
      this summarises the ones the BASIC assembler accepts:
        SVC #imm, SVC imm, SWI imm (Debugger emits SWI imm)
        DBG #imm, DGB imm          (Debugger emits DBG imm)
        SMC #imm, SMC imm, SMI imm (Debugger emits SMI imm)
        HVC #imm, HVC imm          (Debugger emits HVC imm)
        BKPT #imm, BKPT imm        (Debugger emits BKPT imm)
      Assembler.s: Add SMI as a synonym for SMC.
      CmdHelp: Add all the missing v6/v7 opcodes to the help.
      HelpMsgs.s: Split the terse yet huge assembler help (HELP [) into 3 to avoid needing 4k of stack just for the message token lookup.
      Version 1.63. Tagged as 'BASIC-1_63'
  27. 30 May, 2016 1 commit
    • Robert Sprowson's avatar
      Build fix · 438d5775
      Robert Sprowson authored
      For standalone builds wanting VFP assembler support, a dependency is needed on VFPData since there's no preceding resources phase. This dependency got trimmed in error in revision 4.19 of this file.
      Retagged as BASIC-1_62.
  28. 29 May, 2016 1 commit
  29. 28 May, 2016 1 commit
    • Jeffrey Lee's avatar
      Fix RISC OS 3.1 compatibility. Fix "Unknown keyword" error. · 3012d71b
      Jeffrey Lee authored
        s/Basic - Fix error generation for unknown keywords on the command line; MSGPRNXXX is a function, not a SWI
        s/HelpMsgs - Take account of the fact that under RISC OS 3.1 MsgTrans doesn't support tokenised messages, and so the [1B][01] control codes being used for inserting newlines will be left in place in the message output. Passing the message on to OS_PrettyPrint allows the tokens to be expanded, but only if we pass a sensible dictionary pointer (Old code was passing in the message pointer as the dictionary pointer, resulting in recursive expansion of the message and an eventual stack overflow)
        Tested PlingSystem build on RISC OS 3.1
      Version 1.62. Tagged as 'BASIC-1_62'
  30. 01 Aug, 2015 1 commit
  31. 14 Apr, 2015 1 commit
    • Adrian Lees's avatar
      Extended assembler for ARMv6/v7 instructions · 871cde4f
      Adrian Lees authored
      Implemented scalar (non-VFP/NEON) instructions for ARMv6/v7 and a couple of omitted ARMv5 instructions in UAL syntax.
      Added documentary comments and minor performance tweaks to some existing code.
      Corrected stack imbalance in handling of memory moving when local DIMs in use.
      Preliminary test code for assembler instructions.
      Version 1.60. Tagged as 'BASIC-1_60'
  32. 06 Jan, 2015 1 commit
    • Jeffrey Lee's avatar
      Makefile fix for s.VFPData · cd9dcba3
      Jeffrey Lee authored
        Makefile - Split the VFPData rule into two parts so that it's clear where s.VFPData comes from. Fixes amu throwing 'Don't know how to make ...' errors when doing repeated builds of PlingSystem.
        Tested with PlingSystem build
      Version 1.59. Retagged as 'BASIC-1_59'