Commit: MSP430: GAS: Correct range check of imm20 operands

Nick Clifton nickc@redhat.com
Fri Mar 7 10:38:55 GMT 2025


Hi Guys,

  I am applying the attached patch to fix the msp430 assembler's
  checking of 20-bit immediate values.  The code used to check
  for negative values less than -(0x7ffff) but this is incorrect
  as it does not allow -524289.

  Whilst correcting this, and adding a few extra lines to the MSP430
  testsuite to make sure that the checks work correctly I realised
  that it might not be obvious why positive values up to 0xfffff are
  allowed for a signed immediate field.  So I have added in a couple
  of comments explaining about the special native of hex constants
  in immediate fields.

Cheers
  Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: msp430-imm20-range-check.patch
Type: text/x-patch
Size: 6443 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250307/fe132e2f/attachment.bin>


More information about the Binutils mailing list