Menu

#428 General ASxxxx syntax in pcDistance

None
closed-accepted
None
5
2022-03-10
2022-03-05
No

A first attempt to fix [#3280], [#3310] and [#3330 ]

[#2831] needs to be fixed somewhere else, together with the bug that makes =: unusable. Those two aren’t part of this patch, at least not yet.

Main changes:

  • Determines size for general ASxxxx syntax directly in SDCCpeeph.c recursively
  • Support for ports without port->peep.getSize removed, we don't have just instructions

Mostly directives are straight forward to parse, they either have some have no size at all, some kind of fixed size or get their size as an argument.
For things like .odd and .bndry I simply assume the worst case.
.if, .else etc get ignored, so I basically count all possible branches. That blows up the size a bit, but that’s still better than 999.
Strings get their chars counted (for .strz +'\0').
Interpreting nested .rept is the most complicated part, that’s where the recursion happens. It counts dist until it reaches .endm and multiplies it with it’s argument. This is also supported when parsing backwards.

This is a first working version for gathering feedback. I don’t want to merge this before the freeze is over.

What’s missing:

  • labels and =: (not sure if I wanna add this to this patch)
  • removing .dw and .db from port specific getSize functions.
2 Attachments

Related

Bugs: #2831
Bugs: #3280
Bugs: #3310
Bugs: #3330

Discussion

  • Sebastian Riedel

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,6 +3,7 @@
     [#2831] needs to be fixed somewhere else, together with the bug that makes `=:` unusable. Those two aren’t part of this patch, at least not yet.
    
     Main changes:
    +
    
     * Determines size for general ASxxxx syntax directly in SDCCpeeph.c recursively
     * Support for ports without `port->peep.getSize` removed, we don't have just instructions
    
    • Group: -->
     

    Related

    Bugs: #2831

  • Sebastian Riedel

    For now I had to disable .iif syntax since it can have ops and directives on the right side.
    Applied in [r13187]

     

    Related

    Commit: [r13187]

  • Sebastian Riedel

    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB