12.07.2015 Views

MAXQ Core Assembly Guide - Maxim

MAXQ Core Assembly Guide - Maxim

MAXQ Core Assembly Guide - Maxim

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>MAXQ</strong> <strong>Core</strong> <strong>Assembly</strong> <strong>Guide</strong>Include File ContentsInclude files may contain all MaxQAsm and Macro statements and directives except for instructions. Include filesmay end with an END statement, but it is not required that they do so and it will be removed by Macro in any case.Macro Constant OperationsMacro can perform a number of operations on constant values used as immediate operands (beginning with “#”),as well as constant values used in equate definitions. For any of these operators, results extending beyond 32 bitswill be truncated to the low 32 bits of the result. Negative results will be converted to a 32-bit two’s complementvalue.Table 7. Macro Constant OperatorsOperator Format Description+ x + y Returns the integer sum of x and y.- x – y Returns the integer difference of x and y.- -x Unary minus; returns the two’s complement negation of x.* x * y Returns the integer product of x and y./ x / y Returns the value of x divided by y, with any remainder discarded (truncated to an integer).% x % y Returns the modulus of x divided by y.MIN MIN(x, y) If x < y, returns x; otherwise returns y.MAX MAX(x, y) If x > y, returns x; otherwise returns y.| x | y Returns the bitwise OR value of x and y.& x & y Returns the bitwise AND value of x and y.^ x ^ y Returns the bitwise XOR value of x and y.NOT NOT(x)Returns the bitwise negation of x.! !xHIGH HIGH(x) Returns the high byte (bits 8 to 15) of the word value x.LOW LOW(x) Returns the low byte (bits 0 to 7) of the word value x.CONST16 CONST16(x) Returns the low word (bits 0 to 15) of the value x.Returns the value of x shifted left by y bits, with the low y bits filled with 0. The return value x >> yvalue is undefined for values of y greater than 32 or less than 0.Logical AND. If both x and y are nonzero, returns 1; otherwise, returns 0.Logical OR. If either x or y is nonzero, returns 1; otherwise, returns 0.> x > y Greater than. If x > y, returns 1; otherwise, returns 0.>= x >= y Greater than or equal to. If x >= y, returns 1; otherwise, returns 0.< x < y Less than. If x < y, returns 1; otherwise, returns 0.

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

Saved successfully!

Ooh no, something went wrong!