s390guy / SATK

Toolkit for creating baremetal programs targeting mainframe compatible systems
GNU General Public License v3.0
42 stars 6 forks source link

Simple "DS AL1" with comment yields error: "expected start of address values" #19

Closed Fish-Git closed 2 years ago

Fish-Git commented 3 years ago
FISHTEST CSECT

         DC    AL1(0)
         DC    AL1(0)   comment

         DS    AL1
         DS    AL1      comment

         END
ASMA Ver. 0.2.1                                                                                     25 Sep 2021 10:25:32  Page     1

  LOC        OBJECT CODE       ADDR1     ADDR2    STMT

                              00000000  00000002     1 FISHTEST CSECT
                                                     2
00000000  00                                         3          DC    AL1(0)
00000001  00                                         4          DC    AL1(0)   comment
                                                     5
00000002  00                                         6          DS    AL1
                                                     7          DS    AL1      comment
          ** [7:19] expected start of address values, found "      comment"
                                                     8
                                                     9          END

I'm guessing your recent length modifier fix accidentally broke something somewhere. Probably a simple oversight.

Thanks.

s390guy commented 3 years ago

I wish it were that simple. This is a parsing issue. Parsing is done using finite state machines and regular expressions. While very powerful, they are also very brittle. I will need to look into this.

As a workaround, you can use "DS AL1(0) comment". You will see this construct in some of SATK DSECTs. Essentially give the assembler what it wants. The old "It hurts when I do this. Don't do that." solution. At least until it can be analyzed for the cause.

s390guy commented 2 years ago

Corrected by adding the lexical token detecting white space to the context used to parse DS address operands. Correction committed to the repository in asma/parsers.py.

Fish-Git commented 2 years ago

Confirmed! THANKS!