1. 03 May, 2021 1 commit
  2. 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'
      f7d3d75f
  3. 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'
      7f397afc
    • 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
      981c1591
    • 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
      version/configuration.
      960ab450
    • 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.
      7ceb96c9
  4. 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'
      b7877e1f
  5. 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'
      43eba9c9
  6. 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'
      4e05249d
  7. 05 Jan, 2019 1 commit
    • ROOL's avatar
      Fix to ranged cache sync when using offset assembly · a85663de
      ROOL authored
      Detail:
        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.
      Admin:
        Submission from Timothy Baldwin.
      
      Version 1.76. Tagged as 'BASIC-1_76'
      a85663de
  8. 12 Apr, 2018 1 commit
  9. 03 Mar, 2018 1 commit
    • Jeffrey Lee's avatar
      Avoid global OS_SynchroniseCodeAreas · e7cf5fba
      Jeffrey Lee authored
      Detail:
        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
      Admin:
        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'
      e7cf5fba
  10. 25 Feb, 2018 1 commit
    • Jeffrey Lee's avatar
      VFP/NEON assembler improvements · 67bec6e0
      Jeffrey Lee authored
      Detail:
       - 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
      Admin:
        Tested on Raspberry Pi 3
      
      
      Version 1.74. Tagged as 'BASIC-1_74'
      67bec6e0
  11. 18 Sep, 2017 2 commits
    • Jeffrey Lee's avatar
      Adjust VFP error handling · b2180b60
      Jeffrey Lee authored
      Detail:
        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"
      Admin:
        Tested on Raspberry Pi
      
      
      Version 1.73. Tagged as 'BASIC-1_73'
      b2180b60
    • 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
      3c1ecfa0
  12. 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'
      0cc1f65e
  13. 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'
      e3290ce2
  14. 22 Jul, 2017 1 commit
    • Jeffrey Lee's avatar
      MODE improvements · c5db9c42
      Jeffrey Lee authored
      Detail:
        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
      Admin:
        Tested on RISC OS 3.1, 3.7, and latest 5.23
      
      
      Version 1.70. Tagged as 'BASIC-1_70'
      c5db9c42
  15. 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'
      2789c2ee
    • 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.
      8d0cec67
  16. 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'
      8aa04a28
    • 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.
      2ebecdac
    • 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.
      1d7c3850
  17. 03 Jun, 2017 1 commit
    • Jeffrey Lee's avatar
      Add "BASICVFP", a VFP version of BASIC64 · b3332e2b
      Jeffrey Lee authored
      Detail:
        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
      Admin:
        Tested on Raspberry Pi 1/2/3, BB-xM
      
      
      Version 1.67. Tagged as 'BASIC-1_67'
      b3332e2b
  18. 13 Apr, 2017 1 commit
    • Jeffrey Lee's avatar
      Restore old number formatting logic · db8c7df0
      Jeffrey Lee authored
      Detail:
        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
      Admin:
        Tested on Raspberry Pi
        Fixes issue reported on forums:
        https://www.riscosopen.org/forum/forums/4/topics/9199
      
      
      Version 1.66. Tagged as 'BASIC-1_66'
      db8c7df0
  19. 30 Mar, 2017 1 commit
    • Jeffrey Lee's avatar
      Increase accuracy of 5-byte float to string conversion · 99e7d120
      Jeffrey Lee authored
      Detail:
        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.
      Admin:
        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'
      99e7d120
  20. 20 Mar, 2017 1 commit
    • Jeffrey Lee's avatar
      Improve CALL tester · 78e98596
      Jeffrey Lee authored
      Detail:
        Tests/CALL,ffb:
        - 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
      Admin:
        Tested against current BASIC/BASIC64 and BASIC/BASIC64 1.05
      
      
      Version 1.64. Retagged as 'BASIC-1_64'
      78e98596
  21. 04 Mar, 2017 1 commit
    • Jeffrey Lee's avatar
      Fixes and improvements · 4fa98950
      Jeffrey Lee authored
      Detail:
        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.
      Admin:
        Tested on BB-xM
      
      
      Version 1.64. Tagged as 'BASIC-1_64'
      4fa98950
  22. 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.
      3c79de36
  23. 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'
      70705e18
  24. 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.
      438d5775
  25. 29 May, 2016 1 commit
  26. 28 May, 2016 1 commit
    • Jeffrey Lee's avatar
      Fix RISC OS 3.1 compatibility. Fix "Unknown keyword" error. · 3012d71b
      Jeffrey Lee authored
      Detail:
        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)
      Admin:
        Tested PlingSystem build on RISC OS 3.1
      
      
      Version 1.62. Tagged as 'BASIC-1_62'
      3012d71b
  27. 01 Aug, 2015 1 commit
  28. 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'
      871cde4f
  29. 06 Jan, 2015 1 commit
    • Jeffrey Lee's avatar
      Makefile fix for s.VFPData · cd9dcba3
      Jeffrey Lee authored
      Detail:
        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.
      Admin:
        Tested with PlingSystem build
      
      
      Version 1.59. Retagged as 'BASIC-1_59'
      cd9dcba3
  30. 24 Sep, 2014 1 commit
    • Ben Avison's avatar
      Tweaks to permit BASIC to cross-compile · dd2286cc
      Ben Avison authored
      Detail:
        * Changed file paths to forms that also work when cross-compiling
        * Changed case of filenames so they match on case-sensitive filing systems
        * Makefile needs to use leading tabs
        * Escaped the '$' in 'BASIC$Crunch' (squashes a warning in new version of
          objasm - unrelated to cross-compilation)
      Admin:
        Cross-compiles OK with Norcroft tools, though asasm can't stomach the
        expressions BASIC uses. Checked it still builds with RISC OS Norcroft.
      
      Version 1.59. Not tagged
      dd2286cc
  31. 02 Jun, 2014 1 commit
    • Robert Sprowson's avatar
      Correction to register vetting · 1166bc9d
      Robert Sprowson authored
      Assembler.s revision 1.18 had a slight flaw in assembling
        LDR Rn,[R1] (or LDMIA Rn,{R1})
      would report a bad register because the closing bracket matched the test of being greater than '5' and so skipped the thorough check. So LDR Rn,[R1 ] was OK.
      Now, do a more thorough check to determine if the character following could be part of a variable name.
      
      Version 1.59. Not tagged
      1166bc9d
  32. 01 Jun, 2014 2 commits
    • Robert Sprowson's avatar
      Two parsing bug fixes · c405db68
      Robert Sprowson authored
      Lexical.s:
      Rework previous fixes (revision 1.5 and revision 1.4) for BPUT#TRACE,<number> confusing the MATCH routine.
      While revision 1.5 was better it failed to tokenise IF <expr> GOTO 1234 when the THEN is omitted.
      A review of all the keywords shows the only ones that take tokenisable line numbers are TRACE, RESTORE, ON, GOTO, GOSUB and of these only TRACE can be used in a function like manner.
      So, only apply the fix from revision 1.5 if it's a TRACE token.
      Fix from Martin Avison, fixes ticket #387.
      Added a test case in Tests/Match/TokTrace to assist.
      
      Assembler.s:
      Only consider SP or LR or PC to be referring to a register name if used in isolation (not as a substring of another word).
      While LR and PC aren't particularly common start of words in english, SP is, causing source code with such names to give a "Missing ," error.
      We adopt the same logic as for invalid 'R' named variables (eg. r17foo, r9bar) and attempt to find a variable with that name instead.
      Fixes ticket #386.
      
      Version 1.59. Tagged as 'BASIC-1_59'
      c405db68
    • Robert Sprowson's avatar
      Beef up the comments in MATCH routine · 6b8c3cf5
      Robert Sprowson authored
      Submission from Martin Avison. Not tagged.
      6b8c3cf5