Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

VAX MACRO and Instruction Set Reference Manual


Previous Contents Index


DEC

Decrement

Format

opcode dif.mx

Condition Codes

N|| <--- dif LSS 0;  
Z|| <--- dif EQL 0;  
V|| <--- {integer overflow};  
C|| <--- {borrow into most significant bit};  

Exceptions

Opcodes

97 DECB Decrement Byte
B7 DECW Decrement Word
D7 DECL Decrement Long

Description

One is subtracted from the difference operand, and the difference operand is replaced by the result.

Notes

  1. Integer overflow occurs if the largest negative integer is decremented. On overflow, the difference operand is replaced by the largest positive integer.
  2. DECx dif is equivalent to SUBx S^#1, dif, but is 1 byte shorter.

DIV

Divide

Format

2operand: opcode divr.rx, quo.mx

3operand: opcode divr.rx, divd.rx, quo.wx

Condition Codes

N|| <--- quo LSS 0;  
Z|| <--- quo EQL 0;  
V|| <--- {integer overflow} OR {divr EQL 0};  
C|| <--- 0;  

Exceptions

Opcodes

86 DIVB2 Divide Byte 2 Operand
87 DIVB3 Divide Byte 3 Operand
A6 DIVW2 Divide Word 2 Operand
A7 DIVW3 Divide Word 3 Operand
C6 DIVL2 Divide Long 2 Operand
C7 DIVL3 Divide Long 3 Operand

Description

In 2 operand format, the quotient operand is divided by the divisor operand, and the quotient operand is replaced by the result. In 3 operand format, the dividend operand is divided by the divisor operand, and the quotient operand is replaced by the result.

Notes

  1. Division is performed so that the remainder has the same sign as the dividend; that is, the result is truncated toward zero. (Note that a remainder of zero is not saved.)
  2. Integer overflow occurs only if the largest negative integer is divided by --1. On overflow, operands are affected as in note 3 following.
  3. If the divisor operand is zero, then in 2 operand format the quotient operand is not affected; in 3 operand format the quotient operand is replaced by the dividend operand.

EDIV

Extended Divide

Format

opcode divr.rl, divd.rq, quo.wl, rem.wl

Condition Codes

N|| <--- quo LSS 0;  
Z|| <--- quo EQL 0;  
V|| <--- {integer overflow} OR {divr EQL 0};  
C|| <--- 0;  

Exceptions

Opcodes

7B EDIV Extended Divide

Description

The dividend operand is divided by the divisor operand, the quotient operand is replaced by the quotient, and the remainder operand is replaced by the remainder.

Notes

  1. The division is performed such that the remainder operand (unless it is zero) has the same sign as the dividend operand.
  2. On overflow, the operands are affected as in note 3, following.
  3. If the divisor operand is zero, then the quotient operand is replaced by bits 31:0 of the dividend operand, and the remainder operand is replaced by zero.

EMUL

Extended Multiply

Format

opcode mulr.rl, muld.rl, add.rl, prod.wq

Condition Codes

N|| <--- prod LSS 0;  
Z|| <--- prod EQL 0;  
V|| <--- 0;  
C|| <--- 0;  

Exceptions

Opcodes

7A EMUL Extended Multiply

Description

The multiplicand operand is multiplied by the multiplier operand, giving a double-length result. The addend operand is sign extended to double length and added to the result. The product operand is replaced by the final result.

INC

Increment

Format

opcode sum.mx

Condition Codes

N|| <--- sum LSS 0;  
Z|| <--- sum EQL 0;  
V|| <--- {integer overflow};  
C|| <--- {carry from most significant bit};  

Exceptions

Opcodes

96 INCB Increment Byte
B6 INCW Increment Word
D6 INCL Increment Long

Description

One is added to the sum operand and the sum operand is replaced by the result.

Notes

  1. Arithmetic overflow occurs if the largest positive integer is incremented. On overflow, the sum operand is replaced by the largest negative integer.
  2. INCx sum is equivalent to ADDx S^#1, sum, but is 1 byte shorter.

MCOM

Move Complemented

Format

opcode src.rx, dst.wx

Condition Codes

N|| <--- dst LSS 0;  
Z|| <--- dst EQL 0;  
V|| <--- 0;  
C|| <--- C;  

Exceptions

Opcodes

92 MCOMB Move Complemented Byte
B2 MCOMW Move Complemented Word
D2 MCOML Move Complemented Long

Description

The destination operand is replaced by the one's complement of the source operand.

MNEG

Move Negated

Format

opcode src.rx, dst.wx

Condition Codes

N|| <--- dst LSS 0;  
Z|| <--- dst EQL 0;  
V|| <--- {integer overflow};  
C|| <--- dst NEQ 0;  

Exceptions

Opcodes

8E MNEGB Move Negated Byte
AE MNEGW Move Negated Word
CE MNEGL Move Negated Long

Description

The destination operand is replaced by the negative of the source operand.

Note

Integer overflow occurs if the source operand is the largest negative integer (which has no positive counterpart). On overflow, the destination operand is replaced by the source operand.


MOV

Move

Format

