Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Arithmetic Operators
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
        Unary   Binary  Scaling
       ┌───────┬───────┬───────┐
    +  │   X   │   X   │       │
       ├───────┼───────┼───────┤
    -  │   X   │   X   │       │
       ├───────┼───────┼───────┤
    *  │       │   X   │   X   │
       ├───────┼───────┼───────┤
    /  │       │   X   │       │
       ├───────┼───────┼───────┤
   MOD │       │   X   │       │
       └───────┴───────┴───────┘
 
     All of these operators can be used with two operands to calculate
     a numeric result. The minus (-) operator can be placed in front of
     an expression to negate its value. The plus (+) operator can also
     be placed before an expression, but it has no effect. The modulus
     (MOD) operator can only operate on integer expressions. The
     multiplication (*) operator can be used to scale index registers
     on 80386/486 processors. For example:
 
       .386
       movzx   eax, 10
       .while  eax <= 18
               mov     bx, base [eax*2]
               ∙
               ∙
               ∙
               inc     eax
       .endw
 
     See also: Operator Precedence
                                    -♦-