Expressions and Assignments

You can create symbols and assign addresses to those symbols by using the standard assignment operator. An assignment may only be used at the start of an expression, and a semicolon is required at the end of an assignment statement. An example of standard assignment operator usage is shown in the following listing.

Listing: Standard Assignment Operator Usage
  _symbolicname = 
  some_expression
  ;          # Legal
  
  _sym1 + _sym2 = _sym3;          # ILLEGAL!
  

When an expression is evaluated and assigned to a variable, it is given either an absolute or a relocatable type. An absolute expression type is one in which the symbol contains the value that it will have in the output file. A relocatable expression is one in which the value is expressed as a fixed offset from the base of a section.