opcode src.rx, dst.wx

Condition Codes

N|| <--- dst LSS 0;  
Z|| <--- dst EQL 0;  
V|| <--- 0;  
C|| <--- C;  

Exceptions

Opcodes

90 MOVB Move Byte
B0 MOVW Move Word
D0 MOVL Move Long
7D MOVQ Move Quad
7DFD MOVO Move Octa

Description

The destination operand is replaced by the source operand.

MOVZ

Move Zero-Extended

Format

opcode src.rx, dst.wy

Condition Codes

N|| <--- 0;  
Z|| <--- dst EQL 0;  
V|| <--- 0;  
C|| <--- C;  

Exceptions

Opcodes

9B MOVZBW Move Zero-Extended Byte to Word
9A MOVZBL Move Zero-Extended Byte to Long
3C MOVZWL Move Zero-Extended Word to Long

Description

For MOVZBW, bits 7:0 of the destination operand are replaced by the source operand; bits 15:8 are replaced by zero. For MOVZBL, bits 7:0 of the destination operand are replaced by the source operand; bits 31:8 are replaced by zero. For MOVZWL, bits 15:0 of the destination operand are replaced by the source operand; bits 31:16 are replaced by zero.

MUL

Multiply

Format

2operand: opcode mulr.rx, prod.mx

3operand: opcode mulr.rx, muld.rx, prod.wx

Condition Codes

N|| <--- prod LSS 0;  
Z|| <--- prod EQL 0;  
V|| <--- {integer overflow};  
C|| <--- 0;  

Exceptions

Opcodes

84 MULB2 Multiply Byte 2 Operand
85 MULB3 Multiply Byte 3 Operand
A4 MULW2 Multiply Word 2 Operand
A5 MULW3 Multiply Word 3 Operand
C4 MULL2 Multiply Long 2 Operand
C5 MULL3 Multiply Long 3 Operand

Description

In 2 operand format, the product operand is multiplied by the multiplier operand, and the product operand is replaced by the low half of the double-length result. In 3 operand format, the multiplicand operand is multiplied by the multiplier operand, and the product operand is replaced by the low half of the double-length result.

Note

Integer overflow occurs if the high half of the double-length result is not equal to the sign extension of the low half of the double-length result.


PUSHL

Push Long

Format

opcode src.rl

Condition Codes

N|| <--- src LSS 0;  
Z|| <--- src EQL 0;  
V|| <--- 0;  
C|| <--- C;  

Exceptions

Opcodes

DD PUSHL Push Long

Description

The longword source operand is pushed on the stack.

Notes

  1. PUSHL is equivalent to MOVL src, --(SP), but is 1 byte shorter.
  2. POPL is not a VAX instruction. However, the assembler recognizes the inclusion of POPL destination in a program, for which it generates the code for MOVL (SP)+,destination.

ROTL

Rotate Long

Format

opcode cnt.rb, src.rl, dst.wl

Condition Codes

N|| <--- dst LSS 0;  
Z|| <--- dst EQL 0;  
V|| <--- 0;  
C|| <--- C;  

Exceptions

Opcodes

9C ROTL Rotate Long

Description

The source operand is rotated logically by the number of bits specified by the count operand, and the destination operand is replaced by the result. The source operand is unaffected. A positive count operand rotates to the left. A negative count operand rotates to the right. A zero count operand replaces the destination operand with the source operand.

SBWC

Subtract with Carry

Format

opcode sub.rl, dif.ml

Condition Codes

N|| <--- dif LSS 0;  
Z|| <--- dif EQL 0;  
V|| <--- {integer overflow};  
C|| <--- {borrow into most significant bit};  

Exceptions

Opcodes

D9 SBWC Subtract with carry

Description

The subtrahend operand and the contents of the condition code C-bit are subtracted from the difference operand, and the difference operand is replaced by the result.

Notes

  1. On overflow, the difference operand is replaced by the low-order bits of the true result.
  2. The two subtractions in the operation are performed simultaneously.

SUB

Subtract

Format

2operand: opcode sub.rx, dif.mx

3operand: opcode sub.rx, min.rx, dif.wx

Condition Codes

N|| <--- dif LSS 0;  
Z|| <--- dif EQL 0;  
V|| <--- {integer overflow};  
C|| <--- {borrow into most significant bit};  

Exceptions

Opcodes

82 SUBB2 Subtract Byte 2 Operand
83 SUBB3 Subtract Byte 3 Operand
A2 SUBW2 Subtract Word 2 Operand
A3 SUBW3 Subtract Word 3 Operand
C2 SUBL2 Subtract Long 2 Operand
C3 SUBL3 Subtract Long 3 Operand

Description

In 2 operand format, the subtrahend operand is subtracted from the difference operand, and the difference operand is replaced by the result. In 3 operand format, the subtrahend operand is subtracted from the minuend operand, and the difference operand is replaced by the result.

Note

Integer overflow occurs if the input operands to the subtract are of different signs and the sign of the result is the sign of the subtrahend. On overflow, the difference operand is replaced by the low-order bits of the true result.


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
4515PRO_017.HTML