Author Topic: Expression error while compiling  (Read 5248 times)

Offline xparmenides

  • New Member
  • Posts: 1
Expression error while compiling
« on: January 22, 2016, 04:41:06 PM »
Hi all,
    The following expression calculates a segment's address by shifting its start address 4 bits left:
                       code_entry   dd (section.code_1.start)<<4
I think the 'section.code_1.start' is a constant address. So, it is valid to shift it. But, there is an error while compiling:
                        error: shift operator may only be applied to scalar values
The 'section.code_1.start' should be a 'scalar value'. Why the expression can not be calculated?

Thanks.
 

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Expression error while compiling
« Reply #1 on: January 22, 2016, 08:07:35 PM »
Nasm apparently does not agree that "section.code_1.start" is a scalar value. While "segment" is an alias for "section", flat binary format (I ASSume this is flat binary) doesn't have "real segments". I'm guessing that "section.code_1.start" may be the value you want without shifting it left. I may be confused. Get back to me if you think I am.

Best,
Frank