s390guy / SATK

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

length modifier exceeds allowed maximum of 256 #18

Closed Fish-Git closed 3 years ago

Fish-Git commented 3 years ago
FISHTEST CSECT
DSX      DS    XL512
DSC      DS    CL512
DCX      DC    XL512'0'
DCC      DC    CL512' '
         END
ASMA Ver. 0.2.1                                                                                     24 Sep 2021 20:17:40  Page     1

  LOC        OBJECT CODE       ADDR1     ADDR2    STMT

                              00000000  00000000     1 FISHTEST CSECT
                                                     2 DSX      DS    XL512
          ** [2] operand 1 length modifier exceeds allowed maximum of 256: 512
                                                     3 DSC      DS    CL512
          ** [3] operand 1 length modifier exceeds allowed maximum of 256: 512
                                                     4 DCX      DC    XL512'0'
          ** [4] operand 1 length modifier exceeds allowed maximum of 256: 512
                                                     5 DCC      DC    CL512' '
          ** [5] operand 1 length modifier exceeds allowed maximum of 256: 512
                                                     6          END

Since when are hex and char fields limited to just 256 bytes?!

I looked for such a documented limitation somewhere in the ASMA manual and could not find it anywhere. The only places that come anywhere close to mentioning such a limitation is:

Page 48:

DC

The optional length modifier [Ln] may be either an unsigned decimal self-defining term or an expression enclosed in parenthesis. The value must not be less than one nor exceed the maximum allowed for the constant type and not excluded for the type.

Page 50:

DS

See the DC directive description of supported types and implied lengths and alignment.

And nowhere is the "maximum allowed for the constant type" documented!

What the heck is going on Harold?!

Fish-Git commented 3 years ago

FYI:

DS instruction

The maximum length that can be specified for the character (C) and hexadecimal (X) type areas is 65,535 bytes rather than 256 bytes for the same DC operands.

s390guy commented 3 years ago

No idea why this is happening without examining the code. Agree that whatever the maximum is it should be in the manual.

Will check out why this is happening/

s390guy commented 3 years ago

Committed change to increase maximum explicit length for C, CA, CE and X type constants to 65535. Increase applies to both DS and DC constants. Use of a length greater than 256 bytes in a storage-to-storage instruction will result in an error.

Documentation will be updated to reflect this change and previous omission of maximum length.

Fish-Git commented 3 years ago

Fixed! That was quick! Thank you!

Did not see any update to the ASMA manual regarding maximum length modifier value however. Should I presume that will be coming later? Or did you feel such a minor tweak wasn't warranted? If the latter, that's fine too! I'm just happy the problem itself was fixed!

Closing issue.