11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Terms, literals, and expressions┌───────────┐│││Absolute ││Expression │││└─────┬─────┘│ Can be any of├─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────┐│ │ │ │ │ │ │ │ │ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ││ Rel. Exp. │ │ Absolute │ │ Abs. Exp. │ │ Abs. Exp. │ │ Abs. Exp. │ │ Abs. Exp. │ │(Abs. Exp.)│ │ +Abs. Exp.│ │ −Abs. Exp.││ − │ │ Term │ │ + │ │ − │ │ * │ │ / │ │ │ │ │ │ ││ Rel. Exp. │ │ │ │ Abs. Exp. │ │ Abs. Exp. │ │ Abs. Exp. │ │ Abs. Exp. │ │ │ │ │ │ │ │ │└─────┬─────┘ └─────┬─────┘ └───────────┘ └───────────┘ └───────────┘ └───────────┘ └───────────┘ └─┼─────────┘ └─┼─────────┘│ │ └──────┬──────┘│ Can be any of ││ ├─────────────┬─────────────┬─────────────┬─────────────┐ unary operators│ │ │ │ │ ││ │ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐│ │Absolute │ │ Self- │ │ Symbol │ │ Symbol │ │ Symbol ││ │Valued │ │ Defining │ │ Length │ │ Integer │ │ Scale ││ │Ordinary │ │ Term │ │ Attribute │ │ Attribute │ │ Attribute ││ │Symbol │ │ │ │ │ │ │ │ ││ └───────────┘ └───────────┘ └───────────┘ └───────────┘ └───────────┘│┌─────┴─────┐│││Relocatable││Expression │││└─────┬─────┘│ Can be any of├─────────────┬─────────────┬─────────────┬─────────────┬─────────────┐│ │ │ │ │ │ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐ Operators Allowed│ │ │ │ │ │ │ │ │ │ │ ││Relocatable│ │ Rel. Exp. │ │ Rel. Exp. │ │(Rel. Exp.)│ │+Rel. Exp. │ │−Rel. Exp. │ Unary: + Positive│Term │ │ + │ │ − │ │ │ │ │ │ │ − Negative│ │ │ Abs. Exp. │ │ Abs. Exp. │ │ │ ││ │ ││ │└─────┬─────┘ └───────────┘ └───────────┘ └───────────┘ └┼──────────┘ └┼──────────┘ Binary: + Addition│ │ │ − Subtraction│ └──────┬──────┘ * Multiplication Can be any of │ / Division├─────────────┐ unary operators││┌─────┴─────┐ ┌─────┴─────┐│Relocatable│ │ Location │ Rel. Exp. = Relocatable Expression│Valued │ │ Counter │ Abs. Exp. = Absolute Expression│Ordinary │ │ <strong>Ref</strong>erence ││Symbol │ │ │└───────────┘ └───────────┘Figure 11. Definitions of absolute and relocatable expressionsEvaluation of expressionsA single-term expression, like 29 or BETA, has the value of the term involved. Theassembler reduces a multiterm expression, like 25*10+A/B or BETA+10, to a singlevalue, as follows:1. It evaluates each term.2. It does arithmetic operations from left to right. However:a. It does unary operations before binary operations.b. It does binary operations of multiplication and division before the binaryoperations of addition and subtraction.3. In division, it gives an integer result; any fractional portion is dropped.Division by zero gives 0.Chapter 2. Coding and structure 45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!