8000 LB doesn't support omitted immediate offset · Issue #2 · hoglet67/BBCSDL · GitHub
[go: up one dir, main page]

Skip to content
< 8000 link rel="modulepreload" href="https://github.githubassets.com/assets/96230-4c1903a4253ec617.js" crossorigin="anonymous" />

LB doesn't support omitted immediate offset #2

Closed

Description

@mincebert

(Again, copied from StarDot at https://www.stardot.org.uk/forums/viewtopic.php?p=401976#p401976 to track.)

LB A0,(T0) (i.e. missing out the 0 immediate offset) gives an error of imm12 constant out of range, whereas LB A0,0(T0) assembles fine.

I assume it's normally OK to omit this and a 0 assumed, but is it strictly required, or is it a bug/limitation?

Activity

  1. hoglet67 commented on Sep 7, 2023

    @hoglet67
    Owner

    I've had a go at this, and it now copes with:

       10 val0=0
       20 val1=1
       30 P%=&20000
       40 [
       50 LB a0,(a1)
       60 LB a0,0(a1)
       70 LB a0,(0)(a1)
       80 LB a0,((0))(a1)
       90 LB a0,val0 (a1)
      100 LB a0,(val0)(a1)
      110 LB a0,1(a1)
      120 LB a0,(1)(a1)
      130 LB a0,((1))(a1)
      140 LB a0,val1 (a1)
      150 LB a0,(val1)(a1)
      160 LB a0,-1(a1)
      170 LB a0,-(1)(a1)
      180 LB a0,(-1)(a1)
      190 LB a0,-val1 (a1)
      200 LB a0,-(val1)(a1)
      210 LB a0,(-val1)(a1)
    

    There will be some corner cases, like if you use a bracketted variable for the offset, and the variable name matches one of the predefined registers. But I think I'm happy with this for now.

    There is also one case where a space is required:

    LB a0,val0 (a1)
    

    I don'r really understand why that is, but I'm not going to start fiddling with Richard's expression parser.

    Dave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0