VAX MACRO and Instruction Set Reference Manual
VAX MACRO and Instruction Set Reference Manual
Order Number: AAPS6GDTE April 2001 This document describes the features of the VAX MACRO instruction set and assembler. It includes a detailed description of MACRO directives and instructions, as well as information about MACRO source program syntax.
Revision/Update Information:
This manual supersedes the VAX MACRO and Instruction Set Reference Manual, Version 7.1 OpenVMS VAX Version 7.3
Software Version:
2001 Compaq Computer Corporation Compaq, VAX, VMS, and the Compaq logo Registered in U.S. Patent and Trademark Ofce. OpenVMS is a trademark of Compaq Information Technologies Group, L.P. in the United States and other countries. All other product names mentioned herein may be trademarks of their respective companies. Condential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendors standard commercial license. Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty. ZK4515 The Compaq OpenVMS documentation set is available on CD-ROM.
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VAX MACRO Language 1 Introduction 2 VAX MACRO Source Statement Format
2.1 2.2 2.3 2.4 Label Field . . . . Operator Field . Operand Field . Comment Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 23 23 23 xv
iii
iv
.ENDC . . . . . . . . . . .ENDM . . . . . . . . . . .ENDR . . . . . . . . . . .ENTRY . . . . . . . . . .ERROR . . . . . . . . . .EVEN . . . . . . . . . . .EXTERNAL . . . . . .F_FLOATING . . . . .G_FLOATING . . . . .GLOBAL . . . . . . . . .H_FLOATING . . . . .IDENT . . . . . . . . . .IF . . . . . . . . . . . . . .IF_x . . . . . . . . . . . . .IIF . . . . . . . . . . . . . .IRP . . . . . . . . . . . . .IRPC . . . . . . . . . . . .LIBRARY . . . . . . . .LINK . . . . . . . . . . . .LIST . . . . . . . . . . . .LONG . . . . . . . . . . .MACRO . . . . . . . . . .MASK . . . . . . . . . . .MCALL . . . . . . . . . .MDELETE . . . . . . .MEXIT . . . . . . . . . .NARG . . . . . . . . . . .NCHR . . . . . . . . . . .NLIST . . . . . . . . . . .NOCROSS . . . . . . . .NOSHOW . . . . . . . .NTYPE . . . . . . . . . .OCTA . . . . . . . . . . .ODD . . . . . . . . . . . .OPDEF . . . . . . . . . .PACKED . . . . . . . . .PAGE . . . . . . . . . . .PRINT . . . . . . . . . . .PSECT . . . . . . . . . .QUAD . . . . . . . . . . .REFn . . . . . . . . . . . .REPEAT . . . . . . . . .RESTORE_PSECT .SAVE_PSECT . . . . .SHOW
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
626 627 628 629 631 633 634 635 636 637 638 639 640 643 646 647 649 651 652 655 656 657 659 660 661 662 663 664 665 666 667 668 670 671 672 674 675 676 677 681 682 683 685 686
8 Basic Architecture
8.1 8.2 8.3 8.3.1 8.3.2 8.3.3 8.3.4 8.3.5 8.3.6 8.3.7 8.3.8 8.3.9 8.3.10 8.3.11 8.3.12 8.3.13 8.3.14 8.4 8.4.1 8.4.2 8.4.3 8.4.4 8.4.5 8.4.6 8.4.7 8.4.8 8.5 8.5.1
vi
Basic Architecture . . . . . . . . . . . . . . . VAX Addressing . . . . . . . . . . . . . . . . . Data Types . . . . . . . . . . . . . . . . . . . . . Byte . . . . . . . . . . . . . . . . . . . . . . . Word . . . . . . . . . . . . . . . . . . . . . . Longword . . . . . . . . . . . . . . . . . . . Quadword . . . . . . . . . . . . . . . . . . Octaword . . . . . . . . . . . . . . . . . . . F_oating . . . . . . . . . . . . . . . . . . . D_oating . . . . . . . . . . . . . . . . . . . G_oating . . . . . . . . . . . . . . . . . . . H_oating . . . . . . . . . . . . . . . . . . Variable-Length Bit Field . . . . . . . Character String . . . . . . . . . . . . . Trailing Numeric String . . . . . . . . Leading Separate Numeric String Packed Decimal String . . . . . . . . . Processor Status Longword (PSL) . . . C Bit . . . . . . . . . . . . . . . . . . . . . . V Bit . . . . . . . . . . . . . . . . . . . . . . Z Bit . . . . . . . . . . . . . . . . . . . . . . . N Bit . . . . . . . . . . . . . . . . . . . . . . T Bit . . . . . . . . . . . . . . . . . . . . . . IV Bit . . . . . . . . . . . . . . . . . . . . . . FU Bit . . . . . . . . . . . . . . . . . . . . . DV Bit . . . . . . . . . . . . . . . . . . . . . Permanent Exception Enables . . . . . . Divide by Zero . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
81 82 82 82 82 83 83 83 84 84 85 86 86 87 88 811 812 813 814 814 814 814 814 814 814 815 815 815
8.5.2 8.6 8.6.1 8.6.2 8.7 8.7.1 8.7.2 8.7.3 8.7.4 8.7.5 8.7.6 8.7.7 8.7.8 8.7.9 8.8 8.8.1 8.8.2 8.9
Floating Overow . . . . . . . . . . . . . . . . . Instruction and Addressing Mode Formats Opcode Formats . . . . . . . . . . . . . . . . . . Operand Speciers . . . . . . . . . . . . . . . . General Addressing Mode Formats . . . . . . Register Mode . . . . . . . . . . . . . . . . . . . Register Deferred Mode . . . . . . . . . . . . Autoincrement Mode . . . . . . . . . . . . . . Autoincrement Deferred Mode . . . . . . . Autodecrement Mode . . . . . . . . . . . . . . Displacement Mode . . . . . . . . . . . . . . . Displacement Deferred Mode . . . . . . . . Literal Mode . . . . . . . . . . . . . . . . . . . . Index Mode . . . . . . . . . . . . . . . . . . . . . Summary of General Mode Addressing . . . General Register Addressing . . . . . . . . Program Counter Addressing . . . . . . . . Branch Mode Addressing Formats . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
815 815 815 815 816 817 817 818 818 819 819 820 821 823 824 824 825 826
vii
Address Instructions . . . . . . . . . . . . . . MOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . . PUSHA . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.3 Variable-Length Bit Field Instructions . CMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . INSV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.4 Control Instructions . . . . . . . . . . . . . . . ACB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AOBLEQ . . . . . . . . . . . . . . . . . . . . . . . . . . AOBLSS . . . . . . . . . . . . . . . . . . . . . . . . . . . B ................................ BB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BLB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SOBGEQ . . . . . . . . . . . . . . . . . . . . . . . . . . SOBGTR . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.5 Procedure Call Instructions . . . . . . . . . CALLG . . . . . . . . . . . . . . . . . . . . . . . . . . . . CALLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . RET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.6 Miscellaneous Instructions . . . . . . . . . . BICPSW . . . . . . . . . . . . . . . . . . . . . . . . . . . BISPSW . . . . . . . . . . . . . . . . . . . . . . . . . . . BPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HALT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . MOVPSL . . . . . . . . . . . . . . . . . . . . . . . . . . NOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . POPR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PUSHR . . . . . . . . . . . . . . . . . . . . . . . . . . . XFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.7 Queue Instructions . . . . . . . . . . . . . . . . 9.2.7.1 Absolute Queues . . . . . . . . . . . . . . 9.2.7.2 Self-Relative Queues . . . . . . . . . . . 9.2.7.3 Instruction Descriptions . . . . . . . . . INSQHI . . . . . . . . . . . . . . . . . . . . . . . . . . . INSQTI . . . . . . . . . . . . . . . . . . . . . . . . . . . INSQUE . . . . . . . . . . . . . . . . . . . . . . . . . . . REMQHI . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
933 934 935 936 938 939 940 941 942 944 946 947 948 950 951 952 953 954 955 956 958 959 960 961 962 963 965 967 969 970 971 972 973 974 975 977 978 979 980 981 982 982 985 988 989 991 993 995
viii
REMQTI . . . . . . . . . . . . . . . . . . . . . . . . . REMQUE . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.8 Floating-Point Instructions . . . . . . . . 9.2.8.1 Introduction . . . . . . . . . . . . . . . . . 9.2.8.2 Overview of the Instruction Set . . 9.2.8.3 Accuracy . . . . . . . . . . . . . . . . . . . 9.2.8.4 Instruction Descriptions . . . . . . . . ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EMOD . . . . . . . . . . . . . . . . . . . . . . . . . . . MNEG . . . . . . . . . . . . . . . . . . . . . . . . . . . MOV . . . . . . . . . . . . . . . . . . . . . . . . . . . . MUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . POLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.9 Character String Instructions . . . . . . CMPC . . . . . . . . . . . . . . . . . . . . . . . . . . . LOCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . MATCHC . . . . . . . . . . . . . . . . . . . . . . . . . MOVC . . . . . . . . . . . . . . . . . . . . . . . . . . . MOVTC . . . . . . . . . . . . . . . . . . . . . . . . . . MOVTUC . . . . . . . . . . . . . . . . . . . . . . . . . SCANC . . . . . . . . . . . . . . . . . . . . . . . . . . SKPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . SPANC . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.10 Cyclic Redundancy Check Instruction CRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.11 Decimal String Instructions . . . . . . . . 9.2.11.1 Decimal Overow . . . . . . . . . . . . . 9.2.11.2 Zero Numbers . . . . . . . . . . . . . . . 9.2.11.3 Reserved Operand Exception . . . . 9.2.11.4 UNPREDICTABLE Results . . . . . 9.2.11.5 Packed Decimal Operations . . . . . 9.2.11.6 Zero-Length Decimal Strings . . . . 9.2.11.7 Instruction Descriptions . . . . . . . . ADDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . CMPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . CVTLP . . . . . . . . . . . . . . . . . . . . . . . . . . . CVTPL . . . . . . . . . . . . . . . . . . . . . . . . . . . CVTPS . . . . . . . . . . . . . . . . . . . . . . . . . . . CVTPT . . . . . . . . . . . . . . . . . . . . . . . . . . . CVTSP . . . . . . . . . . . . . . . . . . . . . . . . . . . CVTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . DIVP . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
997 999 9101 9101 9102 9103 9104 9106 9107 9108 9109 9111 9113 9115 9116 9117 9118 9121 9123 9124 9126 9128 9129 9130 9132 9134 9136 9137 9138 9139 9140 9142 9143 9143 9143 9143 9143 9144 9144 9146 9148 9150 9151 9152 9153 9155 9157 9159 9161
ix
MOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MULP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SUBP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.12 The EDITPC Instruction and Its Pattern Operators EDITPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$ADJUST_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$BLANK_ZERO . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$END_FLOAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$FILL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$FLOAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$LOAD_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$REPLACE_SIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$_SIGNIF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EO$STORE_SIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.13 Other VAX Instructions . . . . . . . . . . . . . . . . . . . . . . PROBEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CHM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . REI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LDPCTX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SVPCTX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MTPR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MFPR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
9163 9164 9165 9167 9168 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9187 9189 9191 9193 9194 9195 9196
101 101 101 102 103 108 109 1010 1010 1010 1010 1013 1014 1014 1014 1015 1016 1017 1018 1018 1020 1020
10.6 Vector Processor Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.6.1 Vector Memory Management Exception Handling . . . . . . . . . . . . . . . . 10.6.2 Vector Arithmetic Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.6.3 Vector Processor Disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.6.4 Handling Disabled Faults and Vector Context Switching . . . . . . . . . . . 10.6.5 MFVP Exception Reporting Examples . . . . . . . . . . . . . . . . . . . . . . . . . 10.7 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.7.1 Scalar/Vector Instruction Synchronization (SYNC) . . . . . . . . . . . . . . . 10.7.2 Scalar/Vector Memory Synchronization . . . . . . . . . . . . . . . . . . . . . . . . 10.7.2.1 Memory Instruction Synchronization (MSYNC) . . . . . . . . . . . . . . . 10.7.2.2 Memory Activity Completion Synchronization (VMAC) . . . . . . . . . 10.7.3 Other Synchronization Between the Scalar and Vector Processors . . . . 10.7.4 Memory Synchronization Within the Vector Processor (VSYNC) . . . . . 10.7.5 Required Use of Memory Synchronization Instructions . . . . . . . . . . . . 10.7.5.1 When VSYNC Is Not Required . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.8 Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.9 Hardware Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.10 Vector Memory Access Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.10.1 Alignment Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.10.2 Stride Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.10.3 Context of Address Speciers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.10.4 Access Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.10.5 Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VGATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VSCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.11 Vector Integer Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VADDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VCMPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VMULL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VSUBL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.12 Vector Logical and Shift Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VBIC, VBIS, and VXOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.13 Vector Floating-Point Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.13.1 Vector Floating-Point Exception Conditions . . . . . . . . . . . . . . . . . . . . . 10.13.2 Floating-Point Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VCMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VVCVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VDIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VMUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VSUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.14 Vector Edit Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VMERGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IOTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.15 Miscellaneous Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MFVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MTVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VSYNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1024 1025 1026 1027 1028 1030 1033 1033 1034 1034 1035 1036 1036 1037 1039 1041 1042 1043 1043 1043 1043 1044 1044 1045 1047 1049 1051 1052 1053 1054 1056 1058 1059 1060 1062 1063 1063 1064 1065 1067 1070 1072 1074 1076 1077 1078 1079 1080 1081 1083 1084
xi
D Permanent Symbol Table Dened for Use with VAX MACRO E Exceptions That May Occur During Instruction Execution
E.1 E.1.1 E.1.2 E.1.3 E.1.4 E.1.5 E.1.6 E.1.7 E.1.8 E.1.9 E.1.10 E.2 E.2.1 E.2.2 E.3 E.3.1 E.3.2 E.4 E.4.1 E.4.2 E.4.3 E.4.4 E.4.5 E.4.6 E.5 E.5.1 E.5.2 E.5.3 E.5.4 E.6 E.6.1 E.6.2
xii
Arithmetic Traps and Faults . . . . . . . . . . . . . . . . . . . . . . . . . . . . Integer Overow Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Integer Divide-by-Zero Trap . . . . . . . . . . . . . . . . . . . . . . . . . . Floating Overow Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Divide-by-Zero Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Floating Underow Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . Decimal String Overow Trap . . . . . . . . . . . . . . . . . . . . . . . . Subscript-Range Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Floating Overow Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Divide-by-Zero Floating Fault . . . . . . . . . . . . . . . . . . . . . . . . Floating Underow Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory Management Exceptions . . . . . . . . . . . . . . . . . . . . . . . . Access Control Violation Fault . . . . . . . . . . . . . . . . . . . . . . . . Translation Not Valid Fault . . . . . . . . . . . . . . . . . . . . . . . . . . Exceptions Detected During Operand Reference . . . . . . . . . . . . . Reserved Addressing Mode Fault . . . . . . . . . . . . . . . . . . . . . . Reserved Operand Exception . . . . . . . . . . . . . . . . . . . . . . . . . Exceptions Occurring as the Consequence of an Instruction . . . . Reserved or Privileged Instruction Fault . . . . . . . . . . . . . . . . Operand Reserved to Customers Fault . . . . . . . . . . . . . . . . . Instruction Emulation Exceptions . . . . . . . . . . . . . . . . . . . . . Compatibility Mode Exception . . . . . . . . . . . . . . . . . . . . . . . . Change Mode Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Breakpoint Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Trace Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Trace Operation When Entering a Change Mode Instruction . Trace Operation Upon Return From Interrupt . . . . . . . . . . . . Trace Operation After a BISPSW Instruction . . . . . . . . . . . . Trace Operation After a CALLS or CALLG Instruction . . . . . Serious System Failures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Kernel Stack Not Valid Abort . . . . . . . . . . . . . . . . . . . . . . . . . Interrupt Stack Not Valid Halt . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E1 E2 E2 E2 E2 E2 E3 E3 E3 E3 E3 E3 E3 E4 E4 E4 E4 E5 E5 E5 E6 E6 E7 E7 E7 E8 E8 E8 E8 E9 E9 E9
E.6.3
E9
Index Figures
61 101 102 103 104 105 106 107 108 109 1010 1011 1012 1013 E1 Using Transfer Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vector Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vector Length Register (VLR) . . . . . . . . . . . . . . . . . . . . . . . . . . . Vector Mask Register (VMR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vector Count Register (VCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vector Processor Status Register (VPSR) . . . . . . . . . . . . . . . . . . . Vector Arithmetic Exception Register (VAER) . . . . . . . . . . . . . . . Vector Memory Activity Check (VMAC) Register . . . . . . . . . . . . . Vector Translation Buffer Invalidate All (VTBIA) Register . . . . . Vector State Address Register (VSAR) . . . . . . . . . . . . . . . . . . . . . Vector Control Word Operand (cntrl) . . . . . . . . . . . . . . . . . . . . . . Vector Control Word Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory Management Fault Stack Frame (as Sent by the Vector Processor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Encoding of the Reserved Operand . . . . . . . . . . . . . . . . . . . . . . . Compatibility Mode Exception Stack Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696 102 102 103 103 103 106 106 107 107 108 1012 1025 1064 E6
Tables
31 32 33 34 51 52 53 54 61 62 63 64 65 66 67 68 81 82 83 84 Special Characters Used in VAX MACRO Statements . . . . . . . . . . . . . Separating Characters in VAX MACRO Statements . . . . . . . . . . . . . . Unary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Floating-Point Literals Expressed as Decimal Numbers . . . . . . . . . . . Floating-Point Literals Expressed as Rational Numbers . . . . . . . . . . . Index Mode Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary of General Assembler Directives . . . . . . . . . . . . . . . . . . . . . Summary of Macro Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ENABLE and .DISABLE Symbolic Arguments . . . . . . . . . . . . . . . . . . Condition Tests for Conditional Assembly Directives . . . . . . . . . . . . . . Operand Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Program Section Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Default Program Section Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . .SHOW and .NOSHOW Symbolic Arguments . . . . . . . . . . . . . . . . . . . Representation of Least-Signicant Digit and Sign in Zoned Numeric Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Representation of Least-Signicant Digit and Sign in Overpunch Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Floating-Point Literals Expressed as Decimal Numbers . . . . . . . . . . . Floating-Point Literals Expressed as Rational Numbers . . . . . . . . . . . 31 32 310 314 52 59 59 516 61 62 622 641 672 677 679 688 89 810 822 823
xiii
85 86 91 92 101 102 103 104 105 106 107 108 109 1010 1011 1012 1013 1014 1015
1016 C1 C2 C3 C4 C5 C6 D1 D2 D3 E1 E2
General Register Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Program Counter Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary of EDITPC Pattern Operators . . . . . . . . . . . . . . . . . . . . EDITPC Pattern Operator Encoding . . . . . . . . . . . . . . . . . . . . . . . Description of the Vector Processor Status Register (VPSR) . . . . . Possible VPSR<3:0> Settings for MTPR . . . . . . . . . . . . . . . . . . . . . State of the Vector Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VAER Exception Condition Summary Word Encoding . . . . . . . . . . IPR Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description of the Vector Control Word Operand . . . . . . . . . . . . . . Dependencies for Vector Operate Instructions . . . . . . . . . . . . . . . . Dependencies for Vector Load and Gather Instructions . . . . . . . . . Dependencies for Vector Store and Scatter Instructions . . . . . . . . . Dependencies for Vector Compare Instructions . . . . . . . . . . . . . . . Dependencies for Vector MERGE Instructions . . . . . . . . . . . . . . . . Dependencies for IOTA Instruction . . . . . . . . . . . . . . . . . . . . . . . . Dependencies for MFVP Instructions . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Possible Pairs of Read and Write Operations When Scalar/Vector Memory Synchronization (M) or VSYNC (V) Is Required Between Instructions That Reference the Same Memory Location . . . . . . . Encoding of the Exception Condition Type (ETYPE) . . . . . . . . . . . Assembler Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Special Characters Used in VAX MACRO Statements . . . . . . . . . . Summary of Unary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary of Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . Macro String Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary of Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . Opcodes (Alphabetic Order) and Functions . . . . . . . . . . . . . . . . . . One_Byte Opcodes (Numeric Order) . . . . . . . . . . . . . . . . . . . . . . . . Two_Byte Opcodes (Numeric Order) . . . . . . . . . . . . . . . . . . . . . . . . Arithmetic Exception Type Codes . . . . . . . . . . . . . . . . . . . . . . . . . . Compatibility Mode Exception Type Codes . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
825 826 9170 9171 104 105 105 106 108 109 1021 1022 1022 1023 1023 1023 1024 1024
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
xiv
Preface
Intended Audience
This manual is intended for all programmers writing VAX MACRO programs. You should be familiar with assembly language programming, the VAX instruction set, and the OpenVMS operating system before reading this manual.
Document Structure
This manual is divided into two parts, each of which is subdivided into several chapters. Part I describes the VAX MACRO language. Chapter 1 introduces the features of the VAX MACRO language. Chapter 2 describes the format used in VAX MACRO source statements. Chapter 3 describes the following components of VAX MACRO source statements: Character set Numbers Symbols Local labels Terms and expressions Unary and binary operators Direct assignment statements Current location counter
Chapter 4 describes the arguments and string operators used with macros. Chapter 5 summarizes and gives examples of using the VAX MACRO addressing modes. Chapter 6 describes the VAX MACRO general assembler directives and the directives used in dening and expanding macros.
Part II describes the VAX data types, the instruction and addressing mode formats, and the instruction set. Chapter 7 summarizes the terminology and conventions used in the descriptions in Part II. Chapter 8 describes the basic VAX architecture, including the following: Address space Data types
xv
Processor status longword Permanent exception enables Instruction and addressing mode formats
Chapter 9 describes the native-mode instruction set. The instructions are divided into groups according to their function and are listed alphabetically within each group. Chapter 10 describes the extension to the VAX architecture for integrated vector processing.
This manual also contains the following ve appendixes: Appendix A lists the ASCII character set used in VAX MACRO programs. Appendix B gives rules for hexadecimal/decimal conversion. Appendix C summarizes the general assembler and macro directives (in alphabetical order), special characters, unary operators, binary operators, macro string operators, and addressing modes. Appendix D lists the permanent symbols (instruction set) dened for use with VAX MACRO. Appendix E describes the exceptions (traps and faults) that may occur during instruction execution.
Related Documents
The following documents are relevant to VAX MACRO programming: VAX Architecture Reference Manual OpenVMS DCL Dictionary The descriptions of the VMS Linker and Symbolic Debugger in: OpenVMS Linker Utility Manual OpenVMS Debugger Manual OpenVMS Programming Concepts Manual
For additional information about OpenVMS products and services, access the following World Wide Web address: http://www.openvms.compaq.com/
Readers Comments
Compaq welcomes your comments on this manual. Please send comments to either of the following addresses:
Internet Mail [email protected] Compaq Computer Corporation OSSG Documentation Group, ZKO3-4/U08 110 Spit Brook Rd. Nashua, NH 03062-2698
xvi
Conventions
The following conventions are used in this manual:
Ctrl/x A sequence such as Ctrl/x indicates that you must hold down the key labeled Ctrl while you press another key or a pointing device button. A sequence such as PF1 x indicates that you must rst press and release the key labeled PF1 and then press and release another key or a pointing device button. In examples, a key name enclosed in a box indicates that you press a key on the keyboard. (In text, a key name is not enclosed in a box.) In the HTML version of this document, this convention appears as brackets, rather than a box. ... A horizontal ellipsis in examples indicates one of the following possibilities: Additional optional arguments in a statement have been omitted. The preceding item or items can be repeated one or more times. Additional parameters, values, or other information can be entered.
PF1 x
Return
. . . ()
A vertical ellipsis indicates the omission of items from a code example or command format; the items are omitted because they are not important to the topic being discussed. In command format descriptions, parentheses indicate that you must enclose choices in parentheses if you specify more than one. In command format descriptions, brackets indicate optional choices. You can choose one or more items or no items. Do not type the brackets on the command line. However, you must include the brackets in the syntax for OpenVMS directory specications and for a substring specication in an assignment statement. In command format descriptions, vertical bars separate choices within brackets or braces. Within brackets, the choices are optional; within braces, at least one choice is required. Do not type the vertical bars on the command line. In command format descriptions, braces indicate required choices; you must choose at least one of the items listed. Do not type the braces on the command line. This typeface represents the introduction of a new term. It also represents the name of an argument, an attribute, or a reason.
[]
{}
bold text
xvii
italic text
Italic text indicates important information, complete titles of manuals, or variables. Variables include information that varies in system output (Internal error number), in command lines (/PRODUCER=name), and in command parameters in text (where dd represents the predened code for the device type). Uppercase text indicates a command, the name of a routine, the name of a le, or the abbreviation for a system privilege. Monospace type indicates code examples and interactive screen displays. In the C programming language, monospace type in text identies the following elements: keywords, the names of independently compiled external functions and les, syntax summaries, and references to variables or identiers introduced in an example.
UPPERCASE TEXT
Monospace text
A hyphen at the end of a command format description, command line, or code line indicates that the command or statement continues on the following line. All numbers in text are assumed to be decimal unless otherwise noted. Nondecimal radixesbinary, octal, or hexadecimalare explicitly indicated.
numbers
xviii
1
Introduction
VAX MACRO is an assembly language for programming VAX computers using the OpenVMS operating system. Source programs written in VAX MACRO are translated into object (or binary) code by the VAX MACRO assembler, which produces an object module and, optionally, a listing le. The features of the language are introduced in this chapter. VAX MACRO source programs consist of a sequence of source statements. These source statements may be any of the following: VAX native-mode instructions Direct assignment statements Assembler directives
Instructions manipulate data. They perform such functions as addition, data conversion, and transfer of control. Instructions are usually followed in the source statement by operands, which can be any kind of data needed for the operation of the instruction. The VAX instruction set is summarized in Appendix D of this volume and is described in detail in Chapter 9. Direct assignment statements equate symbols to values. Assembler directives guide the assembly process and provide tools for using the instructions. There are two classes of assembler directives: general assembler directives and macro directives. General assembler directives can be used to perform the following operations: Store data or reserve memory for data storage Control the alignment of parts of the program in memory Specify the methods of accessing the sections of memory in which the program will be stored Specify the entry point of the program or a part of the program Specify the way in which symbols will be referenced Specify that a part of the program is to be assembled only under certain conditions Control the format and content of the listing le Display informational messages Control the assembler options that are used to interpret the source program Dene new opcodes
Macro directives are used to dene macros and repeat blocks. They allow you to perform the following operations: Repeat identical or similar sequences of source statements throughout a program without rewriting those sequences
Introduction 11
Introduction
Use string operators to manipulate and test the contents of source statements
Use of macros and repeat blocks helps minimize programmer errors and speeds the debugging process.
12 Introduction
2
VAX MACRO Source Statement Format
A source program consists of a sequence of source statements that the assembler interprets and processes, one at a time, generating object code or performing a specic assembly-time process. A source statement can occupy one source line or can extend onto several source lines. Each source line can be up to 132 characters long; however, to ensure that the source line ts (with its binary expansion) on one line in the listing le, no line should exceed 80 characters. VAX MACRO statements can consist of up to four elds, as follows: Label eldsymbolically denes a location in a program. Operator eldspecies the action to be performed by the statement; can be an instruction, an assembler directive, or a macro call. Operand eldcontains the instruction operands, the assembler directive arguments, or the macro arguments. Comment eldcontains a comment that explains the meaning of the statement; does not affect program execution.
The label eld and the comment eld are optional. The label eld ends with a colon ( : ) and the comment eld begins with a semicolon ( ; ). The operand eld must conform to the format of the instruction, directive, or macro specied in the operator eld. Although statement elds can be separated by either a space or a tab (see Table 32), formatting statements with the tab character is recommended for consistency and clarity and is a Compaq convention.
Field Label Operator Operand Comment Begins in Column 1 9 17 41 Tab Characters to Reach Column 0 1 2 5
For example: .TITLE .ENTRY CLRL SUBL3 BRB ROUT1 START,^M<> R0 #10,4(AP),R2 CONT ; ; ; ; Beginning of routine Clear register Subtract 10 Branch to another routine
LABT: LAB2:
Continue a single statement on several lines by using a hyphen ( - ) as the last nonblank character before the comment eld, or at the end of a line (when there is no comment). For example:
LAB1:
MOVAL
W^BOO$AL_VECTOR,RPB$L_IOVEC(R7)
VAX MACRO treats the preceding statement as equivalent to the following statement: LAB1: MOVAL W^BOO$AL_VECTOR,RPB$L_IOVEC(R7) ; Save boot driver A statement can be continued at any point. Do not continue permanent and user-dened symbol names on two lines. If a symbol name is continued and the rst character on the second line is a tab or a blank, the symbol name is terminated at that character. Section 3.3 describes symbols in detail. Note that when a statement occurs in a macro denition (see Chapter 4 and Chapter 6), the statement cannot contain more than 1000 characters. Blank lines are legal, but they have no signicance in the source program except that they terminate a continued line. The following sections describe each of the statement elds in detail.
The label eld is also used for the symbol in a direct assignment statement (see Section 3.8).
3
Components of MACRO Source Statements
This chapter describes the following components of VAX MACRO source statements: Character set Numbers Symbols Local labels Terms and expressions Unary and binary operators Direct assignment statements Current location counter
Minus sign or hyphen Asterisk Slash Ampersand Exclamation point Backslash Circumex Square brackets Parentheses Angle brackets Question mark Apostrophe Percent sign
* / & ! \ ^ [] () <> ? %
Table 32 denes the separating characters used in VAX MACRO. Table 32 Separating Characters in VAX MACRO Statements
Character (space) (tab) , Character Name Space or tab Comma Usage Separator between statement elds. Spaces within expressions are ignored. Separator between symbolic arguments within the operand eld. Multiple expressions in the operand eld must be separated by commas.
3.2 Numbers
Numbers can be integers, oating-point numbers, or packed decimal strings.
3.3 Symbols
Three types of symbols can be used in VAX MACRO source programs: permanent symbols, user-dened symbols, and macro names.
Processor Register . . General register 11 General register 12 or argument pointer. If you use R12 as an argument pointer, the name AP is recommended; if you use R12 as a general register, the name R12 is recommended. Frame pointer Stack pointer Program counter
Note that the symbols IV and DV are also permanent symbols and cannot be redened. These symbols are used in the register mask to set the integer overow trap (IV) and the decimal string overow trap (DV). See Section 3.6.2.2 for an explanation of their uses.
In addition, by Compaq convention: The dollar sign ( $ ) is reserved for names dened by Compaq. This convention ensures that a user-dened name (which does not have a dollar sign) will not conict with a Compaq-dened name (which does have a dollar sign). Do not use the period ( . ) in any global symbol name (see Section 3.3.3) because languages, such as FORTRAN, do not allow periods in symbol names.
Macro names follow the same rules and conventions as user-dened symbols. (See the description of the .MACRO directive in Chapter 6 for more information on macro names.) User-dened symbols and macro names do not conict; that is, the same name can be used for a user-dened symbol and a macro. To avoid confusion, give the symbols and macros that you dene different names.
When your code references a symbol within the module in which it is dened, VAX MACRO considers the reference internal. When your code references a symbol within a module in which it is not dened, VAX MACRO considers the reference external (that is, the symbol is dened externally in another module). You can use the .DISABLE directive to make references to symbols not dened in the current module illegal. In this case, you must use the .EXTERNAL directive to specify that the reference is an external reference. See Chapter 6 for descriptions of the .DISABLE and .EXTERNAL directives.
A local label block is usually delimited by two user-dened labels. However, the .ENABLE LOCAL_BLOCK directive starts a local block that is terminated only by one of the following: A second .ENABLE LOCAL_BLOCK directive A .DISABLE LOCAL_BLOCK directive followed by a user-dened label or a .PSECT directive
Although local label blocks can extend from one program section to another, Compaq recommends that local labels in one program section not be referenced from another program section. User-dened symbols should be used instead. Local labels can be preserved for future reference with the context of the program section in which they are dened; see the descriptions of the .SAVE_PSECT [LOCAL_BLOCK] directive and the .RESTORE_PSECT directive in Chapter 6. An example showing the use of local labels follows: RPSUB: MOVL 10$: SUBL2 BGTR ADDL2 COMP: MOVL CLRL 10$: CMPL BGTR SUBL INCL BRB 20$: MOVL BRW AMOUNT,R0 DELTA,R0 10$ DELTA,R0 MAX,R1 R2 R0,R1 20$ INCR,R0 R2 10$ R2,COUNT TEST ; ; ; ; ; ; ; ; ; ; ; ; ; Start local label block Define local label 10$ Conditional branch to local label Executed when R0 not > 0 End previous local label block and start new one Define new local label 10$ Conditional branch to local label Executed when R0 not > R1 . . . Unconditional branch to local label Define local label Unconditional branch to user-defined label
ENTR2: SUBL2 R2,R3 10$: SUBL2 R2,R3 BGTR 20$ INCL R0 BRB NEXT 20$: DECL R0 .DISABLE LOCAL_BLOCK NEXT: CLRL R4
VAX MACRO evaluates terms as longword (4-byte) values. If you use an undened symbol as a term, the linker determines the value of the term. The current location counter ( . ) has the value of the location counter at the start of the current operand. Expressions are combinations of terms joined by binary operators (see Section 3.7) and evaluated as longword (4-byte) values. VAX MACRO evaluates expressions from left to right with no operator precedence rules. However, angle brackets ( <> ) can be used to change the order of evaluation. Any part of an expression that is enclosed in angle brackets is rst evaluated to a single value, which is then used in evaluating the complete expression. For example, the expressions A*B+C and A*<B+C> are different. In the rst case, A and B are multiplied and then C added to the product. In the second case, B and C are added and the sum is multiplied by A. Angle brackets can also be used to apply a unary operator to an entire expression, such as -<A+B>. If an arithmetic expression is continued on another line, the listing le will not show the continued line. For example: .WORD <DATA1$^XFF@8+89> You must use /LIST/SHOW=EXPANSION to show the continuation line. VAX MACRO considers unary operators part of a term and thus, performs the action indicated by a unary operator before it performs the action indicated by any binary operator. Expressions fall into three categories: relocatable, absolute, and external (global), as follows: An expression is relocatable if its value is xed relative to the start of the program section in which it appears. The current location counter is relocatable in a relocatable program section.
Any type of expression can be used in most MACRO statements, but restrictions are placed on expressions used in the following: .ALIGN alignment directives .BLKx storage allocation directives .IF and .IIF conditional assembly block directives .REPEAT repeat block directives .OPDEF opcode denition directives .ENTRY entry point directives .BYTE, .LONG, .WORD, .SIGNED_BYTE, and .SIGNED_WORD directive repetition factors Direct assignment statements (see Section 3.8)
See Chapter 6 for descriptions of the directives listed in the preceding list. Expressions used in these directives and in direct assignment statements can contain only symbols that have been previously dened in the current module. They cannot contain either external symbols or symbols dened later in the current module. In addition, the expressions in these directives must be absolute. Expressions in direct assignment statements can be relocatable. An example showing the use of expressions follows. A = 2*100 .BLKB ; ; ; LAB: .BLKW A ; HALF = LAB+<A/2> ; ; ; LAB2: .BLKB LAB2-LAB ; ; ; ; LAB3: .WORD TST+LAB+2 ; ; A+50 2*100 is an absolute expression A+50 is an absolute expression and contains no undefined symbols LAB is relocatable LAB+<A/2> is a relocatable expression and contains no undefined symbols LAB2-LAB is an absolute expression and contains no undefined symbols but contains the symbol LAB3 that is defined later in this module TST+LAB+2 is an external expression because TST is an external symbol
^B ^D ^O ^X ^A
^M
Register mask
#^M<R3,R4,R5>
^F ^C
Floating-point Complement
^F3.0 ^C24
More than one unary operator can be applied to a single term or to an expression enclosed in angle brackets. For example: -+-A This construct is equivalent to: -<+<-A>>
Radix control operators can be included in the source program anywhere a numeric value is legal. A radix control operator affects only the term or expression immediately following it, causing that term or expression to be evaluated in the specied radix. For example: .WORD .WORD .WORD .WORD .LONG ^B00001101 ^D123 ^O47 <A+^O13> ^X<F1C3+FFFFF-20> ; ; ; ; ; ; Binary radix Decimal radix (default) Octal radix 13 is in octal radix All numbers in expression are in hexadecimal radix
The circumex (^) cannot be separated from the B, D, O, or X that follows it, but the entire radix control operator can be separated by spaces and tabs from the term or expression that is to be evaluated in that radix. The default decimal operator is needed only within an expression that has another radix control operator. In the following example, 16 is interpreted as a decimal number because it is preceded by the decimal operator ^D even though the 16 is in an expression prexed by the octal radix control operator. .LONG ^O<10000 + 100 + ^D16>
CMPW MOVL
#^A/XY/,R0 #^A/AB/,R0
3.6.2.2 Register Mask Operator The register mask operator converts a register name or a list of register names enclosed in angle brackets into a 1- or 2-byte register mask. The register mask is used by the Push Registers (PUSHR) and Pop Registers (POPR) instructions and the .ENTRY and .MASK directives (see Chapter 6). Formats ^Mreg-name ^M<reg-name-list> reg-name One of the register names or the DV or IV arithmetic trap-enable speciers. reg-name-list A list of register names and the DV and IV arithmetic trap-enable speciers, separated by commas. The register mask operator sets a bit in the register mask for every register name or arithmetic trap enable specied in the list. The bits corresponding to each register name and arithmetic trap-enable specier follow.
Register Name R0 to R11 R12 or AP FP SP IV DV Arithmetic Trap Enable Bits 0 to 11 12 13 14 15
When the POPR or PUSHR instruction uses the register mask operator, R0 to R11, R12 or AP, FP, and SP can be specied. You cannot specify the PC register name and the IV and DV arithmetic trap-enable speciers. When the .ENTRY or .MASK directive uses the register mask operator, you can specify R2 to R11 and the IV and DV arithmetic trap-enable speciers. However, you cannot specify R0, R1, FP, SP, and PC. IV sets the integer overow trap, and DV sets the decimal string overow trap. The arithmetic trap-enable speciers are described in Chapter 8.
3.6.3.2 Complement Operator The complement operator produces the ones complement of the specied value. Format ^Cterm term Any term or expression. If an expression is specied, it must be enclosed in angle brackets. VAX MACRO evaluates the term or expression as a 4-byte value before complementing it. For example: .LONG .LONG ^C^XFF ^C25 ; Produces FFFFFF00 (hex) ; Produces complement of ; 25 (dec) which is ; FFFFFFE6 (hex)
All binary operators have equal priority. Terms or expressions can be grouped for evaluation by enclosing them in angle brackets. The enclosed terms and expressions are evaluated rst, and remaining operations are performed from left to right. For example: .LONG .LONG 1+2*3 1+<2*3> ; Equals 9 ; Equals 7
Note that a 4-byte result is returned from all binary operations. If you use a 1byte or 2-byte operand, the result is the low-order bytes of the 4-byte result. VAX MACRO displays an error message if the truncation causes a loss of signicance. The following sections describe the arithmetic shift, logical AND, logical inclusive OR, and logical exclusive OR operators.
Components of MACRO Source Statements 3.7 Binary Operators 3.7.2 Logical AND Operator
The logical AND operator ( & ) takes the logical AND of two operands. For example: A = ^B1010 B = ^B1100 .LONG
A&B
A!B
A\B
By Compaq convention, the symbol in a direct assignment statement is placed in the label eld.
When a program section that you dened in the current module is continued, the current location counter is set to the last value of the current location counter in that program section. When you use the current location counter in the operand eld of an instruction, the current location counter has the value of the address of that operand; it does not have the value of the address of the beginning of the instruction. For this reason, you would not normally use the current location counter as a part of the operand specier.
4
Macro Arguments and String Operators
By using macros, you can use a single line to insert a sequence of source lines into a program. A macro denition contains the source lines of the macro. The macro denition can optionally have formal arguments. These formal arguments can be used throughout the sequence of source lines. Later, the formal arguments are replaced by the actual arguments in the macro call. The macro call consists of the macro name optionally followed by actual arguments. The assembler replaces the line containing the macro call with the source lines in the macro denition. It replaces any occurrences of formal arguments in the macro denition with the actual arguments specied in the macro call. This process is called the macro expansion. The macro directives (described in Chapter 6) provide facilities for performing eight categories of functions. Table 62 lists these categories and the directives that fall under them. By default, macro expansions are not printed in the assembly listing. They are printed only when the .SHOW directive (see description in Chapter 6) or the /SHOW qualier (described in the OpenVMS DCL Dictionary) species the EXPANSIONS argument. In the examples in this chapter, the macro expansions are listed as they would appear if .SHOW EXPANSIONS was specied in the source le or /SHOW=EXPANSIONS was specied in the MACRO command string. The remainder of this chapter describes macro arguments, created local labels, and the macro string operators.
The following two examples show possible calls and expansions of the macro dened previously: STORE .LONG .WORD .BYTE 3,2,1 3 1 2 ; ; ; ; Macro call 3 is first argument 1 is third argument 2 is second argument
The following three examples show possible calls and expansions of the macro dened previously: STORE .LONG .WORD .BYTE STORE .LONG .WORD .BYTE STORE .LONG .WORD .BYTE ; No arguments supplied 12 1000 0 ,5,X 12 X 5 1 1 1000 0 ; Last two arguments supplied
The following macro call species keyword arguments: STORE .LONG .WORD .BYTE ARG3=27+5/4,ARG2=5,ARG1=SYMBL SYMBL 27+5/4 5
Because the keywords are specied in the macro call, the arguments in the macro call need not be given in the order they were listed in the macro denition.
FIN:
Note that the argument in the call to REPEAT is not enclosed in angle brackets. The following example calls the macro CNTRPT2: BEG: CNTRPT2 .BYTE REPEAT .ASCII .ASCII BEG,TERM,<<MIND YOUR PS AND QS>> TERM-BEG-1 ; Length of 2*string <MIND YOUR PS AND QS> ; Call REPEAT macro /MIND YOUR PS AND QS/ /MIND YOUR PS AND QS/
TERM: Note that even though the call to REPEAT in the macro denition is not enclosed in delimiters, the call in the expansion is enclosed because the call to CNTRPT2 contains nested delimiters around the string argument.
L1:
The following three calls and expansions of the macro dened previously show both created local labels and a user-dened local label: POSITIVE R0 TSTL R0 BGEQ 30000$ MNEGL R0,R0 30000$: POSITIVE COUNT TSTL COUNT BGEQ 30001$ MNEGL COUNT,COUNT 30001$: POSITIVE VALUE,10$ TSTL VALUE BGEQ 10$ MNEGL VALUE,VALUE 10$:
These operators perform string manipulations on macro arguments and ASCII strings. They can be used only in macros and repeat blocks. The following sections describe these operators and give their formats and examples of their use.
Description
The %LENGTH operator returns the length of a string. For example, the value of %LENGTH(<ABCDE>) is 5.
Examples
The macro denition is as follows:
1.
.MACRO CHK_SIZE ARG1 ; Macro checks if ARG1 .IF GREATER_EQUAL %LENGTH(ARG1)-3 ; is between 3 and .IF LESS_THAN 6-%LENGTH(ARG1) ; 6 characters long .ERROR ; Argument ARG1 is greater than 6 characters .ENDC ; If more than 6 .IF_FALSE ; If less than 3 .ERROR ; Argument ARG1 is less than 3 characters .ENDC ; Otherwise do nothing .ENDM CHK_SIZE The macro calls and expansions of the macro dened previously are as follows:
2.
; Macro checks if A ; is between 3 and ; 6 characters long. ; Should be too short. .ERROR ; Argument A is greater than 6 characters .ENDC ; If more than 6 .IF_FALSE ; If less than 3 %MACRO-E-GENERR, Generated ERROR: Argument A is less than 3 characters 1-3 6-1 .ENDC ; Otherwise do nothing
3.
; Macro checks if ABC ; is between 3 and ; 6 characters long. ; Should be ok. .ERROR ; Argument ABC is greater than 6 characters .ENDC ; If more than 6 .IF_FALSE ; If less than 3 .ERROR ; Argument ABC is less than 3 characters .ENDC ; Otherwise do nothing
Description
The %LOCATE operator locates a substring within a string. If %LOCATE nds a match of the substring, it returns the character position of the rst character of the match in the string. For example, the value of %LOCATE(<D>,<ABCDEF>) is 3. Note that the rst character position of a string is zero. If %LOCATE does not nd a match, it returns a value equal to the length of the string. For example, the value of %LOCATE(<Z>,<ABCDEF>) is 6. The %LOCATE operator returns a numeric value that can be used in any expression.
Examples
The macro denition is as follows:
1.
.MACRO BIT_NAME ARG1 ; Checks if ARG1 is in list .IF EQUAL %LOCATE(ARG1,<DELDFWDLTDMOESC>)-15 ; If it is not, print error .ERROR ; ARG1 is an invalid bit name .ENDC ; If it is, do nothing .ENDM BIT_NAME The macro calls and expansions of the macro dened previously are as follows:
2.
BIT_NAME ESC ; Is ESC in list .IF EQUAL 12-15 ; If it is not, print error .ERROR ; ESC is an invalid bit name .ENDC ; If it is, do nothing BIT_NAME FOO .IF EQUAL 15-15 ; Not in list
; If it is not, print error %MACRO-E-GENERR, Generated ERROR: FOO is an invalid bit name .ENDC ; If it is, do nothing
Note If the optional symbol is specied, the search begins at the character position of string2 specied by the symbol. For example, the value of %LOCATE(<ACE>,<SPACE_HOLDER>,5) is 12 because there is no match after the fth character position.
Description
The %EXTRACT operator extracts a substring from a string. It returns the substring that begins at the specied position and is of the specied length. For example, the value of %EXTRACT(2,3,<ABCDEF>) is CDE. Note that the rst character in a string is in position zero.
Examples
The macro denition is as follows:
1.
.MACRO RESERVE ARG1 XX = %LOCATE(<=>,ARG1) .IF EQUAL XX-%LENGTH(ARG1) .WARN ; Incorrect format for macro call - ARG1 .MEXIT .ENDC %EXTRACT(0,XX,ARG1):: XX = XX+1 .BLKB %EXTRACT(XX,3,ARG1) .ENDM RESERVE The macro calls and expansions of the macro dened previously are as follows:
2.
RESERVE FOOBAR XX = 6 .IF EQUAL XX-6 %MACRO-W-GENWRN, Generated WARNING: Incorrect format for macro call - FOOBAR .MEXIT
3.
RESERVE LOCATION=12 XX = 8 .IF EQUAL XX-11 .WARN ; Incorrect format for macro call - LOCATION=12 .MEXIT .ENDC LOCATION:: XX = XX+1 .BLKB
12
Note If the starting position specied is equal to or greater than the length of the string, or if the length specied is zero, %EXTRACT returns a null string (a string of zero characters).
5
VAX MACRO Addressing Modes
This section summarizes the VAX addressing modes and contains examples of VAX MACRO statements that use these addressing modes. Table 51 summarizes the addressing modes. (Chapter 8 describes the addressing mode formats in detail.) The following are the four types of addressing modes: General register Program counter (PC) Index Branch
Although index mode is a general register mode, it is considered separate because it can be used only in combination with another type of mode.
Autoincrement deferred
@(Rn)+
Yes
Autodecrement
-(Rn)
Yes
Displacement
Yes
A C E
Displacement deferred
Yes
B D F
Literal
No
0-3
Program counter
Relative
Yes
A C E
Relative deferred
Yes
B D F
Key: RnAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rn. RxAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rx. Rx cannot be the same as the Rn specied in the base-mode for certain base modes (see Section 5.3). disAn expression specifying a displacement. addressAn expression specifying an address. literalAn expression, an integer constant, or a oating-point constant.
Immediate
#literal I^#literal
No
General
G^address
Yes
Index
Index
base-mode[Rx]
No
Branch
Branch
address
No
Key: RnAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rn. RxAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rx. Rx cannot be the same as the Rn specied in the base-mode for certain base modes (see Section 5.3). disAn expression specifying a displacement. addressAn expression specifying an address. literalAn expression, an integer constant, or a oating-point constant.
In each of these cases, the least signicant bytes of the operand are in register n and the most signicant bytes are in the highest register used, either n+1 or n+3. The results of the operation are unpredictable if you use the PC in register mode or if you use a large data type that extends the operand into the PC.
Example
CLRB CLRQ TSTW INCL R0 R1 R10 R4 ; ; ; ; Clear lowest byte of R0 Clear R1 and R2 Test lower word of R10 Add 1 to R4
Example
MOVAL CMPL BEQL CLRL MOVL MOVZBL LDATA,R3 (R3),R0 10$ (R3) (SP),R1 (AP),R4 ; ; ; ; ; ; Move address of LDATA to R3 Compare value at LDATA to R0 If they are the same, ignore Clear longword at LDATA Copy top item of stack into R1 Get number of arguments in call
10$:
Example
MOVAL CLRQ CLRL MOVAB INCB INCB XORL3 TABLE,R1 (R1)+ (R1)+ BYTARR,R2 (R2)+ (R2)+ (R3)+,(R4)+,(R5)+ ; Get address of TABLE. ; Clear first and second longwords ; and third longword in TABLE; ; leave R1 pointing to TABLE+12. ; Get address of BYTARR. ; Increment first byte of BYTARR ; and second. ; Exclusive-OR the 2 longwords ; whose addresses are stored in ; R3 and R4 and store result in ; address contained in R5; then ; add 4 to R3, R4, and R5.
Example
MOVAL CLRQ PNTLIS,R2 @(R2)+ ; Get address of pointer list. ; Clear quadword pointed to by ; first absolute address in PNTLIS; ; then add 4 to R2. ; Clear byte pointed to by second ; absolute address in PNTLIS ; then add 4 to R2. ; Move R10 to location whose address ; is pointed to by R0; then add 4 ; to R0.
CLRB
@(R2)+
MOVL
R10,@(R0)+
VAX MACRO Addressing Modes 5.1 General Register Modes 5.1.5 Autodecrement Mode
In autodecrement mode, the processor decrements the contents of the register by the size of the operand data type; the register contains the address of the operand. The processor decrements the register by 1, 2, 4, 8, or 16 for byte, word, longword, quadword, or octaword operands, respectively. Autodecrement mode can be used with index mode (see Section 5.3), but the index register cannot be the same as the register specied in autodecrement mode. Formats -(Rn) -(AP) -(FP) -(SP) Parameters n A number in the range 0 to 12.
Example
CLRO -(R1) ; Subtract 8 from R1 and zero ; the octaword whose address ; is in R1. ; Push the zero-extended low byte ; of R3 onto the stack as a ; longword. ; Subtract 1 from R0 and compare ; low byte of R1 with byte whose ; address is now in R0.
MOVZBL R3,-(SP)
CMPB
R1,-(R0)
Meaning Displacement requires 1 byte. Displacement requires one word (2 bytes). Displacement requires one longword (4 bytes).
If no displacement length specier precedes the expression, and the value of the expression is known, the assembler chooses the smallest number of bytes (1, 2, or 4) needed to store the displacement. If no length specier precedes the expression, and the value of the expression is unknown, the assembler reserves one word (2 bytes) for the displacement. Note that if the displacement is either relocatable or dened later in the source program, the assembler considers it unknown. If the actual displacement does not t in the memory reserved, the linker displays an error message.
Example
MOVAB MOVB KEYWORDS,R3 B^IO(R3),R4 ; Get address of KEYWORDS. ; Get byte whose address is IO ; plus address of KEYWORDS; ; the displacement is stored ; as a byte. ; Get byte whose address is ; ACCOUNT plus address of ; KEYWORDS; the displacement ; is stored as a byte. ; Clear word whose address ; is STA plus contents of R1; ; the displacement is stored ; as a longword. ; Move R0 to address that is -2 ; plus the contents of R2; the ; displacement is stored as a ; byte. ; Test the byte whose address ; is EXTRN plus the address ; of KEYWORDS; the displace; ment is stored as a word, ; since EXTRN is undefined. ; Move <contents of R5> + 2 ; to R0. Note If the value of the displacement is zero, and no displacement length is specied, the assembler uses register deferred mode rather than displacement mode.
MOVB
B^ACCOUNT(R3),R5
CLRW
L^STA(R1)
MOVL
R0,-2(R2)
TSTB
EXTRN(R3)
MOVAB
2(R5),R0
VAX MACRO Addressing Modes 5.1 General Register Modes 5.1.7 Displacement Deferred Mode
In displacement deferred mode, the contents of the register plus the displacement (sign-extended to a longword) produce the address of the operand address (a pointer to the operand). Displacement deferred mode can be used with index mode (see Section 5.3). If used in displacement deferred mode, the index register can be the same as the base register. Formats @dis(Rn) @dis(AP) @dis(FP) @dis(SP) Parameters n A number in the range 0 to 12. dis An expression specifying a displacement; the expression can be preceded by one of the following displacement length speciers, which indicate the number of bytes needed to store the displacement:
Displacement Length Specier B^ W^ L^
Meaning Displacement requires 1 byte. Displacement requires one word (2 bytes). Displacement requires one longword (4 bytes).
If no displacement length specier precedes the expression, and the value of the expression is known, the assembler chooses the smallest number of bytes (1, 2, or 4) needed to store the displacement. If no length specier precedes the expression, and the value of the expression is unknown, the assembler reserves one word (2 bytes) for the displacement. Note that if the displacement is either relocatable or dened later in the source program, the assembler considers it unknown. If the actual displacement does not t in the memory the assembler has reserved, the linker displays an error message.
Example
MOVAL CLRL ARRPOINT,R6 @16(R6) ; Get address of array of pointers. ; Clear longword pointed to by ; longword whose address is ; <16 + address of ARRPOINT>; the ; displacement is stored as a byte.
MOVL
@B^OFFS(R6),@RSOFF(R6) ; Move the longword pointed to ; by longword whose address is ; <OFFS + address of ARRPOINT> ; to the address pointed to by ; longword whose address is ; <RSOFFS + address of ARRPOINT>; ; the first displacement is ; stored as a byte; the second ; displacement is stored as a word.
MOVB
S^#CR,R1
MOVF
#0.625,R6
Notes 1. When you use the #literal format, the assembler chooses whether to use literal mode or immediate mode (see Section 5.2.4). The assembler uses immediate mode if any of the following conditions is satised: The value of the literal does not t in the short literal form. The literal is a relocatable or external expression (see Section 3.5). The literal is an expression that contains undened symbols.
The difference between immediate mode and literal mode is the amount of storage that it takes to store the literal in the instruction. 2. The S^#literal format forces the assembler to use literal mode.
Meaning Displacement requires 1 byte. Displacement requires one word (2 bytes). Displacement requires one longword (4 bytes).
If no displacement length specier precedes the address expression, and the value of the expression is known, the assembler chooses the smallest number of bytes (1, 2, or 4) needed to store the displacement. If no length specier precedes the address expression, and the value of the expression is unknown, the assembler uses the default displacement length (see the description of .DEFAULT in Chapter 6). If the address expression is either dened later in the program or dened in another program section, the assembler considers the value unknown.
Example
MOVL LABEL,R1 ; Get longword at LABEL; the ; assembler uses default ; displacement unless LABEL was ; previously defined in this ; section
CMPL
W^<DATA+4>,R10 ; Compare R10 with longword at ; address DATA+4; CMPL ; uses a word displacement
Meaning Displacement requires 1 byte. Displacement requires one word (2 bytes). Displacement requires one longword (4 bytes).
Example
CLRL @W^PNTR ; Clear longword pointed to by ; longword at PNTR; the assembler ; uses a word displacement ; Increment byte pointed to by ; longword at COUNTS+4; assembler ; uses a longword displacement
INCB
@L^COUNTS+4
Example
CLRL CLRB @#^X1100 @#ACCOUNT ; Clear the contents of location 1100(hex) ; Clear the contents of location ; ACCOUNT; the address is stored ; absolutely, not as a displacement ; Call the procedure SYS$FAO with ; three arguments on the stack
CALLS
#3,@#SYS$FAO
ADDL2
I^#5,R0
MOVG MOVG
#0.2,R6 #PI,R6
Notes 1. When you use the #literal format, the assembler chooses whether to use literal mode (Section 5.1.8) or immediate mode. If the literal is an integer from 0 to 63 or a oating-point constant that ts in the short literal form, the assembler uses literal mode. If the literal is an expression, the assembler uses literal mode if all the following conditions are met: The expression is absolute. The expression contains no undened symbols. The value of the expression ts in the short literal form.
In all other cases, the assembler uses immediate mode. The difference between immediate mode and literal mode is the amount of storage required to store the literal in the instruction. The assembler stores an immediate mode literal in a byte, word, or longword depending on the operand data type. 2. The I^#literal format forces the assembler to use immediate mode. 3. You can specify oating-point numbers two ways: as a numeric value or as a symbol name. The assembler handles these values in different ways, as follows: Numeric values are converted to the appropriate internal oating-point representation.
Symbols are not converted. The assembler assumes that the values have already been converted to internal oating-point representation. Once the assembler obtains the value, it tries to convert the internal representation of the value to a short oating literal. If conversion fails, the assembler uses immediate mode; if conversion succeeds, the assembler uses short oating literal mode.
VAX MACRO Addressing Modes 5.2 Program Counter Modes 5.2.5 General Mode
In general mode, the address you specify is the address of the operand. The linker converts the addressing mode to either relative or absolute mode. If the address is relocatable, the linker converts general mode to relative mode. If the address is absolute, the linker converts general mode to absolute mode. You should use general mode to write position-independent code when you do not know whether the address is relocatable or absolute. A general addressing mode operand requires 5 bytes of storage. You can use general mode with index mode (see Section 5.3). Format G^address Parameters address An expression specifying an address.
Example
CLRL G^LABEL_1 ; Clears the longword at LABEL_1 ; If LABEL_1 is defined as ; absolute then general mode is ; converted to absolute ; mode; if it is defined as ; relocatable, then general mode is ; converted to relative mode ; Calls procedure SYS$SERVICE ; with 5 arguments on stack
CALLS
#5,G^SYS$SERVICE
Example
; ; Register deferred index mode ; OFFS=20 ; Define OFFS MOVAB BLIST,R9 ; Get address of BLIST MOVL #OFFS,R1 ; Set up index register CLRB (R9)[R1] ; Clear byte whose address ; is the address of BLIST ; plus 20*1 CLRQ (R9)[R1] ; Clear quadword whose ; address is the address ; of BLIST plus 20*8 ; Clear octaword whose ; address is the address ; of BLIST plus 20*16
CLRO
(R9)[R1]
; Clear word whose address ; is address of BLIST plus ; 20*2; R9 now contains ; address of BLIST+2
deferred index mode POINT,R8 #30,R2 @(R8)+[R2] ; Get address of POINT ; Set up index register ; Clear word whose address ; is 30*2 plus the address ; stored in POINT; R8 now ; contains 4 plus address of ; POINT
deferred index mode ADDARR,R9 #100,R1 @40(R9)[R1] ; Get address of address array ; Set up index register ; Test floating-point value ; whose address is 100*4 plus ; the address stored at ; (ADDARR+40)
VAX MACRO Addressing Modes 515
Displacement Deferred Index 1;2;3 Relative Index2 Relative Deferred Index Absolute Index General Index
1 RnAny 2 RxAny 3 disAn 2 2
general register R0 to R12 or the AP, FP, or SP register. Rx cannot be the same register as Rn in the autoincrement index, autoincrement deferred index, and decrement index addressing modes. expression specifying a displacement.
Notes 1. If the base mode alters the contents of its register (autoincrement, autoincrement deferred, and autodecrement), the index mode cannot specify the same register. 2. The index register is added to the address after the base mode is completely evaluated. For example, in autoincrement deferred index mode, the base register contains the address of the operand address. The index register (times the length of the operand data type) is added to the operand address rather than to the address stored in the base register.
Example
ADDL3 BLEQ BRW (R1)+,R0,TOTAL LABEL1 LABEL ; Total values and set condition ; codes ; Branch to LABEL1 if result is ; less than or equal to 0 ; Branch unconditionally to LABEL
6
VAX MACRO Assembler Directives
The general assembler directives provide facilities for performing 11 types of functions. Table 61 lists these types of functions and their directives. The macro directives provide facilities for performing eight categories of functions. Table 62 lists these categories and their associated directives. Chapter 4 describes macro arguments and string operators. The remainder of this chapter describes both the general assembler directives and the macro directives, showing their formats and giving examples of their use. For ease of reference, the directives are presented in alphabetical order. Appendix C contains a summary of all assembler directives. Table 61 Summary of General Assembler Directives
Category Listing control directives Directives1 .SHOW (.LIST) .NOSHOW(.NLIST) .TITLE .SUBTITLE (.SBTTL) .IDENT .PAGE .PRINT .WARN .ERROR .ENABLE (.ENABL) .DISABLE(.DSABL) .DEFAULT .BYTE .WORD .LONG .ADDRESS .QUAD .OCTA .PACKED .ASCII .ASCIC .ASCID .ASCIZ .F_FLOATING (.FLOAT) .D_FLOATING (.DOUBLE) .G_FLOATING .H_FLOATING .SIGNED_BYTE .SIGNED_WORD
1 The
1 The
Indenite repeat block directives Repeat block directives End range directive
1 The
.ADDRESS
Address storage directive
Format
.ADDRESS address-list
Parameter
address-list A list of symbols or expressions, separated by commas ( , ), which VAX MACRO interprets as addresses. Repetition factors are not allowed.
Description
.ADDRESS stores successive longwords containing addresses in the object module. Compaq recommends that you use .ADDRESS rather than .LONG for storing address data to provide additional information to the linker. In shareable images, addresses that you specify with .ADDRESS produce position-independent code.
Example
TABLE: .ADDRESS LAB_4, LAB_3, ROUTTERM ; Reference table
.ALIGN
Location counter alignment directive
Format
.ALIGN integer[,expression] .ALIGN keyword[,expression]
Parameters
integer An integer in the range 0 to 9. The location counter is aligned at an address that is the value of 2 raised to the power of the integer. keyword One of ve keywords that specify the alignment boundary. The location counter is aligned to an address that is the next multiple of the following values:
Keyword Size (in Bytes)
= = = = =
1 2 4 8 512
expression Species the ll value to be stored in each byte. The expression must not contain any undened symbols and must be an absolute expression (see Section 3.5).
Description
.ALIGN aligns the location counter to the boundary specied by either an integer or a keyword. Notes 1. The alignment that you specify in .ALIGN cannot exceed the alignment of the program section in which the alignment is attempted (see the description of .PSECT). For example, if you are using the default program section alignment (BYTE) and you specify .ALIGN with a word or larger alignment, the assembler displays an error message. lls the bytes skipped by the location counter (if any) with the value of that expression. Otherwise, the assembler lls the bytes with zeros.
Example
.ALIGN .ALIGN .ALIGN .ALIGN BYTE,0 WORD 3,^A/ / PAGE ; ; ; ; Byte Word Quad Page alignment--fill with null alignment alignment--fill with blanks alignment
.ASCIx
ASCII character storage directives
Description
VAX MACRO has the following four ASCII character storage directives:
Directive Function
Counted ASCII string storage String-descriptor ASCII string storage ASCII string storage Zero-terminated ASCII string storage
Each directive is followed by a string of characters enclosed in a pair of matching delimiters. The delimiters can be any printable character except the space or tab character, equal sign ( = ), semicolon ( ; ), or left angle bracket ( < ). The character that you use as the delimiter cannot appear in the string itself. Although you can use alphanumeric characters as delimiters, use nonalphanumeric characters to avoid confusion. Any character except the null, carriage-return, and form-feed characters can appear within the string. The assembler does not convert lowercase alphabetic characters to uppercase. ASCII character storage directives convert the characters to their 8-bit ASCII value (see Appendix A) and store them one character to a byte. Any character, including the null, carriage-return, and form-feed characters, can be represented by an expression enclosed in angle brackets ( <> ) outside of the delimiters. You must dene the ASCII values of null, carriage-return, and formfeed with a direct assignment statement. The ASCII character storage directives store the 8-bit binary value specied by the expression. ASCII strings can be continued over several lines. Use the hyphen ( - ) as the line continuation character and delimit the string on each line at both ends. Note that you can use a different pair of delimiters for each line. For example: CR=13 LF=10 .ASCII .ASCIZ .ASCIC .ASCII .ASCII .ASCII .ASCII /ABC DEFG/ @Any character can be a delimiter@ ? lowercase is not converted to UPPER? ? this is a test!?<CR><KEY>(LF\TEXT)!Isnt it?! \ Angle Brackets <are part <of> this> string \ / This string is continued / \ on the next line \ <CR><KEY>(LF\TEXT)! this string includes an expression! <128+CR>? whose value is a 13 plus 128?
.ASCIC
Counted ASCII string storage directive
Format
.ASCIC string
Parameter
string A delimited ASCII string.
Description
.ASCIC performs the same function as .ASCII, except that .ASCIC inserts a count byte before the string data. The count byte contains the length of the string in bytes. The length given includes any bytes of nonprintable characters outside the delimited string but excludes the count byte. .ASCIC is useful in copying text because the count indicates the length of the text to be copied.
Example
CR=13 .ASCIC .BYTE .ASCII #HELLO#<CR> 6 #HELLO#<CR> ; Direct assignment statement ; defines CR ; This counted ASCII string ; is equivalent to the ; count followed by ; the ASCII string
.ASCID
String-descriptor ASCII string storage directive
Format
.ASCID string
Parameter
string A delimited ASCII string.
Description
.ASCID performs the same function as ASCII, except that .ASCID inserts a string descriptor before the string data. The string descriptor has the following format: 31 Information Pointer ZK0370GE Length 0
Parameters
length The length of the string (2 bytes). information Descriptor information (2 bytes) is always set to 010E. pointer Position-independent pointer to the string (4 bytes). String descriptors are used in calling procedures (see the OpenVMS RTL String Manipulation (STR$) Manual).
Example
DESCR1: .ASCID /ARGUMENT FOR CALL/ DESCR2: .ASCID /SECOND ARGUMENT/ . . . PUSHAL DESCR1 PUSHAL DESCR2 CALLS #2,STRNG_PROC ; String descriptor ; Another string ; descriptor
.ASCII
ASCII string storage directive
Format
.ASCII string
Parameter
string A delimited ASCII string.
Description
.ASCII stores the ASCII value of each character in the ASCII string or the value of each byte expression in the next available byte.
Example
CR=13 LF=10 .ASCII .ASCII ; Assignment statements ; define CR and LF "DATE: 17-NOV-1988" ; Delimiter is " /EOF/<CR><LF> ; Delimiter is /
.ASCIZ
Zero-terminated ASCII string storage directive
Format
.ASCIZ string
Parameter
string A delimited ASCII string.
Description
.ASCIZ performs the same function as .ASCII, except that .ASCIZ appends a null byte as the nal character of the string. When a list or text string is created with an .ASCIZ directive, you need only perform a search for the null character in the last byte to determine the end of the string.
Example
FF=12 .ASCIZ /ABCDEF/ .ASCIZ /A/<FF>/B/ ; Define FF ; 6 characters in string, ; 7 bytes of data ; 3 characters in strings
.BLKx
Block storage allocation directives
Format
.BLKA expression .BLKB expression .BLKD expression .BLKF expression .BLKG expression .BLKH expression .BLKL expression .BLKO expression .BLKQ expression .BLKW expression
Parameter
expression An expression specifying the amount of storage to be allocated. All the symbols in the expression must be dened and the expression must be an absolute expression (see Section 3.5). If the expression is omitted, a default value of 1 is assumed.
Description
VAX MACRO has the following 10 block storage directives.
Directive Function
.BLKA .BLKB .BLKD .BLKF .BLKG .BLKH .BLKL .BLKO .BLKQ .BLKW
Reserves storage for addresses (longwords). Reserves storage for byte data. Reserves storage for double-precision oating-point data (quadwords). Reserves storage for single-precision oating-point data (longwords). Reserves storage for G_oating data (quadwords). Reserves storage for H_oating data (octawords). Reserves storage for longword data. Reserves storage for octaword data. Reserves storage for quadword data. Reserves storage for word data.
Each directive reserves storage for a different data type. The value of the expression determines the number of data items for which VAX MACRO reserves storage. For example, .BLKL 4 reserves storage for 4 longwords of data and .BLKB 2 reserves storage for 2 bytes of data.
.BLKB .BLKW .BLKA .BLKF .BLKL .BLKD .BLKG .BLKQ .BLKH .BLKO
Value of expression 2 value of expression " 4 value of expression " 8 value of expression " " 16 value of expression "
Example
.BLKB .BLKO .BLKL .BLKF 15 3 1 <3*4> ; ; ; ; ; Space for 15 bytes Space for 3 octawords (48 bytes) Space for 1 longword (4 bytes) Space for 12 single-precision floating-point values (48 bytes)
.BYTE
Byte storage directive
Format
.BYTE expression-list
Parameter
expression-list One or more expressions separated by commas ( , ). Each expression is rst evaluated as a longword expression; then the value of the expression is truncated to 1 byte. The value of each expression should be in the range 0 to 255 for unsigned data or in the range -128 to +127 for signed data. Optionally, each expression can be followed by a repetition factor delimited by square brackets ( [ ] ). An expression followed by a repetition factor has the following format: expression1[expression2] expression1 An expression that species the value to be stored. [expression2] An expression that species the number of times the value will be repeated. The expression must not contain any undened symbols and it must be absolute (see Section 3.5). The square brackets are required.
Description
.BYTE generates successive bytes of binary data in the object module. Notes 1. The assembler displays an error message if the high-order 3 bytes of the longword expression have a value other than 0 or ^XFFFFFF. 2. At link time, a relocatable expression can result in a value that exceeds 1 byte in length. In this case, the linker issues a truncation diagnostic message for the object module in question. For example: A: .BYTE A ; Relocatable value A will ; cause linker truncation ; diagnostic if the statement ; has a virtual address of 256 ; or above
3. The .SIGNED_BYTE directive is the same as .BYTE except that the assembler displays a diagnostic message if a value in the range 128 to 255 is specied. See the description of .SIGNED_BYTE for more information.
.CROSS .NOCROSS
Cross-reference directives
Format
.CROSS [symbol-list] .NOCROSS [symbol-list]
Parameter
symbol-list A list of legal symbol names separated by commas ( , ).
Description
When you specify the /CROSS_REFERENCE qualier in the MACRO command, VAX MACRO produces a cross-reference listing. The .CROSS and .NOCROSS directives control which symbols are included in the cross-reference listing. The .CROSS and .NOCROSS directives have an effect only if /CROSS_REFERENCE was specied in the MACRO command (see the OpenVMS DCL Dictionary). By default, the cross-reference listing includes the denition and all the references to every symbol in the module. You can disable the cross-reference listing for all symbols or for a specied list of symbols by using .NOCROSS. Using .NOCROSS without a symbol list disables the cross-reference listing of all symbols. Any symbol denition or reference that appears in the code after .NOCROSS used without a symbol list and before the next .CROSS used without a symbol list is excluded from the cross-reference listing. You reenable the cross-reference listing by using .CROSS without a symbol list. .NOCROSS with a symbol list disables the cross-reference listing for the listed symbols only. .CROSS with a symbol list enables or reenables the cross-reference listing of the listed symbols. Notes 1. The .CROSS directive without a symbol list will not reenable the crossreference listing of a symbol specied in .NOCROSS with a symbol list. 2. If the cross-reference listing of all symbols is disabled, .CROSS with a symbol list will have no effect until the cross-reference listing is reenabled by .CROSS without a symbol list.
LAB1:
In this example, the denition of LAB1 and the references to LOC1 and LOC2 are not included in the cross-reference listing.
2.
LAB2:
In this example, the denition of LAB2 and the reference to LOC2 are included in the cross-reference, but the reference to LOC1 is not included in the cross-reference.
.DEBUG
Debug symbol attribute directive
Format
.DEBUG symbol-list
Parameter
symbol-list A list of legal symbols separated by commas ( , ).
Description
.DEBUG species that the symbols in the list are made known to the VAX Symbolic Debugger. During an interactive debugging session, you can use these symbols to refer to memory locations or to examine the values assigned to the symbols. Note The assembler adds the symbols in the symbol list to the symbol table in the object module. You need not specify global symbols in the .DEBUG directive because global symbols are automatically put in the object modules symbol table. (See the description of .ENABLE for a discussion of how to make information about local symbols available to the debugger.)
Example
.DEBUG INPUT,OUTPUT,LAB_30,LAB_40 ; Make these symbols known ; to the debugger
.DEFAULT
Default control directive
Format
.DEFAULT DISPLACEMENT, keyword
Parameter
keyword One of three keywordsBYTE, WORD, or LONGindicating the default displacement length.
Description
.DEFAULT determines the default displacement length for the relative and relative deferred addressing modes (see Section 5.2.1 and Section 5.2.2). Notes 1. The .DEFAULT directive has no effect on the default displacement for displacement and displacement deferred addressing modes (see Section 5.1.6 and Section 5.1.7). 2. If there is no .DEFAULT in a source module, the default displacement length for the relative and relative deferred addressing modes is a longword.
Example
.DEFAULT DISPLACEMENT,WORD MOVL LABEL,R1 .DEFAULT DISPLACEMENT,LONG INCB @COUNTS+4 ; ; ; ; ; ; ; ; WORD is default Assembler uses word displacement unless label has been defined LONG is default Assembler uses longword displacement unless COUNTS has been defined
.D_FLOATING .DOUBLE
Floating-point storage directive
Format
.D_FLOATING literal-list .DOUBLE literal-list
Parameter
literal-list A list of oating-point constants (see Section 3.2.2). The constants cannot contain any unary or binary operators except unary plus or unary minus.
Description
.D_FLOATING evaluates the specied oating-point constants and stores the results in the object module. .D_FLOATING generates 64-bit, double-precision, oating-point data (1 bit of sign, 8 bits of exponent, and 55 bits of fraction). See the description of .F_FLOATING for information on storing single-precision oating-point numbers and the descriptions of .G_FLOATING and .H_FLOATING for descriptions of other oating-point numbers. Notes 1. Double-precision oating-point numbers are always rounded. They are not affected by .ENABLE TRUNCATION. 2. The oating-point constants in the literal list must not be preceded by the oating-point operator (^F).
Example
.D_FLOATING 1000,1.0E3,1.0000000E-9 ; Constant .DOUBLE 3.1415928, 1.107153423828 ; List .D_FLOATING 5, 10, 15, 0, 0.5
.DISABLE
Function control directive
Format
.DISABLE argument-list
Parameter
argument-list One or more of the symbolic arguments listed in Table 63 in the description of .ENABLE. You can use either the long or the short form of the symbolic arguments. If you specify multiple arguments, separate them by commas ( , ), spaces, or tabs.
Description
.DISABLE disables the specied assembler functions. See the description of .ENABLE for more information. Note The alternate form of .DISABLE is .DSABL.
.ENABLE
Function control directive
Format
.ENABLE argument-list
Parameter
argument-list One or more of the symbolic arguments listed in Table 63. You can use either the long form or the short form of the symbolic arguments. If you specify multiple arguments, separate them with commas ( , ), spaces, or tabs. Table 63 .ENABLE and .DISABLE Symbolic Arguments
Long Form Short Form Default Condition Function
ABSOLUTE
AMA
Disabled
DEBUG
DBG
Disabled
GLOBAL
GBL
Enabled
LOCAL_BLOCK
LSB
Disabled
When ABSOLUTE is enabled, all the PC relative addressing modes are assembled as absolute addressing modes. When DEBUG is enabled, all local symbols are included in the object modules symbol table for use by the debugger. When GLOBAL is enabled, all undened symbols are considered external symbols. When GLOBAL is disabled, any undened symbol that is not listed in an .EXTERNAL directive causes an assembly error. When LOCAL_BLOCK is enabled, the current local label block is ended and a new one is started. When LOCAL_BLOCK is disabled, the current local label block is ended. See Section 3.4 for a complete description of local label blocks.
(continued on next page)
SUPPRESSION
SUP
Disabled
TRACEBACK
TBK
Enabled
TRUNCATION
FPT
Disabled
VECTOR
Disabled
When SUPPRESSION is enabled, all symbols that are dened but not referred to are not listed in the symbol table. When SUPPRESSION is disabled, all symbols that are dened are listed in the symbol table. When TRACEBACK is enabled, the program section names and lengths, module names, and routine names are included in the object module for use by the debugger. When TRACEBACK is disabled, VAX MACRO excludes this information and, in addition, does not make any local symbol information available to the debugger. When TRUNCATION is enabled, singleprecision, oating-point numbers are truncated. When TRUNCATION is disabled, singleprecision oating-point numbers are rounded. D_ oating, G_oating, and H_oating numbers are not affected by .ENABLE TRUNCATION; they are always rounded. When VECTOR is enabled, the assembler accepts and correctly handles vector code. If vector assembly is not enabled, vector code produces assembly errors.
Example
.ENABLE ABSOLUTE, GLOBAL ; Assemble relative address mode ; as absolute address mode, and consider ; undefined references as global
.DISABLE TRUNCATION,TRACEBACK ; Round floating-point numbers, and ; omit debugging information from ; the object module
.END
Assembly termination directive
Format
.END [symbol]
Parameter
symbol The address (called the transfer address) at which program execution is to begin.
Description
.END terminates the source program. No additional text should occur beyond this point in the current source le or in any additional source les specied in the command line for this assembly. If any additional text does occur, the assembler ignores it. The additional text does not appear in either the listing le or the object le. Notes 1. The transfer address must be in a program section that has the EXE attribute (see the description of .PSECT). 2. When an executable image consisting of several object modules is linked, only one object module should be terminated by an .END directive that species a transfer address. All other object modules should be terminated by .END directives that do not specify a transfer address. If an executable image contains either no transfer address or more than one transfer address, the linker displays an error message. 3. If the source program contains an unterminated conditional code block when the .END directive is specied, the assembler displays an error message.
Example
.ENTRY START,0 . . . .END START ; Entry mask ; Main program ; Transfer address
.ENDC
End conditional directive
Format
.ENDC
Description
.ENDC terminates the conditional range started by the .IF directive. See the description of .IF for more information and examples.
.ENDM
End denition directive
Format
.ENDM [macro-name]
Parameters
macro-name The name of the macro whose denition is to be terminated. The macro name is optional; if specied, it must match the name dened in the matching .MACRO directive. The macro name should be specied so that the assembler can detect any improperly nested macro denitions.
Description
.ENDM terminates the macro denition. See the description of .MACRO for an example of the use of .ENDM. Note If .ENDM is encountered outside a macro denition, the assembler displays an error message.
.ENDR
End range directive
Format
.ENDR
Description
.ENDR indicates the end of a repeat range. It must be the nal statement of every indenite repeat block directive (.IRP and .IRPC) and every repeat block directive (.REPEAT). See the description of these directives for examples of the use of .ENDR.
.ENTRY
Entry directive
Format
.ENTRY symbol,expression
Parameters
symbol The symbolic name for the entry point. expression The register save mask for the entry point. The expression must be an absolute expression and must not contain any undened symbols.
Description
.ENTRY denes a symbolic name for an entry point and stores a register save mask (2 bytes) at that location. The symbol is dened as a global symbol with a value equal to the value of the location counter at the .ENTRY directive. You can use the entry point as the transfer address of the program. Use the register save mask to determine which registers are saved before the procedure is called. These saved registers are automatically restored when the procedure returns control to the calling program. See the description of the procedure call instructions in Chapter 9. Notes 1. The register mask operator (^M) is convenient to use for setting the bits in the register save mask (see Section 3.6.2.2). 2. An assembly error occurs if the expression has bits 0, 1, 12, or 13 set. These bits correspond to the registers R0, R1, AP, and FP and are reserved for the CALL interface. 3. Compaq recommends that you use .ENTRY to dene all callable entry points including the transfer address of the program. Although the following construct also denes an entry point, Compaq discourages its use: symbol:: .WORD expression Although your program can call a procedure starting with this construct, the entry mask is not checked for any illegal registers, and the symbol cannot be used in a .MASK directive. 4. You should use .ENTRY only for procedures that are called by the CALLS or CALLG instruction. A routine that is entered by the BSB or JSB instruction should not use .ENTRY because these instructions do not expect a register save mask. Begin these routines using the following format: symbol:: rst instruction The rst instruction of the routine immediately follows the symbol.
.ERROR
Error directive
Format
.ERROR [expression] ;comment
Parameters
expression An expression whose value is displayed when .ERROR is encountered during assembly. ;comment A comment that is displayed when .ERROR is encountered during assembly. The comment must be preceded by a semicolon ( ; ).
Description
.ERROR causes the assembler to display an error message on the terminal or batch log le and in the listing le (if there is one). Notes 1. .ERROR, .WARN, and .PRINT are message display directives. Use them to display information indicating that a macro call contains an error or an illegal set of conditions. 2. When the assembly is nished, the assembler displays the total number of errors, warnings, information messages, and the sequence numbers of the lines causing the errors or warnings. 3. If .ERROR is included in a macro library, end the comment with a semicolon ( ; ). Otherwise, the librarian will strip the comment from the directive and it will not be displayed when the macro is called. 4. The line containing the .ERROR directive is not included in the listing le. 5. If the expression has a value of zero, it is not displayed in the error message.
In this example, if the symbol LONG_MESS is dened and if the symbol WORK_ AREA has a value of 1000 or less, the following error message is displayed: %MACRO-E-GENERR, Generated ERROR: 25 Need larger WORK_AREA
.EVEN
Even location counter alignment directive
Format
.EVEN
Description
.EVEN ensures that the current value of the location counter is even by adding 1 if the current value is odd. If the current value is already even, no action is taken.
.EXTERNAL
External symbol attribute directive
Format
.EXTERNAL symbol-list
Parameter
symbol-list A list of legal symbols, separated by commas ( , ).
Description
.EXTERNAL indicates that the specied symbols are external; that is, the symbols are dened in another object module and cannot be dened until link time (see Section 3.3.3 for a discussion of external references). Notes 1. If the GLOBAL argument is enabled (see Table 63), all unresolved references will be marked as global and external. If GLOBAL is enabled, you need not specify .EXTERNAL. If GLOBAL is disabled, you must explicitly specify .EXTERNAL to declare any symbols that are dened externally but are referred to in the current module. 2. If GLOBAL is disabled and the assembler nds symbols that are neither dened in the current module nor listed in a .EXTERNAL directive, the assembler displays an error message. 3. Note that if your program does not reference, in a relocatable program section, symbols that are declared in the absolute program section (ABS), the unreferenced symbols are ltered out by the assembler and will not be included in the object le. This ltering out will occur even if the symbols are declared global or external. If you want to be sure that a symbol will be included even if it is not referenced, declare it in a relocatable program section. If you want to make sure that a symbol you dene in an absolute program section is included, reference it in a relocatable program section. 4. The alternate form of .EXTERNAL is .EXTRN.
Example
.EXTERNAL .EXTERNAL SIN,TAN,COS ; These symbols are defined in SINH,COSH,TANH ; externally assembled modules
.F_FLOATING .FLOAT
Floating-point storage directive
Format
.F_FLOATING literal-list .FLOAT literal-list
Parameter
literal-list A list of oating-point constants (see Section 3.2.2). The constants cannot contain any unary or binary operators except unary plus and unary minus.
Description
.F_FLOATING evaluates the specied oating-point constants and stores the results in the object module. .F_FLOATING generates 32-bit, single-precision, oating-point data (1 bit of sign, 8 bits of exponent, and 23 bits of fractional signicance). See the description of .D_FLOATING for information on storing double-precision oating-point numbers and the descriptions of .G_FLOATING and .H_FLOATING for descriptions of other oating-point numbers. Notes 1. See the description of .ENABLE for information on specifying oating-point rounding or truncation. 2. The oating-point constants in the literal list must not be preceded by the oating-point unary operator (^F).
Example
.F_FLOATING .F_FLOATING .F_FLOATING .FLOAT 134.5782,74218.34E20 134.2,0.1342E3,1342E-1 -0.75,1E38,-1.0E-37 0,25,50 ; Constant list ; These all generate 134.2 ; Constant list
.G_FLOATING
G_oating-point storage directive
Format
.G_FLOATING literal-list
Parameters
literal-list A list of oating-point constants (see Section 3.2.2). The constants cannot contain any unary or binary operators except unary plus or unary minus.
Description
.G_FLOATING evaluates the specied oating-point constants and stores the results in the object module. .G_FLOATING generates 64-bit data (1 bit of sign, 11 bits of exponent, and 52 bits of fraction). Notes 1. G_oating-point numbers are always rounded. They are not affected by the .ENABLE TRUNCATION directive. 2. The oating-point constants in the literal list must not be preceded by the oating-point operator (^F).
Example
.G_FLOATING 1000, 1.0E3, 1.0000000E-9 ; Constant list
.GLOBAL
Global symbol attribute directive
Format
.GLOBAL symbol-list
Parameter
symbol-list A list of legal symbol names, separated by commas ( , ).
Description
.GLOBAL indicates that specied symbol names are either globally dened in the current module or externally dened in another module (see Section 3.3.3). Notes 1. .GLOBAL is provided for MACRO-11 compatibility only. Compaq recommends that global denitions be specied by a double colon ( :: ) or double equal sign ( = = ) (see Section 2.1 and Section 3.8) and that external references be specied by .EXTERNAL when necessary. 2. The alternate form of .GLOBAL is .GLOBL.
Example
.GLOBAL LAB_40,LAB_30 .GLOBAL UKN_13 ; Make these symbol names ; globally known ; to all linked modules
.H_FLOATING
H_oating-point storage directive
Format
.H_FLOATING literal-list
Parameter
literal-list A list of oating-point constants (see Section 3.2.2). The constants cannot contain any unary or binary operators except unary plus or unary minus.
Description
.H_FLOATING evaluates the specied oating-point constants and stores the results in the object module. .H_FLOATING generates 128-bit data (1 bit of sign, 15 bits of exponent, and 112 bits of fraction). Notes 1. H_oating-point numbers are always rounded. They are not affected by the .ENABLE TRUNCATION directive. 2. The oating-point constants in the literal list must not be preceded by the oating-point operator (^F).
Example
.H_FLOATING 36912, 15.0E18, 1.0000000E-9 ; Constant list
.IDENT
Identication directive
Format
.IDENT string
Parameter
string A 1- to 31-character string that identies the module, such as a string that species a version number. The string must be delimited. The delimiters can be any paired printing characters other than the left angle bracket (<) or the semicolon ( ; ), as long as the delimiting character is not contained within the text string.
Description
.IDENT provides a means of identifying the object module. This identication is in addition to the name assigned to the object module with .TITLE. A character string can be specied in .IDENT to label the object module. This string is printed in the header of the listing le and also appears in the object module. Notes 1. If a source module contains more than one .IDENT, the last directive given establishes the character string that forms part of the object module identication. 2. If the delimiting characters do not match, or if you use an illegal delimiting character, the assembler displays an error message.
Example
.IDENT /3-47/ ; Version and edit numbers The character string 3-47 is included in the object module.
.IF
Conditional assembly block directives
Format
.IF condition argument(s) . . . range . . . .ENDC
Parameters
condition A specied condition that must be met if the block is to be included in the assembly. The condition must be separated from the argument by a comma ( , ), space, or tab. Table 64 lists the conditions that can be tested by the conditional assembly directives. argument(s) One or more symbolic arguments or expressions of the specied conditional test. If the argument is an expression, it cannot contain any undened symbols and must be an absolute expression (see Section 3.5). range The block of source code that is conditionally included in the assembly.
LESS_THAN
LT
GREATER_EQUAL
GE
Expression
DF B IDN
NDF NB DIF
1 1 2
BLANK, NOT_BLANK, IDENTICAL, and DIFFERENT conditions are only useful in macro denitions.
Description
A conditional assembly block is a series of source statements that is assembled only if a certain condition is met. .IF starts the conditional block and .ENDC ends the conditional block; each .IF must have a corresponding .ENDC. The .IF directive contains a condition test and one or two arguments. The condition test specied is applied to the arguments. If the test is met, all VAX MACRO statements between .IF and .ENDC are assembled. If the test is not met, the statements are not assembled. An exception to this rule occurs when you use subconditional directives (see the description of the .IF_x directive). Conditional blocks can be nested; that is, a conditional block can be inside another conditional block. In this case, the statements in the inner conditional block are assembled only if the condition is met for both the outer and inner block.
Examples
1.
An example of a conditional assembly directive is: .IF EQUAL ALPHA+1 . . . .ENDC ; Assemble block if ALPHA+1=0. Do ; not assemble if ALPHA+1 not=0
2.
Nested conditional directives take the form: .IF condition,argument(s) .IF condition,argument(s) . . . .ENDC .ENDC
3.
The following conditional directives can govern whether assembly is to occur: .IF DEFINED SYM1 .IF DEFINED SYM2 . . . .ENDC .ENDC In this example, if the outermost condition is not satised, no deeper level of evaluation of nested conditional statements within the program occurs. Therefore, both SYM1 and SYM2 must be dened for the code to be assembled.
.IF_x
Subconditional assembly block directives
Format
.IF_FALSE .IF_TRUE .IF_TRUE_FALSE
Description
VAX MACRO has the following three subconditional assembly block directives:
Directive Function
.IF_FALSE
.IF_TRUE
.IF_TRUE_FALSE
If the condition of the assembly block tests false, the program includes the source code following the .IF_FALSE directive and continuing up to the next subconditional directive or to the end of the conditional assembly block. If the condition of the assembly block tests true, the program includes the source code following the .IF_TRUE directive and continuing up to the next subconditional directive or to the end of the conditional assembly block. Regardless of whether the condition of the assembly block tests true or false, the source code following the .IF TRUE_FALSE directive (and continuing up to the next subconditional directive or to the end of the assembly block) is always included.
The implied argument of a subconditional directive is the condition test specied when the conditional assembly block was entered. A conditional or subconditional directive in a nested conditional assembly block is not evaluated if the preceding (or outer) condition in the block is not satised (see Examples 3 and 4). A conditional block with a subconditional directive is different from a nested conditional block. If the condition in the .IF is not met, the inner conditional blocks are not assembled, but a subconditional directive can cause a block to be assembled. Notes 1. If a subconditional directive appears outside a conditional assembly block, the assembler displays an error message. 2. The alternate forms of .IF_FALSE, .IF_TRUE, and .IF_TRUE_FALSE are .IFF, .IFT, and .IFTF.
Assume that symbol SYM is defined: .IF DEFINED SYM . . . .IF_FALSE . . . .IF_TRUE . . . .IF_TRUE_FALSE . . . .IF_TRUE . . . .ENDC ; Tests TRUE since SYM is defined. ; Assembles the following code. ; Tests FALSE since previous ; .IF was TRUE. Does not ; assemble the following code. ; Tests TRUE since SYM is defined. ; Assembles the following code. ; Assembles the following code ; unconditionally. ; Tests TRUE since SYM is defined. ; Assembles remainder of ; conditional assembly block.
2.
Assume that symbol X is defined and that symbol Y is not defined: .IF DEFINED X .IF DEFINED Y .IF_FALSE . . . .IF_TRUE . . . .ENDC .ENDC ; Tests TRUE since X is defined. ; Tests FALSE since Y is not defined. ; Tests TRUE since Y is not defined. ; Assembles the following code. ; Tests FALSE since Y is not defined. ; Does not assemble the following ; code.
3.
Assume that symbol A is defined and that symbol B is not defined: .IF DEFINED A . . . .IF_FALSE . . . .IF NOT_DEFINED B . . . .ENDC .ENDC ; Tests TRUE since A is defined. ; Assembles the following code. ; Tests FALSE since A is defined. ; Does not assemble the following ; code. ; Nested conditional directive ; is not evaluated.
Assume that symbol X is not defined but symbol Y is defined: .IF DEFINED X . . . .IF DEFINED Y . . . .IF_FALSE . . . .IF_TRUE . . . .ENDC .ENDC ; Tests FALSE since X is not defined. ; Does not assemble the following ; code. ; Nested conditional directive ; is not evaluated. ; Nested subconditional ; directive is not evaluated. ; Nested subconditional ; directive is not evaluated.
.IIF
Immediate conditional assembly block directive
Format
.IIF condition [,]argument(s), statement
Parameters
condition One of the legal condition tests dened for conditional assembly blocks in Table 64 (see the description of .IF). The condition must be separated from the arguments by a comma ( , ), space, or tab. If the rst argument can be a blank, the condition must be separated from the arguments with a comma. argument(s) An expression or symbolic argument (described in Table 64) associated with the immediate conditional assembly block directive. If the argument is an expression, it cannot contain any undened symbols and must be an absolute expression (see Section 3.5). The arguments must be separated from the statement by a comma. statement The statement to be assembled if the condition is satised.
Description
.IIF provides a means of writing a one-line conditional assembly block. The condition to be tested and the conditional assembly block are expressed completely within the line containing the .IIF directive. No terminating .ENDC statement is required. Note The assembler displays an error message if .IIF species a condition test other than those listed in Table 64, an illegal argument, or a null argument.
Example
.IIF DEFINED EXAM, BEQL ALPHA This directive generates the following code if the symbol EXAM is dened within the source program: BEQL ALPHA
.IRP
Indenite repeat argument directive
Format
.IRP symbol,<argument list> . . . range . . . .ENDR
Parameters
symbol A formal argument that is successively replaced with the specied actual arguments enclosed in angle brackets ( <> ). If no formal argument is specied, the assembler displays an error message. <argument list> A list of actual arguments enclosed in angle brackets and used in expanding the indenite repeat range. An actual argument can consist of one or more characters. Multiple arguments must be separated by a legal separator (comma, space, or tab). If no actual arguments are specied, no action is taken. range The block of source text to be repeated once for each occurrence of an actual argument in the list. The range can contain macro denitions and repeat ranges. .MEXIT is legal within the range.
Description
.IRP replaces a formal argument with successive actual arguments specied in an argument list. This replacement process occurs during the expansion of the indenite repeat block range. The .ENDR directive species the end of the range. .IRP is analogous to a macro denition with only one formal argument. At each expansion of the repeat block, this formal argument is replaced with successive elements from the argument list. The directive and its range are coded in line within the source program. This type of macro denition and its range do not require calling the macro by name, as do other macros described in this section. .IRP can appear either inside or outside another macro denition, indenite repeat block, or repeat block (see the description of .REPEAT). The rules for specifying .IRP arguments are the same as those for specifying macro arguments.
The macro call and expansion of the macro dened previously is as follows: CALL_SUB TEST,INRES,INTES,UNLIS,OUTCON,#205 .NARG COUNT .IRP ARG,<,,,,,#205,OUTCON,UNLIS,INTES,INRES> .IIF NOT_BLANK , ARG, PUSHL ARG .ENDR .IIF NOT_BLANK , , PUSHL .IIF NOT_BLANK , , PUSHL .IIF NOT_BLANK , , PUSHL .IIF NOT_BLANK , , PUSHL .IIF NOT_BLANK , , PUSHL .IIF NOT_BLANK , #205, PUSHL #205 .IIF NOT_BLANK , OUTCON, PUSHL OUTCON .IIF NOT_BLANK , UNLIS, PUSHL UNLIS .IIF NOT_BLANK , INTES, PUSHL INTES .IIF NOT_BLANK , INRES, PUSHL INRES CALLS #<COUNT-1>,TEST ; Note TEST is counted This example uses the .NARG directive to count the arguments and the .IIF NOT_BLANK directive (see descriptions of .IF and .IIF in this section) to determine whether the actual argument is blank. If the argument is blank, no binary code is generated.
.IRPC
Indenite repeat character directive
Format
.IRPC symbol,<STRING> . . . range . . . .ENDR
Parameters
symbol A formal argument that is successively replaced with the specied characters enclosed in angle brackets ( <> ). If no formal argument is specied, the assembler displays an error message. <STRING> A sequence of characters enclosed in angle brackets and used in the expansion of the indenite repeat range. Although the angle brackets are required only when the string contains separating characters, their use is recommended for legibility. range The block of source text to be repeated once for each occurrence of a character in the list. The range can contain macro denitions and repeat ranges. .MEXIT is legal within the range.
Description
.IRPC is similar to .IRP except that .IRPC permits single-character substitution rather than argument substitution. On each iteration of the indenite repeat range, the formal argument is replaced with each successive character in the specied string. The .ENDR directive species the end of the range. .IRPC is analogous to a macro denition with only one formal argument. At each expansion of the repeat block, this formal argument is replaced with successive characters from the actual argument string. The directive and its range are coded in line within the source program and do not require calling the macro by name. .IRPC can appear either inside or outside another macro denition, indenite repeat block, or repeat block (see description of .REPEAT).
The macro call and expansion of the macro dened previously is as follows: HASH_SYM <MOVC5> .NCHR HV,<MOVC5> .IRPC CHR,<MOVC5> HV+^A?CHR? .ENDR HV+^A?M? HV+^A?O? HV+^A?V? HV+^A?C? HV+^A?5?
HV = HV HV HV HV HV = = = = =
This example uses the .NCHR directive to count the number of characters in an actual argument.
.LIBRARY
Macro library directive
Format
.LIBRARY macro-library-name
Parameters
macro-library-name A delimited string that is the le specication of a macro library.
Description
.LIBRARY adds a name to the macro library list that is searched whenever a .MCALL or an undened opcode is encountered. The libraries are searched in the reverse order in which they were specied to the assembler. If you omit any information from the macro-library-name argument, default values are assumed. The device defaults to your current default disk; the directory defaults to your current default directory; the le type defaults to MLB. Compaq recommends that libraries be specied in the MACRO command line with the /LIBRARY qualier rather than with the .LIBRARY directive. The .LIBRARY directive makes moving les cumbersome.
Example
.LIBRARY .LIBRARY .LIBRARY /DISK:[TEST]USERM/ ?DISK:SYSDEF.MLB? \CURRENT.MLB\ ; DISK:[TEST]USERM.MLB ; DISK:SYSDEF.MLB ; Uses default disk and directory
.LINK
Linker option record directive
Format
.LINK "le-spec" [/qualier[=(module-name[,...])],...]
Parameters
le-spec[,...] A delimited string that species one or more input les. The delimiters can be any matching pair of printable characters except the space, tab, equal sign ( = ), semicolon ( ; ), or left angle bracket (<). The character that you use as the delimiter cannot appear in the string itself. Although you can use alphanumeric characters as delimiters, use nonalphanumeric characters to avoid confusion. The input les can be object modules to be linked, or shareable images to be included in the output image. Input les can also be libraries containing external references or specic modules for inclusion in the output image. The linker will search the libraries for the external references. If you specify multiple input les, separate the le specications with commas ( , ). If you do not specify a le type in an input le specication, the linker supplies default le types, based on the nature of the le. All object modules are assumed to have le types of OBJ. Note that the input le specications must be correct at link time. Make your references explicit, so that if the object module created by VAX MACRO is linked in a directory other than the one in which it was created, the linker will still be able to nd the les referenced in the .LINK directive. No wildcard characters are allowed in the le specication.
File Qualiers
/INCLUDE=(module-name[,...]) Indicates that the associated input le is an object library or shareable image library, and that only the module names specied are to be unconditionally included as input to the linker. At least one module name must be specied. If you specify more than one module name, separate the names with commas ( , ) and enclose the list in parentheses. No wildcard characters are allowed in the module name specications. Module names may not be longer than 31 characters, the maximum length of a VAX MACRO symbol. /LIBRARY Indicates that the associated input le is a library to be searched for modules to resolve any undened symbols in the input les. If the associated input le specication does not include a le type, the linker assumes the default le type of OLB. You can use both /INCLUDE and /LIBRARY to qualify a le specication. If you specify both /INCLUDE and /LIBRARY, the library is subsequently searched for unresolved references. In this case, the explicit inclusion of modules occurs rst; then the linker searches the library for unresolved references.
/I /L /SE /SH
Description
The .LINK directive allows you to include linker option records in an object module produced by VAX MACRO. The qualiers for the .LINK directive perform functions similar to the functions performed by the same qualiers for the DCL command LINK. You should use the .LINK directive for references that are not linker defaults, but that you always want to include in a particular image. Using the .LINK directive enables you to avoid having to explicitly name these references in the DCL command LINK. For detailed information on the qualiers to the DCL command LINK, see the OpenVMS DCL Dictionary. For a complete discussion of the operation of the linker itself, see the OpenVMS Linker Utility Manual.
Examples
1.
.LINK "SYS$LIBRARY:MYLIB" /INCLUDE=(MOD1, MOD2, MOD6) This statement, when included in the le MYPROG.MAR, causes the assembler to request that MYPROG.OBJ be linked with modules MOD1, MOD2, and MOD6 in the library SYS$LIBRARY:MYLIB.OLB (where SYS$LIBRARY is a logical name for the disk and directory in which MYLIB.OLB is listed). The library is not searched for other unresolved references. The statement is equivalent to linking the le with the DCL command:
2.
; Link with object module ; SYS$LIBRARY:MYOBJ.OBJ ; Search object library ; SYS$LIBRARY:YOURLIB.OLB ; for unresolved references
.LINK *SYS$LIBRARY:MYSTB.STB* /SELECTIVE_SEARCH ; Search symbol table ; SYS$LIBRARY:MYSTB.STB ; for unresolved references .LINK "SYS$LIBRARY:MYSHR.EXE" /SHAREABLE ; Link with shareable image ; SYS$LIBRARY:MYSHR.EXE
To increase efciency and performance, include several related input les in a single .LINK directive. The following example shows how the ve options illustrated previously can be included in one statement:
4.
.LINK
.LIST
Listing directive
Format
.LIST [argument-list]
Parameter
argument-list One or more of the symbolic arguments dened in Table 68. You can use either the long form or the short form of the arguments. If multiple arguments are specied, separate them with commas ( , ), spaces, or tabs.
Description
.LIST is equivalent to .SHOW. See the description of .SHOW for more information.
.LONG
Longword storage directive
Format
.LONG expression-list
Parameters
expression-list One or more expressions separated by commas ( , ). You have the option of following each expression with a repetition factor delimited by square brackets ( [ ] ). An expression followed by a repetition factor has the format: expression1[expression2] expression1 An expression that species the value to be stored. [expression2] An expression that species the number of times the value is repeated. The expression must not contain any undened symbols and must be an absolute expression (see Section 3.5). The square brackets are required.
Description
.LONG generates successive longwords (4 bytes) of data in the object module.
Example
LAB_3: .LONG .LONG .LONG LAB_3,^X7FFFFFFF,^AABCD ; 3 longwords of data ^XF@4 ; 1 longword of data 0[22] ; 22 longwords of data
Note Each expression in the list must have a value that can be represented in 32 bits.
.MACRO
Macro denition directive
Format
.MACRO macro-name [formal-argument-list] . . . range . . . .ENDM [macro name]
Parameters
macro-name The name of the macro to be dened; this name can be any legal symbol up to 31 characters long. formal-argument-list The symbols, separated by commas ( , ), to be replaced by the actual arguments in the macro call. range The source text to be included in the macro expansion.
Description
.MACRO begins the denition of a macro. It gives the macro name and a list of formal arguments (see Chapter 4). If the name specied is the same as the name of a previously dened macro, the previous denition is deleted and replaced with the new one. The .MACRO directive is followed by the source text to be included in the macro expansion. The .ENDM directive species the end of the range. Macro names do not conict with user-dened symbols. Both a macro and a user-dened symbol can have the same name. When the assembler encounters a .MACRO directive, it adds the macro name to its macro name table and stores the source text of the macro (up to the matching .ENDM directive). No other processing occurs until the macro is expanded. The symbols in the formal argument list are associated with the macro name and are limited to the scope of the denition of that macro. For this reason, the symbols that appear in the formal argument list can also appear elsewhere in the program.
Example
The macro denition is as follows: .MACRO USERDEF .PSECT DEFIES,ABS 5 ^XFFF123 0 .PSECT RWDATA,NOEXE,LONG .BLKL 100 .BLKB 10 .MACRO USERDEF .ENDM USERDEF .ENDM USERDEF
; Redefine it to null
The macro calls and expansions of the macro dened previously are as follows: USERDEF .PSECT DEFIES,ABS 5 ^XFFF123 0 .PSECT RWDATA,NOEXE,LONG .BLKL 100 .BLKB 10 .MACRO USERDEF .ENDM USERDEF USERDEF ; Should expand data
In this example, when the macro is called the rst time, it denes some symbols and data storage areas and then redenes itself. When the macro is called a second time, the macro expansion contains no source text.
.MASK
Mask directive
Format
.MASK symbol[,expression]
Parameters
symbol A symbol dened in an .ENTRY directive. expression A register save mask.
Description
.MASK reserves a word for a register save mask for a transfer vector. See the description of .TRANSFER for more information and for an example of .MASK. Notes 1. If .MASK does not contain an expression, the assembler directs the linker to copy the register save mask specied in .ENTRY to the word reserved by .MASK. 2. If .MASK contains an expression, the assembler directs the linker to combine this expression with the register save mask specied in .ENTRY and store the result in the word reserved by .MASK. The linker performs an inclusive OR operation to combine the mask in the entry point and the value of the expression. Consequently, a register specied in either .ENTRY or .MASK will be included in the combined mask. See the description of .ENTRY for more information on entry masks.
.MCALL
Macro call directive
Format
.MCALL macro-name-list
Parameters
macro-name-list A list of macros to be dened for this assembly. Separate the macro names with commas ( , ).
Description
.MCALL species the names of the system and user-dened macros that are required to assemble the source program but are not dened in the source le. If any named macro is not found upon completion of the search (that is, if the macro is not dened in any of the macro libraries), the assembler displays an error message. Note .MCALL is provided for compatibility with MACRO-11; with one exception, Compaq recommends that you not use it. When VAX MACRO nds an unknown symbol in the opcode eld, it automatically searches all macro libraries. If it nds the symbol in a library, it uses the macro denition and expands the macro reference. If VAX MACRO does not nd the symbol in the library, it displays an error message. You must use .MCALL when a macro has the same name as an opcode (see description of .MACRO).
Example
.MCALL INSQUE ; Substitute macro in ; library for INSQUE ; instruction
.MDELETE
Macro deletion directive
Format
.MDELETE macro-name-list
Parameters
macro-name-list A list of macros whose denitions are to be deleted. Separate the names with commas ( , ).
Description
.MDELETE deletes the denitions of specied macros. The number of macros actually deleted is printed in the assembly listing on the same line as the .MDELETE directive. .MDELETE completely deletes the macro, freeing memory as necessary. Macro redenition with .MACRO merely redenes the macro.
Example
.MDELETE USERDEF,$SSDEF,ALTR
.MEXIT
Macro exit directive
Format
.MEXIT
Description
.MEXIT terminates a macro expansion before the end of the macro. Termination is the same as if .ENDM were encountered. You can use the directive within repeat blocks. .MEXIT is useful in conditional expansion of macros because it bypasses the complexities of nested conditional directives and alternate assembly paths. Notes 1. When .MEXIT occurs in a repeat block, the assembler terminates the current repetition of the range and suppresses further expansion of the repeat range. 2. When macros or repeat blocks are nested, .MEXIT exits to the next higher level of expansion. 3. If .MEXIT occurs outside a macro denition or a repeat block, the assembler displays an error message.
Example
.MACRO P0L0 . . . .IF EQ N . . . .MEXIT .ENDC . . . .ENDM P0L0 N,A,B
In this example, if the actual argument for the formal argument N equals zero, the conditional block is assembled, and the macro expansion is terminated by .MEXIT.
.NARG
Number of arguments directive
Format
.NARG symbol
Parameters
symbol A symbol that is assigned a value equal to the number of arguments in the macro call.
Description
.NARG determines the number of arguments in the current macro call. .NARG counts all the positional arguments specied in the macro call, including null arguments (specied by adjacent commas ( , )). The value assigned to the specied symbol does not include either any keyword arguments or any formal arguments that have default values. Note If .NARG appears outside a macro, the assembler displays an error message.
Example
The macro denition is as follows: .MACRO .NARG .WORD .ENDM CNT_ARG A1,A2,A3,A4,A5,A6,A7,A8,A9=DEF9,A10=DEF10 COUNTER ; COUNTER is set to no. of ARGS COUNTER ; Store value of COUNTER CNT_ARG
The macro calls and expansions of the macro dened previously are as follows: CNT_ARG TEST,FIND,ANS .NARG COUNTER .WORD COUNTER CNT_ARG .NARG COUNTER .WORD COUNTER ; COUNTER will = 3 ; COUNTER is set to no. of ARGS ; Store value of COUNTER ; COUNTER will = 0 ; COUNTER is set to no. of ARGS ; Store value of COUNTER
CNT_ARG TEST,A2=SYMB2,A3=SY3 ; COUNTER will = 1 .NARG COUNTER ; COUNTER is set to no. of ARGS .WORD COUNTER ; Store value of COUNTER ; Keyword arguments are not counted CNT_ARG ,SYMBL,, .NARG COUNTER .WORD COUNTER ; ; ; ; COUNTER will = COUNTER is set Store value of Null arguments 3 to no. of ARGS COUNTER are counted
.NCHR
Number of characters directive
Format
.NCHR symbol,<string>
Parameters
symbol A symbol that is assigned a value equal to the number of characters in the specied character string. <string> A sequence of printable characters. Delimit the character string with angle brackets ( <> ) (or a character preceded by a circumex ( ^ )) only if the specied character string contains a legal separator (comma ( , ), space, and/or tab) or a semicolon ( ; ).
Description
.NCHR determines the number of characters in a specied character string. It can appear anywhere in a VAX MACRO program and is useful in calculating the length of macro arguments.
Example
The macro denition is as follows: .MACRO .NCHR .WORD .ASCII .ENDM CHAR MESS CHRCNT,<MESS> CHRCNT /MESS/ CHAR ; ; ; ; ; Define MACRO Assign value to CHRCNT Store value Store characters Finish
The macro calls and expansions of the macro dened previously are as follows: CHAR .NCHR .WORD .ASCII CHAR .NCHR .WORD .ASCII <HELLO> CHRCNT,<HELLO> CHRCNT /HELLO/ <14, 75.39 4> CHRCNT,<14, 75.39 4> CHRCNT /14, 75.39 4/ ; CHRCNT ; Assign ; Store ; Store ; CHRCNT ; Assign ; Store ; Store will = 5 value to CHRCNT value characters will = 12(dec) value to CHRCNT value characters
.NLIST
Listing directive
Format
.NLIST [argument-list]
Parameter
argument-list One or more of the symbolic arguments listed in Table 68. Use either the long form or the short form of the arguments. If you specify multiple arguments, separate them with commas ( , ), spaces, or tabs.
Description
.NLIST is equivalent to .NOSHOW. See the description of .SHOW for more information.
.NOCROSS
Cross-reference directive
Format
.NOCROSS [symbol-list]
Parameter
symbol-list A list of legal symbol names separated by commas ( , ).
Description
VAX MACRO produces a cross-reference listing when the /CROSS_REFERENCE qualier is specied in the MACRO command. The .CROSS and .NOCROSS directives control which symbols are included in the cross-reference listing. The description of .NOCROSS is included with the description of .CROSS.
.NOSHOW
Listing directive
Format
.NOSHOW [argument-list]
Parameter
argument-list One or more of the symbolic arguments listed in Table 68 in the description of .SHOW. Use either the long form or the short form of the arguments. If you specify multiple arguments, separate them with commas ( , ), spaces, or tabs.
Description
.NOSHOW species listing control options. See the description of .SHOW for more information.
.NTYPE
Operand type directive
Format
.NTYPE symbol,operand
Parameters
symbol Any legal VAX MACRO symbol. This symbol is assigned a value equal to the 8or 16-bit addressing mode of the operand argument that follows. operand Any legal address expression, as you use it with an opcode. If no argument is specied, zero is assumed.
Description
.NTYPE determines the addressing mode of the specied operand. The value of the symbol is set to the specied addressing mode. In most cases, an 8-bit (1-byte) value is returned. Bits 0 to 3 specify the register associated with the mode, and bits 4 to 7 specify the addressing mode. To provide concise addressing information, the mode bits 4 to 7 are not exactly the same as the numeric value of the addressing mode described in Table C6. Literal mode is indicated by a zero in bits 4 to 7, instead of the values 0 to 3. Mode 1 indicates an immediate mode operand, mode 2 indicates an absolute mode operand, and mode 3 indicates a general mode operand. For indexed addressing mode, a 16-bit (2-byte) value is returned. The high-order byte contains the addressing mode of the base operand specier and the low-order byte contains the addressing mode of the primary operand (the index register). See Chapter 5 of this volume for more information on addressing modes.
.MACRO PUSHADR #ADDR .NTYPE A,ADDR A = A@-4&^XF .IF IDENTICAL 0,<ADDR> PUSHL #0 .MEXIT .ENDC ERR = 0
; ; .IIF LESS_EQUAL A-1, ERR=1 ; .IIF EQUAL A-5, ERR=1 ; .IF EQUAL ERR ; PUSHAL ADDR ; .IFF ; PUSHL ADDR ; .WARN ; ADDR is not an address; .ENDC .ENDM PUSHADR
The macro calls and expansions of the macro dened previously are as follows: PUSHADR (R0) PUSHAL (R0) PUSHADR (R1)[R4] PUSHAL (R1)[R4] PUSHADR 0 PUSHL #0 ; Valid argument ; Yes, stack address ; Valid argument ; Yes, stack address ; Is zero ; Stack zero
PUSHADR #1 ; Not an address PUSHL #1 ; Then stack operand & warn %MACRO-W-GENWRN, Generated WARNING: #1 is not an address PUSHADR R0 ; Not an address PUSHL R0 ; Then stack operand & warn %MACRO-W-GENWRN, Generated WARNING: R0 is not an address Note that to save space, this example is listed as it would appear if .SHOW BINARY, not .SHOW EXPANSIONS, were specied in the source program.
.OCTA
Octaword storage directive
Format
.OCTA literal .OCTA symbol
Parameters
literal Any constant value. This value can be preceded by ^O, ^B, ^X, or ^D to specify the radix as octal, binary, hexadecimal, or decimal, respectively; or it can be preceded by ^A to specify ASCII text. Decimal is the default radix. symbol A symbol dened elsewhere in the program. This symbol results in a signextended, 32-bit value being stored in an octaword.
Description
.OCTA generates 128 bits (16 bytes) of binary data. Note .OCTA is like .QUAD and unlike other data storage directives (.BYTE, .WORD, and .LONG), in that it does not evaluate expressions and that it accepts only one value. It does not accept a list.
Example
.OCTA ^A"FEDCBA987654321" .OCTA 0 .OCTA ^X01234ABCD5678F9 .OCTA VINTERVAL ; ; ; ; ; ; Each ASCII character is stored in a byte OCTA 0 OCTA hex value specified VINTERVAL has 32-bit value, sign-extended
.ODD
Odd location counter alignment directive
Format
.ODD
Description
.ODD ensures that the current value of the location counter is odd by adding 1 if the current value is even. If the current value is already odd, no action is taken.
.OPDEF
Opcode denition directive
Format
.OPDEF opcode value,operand-descriptor-list
Parameters
opcode An ASCII string specifying the name of the opcode. The string can be up to 31 characters long and can contain the letters A to Z, the digits 0 to 9, and the special characters underscore ( _ ), dollar sign ( $ ), and period ( . ). The string should not start with a digit and should not be surrounded by delimiters. value An expression that species the value of the opcode. The expression must be absolute and must not contain any undened values (see Section 3.5). The value of the expression must be in the range 0 to 65; 53510 (hexadecimal FFFF), but you cannot use the values 252 to 255 because the architecture species these as the start of a 2-byte opcode. The expression is represented as follows: If 0 < expression < 251 If expression > 255 Expression is a 1-byte opcode. Expression bits 7:0 are the rst byte of the opcode and expression bits 15:8 are the second byte of the opcode.
operand-descriptor-list A list of operand descriptors that species the number of operands and the type of each. Up to 16 operand descriptors are allowed in the list. Table 65 lists the operand descriptors. Table 65 Operand Descriptors
Access Type Floating Point AF RF MF WF VF Double Floating Point AD RD MD WD VD Data Type
G_ Floating Point AG RG MG WG VG
H_ Floating Point AH RH MH WH VH
Quadword AQ RQ MQ WQ VQ
Octaword AO RO MO WO VO
WW WL VW BW VL
Example
.OPDEF MOVL3 .OPDEF DIVF2 .OPDEF MOVC5 .OPDEF CALL ^XA9FF,RL,ML,WL ^X46,RF,MF ^X2C,RW,AB,AB,RW,AB ^X10,BB ; Defines an instruction ; MOVL3, which uses ; the reserved opcode FF ; Redefines the DIVF2 and ; MOVC5 instructions ; Equivalent to a BSBB
.PACKED
Packed decimal string storage directive
Format
.PACKED decimal-string[,symbol]
Parameters
decimal-string A decimal number from 0 to 31 digits long with an optional sign. Digits can be in the range 0 to 9 (see Section 8.3.14). symbol An optional symbol that is assigned a value equivalent to the number of decimal digits in the string. The sign is not counted as a digit.
Description
.PACKED generates packed decimal data, two digits per byte. Packed decimal data is useful in calculations requiring exact accuracy. Packed decimal data is operated on by the decimal string instructions. See Section 8.3.14 for more information on the format of packed decimal data.
Example
.PACKED .PACKED .PACKED .PACKED -12,PACK_SIZE +500 0 -0,SUM_SIZE ; PACK_SIZE gets value of 2 ; SUM_SIZE gets value of 1
.PAGE
Page ejection directive
Format
.PAGE
Description
.PAGE forces a new page in the listing. The directive itself is not printed in the listing. VAX MACRO ignores .PAGE in a macro denition. The paging operation is performed only during macro expansion.
.PRINT
Assembly message directive
Format
.PRINT [expression] ;comment
Parameters
expression An expression whose value is displayed when .PRINT is encountered during assembly. ;comment A comment that is displayed when .PRINT is encountered during assembly. The comment must be preceded by a semicolon ( ; ).
Description
.PRINT causes the assembler to display an informational message. The message consists of the value of the expression and the comment specied in the .PRINT directive. The message is displayed on the terminal for interactive jobs and in the log le for batch jobs. The message produced by .PRINT is not considered an error or warning message. Notes 1. .PRINT, .ERROR, and .WARN are called the message display directives. You can use these to display information indicating that a macro call contains an error or an illegal set of conditions. 2. If .PRINT is included in a macro library, end the comment with an additional semicolon. If you omit the semicolon, the comment will be stripped from the directive and will not be displayed when the macro is called. 3. If the expression has a value of zero, it is not displayed with the message.
Example
.PRINT 2 ; The sine routine has been changed
.PSECT
Program sectioning directive
Format
.PSECT [program-section-name[,argument-list]]
Parameters
program-section-name The name of the program section. This name can be up to 31 characters long and can contain any alphanumeric character and the special characters underscore ( _ ), dollar sign ( $ ), and period ( . ). The rst character must not be a digit. argument-list A list containing the program section attributes and the program section alignment. Table 66 lists the attributes and their functions. Table 67 lists the default attributes and their opposites. Program sections are aligned when you specify an integer in the range 0 to 9 or one of the ve keywords listed in the following table. If you specify an integer, the program section is linked to begin at the next virtual address, which is a multiple of 2 raised to the power of the integer. If you specify a keyword, the program section is linked to begin at the next virtual address (a multiple of the values listed in the following table):
Keyword Size (in Bytes)
= = = = =
1 2 4 8 512
ABS
AbsoluteThe linker assigns the program section an absolute address. The contents of the program section can be only symbol denitions (usually denitions of symbolic offsets to data structures that are used by the routines being assembled). No data allocations can be made. An absolute program section contributes no binary code to the image, so its byte allocation request to the linker is zero. The size of the data structure being dened is the size of the absolute program section printed in the program section synopsis at the end of the listing. Compare this attribute with its opposite, REL.
(continued on next page)
CON
EXE
GBL
PIC
RD REL
ConcatenateProgram sections with the same name and attributes (including CON) are merged into one program section. Their contents are merged in the order in which the linker acquires them. The allocated virtual address space is the sum of the individual requested allocations. ExecutableThe program section contains instructions. This attribute provides the capability of separating instructions from read-only and read/write data. The linker uses this attribute in gathering program sections and in verifying that the transfer address is in an executable program section. GlobalProgram sections that have the same name and attributes, including GBL and OVR, will have the same relocatable address in memory even when the program sections are in different clusters (see the OpenVMS Linker Utility Manual for more information on clusters). This attribute is specied for FORTRAN COMMON block program sections (see the VAX FORTRAN Users Guide). Compare this attribute with its opposite, LCL. LocalThe program section is restricted to its cluster. Compare this attribute with its opposite, GBL. Library SegmentReserved for future use. Not ExecutableThe program section contains data only; it does not contain instructions. Non-Position-Independent ContentThe program section is assigned to a xed location in virtual memory (when it is in a shareable image). NonreadableReserved for future use. No ShareThe program section is reserved for private use at execution time by the initiating process. NonwritableThe contents of the program section cannot be altered (written into) at execution time. OverlayProgram sections with the same name and attributes, including OVR, have the same relocatable base address in memory. The allocated virtual address space is the requested allocation of the largest overlaying program section. Compare this attribute with its opposite, CON. Position-Independent ContentThe program section can be relocated; that is, it can be assigned to any memory area (when it is in a shareable image). ReadableReserved for future use. RelocatableThe linker assigns the program section a relocatable base address. The contents of the program section can be code or data. Compare this attribute with its opposite, ABS.
(continued on next page)
SHR
USR VEC
WRT
ShareThe program section can be shared at execution time by multiple processes. This attribute is assigned to a program section that can be linked into a shareable image. User SegmentReserved for future use. Vector-ContainingThe program section contains a change mode vector indicating a privileged shareable image. You must use the SHR attribute with VEC. WriteThe contents of the program section can be altered (written into) at execution time.
Description
.PSECT denes a program section and its attributes and refers to a program section once it is dened. Use program sections to do the following: Develop modular programs. Separate instructions from data. Allow different modules to access the same data. Protect read-only data and instructions from being modied. Identify sections of the object module to the debugger. Control the order in which program sections are stored in virtual memory.
The assembler automatically denes two program sections: the absolute program section and the unnamed (or blank) program section. Any symbol denitions that appear before any instruction, data, or .PSECT directive are placed in the absolute program section. Any instructions or data that appear before the rst named program section is dened are placed in the unnamed program section. Any .PSECT directive that does not include a program section name species the unnamed program section. A maximum of 254 user-dened, named program sections can be dened.
. ABS . . BLANK .
Example
.PSECT CODE,NOWRT,EXE,LONG .PSECT RWDATA,WRT,NOEXE,QUAD ; Program section to contain ; modifiable data ; Program section to contain ; executable code
.QUAD
Quadword storage directive
Format
.QUAD literal .QUAD symbol
Parameters
literal Any constant value. This value can be preceded by ^O, ^B, ^X, or ^D to specify the radix as octal, binary, hexadecimal, or decimal, respectively; or it can be preceded by ^A to specify the ASCII text operator. Decimal is the default radix. symbol A symbol dened elsewhere in the program. This symbol results in a signextended, 32-bit value being stored in a quadword.
Description
.QUAD generates 64 bits (8 bytes) of binary data. Note .QUAD is like .OCTA and different from other data storage directives (.BYTE, .WORD, and .LONG) in that it does not evaluate expressions and that it accepts only one value. It does not accept a list.
Example
.QUAD .QUAD .QUAD .QUAD .QUAD ^A..ASK?.. 0 ^X0123456789ABCDEF ^B1111000111001101 LABEL ; ; ; ; ; ; ; Each ASCII character is stored in a byte QUAD 0 QUAD hex value specified QUAD binary value specified LABEL has a 32-bit, zero-extended value.
.REFn
Operand generation directives
Format
.REF1 operand .REF2 operand .REF4 operand .REF8 operand .REF16 operand
Parameter
operand An operand of byte, word, longword, quadword, or octaword context, respectively.
Description
VAX MACRO has the following ve operand generation directives that you can use in macros to dene new opcodes:
Directive Function
a byte operand a word operand a longword operand a quadword operand an octaword operand
The .REFn directives are provided for compatibility with VAX MACRO Version 1.0. Because the .OPDEF directive provides greater functionality and is easier to use than .REFn, you should use .OPDEF instead of .REFn.
Example
.MACRO .BYTE .REF4 .REF4 .REF4 .ENDM MOVL3 MOVL3 A,B,C ^XFF,^XA9 A B C MOVL3 R0,@LAB-1,(R7)+[R10]
; This operand has longword context ; This operand has longword context ; This operand has longword context
This example uses .REF4 to create a new instruction, MOVL3, which uses the reserved opcode FF. See the example in .OPDEF for a preferred method to create a new instruction.
.REPEAT
Repeat block directive
Format
.REPEAT expression range .ENDR
Parameters
expression An expression whose value controls the number of times the range is to be assembled within the program. When the expression is less than or equal to zero, the repeat block is not assembled. The expression must be absolute and must not contain any undened symbols (see Section 3.5). range The source text to be repeated the number of times specied by the value of the expression. The repeat block can contain macro denitions, indenite repeat blocks, or other repeat blocks. .MEXIT is legal within the range.
Description
.REPEAT repeats a block of code a specied number of times, in line with other source code. The .ENDR directive species the end of the range. Note The alternate form of .REPEAT is .REPT.
The macro calls and expansions of the macro dened previously are as follows: COPIES .REPEAT .ASCII .ENDR .ASCII .ASCII .ASCII .ASCII .ASCII .BYTE VARB = 3 COPIES .REPEAT .ASCII .ENDR .ASCII .ASCII .ASCII .BYTE <ABCDEF>,5 5 /ABCDEF/ /ABCDEF/ /ABCDEF/ /ABCDEF/ /ABCDEF/ /ABCDEF/ 0 <HOW MANY TIMES>,VARB 3 /HOW MANY TIMES/ /HOW MANY TIMES/ /HOW MANY TIMES/ /HOW MANY TIMES/ 0
.RESTORE_PSECT
Restore previous program section context directive
Format
.RESTORE_PSECT
Description
.RESTORE_PSECT retrieves the program section from the top of the program section context stack, an internal stack in the assembler. If the stack is empty when .RESTORE_PSECT is issued, the assembler displays an error message. When .RESTORE_PSECT retrieves a program section, it restores the current location counter to the value it had when the program section was saved. The local label block is also restored if it was saved when the program section was saved. See the description of .SAVE_PSECT for more information. Note The alternate form of .RESTORE_PSECT is .RESTORE.
Example
.RESTORE_PSECT and .SAVE_PSECT are especially useful in macros that dene program sections. The macro denition in the following example saves the current program section context and denes new program sections. Then, it restores the saved program section. If the macro did not save and restore the program section context each time the macro was invoked, the program section would change. .MACRO INITD .SAVE_PSECT .PSECT SYMBOLS,ABS HELP_LEV=2 MAXNUM=100 RATE1=16 RATE2=4 .PSECT DATA,NOEXE,LONG TABL: .BLKL 100 TEMP: .BLKB 16 .RESTORE_PSECT .ENDM ; ; ; ; ; ; ; ; ; ; ; ; ; ; Initialize symbols and data areas Save the current PSECT Define new PSECT Define symbol Define symbol Define symbol Define symbol Define another PSECT 100 longwords in TABL More storage Restore the PSECT in effect when MACRO is invoked
.SAVE_PSECT
Save current program section context directive
Format
.SAVE_PSECT [LOCAL_BLOCK]
Parameter
LOCAL_BLOCK An optional keyword that species that the current local label is to be saved with the program section context.
Description
.SAVE_PSECT stores the current program section context on the top of the program section context stack, an internal assembler stack. It leaves the current program section context in effect. The program section context stack can hold 31 entries. Each entry includes the value of the current location counter and the maximum value assigned to the location counter in the current program section. If the stack is full when .SAVE_PSECT is encountered, an error occurs. .SAVE_PSECT and .RESTORE_PSECT are especially useful in macros that dene program sections. See the description of .RESTORE_PSECT for another example using .SAVE_PSECT. Note The alternate form of .SAVE_PSECT is .SAVE.
Example
The macro definition is as follows: .MACRO ERR_MESSAGE,TEXT .IIF NOT_DEFINED .SAVE_PSECT LOCAL_BLOCK .PSECT MESSAGE_TEXT MESSAGE:: .ASCIC /TEXT/ .PSECT MESSAGE_POINTERS .ADDRESS MESSAGE .RESTORE_PSECT PUSHL #MESSAGE_INDEX CALLS #1,PRINT_MESS MESSAGE_INDEX=MESSAGE_INDEX+1 .ENDM ERR_MESSAGE ; Set up lists of messages ; and pointers ; MESSAGE_INDEX, MESSAGE_INDEX=0 ; Keep local labels ; List of error messages ; ; ; ; ; ; Addresses of error messages Store one pointer Get back local labels Print message
Format
.SHOW [argument-list] .NOSHOW [argument-list]
Parameter
argument-list One or more of the optional symbolic arguments dened in Table 68. You can use either the long form or the short form of the arguments. You can use each argument alone or in combination with other arguments. If you specify multiple arguments, you must separate them by commas ( , ), tabs, or spaces. If any argument is not specically included in a listing control statement, the assembler assumes its default value (SHOW or NOSHOW) throughout the source program. Table 68 .SHOW and .NOSHOW Symbolic Arguments
Long Form Short Form Default Function
BINARY
MEB
NOSHOW
CALLS CONDITIONALS
MC CND
SHOW SHOW
DEFINITIONS
MD
SHOW
EXPANSIONS
ME
NOSHOW
Lists macro and repeat block expansions that generate binary code. BINARY is a subset of EXPANSIONS. Lists macro calls and repeat block speciers. Lists unsatised conditional code associated with the conditional assembly directives. Lists macro and repeat range denitions that appear in an input source le. Lists macro and repeat range expansions.
Description
.SHOW and .NOSHOW specify listing control options in the source text of a program. You can use .SHOW and .NOSHOW with or without an argument list. When you use them with an argument list, .SHOW includes and .NOSHOW excludes the lines specied in Table 68. .SHOW and .NOSHOW control the listing of the source lines that are in conditional assembly blocks (see the description of .IF), macros, and repeat blocks.
Example
.MACRO XX . . . .SHOW X=. .NOSHOW . . . .ENDM .NOSHOW EXPANSIONS XX X=. ; Do not list remainder ; of macro expansion
.SIGNED_BYTE
Signed byte data directive
Format
.SIGNED_BYTE expression-list
Parameters
expression-list An expression or list of expressions separated by commas ( , ). You have the option of following each expression with a repetition factor delimited by square brackets ( [ ] ). An expression followed by a repetition factor has the format: expression1[expression2] expression1 An expression that species the value to be stored. The value must be in the range -128 to +127. [expression2] An expression that species the number of times the value will be repeated. The expression must not contain any undened symbols and must be an absolute expression (see Section 3.5). The square brackets are required.
Description
.SIGNED_BYTE is equivalent to .BYTE, except that VAX MACRO indicates that the data is signed in the object module. The linker uses this information to test for overow conditions. Note Specifying .SIGNED_BYTE allows the linker to detect overow conditions when the value of the expression is in the range of 128 to 255. Values in this range can be stored as unsigned data but cannot be stored as signed data in a byte.
Example
.SIGNED_BYTE .SIGNED_BYTE LABEL1-LABEL2 ALPHA[20] ; Data must fit ; in byte
.SIGNED_WORD
Signed word storage directive
Format
.SIGNED_WORD expression-list
Parameters
expression-list An expression or list of expressions separated by commas ( , ). You have the option of following each expression with a repetition factor delimited by square brackets ( [ ] ). An expression followed by a repetition factor has the format: expression1[expression2] expression1 An expression that species the value to be stored. The value must be in the range -32,768 to +32,767. [expression2] An expression that species the number of times the value will be repeated. The expression must not contain any undened symbols and must be an absolute expression (see Section 3.5). The square brackets ( [ ] ) are required.
Description
.SIGNED_WORD is equivalent to .WORD except that the assembler indicates that the data is signed in the object module. The linker uses this information to test for overow conditions. .SIGNED_WORD is useful after the case instruction to ensure that the displacement ts in a word. Note Specifying .SIGNED_WORD allows the linker to detect overow conditions when the value of the expression is in the range of 32,768 to 65,535. Values in this range can be stored as unsigned data but cannot be stored as signed data in a word.
BASE:
MAX:
; Local label specifying base ERR_PROC-30000$ ; Offset list SORT-30000$ ; Offset list REV_SORT-30000$ ; Offset list ; Local label used to count args ; =1, forward sort; =2, backward ; sort
TEST <TEST1,TEST2,TEST3>,L,#1 TEST,#1,S^#<<30003$-30002$>/2>-1 30002$: ; Local label specifying base .SIGNED_WORD TEST1-30002$ ; Offset list .SIGNED_WORD TEST2-30002$ ; Offset list .SIGNED_WORD TEST3-30002$ ; Offset list 30003$: ; Local label used to count args ; Value of TEST can be 1, 2, or 3 In this example, the CASE macro uses .SIGNED_WORD to create a CASEB, CASEW, or CASEL instruction.
CASE CASEL
.SUBTITLE
Subtitle directive
Format
.SUBTITLE comment-string
Parameter
comment-string An ASCII string from 1 to 40 characters long; excess characters are truncated.
Description
.SUBTITLE causes the assembler to print the line of text, represented by the comment-string, in the table of contents (which the assembler produces immediately before the assembly listing). The assembler also prints the line of text as the subtitle on the second line of each assembly listing page. This subtitle text is printed on each page until altered by a subsequent .SUBTITLE directive in the program. Note The alternate form of .SUBTITLE is .SBTTL.
Examples
1.
.SUBTITLE CONDITIONAL ASSEMBLY This directive causes the assembler to print the following text as the subtitle of the assembly listing: CONDITIONAL ASSEMBLY It also causes the text to be printed out in the listings table of contents, along with the source page number and the line sequence number of the source statement where .SUBTITLE was specied. The table of contents would have the following format:
2.
TABLE OF CONTENTS
5000 ASSEMBLER DIRECTIVES 300 MACRO DEFINITIONS 2300 DATA TABLES AND INITIALIZATION 4800 MAIN ROUTINES 2800 CALCULATIONS 5000 I/O ROUTINES 1300 CONDITIONAL ASSEMBLY
.TITLE
Title directive
Format
.TITLE module-name comment-string
Parameters
module-name An identier from 1 to 31 characters long. comment-string An ASCII string from 1 to 40 characters long; excess characters are truncated.
Description
.TITLE assigns a name to the object module. This name is the rst 31 or fewer nonblank characters following the directive. Notes 1. The module name specied with .TITLE bears no relationship to the le specication of the object module, as specied in the VAX MACRO command line. The object module name appears in the linker load map and is also the module name that the debugger and librarian recognize. 2. If .TITLE is not specied, VAX MACRO assigns the default name .MAIN to the object module. If more than one .TITLE directive is specied in the source program, the last .TITLE directive encountered establishes the name for the entire object module. 3. When evaluating the module name, VAX MACRO ignores all spaces, tabs, or both, up to the rst nonspace/nontab character after .TITLE.
Example
.TITLE EVAL Evaluates Expressions
.TRANSFER
Transfer directive
Format
.TRANSFER symbol
Parameter
symbol A global symbol that is an entry point in a procedure or routine.
Description
.TRANSFER redenes a global symbol for use in a shareable image. The linker redenes the symbol as the value of the location counter at the .TRANSFER directive after a shareable image is linked. To make program maintenance easier, programs should not need to be relinked when the shareable images to which they are linked change. To avoid relinking entire programs when their linked shareable images change, keep the entry points in the changed shareable image at their original addresses. To do this, create an object module that contains a transfer vector for each entry point. Do not change the order of the transfer vectors. Link this object module at the beginning of the shareable image. The addresses of the entry points remain xed even if the source code for a routine is changed. After each .TRANSFER directive, create a register save mask (for procedures only) and a branch to the rst instruction of the routine. The .TRANSFER directive does not cause any memory to be allocated and does not generate any binary code. It merely generates instructions to the linker to redene the symbol when a shareable image is being created. Use .TRANSFER with procedures entered by the CALLS or CALLG instruction. In this case, use .TRANSFER with the .ENTRY and .MASK directives. The branch to the actual routine must be a branch to the entry point plus 2 to bypass the 2-byte register save mask. Figure 61 illustrates the use of transfer vectors.
CALLS
ROUTB
CALLS
ROUTB
Shareable Image
Object Modules
RET
RET ZK0535GE
ROUTINE_A,^M<R2,R3>
.WARN
Warning directive
Format
.WARN [expression] ;comment
Parameters
expression An expression whose value is displayed when .WARN is encountered during assembly. ;comment A comment that is displayed when .WARN is encountered during assembly. The comment must be preceded by a semicolon ( ; ).
Description
.WARN causes the assembler to display a warning message on the terminal or in the batch log le, and in the listing le (if there is one). Notes 1. .WARN, .ERROR, and .PRINT are called the message display directives. Use them to display information indicating that a macro call contains an error or an illegal set of conditions. 2. When the assembly is nished, the assembler displays on the terminal or in the batch log le, the total number of errors, warnings, and information messages, and the page numbers and line numbers of the lines causing the errors or warnings. 3. If .WARN is included in a macro library, end the comment with an additional semicolon. If you omit the semicolon, the comment will be stripped from the directive and will not be displayed when the macro is called. 4. The line containing the .WARN directive is not included in the listing le. 5. If the expression has a value of zero, it is not displayed in the warning message.
If the symbols FULL and DOUBLE_PREC are both dened, the following warning message is displayed: %MACRO-W-GENWRN, Generated WARNING: This combination not tested
.WEAK
Weak symbol attribute directive
Format
.WEAK symbol-list
Parameter
symbol-list A list of legal symbols separated by commas ( , ).
Description
.WEAK species symbols that are either dened externally in another module or dened globally in the current module. .WEAK suppresses any object library search for the symbol. When .WEAK species a symbol that is not dened in the current module, the symbol is externally dened. If the linker nds the symbols denition in another module, it uses that denition. If the linker does not nd an external denition, the symbol has a value of zero and the linker does not report an error. The linker does not search a library for the symbol, but if a module brought in from a library for another reason contains the symbol denition, the linker uses it. When .WEAK species a symbol that is dened in the current module, the symbol is considered to be globally dened. However, if this module is inserted in an object library, this symbol is not inserted in the librarys symbol table. Consequently, searching the library at link time to resolve this symbol does not cause the module to be included.
Example
.WEAK IOCAR,LAB_3
.WORD
Word storage directive
Format
.WORD expression-list
Parameters
expression-list One or more expressions separated by commas ( , ). You have the option of following each expression by a repetition factor delimited with square brackets ( [ ] ). An expression followed by a repetition factor has the format: expression1[expression2] expression1 An expression that species the value to be stored. [expression2] An expression that species the number of times the value will be repeated. The expression must not contain any undened symbols and must be an absolute expression (see Section 3.5). The square brackets are required.
Description
.WORD generates successive words (2 bytes) of data in the object module. Notes 1. The expression is rst evaluated as a longword, then truncated to a word. The value of the expression should be in the range of -32,768 to +32,767 for signed data or 0 to 65,535 for unsigned data. The assembler displays an error if the high-order 2 bytes of the longword expression have a value other than zero or ^XFFFF. 2. The .SIGNED_WORD directive is the same as .WORD except that the assembler displays a diagnostic message if a value is in the range from 32,768 to 65,535.
Example
.WORD ^X3F,FIVE[3],32
7
Terminology and Conventions
The following sections describe terminology and conventions used in Part II of this volume.
7.1 Numbering
All numbers, unless otherwise indicated, are decimal. Where there is ambiguity, numbers other than decimal are indicated with the base in English following the number in parentheses. For example: FF (hex)
7.4 MBZ
Fields specied as MBZ (must be zero) must never be lled by software with a nonzero value. If the processor encounters a nonzero value in a eld specied as MBZ, a reserved operand fault or abort occurs if that eld is accessible to nonprivileged software. MBZ elds that are accessible only to privileged software (kernel mode) cannot be checked for nonzero value by some or all VAX implementations. Nonzero values in MBZ elds accessible only to privileged software may produce UNDEFINED operation.
7.5 RAZ
Fields specied as RAZ (read as zero) return a zero when read.
7.6 SBZ
Fields specied as SBZ (should be zero) should be lled by software with a zero value. Non-zero values in SBZ elds produce UNPREDICTABLE results and may produce extraneous instruction-issue delays.
7.7 Reserved
Unassigned values of elds are reserved for future use. In many cases, some values are indicated as reserved to CSS and customers. Only these values should be used for nonstandard applications. The values indicated as reserved to Compaq and all MBZ (must be zero) elds are to be used only to extend future standard architecture.
8
Basic Architecture
The following sections describe the basic VAX architecture, including the following: Address space Data types Processor status longword (PSL) Permanent exception enables Instruction and addressing mode formats
Basic Architecture 81
Where confusion may be possible, this manual uses the term scalar to describe objects belonging to the scalar part of the architecture as in scalar instructions and scalar processor. Similarily, the term vector is used to describe parts belonging to the vector part of the architecture as in vector registers, and vector instructions. With the exception of Chapter 10, instructions, exceptions, registers, and other objects described in the rest of the this manual refer to the scalar part of the architecture unless otherwise stated.
8.3.1 Byte
A byte is 8 contiguous bits starting on an addressable byte boundary. The bits are numbered from right to left 0 to 7. 7 0 :A
ZK 1119A GE
A byte is specied by its address A. When interpreted arithmetically, a byte is a twos complement integer with bits of increasing signicance ranging from bit 0 to bit 6, with bit 7 the sign bit. The value of the integer is in the range -128 to +127. For the purposes of addition, subtraction, and comparison, VAX instructions also provide direct support for the interpretation of a byte as an unsigned integer with bits of increasing signicance ranging from bit 0 to bit 7. The value of the unsigned integer is in the range 0 to 255.
8.3.2 Word
A word is 2 contiguous bytes starting on an arbitrary byte boundary. The 16 bits are numbered from right to left 0 to 15.
15 0 :A
ZK 1120A GE
A word is specied by its address, A, which is the address of the byte containing bit 0. When interpreted arithmetically, a word is a twos complement integer with bits of increasing signicance ranging from bit 0 to bit 14, with bit 15 the
82 Basic Architecture
8.3.3 Longword
A longword is 4 contiguous bytes starting on an arbitrary byte boundary. The 32 bits are numbered from right to left 0 to 31.
31 0 :A
ZK 1121A GE
A longword is specied by its address, A, which is the address of the byte containing bit 0. When interpreted arithmetically, a longword is a twos complement integer with bits of increasing signicance ranging from bit 0 to bit 30, with bit 31 the sign bit. The value of the integer is in the range 2,147,483,648 to +2,147,483,647. For the purposes of addition, subtraction, and comparison, VAX instructions also provide direct support for the interpretation of a longword as an unsigned integer with bits of increasing signicance ranging from bit 0 to bit 31. The value of the unsigned integer is in the range 0 to 4,294,967,295.
8.3.4 Quadword
A quadword is 8 contiguous bytes starting on an arbitrary byte boundary. The 64 bits are numbered from right to left 0 to 63.
31 0 :A : A+4 63 32
ZK 1122A GE
A quadword is specied by its address, A, which is the address of the byte containing bit 0. When interpreted arithmetically, a quadword is a twos complement integer with bits of increasing signicance ranging from bit 0 to bit 62, with bit 63 the sign bit. The value of the integer is in the range -2**63 to +2**63-1. The quadword data type is not fully supported by VAX instructions.
8.3.5 Octaword
An octaword is 16 contiguous bytes starting on an arbitrary byte boundary. The 128 bits are numbered from right to left 0 to 127.
Basic Architecture 83
31
127
96
ZK 1123A GE
An octaword is specied by its address, A, which is the address of the byte containing bit 0. When interpreted arithmetically, an octaword is a twos complement integer with bits of increasing signicance ranging from bit 0 to bit 126, with bit 127 the sign bit. The value of the integer is in the range -2**127 to +2**127-1. The octaword data type is not fully supported by VAX instructions.
8.3.6 F_oating
An F_oating datum is 4 contiguous bytes starting on an arbitrary byte boundary. The 32 bits are labeled from right to left 0 to 31. 15 14 S exp fraction 7 6 fraction 0 :A : A+2
ZK 1124A GE
An F_oating datum is specied by its address, A, which is the address of the byte containing bit 0. The form of an F_oating datum is sign magnitude with bit 15 as the sign bit, bits 14:7 as an excess 128 binary exponent, and bits 6:0 and 31:16 as a normalized 24-bit fraction with the redundant most-signicant fraction bit not represented. Within the fraction, bits of increasing signicance range from bits 16 to 31 and 0 to 6. The 8-bit exponent eld encodes the values 0 to 255. An exponent value of zero, together with a sign bit of zero, is taken to indicate that the F_oating datum has a value of zero. Exponent values of 1 to 255 indicate true binary exponents of -127 to +127. An exponent value of zero, together with a sign bit of 1, is taken as reserved. Floating-point instructions processing a reserved operand take a reserved operand fault (see Appendix E). The value of an F_oating datum is in the approximate range .29*10**-38 to 1.7*10**38. The precision of an F_oating datum is approximately one part in 2**23; that is, typically 7 decimal digits.
8.3.7 D_oating
A D_oating datum is 8 contiguous bytes starting on an arbitrary byte boundary. The bits are labeled from right to left 0 to 63.
84 Basic Architecture
15 14 S exp
A D_oating datum is specied by its address, A, which is the address of the byte containing bit 0. The form of a D_oating datum is identical to an F_oating datum except for additional 32 low-signicance fraction bits. Within the fraction, bits of increasing signicance range from bits 48 to 63, 32 to 47, 16 to 31, and 0 to 6. The exponent conventions and the approximate range of values are the same for D_oating as they are for F_oating. The precision of a D_oating datum is approximately one part in 2**55, typically, 16 decimal digits.
8.3.8 G_oating
A G_oating datum is 8 contiguous bytes starting on an arbitrary byte boundary. The bits are labeled from right to left 0 to 63. 15 14 S exp fraction fraction fraction 4 3 fract 0 :A : A+2 : A+4 : A+6
ZK 1126A GE
A G_oating datum is specied by its address, A, which is the address of the byte containing bit 0. The form of a G_oating datum is sign magnitude, with bit 15 as the sign bit, bits 14:4 as an excess 1024 binary exponent, and bits 3:0 and 63:16 as a normalized 53-bit fraction with the redundant most-signicant fraction bit not represented. Within the fraction, bits of increasing signicance range from bits 48 to 63, 32 to 47, 16 to 31, and 0 to 3. The 11-bit exponent eld encodes the values 0 to 2047. An exponent value of zero, together with a sign bit of zero, is taken to indicate that the G_oating datum has a value of zero. Exponent values of 1 to 2047 indicate true binary exponents of -1023 to +1023. An exponent value of zero, together with a sign bit of 1, is taken as reserved. Floating-point instructions processing a reserved operand take a reserved operand fault (see Appendix E). The value of a G_oating datum is in the approximate range .56*10**-308 to .9*10**308. The precision of a G_oating datum is approximately one part in 2**52; that is, typically 15 decimal digits.
Basic Architecture 85
An H_oating datum is specied by its address, A, which is the address of the byte containing bit 0. The form of an H_oating datum is sign magnitude with bit 15 as the sign bit, bits 14:0 as an excess 16,384 binary exponent, and bits 127:16 as a normalized 113-bit fraction with the redundant most-signicant fraction bit not represented. Within the fraction, bits of increasing signicance range from bits 112 to 127, 96 to 111, 80 to 95, 64 to 79, 48 to 63, 32 to 47, and 16 to 31. The 15-bit exponent eld encodes the values 0 to 32,767. An exponent value of zero, together with a sign bit of 0, is taken to indicate that the H_oating datum has a value of zero. Exponent values of 1 to 32,767 indicate true binary exponents of -16,383 to +16,383. An exponent value of zero, together with a sign bit of 1, is taken as reserved. Floating-point instructions processing a reserved operand take a reserved operand fault (see Appendix E). The value of an H_oating datum is in the approximate range .84*10**-4932 to .59*10**4932. The precision of an H_oating datum is approximately one part in 2**112, typically, 33 decimal digits.
The specication of a bit eld is indicated by the following gure, where the eld is the shaded area.
P+S P+S1 P P1 0 :A S1 0
ZK 1128A GE
86 Basic Architecture
The sign-extended, 29-bit byte offset is added to the address A; the resulting address species the byte in which the eld begins. The 3-bit, bit-within-byte eld encodes the starting position (0 to 7) of the eld within that byte. The VAX eld instructions provide direct support for the interpretation of a eld as a signed or unsigned integer. When interpreted as a signed integer, it is twos complement with bits of increasing signicance ranging from bits 0 to S-2; bit S-1 is the sign bit. When interpreted as an unsigned integer, bits of increasing signicance range from bits 0 to S-1. A eld of size zero has a value identically equal to zero. A variable-length bit eld may be contained in 1 to 5 bytes. From a memory management point of view, only the minimum number of aligned longwords necessary to contain the eld may be actually referenced. For bit elds in registers, the position is in the range 0 to 31. The position operand species the starting position (0 to 31) of the eld in the register. A variable-length bit eld may be contained in two registers if the sum of position and size exceeds 32.
31 P P1 0 Rn R [n+1] P+S P+S1
ZK 1130A GE
For further details on the specication of variable-length bit elds, see the descriptions of the variable-length bit eld instructions in Section 9.2.3.
Basic Architecture 87
0 :A
: A+L1 7 0
ZK 1131A GE
The address of a string species the rst character of a string. Thus XYZ is represented as follows: "X" "Y" "Z" :A : A+1 : A+2
ZK 1132A GE
Digit 0 1 2 3 4 5 6 7 8 9
Decimal 48 49 50 51 52 53 54 55 56 57
Hex 30 31 32 33 34 35 36 37 38 39
The highest-addressed byte of a trailing numeric string represents an encoding of both the least-signicant digit and the sign of the numeric string. The VAX
88 Basic Architecture
Because compilers of many manufacturers over the years have used the overpunch format and various card encodings, several variations in overpunch format have evolved. Typically, these alternate forms are accepted on input; the normal form is generated as the output for all operations. The valid representations of the digit and sign in each of the latter two formats is indicated in Table 81 and Table 82. Table 81 Representation of Least-Signicant Digit and Sign in Zoned Numeric Format
Digit 0 1 2 3 4 5 6 7 8 9 -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 Decimal 48 49 50 51 52 53 54 55 56 57 112 113 114 115 116 117 118 119 120 121 Hex 30 31 32 33 34 35 36 37 38 39 70 71 72 73 74 75 76 77 78 79 ASCII Character 0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y
Basic Architecture 89
The length L of a trailing numeric string must be in the range 0 to 31 (0 to 31 digits). The value of a zero-length string is zero. The address A of the string species the byte of the string containing the mostsignicant digit. Digits of decreasing signicance are assigned to increasing addresses. Thus 123 is represented as follows: Zoned Format or Unsigned 7 3 3 3 4 3 1 2 3 0 :A : A+1 : A+2 Overpunch Format 7 3 3 4 4 3 1 2 3 0 :A : A+1 : A+2
ZK 1133A GE
ZK 1134A GE
The preferred representation for + is ASCII +. All subsequent bytes contain an ASCII digit character, as indicated in the following table:
Digit 0 1 2 3 4 5 6 7 8 9 Decimal 48 49 50 51 52 53 54 55 56 57 Hex 30 31 32 33 34 35 36 37 38 39 ASCII character 0 1 2 3 4 5 6 7 8 9
The length L of a leading separate numeric string must be in the range 0 to 31 (0 to 31 digits). The value of a zero-length string is zero. The address A of the string species the byte of the string containing the sign. Digits of decreasing signicance are assigned to bytes of increasing addresses. Thus +123 is represented as follows:
7 2 3 3 3
4 3 B 1 2 3
ZK 1135A GE
The leading separate numeric string with a value of -123 is represented as follows: 7 2 3 3 3 4 3 D 1 2 3 0 :A : A+1 : A+2 : A+3
ZK 1136A GE
The preferred sign representation is 12 for + and 13 for -. The length L is the number of digits in the packed decimal string (not counting the sign); L must be
812 Basic Architecture
ZK 1137A GE
The packed decimal number -12 has a length of 2 and is represented as follows: 7 0 2 4 3 1 13 0 :A : A+1
ZK 1138A GE
ZK 1139A GE
The processor status word (PSW), bits 0 to 15 of the processor status longword, contains the following codes: The condition codes, which give information on the results produced by previous VAX scalar instructions. The exception enable codes, which control the processor action on certain VAX scalar exception conditions (see Appendix E).
8.4.1 C Bit
The C (carry) condition code bit, when set, indicates that the last instruction that affected C had a carry out of the most-signicant bit of the result, or a borrow into the most-signicant bit. When C is clear, no carry or borrow occurred.
8.4.2 V Bit
The V (overow) condition code bit, when set, indicates that the last instruction that affected V produced a result whose magnitude was too large to be properly represented in the operand that received the result, or that there was a conversion error. When V is clear, no overow or conversion error occurred.
8.4.3 Z Bit
The Z (zero) condition code, when set, indicates that the last instruction that affected Z produced a result that was zero. When Z is clear, the result was nonzero.
8.4.4 N Bit
The N (negative) condition code bit, when set, indicates that the last instruction that affected N produced a negative result. When N is clear, the result was positive (or zero).
8.4.5 T Bit
The T (trace) bit, when set at the beginning of an instruction, causes the TP bit in the Processor Status Longword to be set. When TP is set at the end of an instruction, a trace fault is taken before the execution of the next instruction. See Appendix E for additional information on the TP bit and the trace fault.
8.4.6 IV Bit
The IV (integer overow) bit, when set, forces an integer overow trap after execution of an instruction that produced an integer result that overowed or had a conversion error. When IV is clear, no integer overow trap occurs. (However, the condition code V bit is still set.)
8.4.7 FU Bit
The FU (oating underow) bit, when set, forces a oating underow fault if the result of a oating-point instruction is too small in magnitude to be represented in the result operand. When FU is clear, no underow fault occurs.
ZK 1140A GE
The opcode may extend over 2 bytes; the length depends on the contents of the byte at address A. If, and only if, the value of the byte is FC (hex) to FF (hex), the opcode is 2 bytes long. 15 opcode 8 7 FC FF 0 :A
ZK 1141A GE
For the address and branch access types, which do not directly reference operands, the data type indicates: Addressthe operand size to be used in the address calculation in autoincrement, autodecrement, and index modes Branchthe size of the branch displacement
Note In the formal descriptions of the addressing modes, the symbol for a register (for example, Rn or PC) always means the contents of the register (for example, the contents of register n or the contents of register 15). However, in text, when there is no ambiguity, the symbol for a register is often used as the name of a register (for example, Rn may be used for the name of register n, and PC may be used for the name of register 15).
Each general mode addressing description includes the denition of the operand address and the specied operand. For operand speciers of address access type, the operand address is the actual instruction operand. For other access types, the specied operand is the instruction operand. The branch mode addressing description includes the denition of the branch address.
No specier extension follows. In register mode addressing, the operand is the contents of either register n or (for quadword, D_oating, and certain eld operands) register n+1 concatenated with register n.
operand = Rn or R[n+1]Rn or R[n+3]R[n+2]R[n+1]Rn ! If four registers ! If two registers ! If 1 register
No specier extension follows. If Rn denotes the PC, immediate data follows, and the mode is termed immediate mode. In autoincrement mode addressing, the address of the operand is the contents of register n. After the operand address is determined, the size of the operand in bytes (1 for byte; 2 for word; 4 for longword and F_oating; 8 for quadword, G_oating, and D_oating; and 16 for octaword and H_oating) is added to the contents of register n, and the contents of register n are replaced by the result. OA = Rn Rn <- Rn + size operand = (OA) The assembler notation for autoincrement mode is (Rn)+. For immediate mode, the notation is I^#constant, where constant is the immediate data that follows.
No specier extension follows. If Rn denotes the PC, a longword address follows and the mode is termed absolute mode. In autoincrement deferred mode addressing, the address of the operand is the contents of a longword whose address is the contents of register n. After the operand address is determined, 4 (the size in bytes of a longword address) is added to the contents of register n and the contents of register n are replaced by the result. OA = (Rn) Rn <- Rn + 4
No specier extension follows. In autodecrement mode addressing, the size of the operand in bytes (1 for byte; 2 for word; 4 for longword and F_oating; 8 for quadword, G_oating, and D_ oating; and 16 for octaword and H_oating) is subtracted from the contents of register n, and the contents of register n are replaced by the result. The updated contents of register n are the address of the operand. Rn <- Rn - size OA = Rn operand = (OA) The assembler notation for autodecrement mode is -(Rn).
The specier extension is a signed byte displacement that follows the operand specier. This is the byte displacement mode. 7 12 4 3 Rn
ZK 1148A GE
The specier extension is a signed word displacement that follows the operand specier. This is the word displacement mode. 7 14 4 3 Rn
ZK 1149A GE
The specier extension is a signed byte displacement that follows the operand specier. This is the byte displacement deferred mode. 7 13 4 3 Rn
ZK 1151A GE
The specier extension is a signed word displacement that follows the operand specier. This is the word displacement deferred mode. 7 15 4 3 Rn
ZK 1152A GE
The specier extension is a longword displacement that follows the operand specier. This is the longword displacement deferred mode. In displacement deferred mode addressing, the displacement (after it is sign extended to 32 bits, if it is byte or word displacement) is added to the contents of register n, and the result is the address of a longword whose contents are the operand address.
No specier extension follows. For operands of data type byte, word, longword, quadword, and octaword, the operand is the zero extension of the 6-bit literal eld. operand = ZEXT(literal) Thus, for these data types, you may use literal mode for values in the range 0 to 63. For operands of data type F_oating, G_oating, D_oating, and H_oating, the 6-bit literal eld is composed of two, 3-bit elds. These elds are illustrated in the following diagram, where exp is exponent and fra is fraction: 5 exp 3 2 fra 0
ZK 1154A GE
You use the exponent and fraction elds to form an F_oating or D_oating operand as follows: 15 14 0 128 + exp 0 0 0 7 6 fra 4 3 0 :A + 2 :A + 4 :A + 6
ZK 1155A GE
You use the exponent and fraction elds to form an H_oating operand as follows: 15 14 0 fra 16,384 + exp 0 0 0 0 0 0 0 :A + 2 :A + 4 :A + 6 :A + 8 :A + 10 :A + 12 :A + 14
ZK 1157A GE
The range of values available is given in Table 83 and Table 84 in both decimal and rational number notation. Table 83 Floating-Point Literals Expressed as Decimal Numbers
Exponent 0 1 2 3 4 5 6 7 0 0.5 1.0 2.0 4.0 8.0 16.0 32.0 64.0 1 0.5625 1.125 2.25 4.5 9.0 18.0 36.0 72.0 2 0.625 1.25 2.5 5.0 10.0 20.0 40.0 80.0 3 0.6875 1.37 2.75 5.5 11.0 22.0 44.0 88.0 4 0.75 1.5 3.0 6.0 12.0 24.0 48.0 96.0 5 0.8125 1.625 3.25 6.5 13.0 26.0 52.0 104.0 6 0.875 1.75 3.5 7.0 14.0 28.0 56.0 112.0 7 0.9375 1.875 3.75 7.5 15.0 30.0 60.0 120.0
Bits 15:8 contain a second operand specier (termed the base operand specier) for any of the addressing modes except register, literal, or index. The specication of register, literal, or index addressing mode results in an illegal addressing mode fault (see Appendix E). If the base operand specier requires it, a specier extension immediately follows. The base operand specier is subject to the same restrictions as would apply if it were used alone. If the use of some particular specier is illegal (that is, causes a fault or UNPREDICTABLE behavior) under some circumstances, then that specier is similarly illegal as a base operand specier in index mode under the same circumstances. The operand to be specied by index mode addressing is termed the primary operand. You normally use the base operand specier to determine an operand address. This address is termed the base operand address (BOA). The address of the primary operand specied is determined by multiplying the contents of the index register x by the size of the primary operand in bytes (1 for byte; 2 for word; 4 for longword and F_oating; 8 for quadword, D_oating, and G_oating; and 16 for octaword and H_oating), adding BOA, and taking the result. OA = BOA + {size * (Rx)} operand = (OA) If the base operand specier is for autoincrement or autodecrement mode, the increment or decrement size is the size in bytes of the primary operand. Certain restrictions are placed on the index register x. You cannot use the PC as an index register. If you use it, a reserved addressing mode fault occurs (see Appendix E). If the base operand specier is for an addressing mode that results in register modication (that is, autoincrement mode, autodecrement mode, or autoincrement deferred mode), the same register cannot be the index register. If it is, the primary operand address is UNPREDICTABLE.
ZK 1326A GE
r mw a v y u u y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y
Can Be Indexed? u y y y y y y y
The operand specier is a signed word displacement. In branch displacement addressing, the byte or word displacement is sign extended to 32 bits and added to the updated address in the PC. The updated address in the PC is the location of the rst byte beyond the operand specier. The result is the branch address A. A = PC + SEXT(displ) The assembler notation for byte and word branch displacement addressing is A, where A is the branch address. Note that you must use the branch address, and not the displacement.
9
VAX Instruction Set
The following sections describe the native-mode instruction set. The instructions are divided into groups according to their function and are listed alphabetically within each group.
Within each major section, instructions that are closely related are combined into groups and described together. The instruction group description is composed of the following: The group name.
Operand Specier Notation Operand speciers are described as follows: name . access-type data-type name A mnemonic name for the operand in the context of the instruction. The name is often abbreviated. access-type A letter denoting the operand specier access type:
a Calculate the effective address of the specied operand. Address is returned in a longword that is the actual instruction operand. Context of address calculation is given by data-type; that is, size to be used in autoincrement, autodecrement, and indexing. No operand reference. Operand specier is a branch displacement. Size of branch displacement is given by data-type. Operand is read, potentially modied, and written. Note that this is not an indivisible memory operation. Also note that if the operand is not actually modied, it may not be written back. However, modify type operands are always checked for both read and write accessibility. Operand is read only. Calculate the effective address of the specied operand. If the effective address is in memory, the address is returned in a longword that is the actual instruction operand. Context of address calculation is given by data-type. If the effective address is Rn, the operand is in Rn or R[n+1]Rn. Operand is written only.
b m
r v
Operation Description Notation The operation of an instruction is given as a sequence of control and assignment statements in an ALGOL-like syntax. No attempt is made to formally dene the syntax; it is assumed to be familiar to the reader. The notation used is an extension of the notation introduced in Section 8.7.
+ * / ** <= Rn or R[n] PC, SP, FP, or AP PSW PSL (x) (x)+ -(x) <x:y> <x1,x2,...,xn> {} AND OR XOR NOT LSS LSSU LEQ Addition Subtraction, unary minus Multiplication Division (quotient only) Exponentiation Concatenation Is replaced by Is dened as Contents of register Rn The contents of register R15, R14, R13, or R12, respectively The contents of the processor status word The contents of the processor status longword Contents of memory location whose address is x Contents of memory location whose address is x; x incremented by the size of operand referenced at x x decremented by size of operand to be referenced at x; contents of memory location whose address is x A modier that delimits an extent from bit position x to bit position y inclusive A modier that enumerates bits x1,x2,...,xn Arithmetic parentheses used to indicate precedence Logical AND Logical OR Logical XOR Logical (ones) complement Less than signed Less than unsigned Less than or equal signed
Use the following conventions: Other than alterations caused by (x)+, or -(x), and the advancement of the program counter (PC), only operands or portions of operands appearing on the left side of assignment statements are affected. No operator precedence is assumed, except that replacement (<-) has the lowest precedence. Precedence is indicated explicitly by { }. All arithmetic, logical, and relational operators are dened in the context of their operands. For example, + applied to oating operands means a oating add, while + applied to byte operands is an integer byte add. Similarly, LSS is a oating comparison when applied to oating operands, while LSS is an integer byte comparison when applied to byte operands. Instruction operands are evaluated according to the operand specier conventions (see Chapter 8). The order in which operands appear in the instruction description has no effect on the order of evaluation. Condition codes generally indicate the effect of an operation on the value of actual stored results, not on true results (which might be generated internally to greater precision). For example, two positive integers can be added together and the sum stored as a negative value because of overow. The condition codes indicate a negative value even though the true result is clearly positive.
VAX Instruction Set 9.2 Instruction Descriptions 9.2.1 Integer Arithmetic and Logical Instructions
The following instructions are described in this section:
Number of Instructions 1 3 3 1 2 3 3 3 3 3 5 3 6
Description and Opcode 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Add Aligned Word ADAWI add.rw, sum.mw Add 2 Operand ADD{B,W,L}2 add.rx, sum.mx Add 3 Operand ADD{B,W,L}3 add1.rx, add2.rx, sum.wx Add with Carry ADWC add.rl, sum.ml Arithmetic Shift ASH{L,Q} cnt.rb, src.rx, dst.wx Bit Clear 2 Operand BIC{B,W,L}2 mask.rx, dst.mx Bit Clear 3 Operand BIC{B,W,L}3 mask.rx, src.rx, dst.wx Bit Set 2 Operand BIS{B,W,L}2 mask.rx, dst.mx Bit Set 3 Operand BIS{B,W,L}3 mask.rx, src.rx, dst.wx Bit Test BIT{B,W,L} mask.rx, src.rx Clear CLR{B,W,L,Q,O} dst.wx Compare CMP{B,W,L} src1.rx, src2.rx Convert CVT{B,W,L}{B,W,L} src.rx, dst.wy All pairs except BB,WW,LL Decrement DEC{B,W,L} dif.mx Divide 2 Operand DIV{B,W,L}2 divr.rx, quo.mx Divide 3 Operand DIV{B,W,L}3 divr.rx, divd.rx, quo.wx Extended Divide EDIV divr.rl, divd.rq, quo.wl, rem.wl Extended Multiply EMUL mulr.rl, muld.rl, add.rl, prod.wq Increment INC{B,W,L} sum.mx Move Complemented MCOM{B,W,L} src.rx, dst.wx Move Negated MNEG{B,W,L} src.rx, dst.wx Move OV{B,W,L,Q} src.rx, dst.wx
3 3 3 1 1 3 3 3 4
Description and Opcode 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. Move Zero-Extended MOVZ{BW,BL,WL} src.rx, dst.wy Multiply 2 Operand MUL{B,W,L}2 mulr.rx, prod.mx Multiply 3 Operand MUL{B,W,L}3 mulr.rx, muld.rx, prod.wx Push Long PUSHL src.rl, {-(SP).wl} Rotate Long ROTL cnt.rb, src.rl, dst.wl Subtract with Carry SBWC sub.rl, dif.ml Subtract 2 Operand SUB{B,W,L}2 sub.rx, dif.mx Subtract 3 Operand SUB{B,W,L}3 sub.rx, min.rx, dif.wx Test TST{B,W,L} src.rx Exclusive OR 2 Operand XOR{B,W,L}2 mask.rx, dst.mx Exclusive OR 3 Operand XOR{B,W,L}3 mask.rx, src.rx, dst.wx
ADAWI
Add Aligned Word Interlocked
Format
opcode add.rw, sum.mw
Condition Codes
N Z V C Exceptions reserved operand fault integer overow < < < < sum LSS 0; sum EQL 0; {integer overow}; {carry from most-signicant bit};
Opcodes
58 ADAWI Add Aligned Word Interlocked
Description
The addend operand is added to the sum operand, and the sum operand is replaced by the result. If the sum operand is contained in memory, then the operation is interlocked against interlocked operations to the same address from other processors. The destination must be aligned on a word boundary; that is, bit 0 of the address of the sum operand must be zero. If it is not, a reserved operand fault is taken. Notes 1. Integer overow occurs if the input operands to the add have the same sign, and the result has the opposite sign. On overow, the sum operand is replaced by the low-order bits of the true result. 2. If the addend and the sum operands overlap, the result and the condition codes are UNPREDICTABLE.
ADD
Add
Format
2operand: 3operand: opcode opcode add.rx, sum.mx add1.rx, add2.rx, sum.wx
Condition Codes
N Z V C Exceptions integer overow < < < < sum LSS 0; sum EQL 0; {integer overow}; {carry from most-signicant bit};
Opcodes
80 81 A0 A1 C0 C1 ADDB2 ADDB3 ADDW2 ADDW3 ADDL2 ADDL3 Add Add Add Add Add Add Byte 2 Operand Byte 3 Operand Word 2 Operand Word 3 Operand Long 2 Operand Long 3 Operand
Description
In 2 operand format, the addend operand is added to the sum operand and the sum operand is replaced by the result. In 3 operand format, the addend 1 operand is added to the addend 2 operand and the sum operand is replaced by the result. Note Integer overow occurs if the input operands to the add have the same sign and the result has the opposite sign. On overow, the sum operand is replaced by the low-order bits of the true result.
ADWC
Add with Carry
Format
opcode add.rl, sum.ml
Condition Codes
N Z V C Exceptions integer overow < < < < sum LSS 0; sum EQL 0; {integer overow}; {carry from most-signicant bit};
Opcodes
D8 ADWC Add with Carry
Description
The contents of the condition code C-bit and the addend operand are added to the sum operand and the sum operand is replaced by the result. Notes 1. On overow, the sum operand is replaced by the low-order bits of the true result. 2. The two additions in the operation are performed simultaneously.
ASH
Arithmetic Shift
Format
opcode cnt.rb, src.rx, dst.wx
Condition Codes
N Z V C Exceptions integer overow < < < < dst LSS 0; dst EQL 0; {integer overow}; 0;
Opcodes
78 79 ASHL ASHQ Arithmetic Shift Long Arithmetic Shift Quad
Description
The source operand is arithmetically shifted by the number of bits specied by the count operand and the destination operand is replaced by the result. The source operand is unaffected. A positive count operand shifts to the left, bringing zeros into the least signicant bit. A negative count operand shifts to the right, bringing in copies of the most signicant (sign) bit into the most signicant bit. A zero count operand replaces the destination operand with the unshifted source operand. Notes 1. Integer overow occurs on a left shift if any bit shifted into the sign bit position differs from the sign bit of the source operand. 2. If cnt GTR 32 (ASHL) or cnt GTR 64 (ASHQ), the destination operand is replaced by zero. 3. If cnt LEQ -31 (ASHL) or cnt LEQ -63 (ASHQ), all the bits of the destination operand are copies of the sign bit of the source operand.
BIC
Bit Clear
Format
2operand: 3operand: opcode opcode mask.rx, dst.mx mask.rx, src.rx, dst.wx
Condition Codes
N Z V C Exceptions None. < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
8A 8B AA AB CA CB BICB2 BICB3 BICW2 BICW3 BICL2 BICL3 Bit Bit Bit Bit Bit Bit Clear Clear Clear Clear Clear Clear Byte Byte Word Word Long Long
Description
In 2 operand format, the result of the logical AND on the destination operand and the ones complement of the mask operand replaces the destination operand. In 3 operand format, the result of the logical AND on the source operand and the ones complement of the mask operand replaces the destination operand.
BIS
Bit Set
Format
2operand: 3operand: opcode opcode mask.rx, dst.mx mask.rx, src.rx, dst.wx
Condition Codes
N Z V C Exceptions None. < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
88 89 A8 A9 C8 C9 BISB2 BISB3 BISW2 BISW3 BISL2 BISL3 Bit Bit Bit Bit Bit Bit Set Set Set Set Set Set Byte 2 Operand Byte 3 Operand Word 2 Operand Word 3 Operand Long 2 Operand Long 3 Operand
Description
In 2 operand format, the result of the logical OR on the mask operand and the destination operand replaces the destination operand. In 3 operand format, the result of the logical OR on the mask operand and the source operand replaces the destination operand.
BIT
Bit Test
Format
opcode mask.rx, src.rx
Condition Codes
N Z V C Exceptions None. < < < < tmp LSS 0; tmp EQL 0; 0; C;
Opcodes
93 B3 D3 BITB BITW BITL Bit Test Byte Bit Test Word Bit Test Long
Description
The logical AND is performed on the mask operand and the source operand. Both operands are unaffected. The only action is to modify condition codes.
CLR
Clear
Format
opcode dst.wx
Condition Codes
N Z V C Exceptions None. < < < < 0; 1; 0; C;
Opcodes
94 B4 D4 7C 7CFD CLRB CLRW CLRL CLRQ CLRO Clear Clear Clear Clear Clear Byte Word Long Quad Octa
Description
The destination operand is replaced by zero. Note CLRx dst is equivalent to MOVx S^#0, dst, but is 1 byte shorter.
CMP
Compare
Format
opcode src1.rx, src2.rx
Condition Codes
N Z V C Exceptions None. < < < < src1 LSS src2; src1 EQL src2; 0; src1 LSSU src2;
Opcodes
91 B1 D1 CMPB CMPW CMPL Compare Byte Compare Word Compare Long
Description
The source 1 operand is compared with the source 2 operand. The only action is to modify the condition codes.
CVT
Convert
Format
opcode src.rx, dst.wy
Condition Codes
N Z V C Exceptions integer overow < < < < dst LSS 0; dst EQL 0; {integer overow}; 0;
Opcodes
99 98 33 32 F6 F7 CVTBW CVTBL CVTWB CVTWL CVTLB CVTLW Convert Convert Convert Convert Convert Convert Byte to Word Byte to Long Word to Byte Word to Long Long to Byte Long to Word
Description
The source operand is converted to the data type of the destination operand and the destination operand is replaced by the result. Conversion of a shorter data type to a longer one is done by sign extension; conversion of longer data type to a shorter one is done by truncation of the higher-numbered (most signicant) bits. Note Integer overow occurs if any truncated bits of the source operand are not equal to the sign bit of the destination operand.
DEC
Decrement
Format
opcode dif.mx
Condition Codes
N Z V C Exceptions integer overow < < < < dif LSS 0; dif EQL 0; {integer overow}; {borrow into most signicant bit};
Opcodes
97 B7 D7 DECB DECW DECL Decrement Byte Decrement Word Decrement Long
Description
One is subtracted from the difference operand, and the difference operand is replaced by the result. Notes 1. Integer overow occurs if the largest negative integer is decremented. On overow, 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: 3operand: opcode opcode divr.rx, quo.mx divr.rx, divd.rx, quo.wx
Condition Codes
N Z V C Exceptions integer overow divide by zero < < < < quo LSS 0; quo EQL 0; {integer overow} OR {divr EQL 0}; 0;
Opcodes
86 87 A6 A7 C6 C7 DIVB2 DIVB3 DIVW2 DIVW3 DIVL2 DIVL3 Divide Divide Divide Divide Divide Divide Byte 2 Operand Byte 3 Operand Word 2 Operand Word 3 Operand Long 2 Operand 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 overow occurs only if the largest negative integer is divided by -1. On overow, 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 Z V C Exceptions integer overow divide by zero < < < < quo LSS 0; quo EQL 0; {integer overow} OR {divr EQL 0}; 0;
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 overow, 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 Z V C Exceptions None. < < < < prod LSS 0; prod EQL 0; 0; 0;
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 nal result.
INC
Increment
Format
opcode sum.mx
Condition Codes
N Z V C Exceptions integer overow < < < < sum LSS 0; sum EQL 0; {integer overow}; {carry from most signicant bit};
Opcodes
96 B6 D6 INCB INCW INCL Increment Byte Increment Word Increment Long
Description
One is added to the sum operand and the sum operand is replaced by the result. Notes 1. Arithmetic overow occurs if the largest positive integer is incremented. On overow, 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 Z V C Exceptions None. < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
92 B2 D2 MCOMB MCOMW MCOML Move Complemented Byte Move Complemented Word Move Complemented Long
Description
The destination operand is replaced by the ones complement of the source operand.
MNEG
Move Negated
Format
opcode src.rx, dst.wx
Condition Codes
N Z V C Exceptions integer overow < < < < dst LSS 0; dst EQL 0; {integer overow}; dst NEQ 0;
Opcodes
8E AE CE MNEGB MNEGW MNEGL Move Negated Byte Move Negated Word Move Negated Long
Description
The destination operand is replaced by the negative of the source operand. Note Integer overow occurs if the source operand is the largest negative integer (which has no positive counterpart). On overow, the destination operand is replaced by the source operand.
MOV
Move
Format
opcode src.rx, dst.wx
Condition Codes
N Z V C Exceptions None. < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
90 B0 D0 7D 7DFD MOVB MOVW MOVL MOVQ MOVO Move Move Move Move Move Byte Word Long Quad Octa
Description
The destination operand is replaced by the source operand.
MOVZ
Move Zero-Extended
Format
opcode src.rx, dst.wy
Condition Codes
N Z V C Exceptions None. < < < < 0; dst EQL 0; 0; C;
Opcodes
9B 9A 3C MOVZBW MOVZBL MOVZWL Move Zero-Extended Byte to Word Move Zero-Extended Byte to Long 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: 3operand: opcode opcode mulr.rx, prod.mx mulr.rx, muld.rx, prod.wx
Condition Codes
N Z V C Exceptions integer overow < < < < prod LSS 0; prod EQL 0; {integer overow}; 0;
Opcodes
84 85 A4 A5 C4 C5 MULB2 MULB3 MULW2 MULW3 MULL2 MULL3 Multiply Multiply Multiply Multiply Multiply Multiply Byte 2 Operand Byte 3 Operand Word 2 Operand Word 3 Operand Long 2 Operand 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 overow 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 Z V C Exceptions None. < < < < src LSS 0; src EQL 0; 0; C;
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 Z V C Exceptions None. < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
9C ROTL Rotate Long
Description
The source operand is rotated logically by the number of bits specied 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 Z V C Exceptions integer overow < < < < dif LSS 0; dif EQL 0; {integer overow}; {borrow into most signicant bit};
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 overow, 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: 3operand: opcode opcode sub.rx, dif.mx sub.rx, min.rx, dif.wx
Condition Codes
N Z V C Exceptions integer overow < < < < dif LSS 0; dif EQL 0; {integer overow}; {borrow into most signicant bit};
Opcodes
82 83 A2 A3 C2 C3 SUBB2 SUBB3 SUBW2 SUBW3 SUBL2 SUBL3 Subtract Subtract Subtract Subtract Subtract Subtract Byte 2 Operand Byte 3 Operand Word 2 Operand Word 3 Operand Long 2 Operand 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 overow 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 overow, the difference operand is replaced by the low-order bits of the true result.
TST
Test
Format
opcode src.rx
Condition Codes
N Z V C Exceptions None. < < < < src LSS 0; src EQL 0; 0; 0;
Opcodes
95 B5 D5 TSTB TSTW TSTL Test Byte Test Word Test Long
Description
The condition codes are modied according to the value of the source operand. Note The operand src is equivalent to CMPx src, S^#0, but is 1 byte shorter.
XOR
Exclusive OR
Format
2operand: 3operand: opcode opcode mask.rx, dst.mx mask.rx, src.rx, dst.wx
Condition Codes
N Z V C Exceptions None. < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
8C 8D AC AD CC CD XORB2 XORB3 XORW2 XORW3 XORL2 XORL3 Exclusive Exclusive Exclusive Exclusive Exclusive Exclusive OR OR OR OR OR OR Byte 2 Operand Byte 3 Operand Word 2 Operand Word 3 Operand Long 2 Operand Long 3 Operand
Description
In 2 operand format, the result of the logical XOR on the mask operand and the destination operand replaces the destination operand. In 3 operand format, the result of the logical XOR on the mask operand and the source operand replaces the destination operand.
Description and Opcode 1. 2. Move Address MOVA{B,W,L=F,Q=D=G,O=H} src.ax, dst.wl Push Address PUSHA{B,W,L=F,Q=D=G,O=H} src.ax, {-(SP).wl}
MOVA
Move Address
Format
opcode src.ax, dst.wl
Condition Codes
N Z V C Exceptions None. < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
9E 3E DE 7E MOVAB MOVAW MOVAL MOVAF MOVAQ MOVAD MOVAG MOVAH MOVAO Move Move Move Move Move Move Move Move Move Address Address Address Address Address Address Address Address Address Byte Word Long F_oating Quad D_oating G_oating H_oating Octa
7EFD
Description
The destination operand is replaced by the source operand. The context in which the source operand is evaluated is given by the data type of the instruction. The operand whose address replaces the destination operand is not referenced. Note The access type of the source operand is address, which causes the address of the specied operand to be moved.
PUSHA
Push Address
Format
opcode src.ax
Condition Codes
N Z V C Exceptions None. < < < < src LSS 0; src EQL 0; 0; C;
Opcodes
9F 3F DF 7F PUSHAB PUSHAW PUSHAL PUSHAF PUSHAQ PUSHAD PUSHAG PUSHAH PUSHAO Push Push Push Push Push Push Push Push Push Address Address Address Address Address Address Address Address Address Byte Word Long, F_oating Quad, D_oating, G_oating H_oating Octa
7FFD
Description
The source operand is pushed on the stack. The context in which the source operand is evaluated is given by the data type of the instruction. The operand whose address is pushed is not referenced. Notes 1. PUSHAx src is equivalent to MOVAx src, -(SP), but is one byte shorter. 2. The source operand is of address access type, which causes the address of the specied operand to be pushed.
Description and Opcode 1. Compare Field CMPV pos.rl, size.rb, base.vb, {eld.rv}, src.rl Compare Zero-Extended Field CMPZV pos.rl, size.rb, base.vb, {eld.rv}, src.rl Extract Field EXTV pos.rl, size.rb, base.vb, {eld.rv}, dst.wl Extract Zero-Extended Field EXTZV pos.rl, size.rb, base.vb, {eld.rv}, dst.wl Find First FF{S,C} startpos.rl, size.rb, base.vb, {eld.rv}, ndpos.wl Insert Field INSV src.rl, pos.rl, size.rb, base.vb, {eld.wv}
2.
3.
4.
5.
6.
Description and Opcode 1. Branch on Bit BB{S,C} pos.rl, base.vb, displ.bb, {eld.rv} Branch on Bit (and modify without interlock) BB{S,C}{S,C} pos.rl, base.vb, displ.bb, {eld.mv} Branch on Bit (and modify) Interlocked BB{SS,CC}I pos.rl, base.vb, displ.bb, {eld.mv}
2.
3.
CMP
Compare Field
Format
opcode pos.rl, size.rb, base.vb, src.rl
Condition Codes
N Z V C Exceptions reserved operand < < < < tmp LSS src; tmp EQL src; 0; tmp LSSU src;
Opcodes
EC ED CMPV CMPZV Compare Field Compare Zero-Extended Field
Description
The eld specied by the position, size, and base operands is compared with the source operand. For CMPV, the source operand is compared with the sign-extended eld. For CMPZV, the source operand is compared with the zero-extended eld. The only action is to affect the condition codes. Notes 1. A reserved operand fault occurs if: size GTRU 32 pos GTRU 31, size NEQ 0, and the eld is contained in the registers
EXT
Extract Field
Format
opcode pos.rl, size.rb, base.vb, dst.wl
Condition Codes
N Z V C Exceptions reserved operand < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
EE EF EXTV EXTZV Extract Field Extract Zero-Extended Field
Description
For EXTV, the destination operand is replaced by the sign-extended eld specied by the position, size, and base operands. For EXTZV, the destination operand is replaced by the zero-extended eld specied by the position, size, and base operands. If the size operand is zero, the only action is to replace the destination operand with zero and to modify the condition codes. Notes 1. A reserved operand fault occurs if: size GTRU 32 pos GTRU 31, size NEQ 0, and the eld is contained in the registers
2. On a reserved operand fault, the destination operand is unaffected, and the condition codes are UNPREDICTABLE.
FF
Find First
Format
opcode startpos.rl, size.rb, base.vb, ndpos.wl
Condition Codes
N Z V C Exceptions reserved operand < < < < 0; {bit not found}; 0; 0;
Opcodes
EB EA FFC FFS Find First Clear Find First Set
Description
A eld specied by the start position, size, and base operands is extracted. Starting at bit 0 and extending to the highest bit in the eld, the eld is tested for a bit in the state indicated by the instruction. If a bit in the indicated state is found, the nd position operand is replaced by the position of the bit, and the Z condition code bit is cleared. If no bit in the indicated state is found, the nd position operand is replaced by the position (relative to the base) of a bit one position to the left of the specied eld, and the Z condition code bit is set. If the size operand is zero, the nd position operand is replaced by the start position operand, and the Z condition code bit is set. Notes 1. A reserved operand fault occurs if: size GTRU 32 startpos GTRU 31, size NEQ 0, and the eld is contained in the registers
2. On a reserved operand fault, the nd position operand is unaffected, and the condition codes are UNPREDICTABLE.
INSV
Insert Field
Format
opcode src.rl, pos.rl, size.rb, base.vb
Condition Codes
N Z V C Exceptions reserved operand < < < < N; Z; V; C;
Opcodes
F0 INSV Insert Field
Description
size
The eld specied by the position, size, and base operands is replaced by bits 0 1 : 0 of the source operand. If the size operand is zero, the instruction has no effect. Notes 1. When executing INSV, a processor may read in the entire aligned longword or longwords that contains the eld, replace the eld portion of the aligned longword with the source operand, and write back the entire aligned longword. Because of this, data written to the noneld portion of the aligned longword in memory by another processor or I/O device during the execution of INSV may be written over when the INSV is completed. 2. A reserved operand fault occurs if: size GTRU 32 pos GTRU 31, size NEQ 0, and the eld is contained in the registers
3. On a reserved operand fault, the eld is unaffected, and the condition codes are UNPREDICTABLE.
Description and Opcode 1. Add Compare and Branch ACB{B,W,L,F,D,G,H} limit.rx, add.rx, index.mx, displ.bw Compare is LE on positive add, GE on negative add. Add One and Branch Less Than or Equal AOBLEQ limit.rl, index.ml, displ.bb Add One and Branch Less Than AOBLSS limit.rl, index.ml, displ.bb Conditional Branch Condition LSS LEQ EQL, EQLU NEQ, NEQU GEQ GTR LSSU, CS LEQU GEQU, CC GTRU VS VC 5. Name Less Than Less Than or Equal Equal, Equal Unsigned Not Equal, Not Equal Unsigned Greater Than or Equal Greater Than Less Than Unsigned, Carry Set Less Than or Equal Unsigned Greater Than or Equal Unsigned, Carry Clear Greater Than Unsigned Overow Set Overow Clear
2. 3. 4.
1 1 12
Branch on Bit BB{S,C} pos.rl, base.vb, displ.bb, {eld.rv} Branch on Bit (and modify without interlock) BB{S,C}{S,C} pos.rl, base.vb, displ.bb, {eld.mv} Branch on Bit (and modify) Interlocked BB{SS,CC}I pos.rl, base.vb, displ.bb, {eld.mv} Branch on Low Bit BLB{S,C} src.rl, displ.bb Branch with {Byte, Word} Displacement BR{B,W} displ.bx
6.
7.
8. 9.
2 2
Description and Opcode 10. 11. Branch to Subroutine with {Byte, Word} Displacement BSB{B,W} displ.bx, {-(SP).wl} Case CASE{B,W,L} selector.rx, base.rx, limit.rx, displ.bw-list Jump JMP dst.ab Jump to Subroutine JSB dst.ab, {-(SP).wl} Return from Subroutine RSB {(SP)+.rl} Subtract One and Branch Greater Than or Equal SOBGEQ index.ml, displ.bb Subtract One and Branch Greater Than SOBGTR index.ml, displ.bb
1 1 1 1 1
ACB
Add Compare and Branch
Format
opcode limit.rx, add.rx, index.mx, displ.bw
Condition Codes
N Z V C Exceptions integer overow oating overow oating underow reserved operand < < < < index LSS 0; index EQL 0; {integer overow}; C;
Opcodes
9D 3D F1 4F 4FFD 6F 6FFD ACBB ACBW ACBL ACBF ACBG ACBD ACBH Add Add Add Add Add Add Add Compare Compare Compare Compare Compare Compare Compare and and and and and and and Branch Branch Branch Branch Branch Branch Branch Byte Word Long F_oating G_oating D_oating H_oating
Description
The addend operand is added to the index operand and the index operand is replaced by the result. The index operand is compared with the limit operand. If the addend operand is positive (or zero) and the comparison is less than or equal to zero, or if the addend is negative and the comparison is greater than or equal to zero, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Notes 1. ACB efciently implements the general FOR or DO loops in high-level languages, since the sense of the comparison between index and limit is dependent on the sign of the addend. 2. On integer overow, the index operand is replaced by the low-order bits of the true result. Comparison and branch determination proceed normally on the updated index operand.
AOBLEQ
Add One and Branch Less Than or Equal
Format
opcode limit.rl, index.ml, displ.bb
Condition Codes
N Z V C Exceptions integer overow < < < < index LSS 0; index EQL 0; {integer overow}; C;
Opcodes
F3 AOBLEQ Add One and Branch Less Than or Equal
Description
One is added to the index operand, and the index operand is replaced by the result. The index operand is compared with the limit operand. If the comparison is less than or equal to zero, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Notes 1. Integer overow occurs if the index operand before addition is the largest positive integer. On overow, the index operand is replaced by the largest negative integer, and the branch is taken. 2. The C-bit is unaffected.
AOBLSS
Add One and Branch Less Than
Format
opcode limit.rl, index.ml, displ.bb
Condition Codes
N Z V C Exceptions integer overow < < < < index LSS 0; index EQL 0; {integer overow}; C;
Opcodes
F2 AOBLSS Add One and Branch Less Than
Description
One is added to the index operand and the index operand is replaced by the result. The index operand is compared with the limit operand. If the comparison result is less than zero, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Notes 1. Integer overow occurs if the index operand before addition is the largest positive integer. On overow, the index operand is replaced by the largest negative integer, and thus (unless the limit operand is the largest negative integer), the branch is taken. 2. The C-bit is unaffected.
B
Branch on (condition)
Format
opcode displ.bb
Condition Codes
N Z V C Exceptions None. Opcodes 14 15 12 13 18 19 1A 1B 1C 1D 1E {N OR Z} EQL 0 {N OR Z} EQL 1 Z EQL 0 Z EQL 1 N EQL 0 N EQL 1 {C OR Z} EQL 0 {C OR Z} EQL 1 V EQL 0 V EQL 1 C EQL 0 BGTR BLEQ BNEQ, BNEQU BEQL, BEQLU BGEQ BLSS BGTRU BLEQU BVC BVS BGEQU, BCC BLSSU, BCS Branch on Greater Than (signed) Branch on Less Than or Equal (signed) Branch on Not Equal (signed) Branch on Not Equal Unsigned Branch on Equal (signed) Branch on Equal Unsigned Branch on Greater Than or Equal (signed) Branch on Less Than (signed) Branch on Greater Than Unsigned Branch Less Than or Equal Unsigned Branch on Overow Clear Branch on Overow Set Branch on Greater Than or Equal Unsigned Branch on Carry Clear Branch on Less Than Unsigned Branch on Carry Set < < < < N; Z; V; C;
1F
C EQL 1
Typically, you would use these instructions to check for overow (when overow traps are not enabled), for multiprecision arithmetic, and for other special purposes. 2. Unsigned Group BLSSU BLEQU BEQLU BNEQU BGEQU BGTRU C EQL 1 {C OR Z} EQL 1 Z EQL 1 Z EQL 0 C EQL 0 {C OR Z} EQL 0
These instructions typically follow integer and eld instructions where the operands are treated as unsigned integers, address instructions, and character string instructions. 3. Signed Group BLSS BLEQ BEQL BNEQ BGEQ BGTR N EQL 1 {N OR Z} EQL 1 Z EQL 1 Z EQL 0 N EQL 0 {N OR Z} EQL 0
These instructions typically follow oating-point instructions, decimal string instructions, and integer and eld instructions where the operands are being treated as signed integers.
BB
Branch on Bit
Format
opcode pos.rl, base.vb, displ.bb
Condition Codes
N Z V C Exceptions reserved operand < < < < N; Z; V; C;
Opcodes
E0 E1 BBS BBC Branch on Bit Set Branch on Bit Clear
Description
The single bit eld specied by the position and base operands is tested. If it is in the test state indicated by the instruction, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Notes 1. A reserved operand fault occurs if pos GTRU 31 and the bit specied is contained in a register. 2. On a reserved operand fault, the condition codes are UNPREDICTABLE.
BB
Branch on Bit (and modify without interlock)
Format
opcode pos.rl, base.vb, displ.bb
Condition Codes
N Z V C Exceptions reserved operand < < < < N; Z; V; C;
Opcodes
E2 E3 E4 E5 BBSS BBCS BBSC BBCC Branch Branch Branch Branch on on on on Bit Bit Bit Bit Set and Set Clear and Set Set and Clear Clear and Clear
Description
The single bit eld specied by the position and base operands is tested. If it is in the test state indicated by the instruction, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Regardless of whether the branch is taken or not, the tested bit is put in the new state as indicated by the instruction. Notes 1. A reserved operand fault occurs if pos GTRU 31 and the bit is contained in a register. 2. On a reserved operand fault, the eld is unaffected, and the condition codes are UNPREDICTABLE. 3. The modication of the bit is not an interlocked operation. See BBSSI and BBCCI for interlocking instructions.
BB
Branch on Bit Interlocked
Format
opcode pos.rl, base.vb, displ.bb
Condition Codes
N Z V C Exceptions reserved operand < < < < N; Z; V; C;
Opcodes
E6 E7 BBSSI BBCCI Branch on Bit Set and Set Interlocked Branch on Bit Clear and Clear Interlocked
Description
The single bit eld specied by the position and base operands is tested. If it is in the test state indicated by the instruction, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Regardless of whether the branch is taken, the tested bit is put in the new state as indicated by the instruction. If the bit is contained in memory, the reading of the state of the bit and the setting of the bit to the new state is an interlocked operation. No other processor or I/O device can do an interlocked access on this bit during the interlocked operation. Notes 1. A reserved operand fault occurs if pos GTRU 31 and the specied bit is contained in a register. 2. On a reserved operand fault, the eld is unaffected, and the condition codes are UNPREDICTABLE. 3. Except for memory interlocking, BBSSI is equivalent to BBSS, and BBCCI is equivalent to BBCC. 4. This instruction is designed to modify interlocks with other processors or devices. For example, to implement busy waiting: 1$: BBSSI bit,base,1$
BLB
Branch on Low Bit
Format
opcode src.rl, displ.bb
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
E8 E9 BLBS BLBC Branch on Low Bit Set Branch on Low Bit Clear
Description
The low bit (bit 0) of the source operand is tested. If it is equal to the test state indicated by the instruction, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result.
BR
Branch
Format
opcode displ.bx
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
11 31 BRB BRW Branch with Byte Displacement Branch with Word Displacement
Description
The sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result.
BSB
Branch to Subroutine
Format
opcode displ.bx
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
10 30 BSBB BSBW Branch to Subroutine with Byte Displacement Branch to Subroutine with Word Displacement
Description
The program counter (PC) is pushed on the stack as a longword. The signextended branch displacement is added to the PC, and the PC is replaced by the result.
CASE
Case
Format
opcode selector.rx, base.rx, limit.rx, displ[0].bw, ..., displ[limit].bw
Condition Codes
N Z V C Exceptions None. < < < < tmp LSS limit; tmp EQL limit; 0; tmp LSSU limit;
Opcodes
8F AF CF CASEB CASEW CASEL Case Byte Case Word Case Long
Description
The base operand is subtracted from the selector operand, and the result replaces a temporary operand. The temporary operand is compared with the limit operand; if it is less than or equal unsigned, a branch displacement selected by the temporary value is added to the program counter (PC), and the PC is replaced by the result. Otherwise, twice the sum of the limit operand and 1 is added to the PC, and the PC is replaced by the result. This operation causes the PC to be moved past the array of branch displacements. Regardless of the branch taken, the condition codes are modied as a result of the comparison of the temporary operand with the limit operand. Notes 1. After operand evaluation, the PC points at displ[0], not to the next instruction. The branch displacements are relative to the address of displ[0]. 2. The selector and base operands can both be considered as either signed or unsigned integers. In the following example, the CASEB instruction selects one of eight displacements immediately following the instruction. The example is for illustration only. An actual instruction would use run-time variables instead of the assembly-time static values shown. Also, in an actual instruction, the displacements selected by the CASEB instruction would be branches to various routines.
JMP
Jump
Format
opcode dst.ab
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
17 JMP Jump
Description
The program counter (PC) is replaced by the destination operand.
JSB
Jump to Subroutine
Format
opcode dst.ab
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
16 JSB Jump to Subroutine
Description
The program counter (PC) is pushed onto the stack as a longword. The PC is replaced by the destination operand. Note Because the operand specier conventions cause the evaluation of the destination operand before saving the PC, you can use JSB for coroutine calls with the stack used for linkage. The form of this call is: JSB @(SP)+
RSB
Return from Subroutine
Format
opcode
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
05 RSB Return from Subroutine
Description
The program counter (PC) is replaced by a longword popped from the stack. Notes 1. Use RSB to return from subroutines called by the BSBB, BSBW, and JSB instructions. 2. RSB is equivalent to JMP @(SP)+, but is 1 byte shorter.
SOBGEQ
Subtract One and Branch Greater Than or Equal
Format
opcode index.ml, displ.bb
Condition Codes
N Z V C Exceptions integer overow < < < < index LSS 0; index EQL 0; {integer overow}; C;
Opcodes
F4 SOBGEQ Subtract One and Branch Greater Than or Equal
Description
One is subtracted from the index operand, and the index operand is replaced by the result. If the index operand is greater than or equal to zero, the signextended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Notes 1. Integer overow occurs if the index operand before subtraction is the largest negative integer. On overow, the index operand is replaced by the largest positive integer; therefore, the branch is taken. 2. The C-bit is unaffected.
SOBGTR
Subtract One and Branch Greater Than
Format
opcode index.ml, displ.bb
Condition Codes
N Z V C Exceptions integer overow < < < < index LSS 0; index EQL 0; {integer overow}; C;
Opcodes
F5 SOBGTR Subtract One and Branch Greater Than
Description
One is subtracted from the index operand, and the index operand is replaced by the result. If the index operand is greater than zero, the sign-extended branch displacement is added to the program counter (PC), and the PC is replaced by the result. Notes 1. Integer overow occurs if the index operand before subtraction is the largest negative integer. On overow, the index operand is replaced by the largest positive integer, and thus, the branch is taken. 2. The C-bit is unaffected.
CALLG and CALLS call the procedure. The RETURN instruction returns from the procedure. Refer to the OpenVMS Programming Concepts Manual for the procedure calling standard. The CALLG instruction calls a procedure with the argument list in an arbitrary location. The CALLS instruction calls a procedure with the argument list on the stack. Upon return after a CALLS instruction, this list is automatically removed from the stack. Both call instructions specify the address of the entry point of the procedure being called. The entry point is assumed to consist of a word called the entry mask followed by the procedures instructions. The procedure terminates by executing a RET instruction. The entry mask species the register use and overow enables of the subprocedure. 15 14 13 12 11 D V I V MBZ Registers
ZK 1162A GE
At the occurrence of one of the call instructions, the stack is aligned to a longword boundary, and the trap enables in the processor status longword (PSW) are set to a known state to ensure consistent behavior of the called procedure. Integer overow enable and decimal overow enable are affected according to bits 14 and 15 of the entry mask, respectively. Floating underow enable is cleared. Registers R11 to R0, specied by bits 11 to 0, respectively, are saved on the stack and are restored by the RET instruction. In addition, the program counter (PC), stack pointer (SP), frame pointer (FP), and argument pointer (AP) are always preserved by the CALL instructions and restored by the RET instruction. All external procedure calls generated by standard Compaq language processors and all intermodule calls to major VAX software subsystems comply with the procedure calling software standard (see the VAX Procedure Calling and Condition Handling Standard in the OpenVMS Programming Concepts Manual). The procedure calling standard requires that all registers in the range R2 to R11 used in the procedure must appear in the mask. R0 and R1 are not preserved by any called procedure that complies with the procedure calling standard. To preserve the state, the CALL instructions form a structure on the stack termed a call frame or stack frame. The call frame contains the saved registers, the saved PSW, the register save mask, and several control bits. The frame also includes a longword that the CALL instructions clear. The system uses this longword to implement the OpenVMS condition handling facility (see the VAX Procedure Calling and Condition Handling Standard in the OpenVMS Programming Interfaces: Calling a System Routine). At the end of execution of
Saved R11 (...) (0 to 3 bytes specified by SPA, Stack Pointer Alignment) S = set if CALLS; clear if CALLG.
ZK 1163A GE
Note that the saved condition codes and the saved trace enable (PSW<T>) are cleared. The contents of the frame PSW<3:0> at the time RET is executed will become the condition codes resulting from the execution of the procedure. Similarly, the content of the frame PSW<4> at the time the RET is executed will become the PSW<T> bit. The following instructions are described in this section.
Number of Instructions 1 1 1
Description and Opcode 1. 2. 3. Call Procedure with General Argument List CALLG arglist.ab, dst.ab, {-(SP).w*} Call Procedure with Stack Argument List CALLS numarg.rl, dst.ab, {-(SP).w*} Return from Procedure RET {(SP)+.r*}
CALLG
Call Procedure with General Argument List
Format
opcode arglist.ab, dst.ab
Condition Codes
N Z V C Exceptions reserved operand < < < < 0; 0; 0; 0;
Opcodes
FA CALLG Call Procedure with General Argument List
Description
The stack pointer (SP) is saved in a temporary register. Bits 1:0 are replaced by zero, so that the stack is longword aligned. The procedure entry mask is scanned from bit 11 to bit 0, and the contents of registers whose numbers correspond to set bits in the mask are pushed on the stack as longwords. The program counter (PC), frame pointer (FP), and argument pointer (AP) are pushed on the stack as longwords. The condition codes are cleared. A longword containing the saved low 2 bits of the SP in bits 31:30, a zero in bits 29 and 28, the low 12 bits of the procedure entry mask in bits 27:16, and the processor status word (PSW) in bits 15:0 with T cleared are pushed on the stack. A longword zero is pushed on the stack. The FP is replaced by the SP. The AP is replaced by the arglist operand. The trap enables in the PSW are set to a known state. Integer overow and decimal overow are affected according to bits 14 and 15 of the entry mask, respectively; oating underow is cleared. The T-bit is unaffected. The PC is replaced by the sum of destination operand plus 2, which transfers control to the called procedure at the byte beyond the entry mask.
: (SP) : (FP) Frame (0 to 3 bytes specified by SPA)
ZK 1164A GE
Stack
Notes 1. If bits 13:12 of the entry mask are not zero, a reserved operand fault occurs. 2. On a reserved operand fault, condition codes are UNPREDICTABLE.
Refer to the VAX Procedure Calling and Condition Handling Standard in the OpenVMS Programming Concepts Manual.
CALLS
Call Procedure with Stack Argument List
Format
opcode numarg.rl, dst.ab
Condition Codes
N Z V C Exceptions reserved operand < < < < 0; 0; 0; 0;
Opcodes
FB CALLS Call Procedure with Stack Argument List
Description
The numarg operand is pushed on the stack as a longword (byte 0 contains the number of arguments; Compaq software uses the high-order 24 bits). The stack pointer (SP) is saved in a temporary register, and then bits 1:0 of the SP are replaced by zero so that the stack is longword aligned. The procedure entry mask is scanned from bit 11 to bit 0, and the contents of registers whose numbers correspond to set bits in the mask are pushed on the stack. The program counter (PC), frame pointer (FP), and argument pointer (AP) are pushed on the stack as longwords. The condition codes are cleared. A longword containing the saved low 2 bits of the SP in bits 31:30, a 1 in bit 29, a zero in bit 28, the low 12 bits of the procedure entry mask in bits 27:16, and the processor status word (PSW) in bits 15:0 with T cleared is pushed on the stack. A longword zero is pushed on the stack. The FP is replaced by the SP. The AP is set to the value of the stack pointer after the numarg operand was pushed on the stack. The trap enables in the PSW are set to a known state. Integer overow and decimal overow are affected according to bits 14 and 15 of the entry mask, respectively. Floating underow is cleared. The T-Bit is unaffected.
Stack
: (AP)
Notes 1. If bits 13:12 of the entry mask are not zero, a reserved operand fault occurs. 2. On a reserved operand fault, the condition codes are UNPREDICTABLE. 3. Normal use is to push the arglist onto the stack in reverse order prior to the CALLS. On return, the arglist is removed from the stack automatically. 4. The procedure calling standard and the condition handling facility require the following register saving conventions: R0 and R1 are always available for function return values and are never saved in the entry mask. All registers R2 to R11 that are modied in the called procedure must be preserved in the entry mask. Refer to the VAX Procedure Calling and Condition Handling Standard in the OpenVMS Programming Concepts Manual.
RET
Return from Procedure
Format
opcode
Condition Codes
N Z V C Exceptions reserved operand < < < < tmp1<3>; tmp1<2>; tmp1<1>; tmp1<0>;
Opcodes
04 RET Return from Procedure
Description
The stack pointer (SP) is replaced by the frame pointer (FP) plus 4. A longword containing stack alignment bits in bits 31:30, a CALLS/CALLG ag in bit 29, the low 12 bits of the procedure entry mask in bits 27:16, and a saved processor status word (PSW) in bits 15:0 is popped from the stack and saved in a temporary. The program counter (PC), frame pointer (FP), and argument pointer (AP) are replaced by longwords popped from the stack. A register restore mask is formed from bits 27:16 of the temporary. Scanning from bit 0 to bit 11 of the restore mask, the contents of registers whose numbers are indicated by set bits in the mask are replaced by longwords popped from the stack. The SP is incremented by 31:30 of the temporary. The PSW is replaced by bits 15:0 of the temporary. If bit 29 in the temporary is 1 (indicating that the procedure was called by CALLS), a longword containing the number of arguments is popped from the stack. Four times the unsigned value of the low byte of this longword is added to the SP, and the SP is replaced by the result. Notes 1. A reserved operand fault occurs if tmp1<15:8> NEQ 0. 2. On a reserved operand fault, the condition codes are UNPREDICTABLE. 3. The value of tmp1<28> is ignored. 4. The procedure calling standard and condition handling facility assume that procedures which return a function value or a status code do so in R0, or R0 and R1. Refer to the VAX Procedure Calling and Condition Handling Standard in the OpenVMS Programming Concepts Manual.
Description and Opcode 1. 2. 3. 4. 5. Bit Clear PSW BICPSW mask.rw Bit Set PSW BISPSW mask.rw Breakpoint Fault BPT {-(KSP).w*} Halt HALT {-(KSP).w*} Index INDEX subscript.rl, low.rl, high.rl, size.rl, indexin.rl, indexout.wl Move from PSL MOVPSL dst.wl No Operation NOP Pop Registers POPR mask.rw, {(SP)+.r*} Push Registers PUSHR mask.rw, {-(SP).w*} Extended Function Call XFC {unspecied operands}
6. 7. 8. 9. 10.
1 1 1 1 1
BICPSW
Bit Clear PSW
Format
opcode mask.rw
Condition Codes
N Z V C Exceptions reserved operand < < < < N AND {NOT mask<3>}; Z AND {NOT mask<2>}; V AND {NOT mask<1>}; C AND {NOT mask<0>};
Opcodes
B9 BICPSW Bit Clear PSW
Description
The result of the logical AND on processor status word (PSW) and the ones complement of the mask operand replaces PSW. Note A reserved operand fault occurs if mask<15:8> is not zero. On a reserved operand fault, the PSW is not affected.
BISPSW
Bit Set PSW
Format
opcode mask.rw
Condition Codes
N Z V C Exceptions reserved operand < < < < N OR mask<3>; Z OR mask<2>; V OR mask<1>; C OR mask<0>;
Opcodes
B8 BISPSW Bit Set PSW
Description
The result of the logical OR on processor status word (PSW) and the mask operand replaces PSW. Note A reserved operand fault occurs if mask<15:8> is not zero. On a reserved operand fault, the PSW is not affected.
BPT
Breakpoint Fault
Format
opcode
Condition Codes
N Z V C Exceptions None. < < < < 0; ! Condition codes cleared after BPT fault 0; 0; 0;
Opcodes
03 BPT Breakpoint Fault
Description
To understand the operation of this instruction, refer to Appendix E. This instruction, together with the T-bit, is used to implement debugging facilities.
HALT
Halt
Format
opcode
Condition Codes
N Z V C N Z V C Exceptions privileged instruction < < < < < < < < 0; 0; 0; 0; ! ! ! ! If privileged instruction fault, condition codes are cleared after the fault. PSL saved on stack contains condition codes prior to HALT.
N; ! If processor halt Z; V; C;
Opcodes
00 HALT Halt
Description
If the process is running in kernel mode, the processor is halted. Otherwise, a privileged instruction fault occurs. For information about privileged instruction faults, refer to Appendix E. Note This opcode is zero to trap many branches to data.
INDEX
Compute Index
Format
opcode subscript.rl, low.rl, high.rl, size.rl, indexin.rl, indexout.wl
Condition Codes
N Z V C Exceptions subscript range < < < < indexout LSS 0; indexout EQL 0; 0; 0;
Opcodes
0A INDEX index
Description
The indexin operand is added to the subscript operand and the sum multiplied by the size operand. The indexout operand is replaced by the result. If the subscript operand is less than the low operand or greater than the high operand, a subscript range trap is taken. Notes 1. No arithmetic exception other than subscript range can result from this instruction. Therefore, no indication is given if overow occurs in either the add or the multiply steps. If overow occurs on the add step, the sum is the low-order 32 bits of the true result. If overow occurs on the multiply step, the indexout operand is replaced by the low-order 32 bits of the true product of the sum and the subscript operand. In the normal use of this instruction, overow cannot occur without a subscript range trap occurring. 2. The index instruction is useful in index calculations for arrays of the xedlength data types (integer and oating) and for index calculations for arrays of bit elds, character strings, and decimal strings. The indexin operand permits cascading INDEX instructions for multidimensional arrays. For onedimensional bit eld arrays, it also permits introduction of the constant portion of an index calculation that is not readily absorbed by address arithmetic. The following notes show some of the uses of INDEX.
MOVPSL
Move from PSL
Format
opcode dst.wl
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
DC MOVPSL Move from PSL
Description
The destination operand is replaced by processor status longword (PSL).
NOP
No Operation
Format
opcode
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
01 NOP No Operation
Description
No operation is performed. Because the time delay caused by a NOP instruction is dependent on processor type, Compaq recommends that you do not use NOP as a means of delaying program execution. When you must have a program wait for a specied period, you should use a macro, such as the TIMEDWAIT macro, or code sequence that is not dependent on the processors internal speed.
POPR
Pop Registers
Format
opcode mask.rw
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
BA POPR Pop Registers
Description
The contents of registers whose numbers correspond to set bits in the mask operand are replaced by longwords popped from the stack. R[n] is replaced if mask<n> is set. The mask is scanned from bit 0 to bit 14. Bit 15 is ignored.
PUSHR
Push Registers
Format
opcode mask.rw
Condition Codes
N Z V C Exceptions None. < < < < N; Z; V; C;
Opcodes
BB PUSHR Push Registers
Description
The contents of registers whose numbers correspond to set bits in the mask operand are pushed on the stack as longwords. R[n] is pushed if mask<n> is set. The mask is scanned from bit 14 to bit 0. Bit 15 is ignored. Note The order of pushing is specied so that the contents of higher-numbered registers are stored at higher memory addresses. An example of a result of this would be a double-oating datum stored in adjacent registers being stored by PUSHR in memory in the correct order.
XFC
Extended Function Call
Format
opcode
Condition Codes
N Z V C Exceptions None. < < < < 0; 0; 0; 0;
Opcodes
FC XFC Extended Function Call
Description
To understand the operation of this instruction, refer to Appendix E and the VAX Architecture Reference Manual. This instruction provides for customer-dened extensions to the instruction set.
0 :H : H+4
If an entry at address B is inserted into an empty queue (at either the head or the tail), the queue appears as follows:
31 B B 31 31 H H 31 0
ZK 1167A GE
0 :H : H+4 0 0 :B : B+4
Following the preceding steps in reverse order gives the effect of removal at the tail and removal at the head. If more than one process can perform operations on a queue simultaneously, insertions and removals should only be done at the head or tail of the queue. If only one process (or one process at a time) can perform operations on a queue, insertions and removals can be made at other than the head or tail of the queue. In the preceding example with the queue containing entries A, B, and C, the entry at address B can be removed, giving the following:
31 A C 31 31 C H 31 31 H A 31
The reason for this restriction is that operations at the head or tail are always valid because the queue header is always present. Operations elsewhere in the queue depend on specic entries being present and may become invalid if another process is simultaneously performing operations on the queue. Two instructions are provided for manipulating absolute queues: INSQUE and REMQUE. INSQUE inserts an entry specied by an entry operand into the queue following the entry specied by the predecessor operand. REMQUE removes the entry specied by the entry operand. Queue entries can be on arbitrary byte boundaries. Both INSQUE and REMQUE are implemented as noninterruptible instructions. 9.2.7.2 Self-Relative Queues Self-relative queues use displacements from queue entries as links. Queue entries are linked by a pair of longwords. The rst (lowest addressed) longword is the forward link; it is the displacement of the succeeding queue entry from the present entry. The second (highest-addressed) longword is the backward link; it is the displacement of the preceding queue entry from the present entry. A queue is specied by a queue header, which also consists of two longword links. The forward link of the header is the address of the entry called the head of the queue. The backward link of the header is the address of the entry called the tail of the queue. The forward link of the tail points to the header. The following text contains examples of queue operations. An empty queue is specied by its header at address H. Because the queue is empty, the self-relative links must be zero, as shown.
31 0 0 31 0
ZK 1171A GE
0 :H : H+4
0 :H : H+4 0 0 :B : B+4
If an entry at address A is inserted at the head of the queue, the queue appears as follows:
31 AH BH 31 31 BA HA 31 31 HB AB 31 0
ZK 1173A GE
Finally, if an entry at address C is inserted at the tail, the queue appears as follows:
31 AH CH 31 31 BA HA 31 31 CB AB 31 31 HC BC 31
Following the previous steps in reverse order gives the effect of removal at the tail and at the head. The following four instructions manipulate self-relative queues: 1. INSQHIInsert entry into queue at head, interlocked. 2. INSQTIInsert entry into queue at tail, interlocked. 3. REMQHIRemove entry from queue at head, interlocked. 4. REMQTIRemove entry from queue at tail, interlocked. These operations are interlocked to allow cooperating processes in a multiprocessor system to access a shared list without additional synchronization. Queue entries must be quadword aligned. A hardware-supported interlocked memory access mechanism is used to read the queue header. Bit 0 of the queue header is used as a secondary interlock; it is set when the queue is being accessed. If an interlocked queue instruction encounters the secondary interlock set, then, if no exception conditions exist, it terminates after setting the condition codes to indicate failure to gain access to the queue. If the secondary interlock bit is not set, then the interlocked queue instruction sets the secondary interlock bit during instruction execution and clears the secondary interlock bit at instruction completion. In this way, other interlocked queue instructions are prevented from operating on the same queue. If an interlocked queue instruction encounters both the secondary interlock set and an exception condition resulting from instruction execution, then it is UNPREDICTABLE whether the exception occurs or the instruction terminates after setting the condition codes.
Description and Opcode 1. 2. 3. 4. 5. 6. Insert Entry into Queue at Head, Interlocked INSQHI entry.ab, header.aq Insert Entry into Queue at Tail, Interlocked INSQTI entry.ab, header.aq Insert Entry in Queue INSQUE entry.ab, pred.ab Remove Entry from Queue at Head, Interlocked REMQHI header.aq, addr.wl Remove Entry from Queue at Tail, Interlocked REMQTI header.aq, addr.wl Remove Entry from Queue REMQUE entry.ab, addr.wl
INSQHI
Insert Entry into Queue at Head, Interlocked
Format
opcode entry.ab, header.aq
Condition Codes
if {insertion succeeded} then begin N < 0; Z < (entry) EQL (entry+4); ! First entry in queue V < 0; C < 0; end; else begin N < 0; Z < 0; V < 0; C < 1; ! Secondary interlock failed end; Exceptions reserved operand
Opcodes
5C INSQHI Insert Entry into Queue at Head, Interlocked
Description
The entry specied by the entry operand is inserted into the queue following the header. If the entry inserted was the rst one in the queue, the condition code Z-bit is set; otherwise it is cleared. The insertion is a noninterruptible operation. The insertion is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
INSQTI
Insert Entry into Queue at Tail, Interlocked
Format
opcode entry.ab, header.aq
Condition Codes
if {insertion succeeded} then begin N < 0; Z < (entry) EQL (entry+4); ! First entry in queue V < 0; C < 0; end; else begin N < 0; Z < 0; V < 0; C < 1; ! Secondary interlock failed end; Exceptions reserved operand
Opcodes
5D INSQTI Insert Entry into Queue at Tail, Interlocked
Description
The entry specied by the entry operand is inserted into the queue preceding the header. If the entry inserted was the rst one in the queue, the condition code Z-bit is set; otherwise, it is cleared. The insertion is a noninterruptible operation. The insertion is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
INSQUE
Insert Entry in Queue
Format
opcode entry.ab, pred.ab
Condition Codes
N Z V C Exceptions None. < < < < (entry) LSS (entry+4); (entry) EQL (entry+4); ! First entry in queue 0; (entry) LSSU (entry+4);
Opcodes
0E INSQUE Insert Entry in Queue
Description
The entry specied by the entry operand is inserted into the queue following the entry specied by the predecessor operand. If the entry inserted was the rst one in the queue, the condition code Z-bit is set; otherwise it is cleared. The insertion is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. Notes 1. The following three types of insertion can be performed by appropriate choice of the predecessor operand: Insert at head: INSQUE entry, h Insert at tail: INSQUE entry,@h+4 ; h is queue head (Note "@" in this case only) Insert after arbitrary predecessor: INSQUE entry,p ; p is predecessor ; h is queue head
2. Because the insertion is noninterruptible, processes running in kernel mode can share queues with interrupt service routines. 3. The INSQUE and REMQUE instructions are implemented such that cooperating software processes in a single processor may access a shared list without additional synchronization, if the insertions and removals are only at the head or tail of the queue.
REMQHI
Remove Entry from Queue at Head, Interlocked
Format
opcode header.aq, addr.wl
Condition Codes
if {removal succeeded} then begin N < 0; Z < (header) EQL 0; ! Queue empty after removal V < {queue empty before this instruction}; C < 0; end; else begin N < 0; Z < 0; V < 1; ! Did not remove anything C < 1; ! Secondary interlock failed end; Exceptions reserved operand
Opcodes
5E REMQHI Remove Entry from Queue at Head, Interlocked
Description
If the secondary interlock is clear, the queue entry following the header is removed from the queue and the address operand is replaced by the address of the entry removed. If the queue was empty prior to this instruction, or if the secondary interlock failed, the condition code V-bit is set; otherwise it is cleared. If the interlock succeeded and the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise, it is cleared. The removal is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. The removal is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
2$: 4. To remove entries until the queue is empty, you can use the following: 1$: REMQHI ... BVS 2$ . process removed entry . BR 1$ . BCS 1$ queue empty ; Anything removed? ; No
2$
5. During access validation, any access that cannot be completed results in a memory management exception, even though the queue removal is not started. 6. A reserved operand fault occurs if header or (header + (header)) is an address that is not quadword aligned (that is, <2:0> NEQU 0) or if (header)<2:1> is not zero. A reserved operand fault also occurs if the header address operand equals the address of the addr operand. In this case, the queue is not altered. 7. If the instruction encounters both the secondary interlock set and an exception condition resulting from instruction execution, then it is UNPREDICTABLE whether the exception occurs or the instruction terminates after setting the condition codes.
REMQTI
Remove Entry from Queue at Tail, Interlocked
Format
opcode header.aq, addr.wl
Condition Codes
if {removal succeeded} then begin N < 0; Z < (header + 4) EQL 0; ! Queue empty after removal V < {queue empty before this instruction}; C < 0; end; else begin N < 0; Z < 0; V < 1; ! Did not remove anything C < 1; ! Secondary interlock failed end; Exceptions reserved operand
Opcodes
5F REMQTI Remove Entry from Queue at Tail, Interlocked
Description
If the secondary interlock is clear, the queue entry preceding the header is removed from the queue and the address operand is replaced by the address of the entry removed. If the queue was empty prior to this instruction, or if the secondary interlock failed, the condition code V-bit is set; otherwise it is cleared. If the interlock succeeded and the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise it is cleared. The removal is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process, even in a multiprocessor environment. The removal is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
2$: 4. To remove entries until the queue is empty, you can use the following: 1$: REMQTI ... BVS 2$ . process removed entry . BR 1$ . BCS 1$ queue empty ; Anything removed? ; No
2$:
5. During access validation, any access that cannot be completed results in a memory management exception, even though the queue removal is not started. 6. A reserved operand fault occurs if header, (header + 4), or (header + (header + 4)+4) is an address that is not quadword aligned (that is, <2:0> NEQU 0), or if (header)<2:1> is not zero. A reserved operand fault also occurs if the header address operand equals the address of the addr operand. In this case, the queue is not altered. 7. If the instruction encounters both the secondary interlock set and an exception condition resulting from instruction execution, then it is UNPREDICTABLE whether the exception occurs or the instruction terminates after setting the condition codes.
REMQUE
Remove Entry from Queue
Format
opcode entry.ab,addr.wl
Condition Codes
N Z V C Exceptions None. < < < < (entry) (entry) (entry) (entry) LSS (entry+4); EQL (entry+4); ! Queue empty EQL (entry+4); ! No entry to remove LSSU (entry+4);
Opcodes
0F REMQUE Remove Entry from Queue
Description
The queue entry specied by the entry operand is removed from the queue. The address operand is replaced by the address of the entry removed. If there was no entry in the queue to be removed, the condition code V-bit is set; otherwise it is cleared. If the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise it is cleared. The removal is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. Notes 1. The following three types of removal can be performed by suitable choice of entry operand: Remove at head: REMQUE @h,addr Remove at tail: REMQUE @h+4,addr Remove arbitrary entry: REMQUE entry,addr 2. Because the removal is noninterruptible, processes running in kernel mode can share queues with interrupt service routines. 3. The INSQUE and REMQUE instructions are implemented so that cooperating software processes in a single processor may access a shared list without additional synchronization, if the insertions and removals are only at the head or tail of the queue. ; h is queue header ; h is queue header
6. During access validation, any access that cannot be completed results in a memory management exception, even though the queue removal is not started.
To be consistent with the oating-point instruction set, which faults on reserved operands (see Chapter 8), software-implemented oating-point functions (for example, the absolute function) should verify that no input operands are reserved. An easy way to do this is a oating move or test of the input operands. To make high-speed, oating-point operations easier, restrictions are placed on the addressing mode combinations usable within a single oating-point instruction. These combinations involve the logically inconsistent simultaneous use of a value as both a oating-point operand and an address. If, within the same instruction, you use the contents of register Rn as both a part of a oating-point input operand (an .rf, .rd, .rg, .rh, .mf, .md, .mg, or .mh operand) and as an address in an addressing mode that modies Rn (autoincrement, autodecrement, or autoincrement deferred), the value of the oating-point operand is UNPREDICTABLE. 9.2.8.1 Introduction Mathematically, a oating-point number may be dened as having the following form:
(+or
0)(2 3 3 ) 3
K
where K is an integer and f is a nonnegative fraction. For a nonvanishing number, K and f are uniquely determined by imposing the following condition: 1/2 LEQ f LSS 1. The fractional factor, f, of the number is then said to be binary normalized. For the number 0, f must be assigned the value zero, and the value of K is indeterminate. VAX derives these oating-point data formats from this mathematical representation for oating-point numbers. Four types of oating-point data are provided: the two standard PDP-11 formats (F_oating and D_oating), and two extended-range formats (G_oating and H_oating). Single-precision, or oating, data is 32 bits long. Double-precision, or D_oating, data is 64 bits long. Extended-range double-precision, or G_oating, data is 64 bits long. Extended-range quadruple-precision, or H_oating, data is 128 bits long. Use sign magnitude notation as follows: 1. Nonzero oating-point numbers: The most signicant bit of the oating-point data is the sign bit: 0 for positive and 1 for negative.
choppedvalue
truevalue
If a stored result is not exact: Its magnitude is always less than that of the true result for chopping. Its magnitude is always less than that of the true result for rounding if the rounding bit is zero. Its magnitude is greater than that of the true result for rounding if the rounding bit is 1.
9.2.8.4 Instruction Descriptions The following instructions are described in this section:
Number of Instructions 4 4 3 4 34
Description and Opcode 1. 2. 3. 4. 5. Add 2 Operand ADD{F,D,G,H}2 add.rx, sum.mx Add 3 Operand ADD{F,D,G,H}3 add1.rx, add2.rx, sum.wx Clear CLR{L=F,Q=D=G,O=H} dst.wx Compare CMP{F,D,G,H} src1.rx, src2.rx Convert CVT{F,D,G,H}{B,W,L,F,D,G,H} src.rx, dst.wy CVT{B,W,L}{F,D,G,H} src.rx, dst.wy All pairs except FF,DD,GG,HH,DG, and GD Convert Rounded CVTR{F,D,G,H}L src.rx, dst.wl Divide 2 Operand DIV{F,D,G,H}2 divr.rx, quo.mx Divide 3 Operand DIV{F,D,G,H}3 divr.rx, divd.rx, quo.wx Extended Modulus EMOD{F,D} mulr.rx, mulrx.rb, muld.rx, int.wl, fract.wx EMOD{G,H} mulr.rx, mulrx.rw, muld.rx, int.wl, fract.wx Move Negated MNEG{F,D,G,H} src.rx, dst.wx Move MOV{F,D,G,H} src.rx, dst.wx Multiply 2 Operand MUL{F,D,G,H}2 mulr.rx, prod.mx
6. 7. 8. 9.
4 4 4 4
4 4 4
Description and Opcode 13. 14. Multiply 3 Operand MUL{F,D,G,H}3 mulr.rx, muld.rx, prod.wx Polynomial Evaluation F_oating POLYF arg.rf, degree.rw, tbladdr.ab, {R0-3.wl} Polynomial Evaluation D_oating POLYD arg.rd, degree.rw, tbladdr.ab, {R0-5.wl} Polynomial Evaluation G_oating POLYG arg.rg, degree.rw, tbladdr.ab, {R0-5.wl} Polynomial Evaluation H_oating POLYH arg.rh, degree.rw, tbladdr.ab, {R0-5.wl,-16(SP):-1(SP).wb} Subtract 2 Operand SUB{F,D,G,H}2 sub.rx, dif.mx Subtract 3 Operand SUB{F,D,G,H}3 sub.rx, min.rx, dif.wx Test TST{F,D,G,H} src.rx
15.
16.
17.
4 4 4
Description and Opcode 1. Add Compare and Branch ACB{F,D,G,H} limit.rx, add.rx, index.mx, displ.bw Compare is LE on positive add, GE on negative add.
ADD
Add
Format
2operand: 3operand: opcode opcode add.rx, sum.mx add1.rx, add2.rx, sum.wx
Condition Codes
N Z V C Exceptions oating overow oating underow reserved operand < < < < sum LSS 0; sum EQL 0; 0; 0;
Opcodes
40 41 60 61 40FD 41FD 60FD 61FD ADDF2 ADDF3 ADDD2 ADDD3 ADDG2 ADDG3 ADDH2 ADDH3 Add Add Add Add Add Add Add Add F_oating 2 Operand F_oating 3 Operand D_oating 2 Operand D_oating 3 Operand G_oating 2 Operand G_oating 3 Operand H_oating 2 Operand H_oating 3 Operand
Description
In 2 operand format, the addend operand is added to the sum operand, and the sum operand is replaced by the rounded result. In 3 operand format, the addend 1 operand is added to the addend 2 operand, and the sum operand is replaced by the rounded result. Notes 1. On a reserved operand fault, the sum operand is unaffected, and the condition codes are UNPREDICTABLE. 2. On oating underow, if FU is set, a fault occurs. Zero is stored as the result of oating underow only if FU is clear. On a oating underow fault, the sum operand is unaffected. If FU is clear, the sum operand is replaced by zero, and no exception occurs. 3. On oating overow, the instruction faults, the sum operand is unaffected, and the condition codes are UNPREDICTABLE.
CLR
Clear
Format
opcode dst.wx
Condition Codes
N Z V C Exceptions None. < < < < 0; 1; 0; C;
Opcodes
D4 7C 7CFD CLRF CLRD CLRG CLRH Clear Clear Clear Clear F_oating D_oating, G_oating H_oating
Description
The destination operand is replaced by zero. Note CLRx dst is equivalent to MOVx S^#0, dst, but is 1 byte shorter.
CMP
Compare
Format
opcode src1.rx, src2.rx
Condition Codes
N Z V C Exceptions reserved operand < < < < src1 LSS src2; src1 EQL src2; 0; 0;
Opcodes
51 71 51FD 71FD CMPF CMPD CMPG CMPH Compare Compare Compare Compare F_oating D_oating G_oating H_oating
Description
The source 1 operand is compared with the source 2 operand. The only action is to affect the condition codes.
CVT
Convert
Format
opcode src.rx, dst.wy
Condition Codes
N Z V C Exceptions integer overow oating overow oating underow reserved operand < < < < dst LSS 0; dst EQL 0; {integer overow}; 0;
Opcodes
4C 6C 4CFD 6CFD 4D 6D 4DFD 6DFD 4E 6E 4EFD 6EFD 48 68 48FD 68FD 49 69 49FD 69FD 4A CVTBF CVTBD CVTBG CVTBH CVTWF CVTWD CVTWG CVTWH CVTLF CVTLD CVTLG CVTLH CVTFB CVTDB CVTGB CVTHB CVTFW CVTDW CVTGW CVTHW CVTFL Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Convert Byte to F_oating Byte to D_oating Byte to G_oating Byte to H_oating Word to F_oating Word to D_oating Word to G_oating Word to H_oating Long to F_oating Long to D_oating Long to G_oating Long to H_oating F_oating to Byte D_oating to Byte G_oating to Byte H_oating to Byte F_oating to Word D_oating to Word G_oating to Word H_oating to Word F_oating to Long
Description
The source operand is converted to the data type of the destination operand, and the destination operand is replaced by the result. The form of the conversion is as follows:
Form Instructions
Exact
Truncated Rounded
CVTBF, CVTBD, CVTBG, CVTBH, CVTWF, CVTWD, CVTWG, CVTWH, CVTLD, CVTLG, CVTLH, CVTFD, CVTFG, CVTFH, CVTDH, CVTGH CVTFB, CVTDB, CVTGB, CVTHB, CVTFW, CVTDW, CVTGW, CVTHW, CVTFL, CVTDL, CVTGL, CVTHL CVTLF, CVTRFL, CVTRDL, CVTRGL, CVTRHL, CVTDF, CVTGF, CVTHF, CVTHD, CVTHG
Notes 1. Only CVTDF, CVTGF, CVTHF, CVTHD, and CVTHG can result in a oating overow fault; the destination operand is unaffected, and the condition codes are UNPREDICTABLE. 2. Only converts with a oating-point source operand can result in a reserved operand fault. On a reserved operand fault, the destination operand is unaffected, and the condition codes are UNPREDICTABLE. 3. Only converts with an integer destination operand can result in integer overow. On integer overow, the destination operand is replaced by the low-order bits of the true result. 4. Only CVTGF, CVTHF, CVTHD, and CVTHG can result in oating underow. If FU is set, a fault occurs. On a oating underow fault, the destination operand is unaffected. If FU is clear, the destination operand is replaced by zero, and no exception occurs.
DIV
Divide
Format
2operand: 3operand: opcode opcode divr.rx, quo.mx divr.rx, divd.rx, quo.wx
Condition Codes
N Z V C Exceptions oating overow oating underow divide by zero reserved operand < < < < quo LSS 0; quo EQL 0; 0; 0;
Opcodes
46 47 66 67 46FD 47FD 66FD 67FD DIVF2 DIVF3 DIVD2 DIVD3 DIVG2 DIVG3 DIVH2 DIVH3 Divide Divide Divide Divide Divide Divide Divide Divide F_oating 2 Operand F_oating 3 Operand D_oating 2 Operand D_oating 3 Operand G_oating 2 Operand G_oating 3 Operand H_oating 2 Operand H_oating 3 Operand
Description
In 2 operand format, the quotient operand is divided by the divisor operand and the quotient operand is replaced by the rounded result. In 3 operand format, the dividend operand is divided by the divisor operand, and the quotient operand is replaced by the rounded result. Notes 1. On a reserved operand fault, the quotient operand is unaffected, and the condition codes are UNPREDICTABLE. 2. On oating underow, if FU is set, a fault occurs. On a oating underow fault, the quotient operand is unaffected. If FU is clear, the quotient operand is replaced by zero, and no exception occurs.
EMOD
Extended Multiply and Integerize
Format
EMODF and EMODD: opcode mulr.rx, mulrx.rb, muld.rx, int.wl, fract.wx
Condition Codes
N Z V C Exceptions integer overow oating underow reserved operand < < < < fract LSS 0; fract EQL 0; {integer overow}; 0;
Opcodes
54 74 54FD 74FD EMODF EMODD EMODG EMODH Extended Extended Extended Extended Multiply Multiply Multiply Multiply and and and and Integerize Integerize Integerize Integerize F_oating D_oating G_oating H_oating
Description
The multiplier extension operand is concatenated with the multiplier operand to gain 8 (EMODD and EMODF), 11 (EMODG), or 15 (EMODH) additional loworder fraction bits. The low-order 5 or 1 bits of the 16-bit multiplier extension operand are ignored by the EMODG and EMODH instructions, respectively. The multiplicand operand is multiplied by the extended multiplier operand. The multiplication result is equivalent to the exact product truncated (before normalization) to a fraction eld of 32 bits in F_oating, 64 bits in D_oating and G_oating, and 128 bits in H_oating. The result is regarded as the sum of an integer and fraction of the same sign. The integer operand is replaced by the integer part of the result, and the fraction operand is replaced by the rounded fractional part of the result.
MNEG
Move Negated
Format
opcode src.rx, dst.wx
Condition Codes
N Z V C Exceptions reserved operand < < < < dst LSS 0; dst EQL 0; 0; 0;
Opcodes
52 72 52FD 72FD MNEGF MNEGD MNEGG MNEGH Move Move Move Move Negated Negated Negated Negated F_oating D_oating G_oating H_oating
Description
The destination operand is replaced by the negative of the source operand.
MOV
Move
Format
opcode src.rx, dst.wx
Condition Codes
N Z V C Exceptions reserved operand < < < < dst LSS 0; dst EQL 0; 0; C;
Opcodes
50 70 50FD 70FD MOVF MOVD MOVG MOVH Move Move Move Move F_oating D_oating G_oating H_oating
Description
The destination operand is replaced by the source operand. Note On a reserved operand fault, the destination operand is unaffected, and the condition codes are UNPREDICTABLE.
MUL
Multiply
Format
2operand: 3operand: opcode opcode mulr.rx, prod.mx mulr.rx, muld.rx, prod.wx
Condition Codes
N Z V C Exceptions oating overow oating underow reserved operand < < < < prod LSS 0; prod EQL 0; 0; 0;
Opcodes
44 45 64 65 44FD 45FD 64FD 65FD MULF2 MULF3 MULD2 MULD3 MULG2 MULG3 MULH2 MULH3 Multiply Multiply Multiply Multiply Multiply Multiply Multiply Multiply F_oating 2 Operand F_oating 3 Operand D_oating 2 Operand D_oating 3 Operand G_oating 2 Operand G_oating 3 Operand H_oating 2 Operand H_oating 3 Operand
Description
In 2 operand format, the product operand is multiplied by the multiplier operand, and the product operand is replaced by the rounded result. In 3 operand format, the multiplicand operand is multiplied by the multiplier operand, and the product operand is replaced by the rounded result. Notes 1. On a reserved operand fault, the product operand is unaffected, and the condition codes are UNPREDICTABLE. 2. On oating underow, if FU is set, a fault occurs. On a oating underow fault, the product operand is unaffected. If FU is clear, the product operand is replaced by zero, and no exception occurs. 3. On oating overow, the instruction faults, the product operand is unaffected, and the condition codes are UNPREDICTABLE.
POLY
Polynomial Evaluation
Format
opcode arg.rx, degree.rw, tbladdr.ab
Condition Codes
N Z V C Exceptions oating overow oating underow reserved operand < < < < R0 LSS 0; R0 EQL 0; 0; 0;
Opcodes
55 75 55FD 75FD POLYF POLYD POLYG POLYH Polynomial Polynomial Polynomial Polynomial Evaluation Evaluation Evaluation Evaluation F_oating D_oating G_oating H_oating
Description
The table address operand points to a table of polynomial coefcients. The coefcient of the highest-order term of the polynomial is pointed to by the table address operand. The table is specied with lower-order coefcients stored at increasing addresses. The data type of the coefcients is the same as the data type of the argument operand. The evaluation is carried out by Horners method, and the contents of R0 (R1R0 for POLYD and POLYG, R3R2R1R0 for POLYH) are replaced by the result. The result computed is: if d = degree and x = arg result = C[0]+x**0 + x*(C[1] + x*(C[2] + ... x*C[d])) The unsigned word degree operand species the highest-numbered coefcient to participate in the evaluation. POLYH requires four longwords on the stack to store arg in case the instruction is interrupted. Notes 1. After execution: POLYF: R0 = result R1 = 0 R2 = 0 R3 = table address + degree*4 + 4
R1 = arg R2<7:0> = tmp1 ! Number of iterations remaining R2<31:8> = implementation specific R3 = tmp2 ! Points to table entry causing ! exception POLYD and POLYG: R1R0 = tmp3 ! Partial result after iteration ! prior to the one causing the ! overflow/underflow R2<7:0> = tmp1 ! Number of iterations remaining R2<31:8> = implementation specific R3 = tmp2 ! Points to table entry causing ! exception R5R4 = arg POLYH: R3R2R1R0 = tmp3 ! Partial result after iteration ! prior to the one causing the ! overflow/underflow R4<7:0> = tmp1 ! Number of iterations remaining R4<31:8> = implementation specific R5 = tmp2 ! Points to table entry causing ! exception arg is saved on the stack in use during the faulting instruction. Implementation-specic information is saved to allow the instruction to continue after possible scaling of the coefcients and partial result by the fault handler. 3. If the unsigned word degree operand is zero and the argument is not a reserved operand, the result is C[0]. 4. If the unsigned word degree operand is greater than 31, a reserved operand fault occurs.
6. On oating underow after the rounding operation at any iteration of the computation loop, a fault occurs if FU is set. If FU is clear, the temporary result (tmp3) is replaced by zero and the operation continues. In this case, the nal result may be nonzero if underow occurred before the last iteration. 7. On oating overow after the rounding operation at any iteration of the computation loop, the instruction terminates with a fault. 8. If the argument is zero and one of the coefcients in the table is the reserved operand, whether a reserved operand fault occurs is UNPREDICTABLE. 9. For POLYH, some implementations may not save arg on the stack until after an interrupt or fault occurs. However, arg will always be on the stack if an interrupt or oating fault occurs after FPD is set. If the four longwords on the stack overlap any of the source operands, the results are UNPREDICTABLE.
Example
; To compute P(x) = C0 + C1*x + C2*x**2 ; where C0 = 1.0, C1 = .5, and C2 = .25 POLYF . . . PTABLE: .FLOAT .FLOAT .FLOAT X,#2,PTABLE
; C2 ; C1 ; C0
SUB
Subtract
Format
2operand: 3operand: opcode opcode sub.rx, dif.mx sub.rx, min.rx, dif.wx
Condition Codes
N Z V C Exceptions oating overow oating underow reserved operand < < < < dif LSS 0; dif EQL 0; 0; 0;
Opcodes
42 43 62 63 42FD 43FD 62FD 63FD SUBF2 SUBF3 SUBD2 SUBD3 SUBG2 SUBG3 SUBH2 SUBH3 Subtract Subtract Subtract Subtract Subtract Subtract Subtract Subtract F_oating 2 Operand F_oating 3 Operand D_oating 2 Operand D_oating 3 Operand G_oating 2 Operand G_oating 3 Operand H_oating 2 Operand H_oating 3 Operand
Description
In 2 operand format, the subtrahend operand is subtracted from the difference operand, and the difference is replaced by the rounded result. In 3 operand format, the subtrahend operand is subtracted from the minuend operand, and the difference operand is replaced by the rounded result.
TST
Test
Format
opcode src.rx
Condition Codes
N Z V C Exceptions reserved operand < < < < src LSS 0; src EQL 0; 0; 0;
Opcodes
53 73 53FD 73FD TSTF TSTD TSTG TSTH Test Test Test Test F_oating D_oating G_oating H_oating
Description
The condition codes are affected according to the value of the source operand. Notes 1. TSTx src is equivalent to CMPx src, #0, but is 5 (F_oating) or 9 (D_oating or G_oating) or 17 (H_oating) bytes shorter. 2. On a reserved operand fault, the condition codes are UNPREDICTABLE.
The elds LENGTH 1, LENGTH 2 (if required), and LENGTH 3 (if required) contain the number of bytes remaining to be processed in the rst, second, and third string operands, respectively. The elds ADDRESS 1, ADDRESS 2 (if required), and ADDRESS 3 (if required) contain the address of the next byte to be processed in the rst, second, and third string operands, respectively. Memory access faults do not occur when a zero-length string is specied because no memory reference occurs. The following instructions are described in this section.
Number of Instructions 1
Description and Opcode 1. Compare Characters 3 Operand CMPC3 len.rw, src1addr.ab, src2addr.ab, {R0-3.wl} Compare Characters 5 Operand CMPC5 src1len.rw, src1addr.ab, ll.rb, src2len.rw, src2addr.ab, {R0-3.wl} Locate Character LOCC char.rb, len.rw, addr.ab, {R0-1.wl}
2.
3.
Description and Opcode 4. Match Characters MATCHC len1.rw, addr1.ab, len2.rw, addr2.ab, {R0-3.wl} Move Character 3 Operand MOVC3 len.rw, srcaddr.ab, dstaddr.ab, {R0-5.wl} Move Character 5 Operand MOVC5 srclen.rw, srcaddr.ab, ll.rb, dstlen.rw, dstaddr.ab, {R0-5.wl} Move Translated Characters MOVTC srclen.rw, srcaddr.ab, ll.rb, tbladdr.ab, dstlen.rw, dstaddr.ab, {R0-5.wl} Move Translated Until Character MOVTUC srclen.rw, srcaddr.ab, esc.rb, tbladdr.ab, dstlen.rw, dstaddr.ab, {R0-5.wl} Scan Characters SCANC len.rw, addr.ab, tbladdr.ab, mask.rb, {R0-3.wl} Skip Character SKPC char.rb, len.rw, addr.ab, {R0-1.wl} Span Characters SPANC len.rw, addr.ab, tbladdr.ab, mask.rb, {R0-3.wl}
5.
6.
7.
8.
9.
10. 11.
1 1
CMPC
Compare Characters
Format
3operand: 5operand: opcode opcode len.rw, src1addr.ab, src2addr.ab src1len.rw, src1addr.ab, ll.rb, src2len.rw, src2addr.ab
Condition Codes
N Z V C Exceptions None. < < < < {rst byte} LSS {second byte}; {rst byte} EQL {second byte}; 0; {rst byte} LSSU {second byte};
Opcodes
29 2D CMPC3 CMPC5 Compare Characters 3 Operand Compare Characters 5 Operand
Description
In 3 operand format, the bytes of string1 specied by the length and address1 operands are compared with the bytes of string2 specied by the length and address2 operands. Comparison proceeds until inequality is detected or all the bytes of the strings have been examined. Condition codes are affected by the result of the last byte comparison. In 5 operand format, the bytes of the string1 operand specied by the length1 and address1 operands are compared with the bytes of the string2 operand specied by the length2 and address2 operands. If one string is longer than the other, the shorter string is conceptually extended to the length of the longer by appending (at higher addresses) bytes equal to the ll operand. Comparison proceeds until inequality is detected or all the bytes of the strings have been examined. Condition codes are affected by the result of the last byte comparison. For either CMPC3 or CMPC5, two zero-length strings compare equal (that is, Z is set and N, V, and C are cleared). Notes 1. After execution of CMPC3: R0 = R1 = Number of bytes remaining in string1 (including byte that terminated comparison); R0 is zero only if strings are equal Address of the byte in string1 that terminated comparison; if strings are equal, address of 1 byte beyond string1
2. After execution of CMPC5: R0 = Number of bytes remaining in string1 (including byte that terminated comparison); R0 is zero only if string1 and string2 are of equal length and equal or string1 was exhausted before comparison terminated Address of the byte in string1 that terminated comparison; if comparison did not terminate before string1 exhausted, address of 1 byte beyond string1 Number of bytes remaining in string2 (including byte that terminated comparison); R2 is zero only if string2 and string1 are of equal length or string2 was exhausted before comparison terminated Address of the byte in string2 that terminated comparison; if comparison did not terminate before string2 was exhausted, address of 1 byte beyond string2
R1 =
R2 =
R3 =
3. If both strings have zero length, condition code Z is set and N, V, and C are cleared just as in the case of two equal strings.
LOCC
Locate Character
Format
opcode char.rb, len.rw, addr.ab
Condition Codes
N Z V C Exceptions None. < < < < 0; R0 EQL 0; 0; 0;
Opcodes
3A LOCC Locate Character
Description
The character operand is compared with the bytes of the string specied by the length and address operands. Comparison continues until equality is detected or all bytes of the string have been compared. If equality is detected, the condition code Z-bit is cleared; otherwise, the Z-bit is set. Notes 1. After execution: R0 = R1 = Number of bytes remaining in the string (including located one) if byte located; otherwise, zero Address of the byte located if byte located; otherwise, address of 1 byte beyond the string
2. If the string has zero length, condition code Z is set just as though each byte of the entire string were unequal to character.
MATCHC
Match Characters
Format
opcode objlen.rw, objaddr.ab, srclen.rw, srcaddr.ab
Condition Codes
N Z V C Exceptions None. < < < < 0; R0 EQL 0; !match found 0; 0;
Opcodes
39 MATCHC Match Characters
Description
The source string specied by the source length and source address operands is searched for a substring that matches the object string specied by the object length and object address operands. If the substring is found, the condition code Z-bit is set; otherwise, it is cleared. Notes 1. After execution: R0 = R1 = R2 = R3 = If a match occurred, zero; otherwise, the number of bytes in the object string If a match occurred, the address of 1 byte beyond the object string; that is, objaddr + objlen; otherwise, the address of the object string If a match occurred, the number of bytes remaining in the source string; otherwise, zero If a match occurred, the address of 1 byte beyond the last byte matched; otherwise, the address of 1 byte beyond the source string; that is, srcaddr + srclen
For zero-length source and object strings, R3 and R1 contain the source and object addresses, respectively. 2. If both strings have zero length, or if the object string has zero length, condition code Z is set, and registers R0 to R3 are left just as though the substring were found. 3. If the source string has zero length and the object string has nonzero length, condition code Z is cleared, and registers R0 to R3 are left just as though the substring were not found.
MOVC
Move Character
Format
3operand: 5operand: opcode opcode len.rw, srcaddr.ab, dstaddr.ab srclen.rw, srcaddr.ab, ll.rb, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C N Z V C Exceptions None. < < < < < < < < 0; !MOVC3 1; 0; 0; srclen LSS dstlen; !MOVC5 srclen EQL dstlen; 0; srclen LSSU dstlen;
Opcodes
28 2C MOVC3 MOVC5 Move Character 3 Operand Move Character 5 Operand
Description
In 3 operand format, the destination string specied by the length and destination address operands is replaced by the source string specied by the length and source address operands. In 5 operand format, the destination string specied by the destination length and destination address operands is replaced by the source string specied by the source length and source address operands. If the destination string is longer than the source string, the highest-addressed bytes of the destination are replaced by the ll operand. If the destination string is shorter than the source string, the highest-addressed bytes of the source string are not moved. The operation of the instruction is such that overlap of the source and destination strings does not affect the result. Notes 1. After execution of MOVC3: R0 = R1 = 0 Address of 1 byte beyond the source string
2. After execution of MOVC5: R0 = R1 R2 R3 R4 R5 = = = = = Number of unmoved bytes remaining in source string. R0 is nonzero only if source string is longer than destination string Address of 1 byte beyond last byte in source that was moved 0 Address of 1 byte beyond the destination string 0 0
3. MOVC3 is the preferred way to copy one block of memory to another. 4. MOVC5 with a zero source length operand is the preferred way to ll a block of memory with the ll character.
MOVTC
Move Translated Characters
Format
opcode srclen.rw, srcaddr.ab, ll.rb, tbladdr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions None. < < < < srclen LSS dstlen; srclen EQL dstlen; 0; srclen LSSU dstlen;
Opcodes
2E MOVTC Move Translated Characters
Description
The source string specied by the source length and source address operands is translated. It replaces the destination string specied by the destination length and destination address operands. Translation is accomplished by using each byte of the source string as an index into a 256-byte table whose rst entry (entry number 0) address is specied by the table address operand. The byte selected replaces the byte of the destination string. If the destination string is longer than the source string, the highest-addressed bytes of the destination string are replaced by the ll operand. If the destination string is shorter than the source string, the highest-addressed bytes of the source string are not translated and moved. The operation of the instruction is such that overlap of the source and destination strings does not affect the result. If the destination string overlaps the translation table, the destination string is UNPREDICTABLE.
MOVTUC
Move Translated Until Character
Format
opcode srclen.rw, srcaddr.ab, esc.rb, tbladdr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions None. < < < < srclen LSS dstlen; srclen EQL dstlen; {terminated by escape}; srclen LSSU dstlen;
Opcodes
2F MOVTUC Move Translated Until Character
Description
The source string specied by the source length and source address operands is translated. It replaces the destination string specied by the destination length and destination address operands. Translation is accomplished by using each byte of the source string as an index into a 256-byte table whose rst entry address (entry number 0) is specied by the table address operand. The byte selected replaces the byte of the destination string. Translation continues until a translated byte is equal to the escape byte, or until the source string or destination string is exhausted. If translation is terminated because of escape, the condition code V-bit is set; otherwise, it is cleared. If the destination string overlaps the table, the destination string and registers R0 to R5 are UNPREDICTABLE. If the source and destination strings overlap and their addresses are not identical, the destination string and registers R0 to R5 are UNPREDICTABLE. If the source and destination string addresses are identical, the translation is performed correctly. Notes 1. After execution: R0 = Number of bytes remaining in source string (including the byte that caused the escape); R0 is zero only if the entire source string was translated and moved without escape Address of the byte that resulted in destination string exhaustion or escape; or if no exhaustion or escape, address of 1 byte beyond the source string
R1 =
SCANC
Scan Characters
Format
opcode len.rw, addr.ab, tbladdr.ab, mask.rb
Condition Codes
N Z V C Exceptions None. < < < < 0; R0 EQL 0; 0; 0;
Opcodes
2A SCANC Scan Characters
Description
The assembler successively uses the bytes of the string specied by the length and address operands to index into a 256-byte table whose rst entry (entry number 0) address is specied by the table address operand. The logical AND is performed on the byte selected from the table and the mask operand. The operation continues until the result of the AND is nonzero, or until all the bytes of the string have been exhausted. If a nonzero AND result is detected, the condition code Z-bit is cleared; otherwise, the Z-bit is set. Notes 1. After execution: R0 = Number of bytes remaining in the string (including the byte that produced the nonzero AND result); R0 is zero only if there was no nonzero AND result Address of the byte that produced the nonzero AND result; if no nonzero result, address of 1 byte beyond the string 0 Address of the table
R1 = R2 = R3 =
2. If the string has zero length, condition code Z is set just as though the entire string were scanned.
SKPC
Skip Character
Format
opcode char.rb, len.rw, addr.ab
Condition Codes
N Z V C Exceptions None. < < < < 0; R0 EQL 0; 0; 0;
Opcodes
3B SKPC Skip Character
Description
The character operand is compared with the bytes of the string specied by the length and address operands. Comparison continues until inequality is detected or all bytes of the string have been compared. If inequality is detected, the condition code Z-bit is cleared; otherwise, the Z-bit is set. Notes 1. After execution: R0 = R1 = Number of bytes remaining in the string (including the unequal one) if unequal byte located; otherwise, zero Address of the byte located if byte located; otherwise, address of 1 byte beyond the string
2. If the string has zero length, condition code Z is set just as though each byte of the entire string were equal to the character.
SPANC
Span Characters
Format
opcode len.rw, addr.ab, tbladdr.ab, mask.rb
Condition Codes
N Z V C Exceptions None. < < < < 0; R0 EQL 0; 0; 0;
Opcodes
2B SPANC Span Characters
Description
The assembler successively uses the bytes of the string specied by the length and address operands to index into a 256-byte table whose rst entry (entry number 0) address is specied by the table address operand. The logical AND is performed on the byte selected from the table and the mask operand. The operation continues until the result of the AND is zero, or until all the bytes of the string have been exhausted. If a zero AND result is detected, the condition code Z-bit is cleared; otherwise, the Z-bit is set. Notes 1. After execution: R0 = Number of bytes remaining in the string (including the byte that produced the zero AND result); R0 is zero only if there was no zero AND result Address of the byte that produced a zero AND result; if no nonzero result, address of 1 byte beyond the string 0 Address of the table
R1 = R2 = R3 =
2. If the string has zero length, the condition code Z-bit is set just as though the entire string were spanned.
CRC
Calculate Cyclic Redundancy Check
Format
opcode tbl.ab, inicrc.rl, strlen.rw, stream.ab
Condition Codes
N Z V C Exceptions None. < < < < R0 LSS 0; R0 EQL 0; 0; 0;
Opcodes
0B CRC Calculate Cyclic Redundancy Check
Description
The CRC of the data stream described by the string descriptor is calculated. The initial CRC is given by inicrc; it is normally zero or -1, unless the CRC is calculated in several steps. The result is left in R0. If the polynomial is less than order 32, the result must be extracted from the low-order bits of R0. The CRC polynomial is expressed by the contents of the 16-longword table. See the notes for the calculation of the table. Notes 1. After execution: R0 R1 R2 R3 = = = = Result of CRC 0 0 Address 1 byte beyond the end of the source string
2. If the data stream is not a multiple of 8 bits, it must be right-adjusted with leading zero ll. 3. If the CRC polynomial is less than order 32, the result must be extracted from the low-order bits of R0. 4. Use the following algorithm to calculate the CRC table given a polynomial expressed: polyn<n> <- {coefficient of x**{order -1-n}}
150 190
5. The following are descriptions of some commonly used CRC polynomials: CRC-16 (used in DDCMP and Bisync) polynomial: poly: initialize: result: polynomial: poly: initialize: result: AUTODIN-II polynomial: poly: initialize: result: x^32+x^26+x^23+x^22+x^16+x^12 +x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1 EDB88320 (hex) -1<31:0> ones complement of R0<31:0> x^16 + x^15 + x^2 + 1 120001 (octal) 0 R0<15:0> x^16 + x^12 + x^5 + 1 102010 (octal) -1<15:0> ones complement of R0<15:0>
6. The CRC instruction produces an UNPREDICTABLE result unless the table is well-formed, like the one produced in note 3. Note that for any wellformed table, entry[0] is always zero and entry[8] is always the polynomial expressed as in note 3. The operation can be implemented using shifts of 1, 2, or 4 bits at a time, as follows:
Steps per Byte (limit) Table Index Multiplier (i) Use Table Entries
Shift (s)
Table Index
1 2 4
8 4 2
8 4 1
Where the phrase decimal string is used, it means any of the three data types. Conversion instructions are provided between the data types. Where necessary, a specic data type is identied. A decimal string is specied by two operands: 1. For all decimal strings, the length is the number of digits in the string. The number of bytes in the string is a function of the length and the type of decimal string referenced (see Chapter 8). 2. The address of the lowest-addressed byte of the string. This byte contains the most signicant digit for trailing numeric and packed decimal strings, as well as a sign for leading separate numeric strings. The address is specied by a byte operand of address access type. Each of the decimal string instructions uses general registers R0 to R3 or R0 to R5 to hold a control block that maintains updated addresses and state during the execution of the instruction. At completion, the registers containing addresses are available to the software for use as string specication operands for a subsequent instruction on the same decimal strings. During the execution of the instructions, pending interrupt conditions are tested; if any is found, the control block is updated. The rst part done is set in the processor status longword (PSL), and the instruction is interrupted (refer to Appendix E). After the interruption, the instruction resumes transparently. The format of the control block at completion is as follows:
31 0 ADDRESS 1 0 ADDRESS 2 0 ADDRESS 3 0 : R0 : R1 : R2 : R3 : R4 : R5
ZK 1176A GE
The elds ADDRESS 1, ADDRESS 2, and ADDRESS 3 (if required) contain the address of the byte containing the most signicant digit of the rst, second, and third (if required) string operands, respectively. The decimal string instructions treat decimal strings as integers with the decimal point assumed immediately beyond the least signicant digit of the string. If a string in which a result is to be stored is longer than the result, its most signicant digits are lled with zeros.
9.2.11.6 Zero-Length Decimal Strings The length of a packed decimal string can be zero. In this case, the value is zero (plus or minus) and 1 byte of storage is occupied. This byte must contain a 0 digit in the high nibble and the sign in the low nibble. The length of a trailing numeric string can be zero. In this case, no storage is occupied by the string. If a destination operand is a zero-length trailing numeric string, the sign of the operation is lost. Memory access faults do not occur when a zero-length trailing numeric operand is specied because no memory reference occurs. The value of a zero-length trailing numeric string is identically zero. The length of a leading separate numeric string can be zero. In this case, 1 byte of storage is occupied by the sign. Memory is accessed when a zero-length operand is specied, and a reserved operand abort will occur if an invalid sign is detected. The value of a zero-length leading separate numeric string is zero. 9.2.11.7 Instruction Descriptions The following instructions are described in this section:
Number of Instructions 1
Description and Opcode 1. Add Packed 4 Operand ADDP4 addlen.rw, addaddr.ab, sumlen.rw, sumaddr.ab, {R0-3.wl} Add Packed 6 Operand ADDP6 add1len.rw, add1addr.ab, add2len.rw, add2addr.ab, sumlen.rw, sumaddr.ab, {R0-5.wl} Arithmetic Shift and Round Packed ASHP cnt.rb, srclen.rw, srcaddr.ab, round.rb, dstlen.rw, dstaddr.ab, {R0-3.wl} Compare Packed 3 Operand CMPP3 len.rw, src1addr.ab, src2addr.ab, {R0-3.wl} Compare Packed 4 Operand CMPP4 src1len.rw, src1addr.ab, src2len.rw, src2addr.ab, {R0-3.wl} Convert Long to Packed CVTLP src.rl, dstlen.rw, dstaddr.ab, {R0-3.wl} Convert Packed to Long CVTPL srclen.rw, srcaddr.ab, {R0-3.wl}, dst.wl Convert Packed to Leading Separate CVTPS srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab, {R0-3.wl}
2.
3.
4.
5.
6.
7.
8.
Description and Opcode 9. Convert Packed to Trailing CVTPT srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab, {R0-3.wl} Convert Leading Separate to Packed CVTSP srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab, {R0-3.wl} Convert Trailing to Packed CVTTP srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab, {R0-3.wl} Divide Packed DIVP divrlen.rw, divraddr.ab, divdlen.rw, divdaddr.ab, quolen.rw, quoaddr.ab, {R0-5.wl, -16(SP):-1(SP).wb} Move Packed MOVP len.rw, srcaddr.ab, dstaddr.ab, {R0-3.wl} Multiply Packed MULP mulrlen.rw, mulraddr.ab, muldlen.rw, muldaddr.ab, prodlen.rw, prodaddr.ab, {R0-5.wl} Subtract Packed 4 Operand SUBP4 sublen.rw, subaddr.ab, dien.rw, difaddr.ab, {R0-3.wl} Subtract Packed 6 Operand SUBP6 sublen.rw, subaddr.ab, minlen.rw, minaddr.ab, dien.rw, difaddr.ab, {R0-5.wl}
10.
11.
12.
13.
14.
15.
16.
ADDP
Add Packed
Format
opcode opcode addlen.rw, addaddr.ab, sumlen.rw, sumaddr.ab add1len.rw, add1addr.ab, add2len.rw, add2addr.ab, sumlen.rw, sumaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {sum string} LSS 0; {sum string} EQL 0; {decimal overow}; 0;
Opcodes
20 21 ADDP4 ADDP6 Add Packed 4 Operand Add Packed 6 Operand
Description
In 4 operand format, the addend string specied by the addend length and addend address operands is added to the sum string specied by the sum length and sum address operands, and the sum string is replaced by the result. In 6 operand format, the addend1 string specied by the addend1 length and addend1 address operands is added to the addend2 string specied by the addend2 length and addend2 address operands. The sum string specied by the sum length and sum address operands is replaced by the result. Notes 1. After execution of ADDP4: R0 = R1 = R2 = R3 = 0 Address of the byte containing the most signicant digit of the addend string 0 Address of the byte containing the most signicant digit of the sum string
3. The sum string, R0 to R3 (or R0 to R5 for ADDP6) and the condition codes are UNPREDICTABLE if: the sum string overlaps the addend, addend1, or addend2 strings; the addend, addend1, addend2, or sum (4 operand only) strings contain an invalid nibble; or a reserved operand abort occurs.
ASHP
Arithmetic Shift and Round Packed
Format
opcode cnt.rb, srclen.rw, srcaddr.ab, round.rb, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {dst string} LSS 0; {dst string} EQL 0; {decimal overow}; 0;
Opcodes
F8 ASHP Arithmetic Shift and Round Packed
Description
The source string specied by the source length and source address operands is scaled by a power of 10 specied by the count operand. The destination string specied by the destination length and destination address operands is replaced by the result. A positive count operand effectively multiplies, a negative count effectively divides, and a zero count just moves and affects condition codes. When a negative count is specied, the result is rounded using the round operand. Notes 1. After execution: R0 = R1 = R2 = R3 = 0 Address of the byte containing the most signicant digit of the source string 0 Address of the byte containing the most signicant digit of the destination string
2. The destination string, R0 to R3, and the condition codes are UNPREDICTABLE if the destination string overlaps the source string, the source string contains an invalid nibble, or a reserved operand abort occurs. 3. When the count operand is negative, the result is rounded by decimally adding bits 3:0 of the round operand to the most signicant low-order digit discarded and propagating the carry, if any, to higher-order digits. Both the
CMPP
Compare Packed
Format
3operand: 4operand: opcode opcode len.rw, src1addr.ab, src2addr.ab src1len.rw, src1addr.ab, src2len.rw, src2addr.ab
Condition Codes
N Z V C Exceptions reserved operand < < < < {src1 string} LSS {src2 string}; {src1 string} EQL {src2 string}; 0; 0;
Opcodes
35 37 CMPP3 CMPP4 Compare Packed 3 Operand Compare Packed 4 Operand
Description
In 3 operand format, the source 1 string specied by the length and source 1 address operands is compared to the source 2 string specied by the length and source 2 address operands. The only action is to affect the condition codes. In 4 operand format, the source 1 string specied by the source 1 length and source 1 address operands is compared to the source 2 string specied by the source 2 length and source 2 address operands. The only action is to affect the condition codes. Notes 1. After execution of CMPP3 or CMPP4: R0 R1 R2 R3 = = = = 0 Address of the byte containing the most signicant digit of string1 0 Address of the byte containing the most signicant digit of string2
2. R0 to R3 and the condition codes are UNPREDICTABLE if the source strings overlap, if either string contains an invalid nibble, or if a reserved operand abort occurs.
CVTLP
Convert Long to Packed
Format
opcode src.rl, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {dst string} LSS 0; {dst string} EQL 0; {decimal overow}; 0;
Opcodes
F9 CVTLP Convert Long to Packed
Description
The source operand is converted to a packed decimal string. The destination string operand specied by the destination length and destination address operands is replaced by the result. Notes 1. After execution: R0 R1 R2 R3 = = = = 0 0 0 Address of the byte containing the most signicant digit of the destination string
2. The destination string, R0 to R3, and the condition codes are UNPREDICTABLE on a reserved operand abort. 3. Overlapping operands produce correct results.
CVTPL
Convert Packed to Long
Format
opcode srclen.rw, srcaddr.ab, dst.wl
Condition Codes
N Z V C Exceptions reserved operand integer overow < < < < dst LSS 0; dst EQL 0; {integer overow}; 0;
Opcodes
36 CVTPL Convert Packed to Long
Description
The source string specied by the source length and source address operands is converted to a longword, and the destination operand is replaced by the result. Notes 1. After execution: R0 = R1 = R2 = R3 = 0 Address of the byte containing the most signicant digit of the source string 0 0
2. The destination operand, R0 to R3, and the condition codes are UNPREDICTABLE on a reserved operand abort, or if the string contains an invalid nibble. 3. The destination operand is stored after the registers are updated as specied in note 1. You may use R0 to R3 as the destination operand. 4. If the source string has a value outside the range -2,147,483,648 to +2,147,483,647, integer overow occurs and the destination operand is replaced by the low-order 32 bits of the correctly signed innite precision conversion. On overow, the sign of the destination may be different from the sign of the source. 5. Overlapping operands produce correct results.
CVTPS
Convert Packed to Leading Separate Numeric
Format
opcode srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {src string} LSS 0; {src string} EQL 0; {decimal overow}; 0;
Opcodes
08 CVTPS Convert Packed to Leading Separate Numeric
Description
The source packed decimal string specied by the source length and source address operands is converted to a leading separate numeric string. The destination string specied by the destination length and destination address operands is replaced by the result. Conversion is effected by replacing the lowest-addressed byte of the destination string with the ASCII character + or -, determined by the sign of the source string. The remaining bytes of the destination string are replaced by the ASCII representations of the values of the corresponding packed decimal digits of the source string. Notes 1. After execution: R0 = R1 = R2 = R3 = 0 Address of the byte containing the most signicant digit of the source string 0 Address of the sign byte of the destination string
2. The destination string, R0 to R3, and the condition codes are UNPREDICTABLE if the destination string overlaps the source string, the source string contains an invalid nibble, or a reserved operand abort occurs.
CVTPT
Convert Packed to Trailing Numeric
Format
opcode srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {src string} LSS 0; {src string} EQL 0; {decimal overow}; 0;
Opcodes
24 CVTPT Convert Packed to Trailing Numeric
Description
The source packed decimal string specied by the source length and source address operands is converted to a trailing numeric string. The destination string specied by the destination length and destination address operands is replaced by the result. The condition code N and Z bits are affected by the value of the source packed decimal string. Conversion is effected by using the highest-addressed byte of the source string (the byte containing the sign and the least signicant digit), even if the source string value is -0. The assembler uses this byte as an unsigned index into a 256-byte table whose rst entry (entry number 0) address is specied by the table address operand. The byte read from the table replaces the least signicant byte of the destination string. The remaining bytes of the destination string are replaced by the ASCII representations of the values of the corresponding packed decimal digits of the source string. Notes 1. After execution: R0 = R1 = R2 = R3 = 0 Address of the byte containing the most signicant digit of the source string 0 Address of the most signicant digit of the destination string
CVTSP
Convert Leading Separate Numeric to Packed
Format
opcode srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {dst string} LSS 0; {dst string} EQL 0; {decimal overow}; 0;
Opcodes
09 CVTSP Convert Leading Separate Numeric to Packed
Description
The source numeric string specied by the source length and source address operands is converted to a packed decimal string, and the destination string specied by the destination address and destination length operands is replaced by the result. Notes 1. A reserved operand abort occurs if: The length of the source leading separate numeric string is outside the range 0 to 31 The length of the destination packed decimal string is outside the range 0 to 31 The source string contains an invalid byte. An invalid byte is any character other than an ASCII 0 to 9 in a digit byte or an ASCII +, <space>, or - in the sign byte
2. After execution: R0 R1 R2 R3 = = = = 0 Address of the sign byte of the source string 0 Address of the byte containing the most signicant digit of the destination string
CVTTP
Convert Trailing Numeric to Packed
Format
opcode srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {dst string}LSS 0; {dst string} EQL 0; {decimal overow}; 0;
Opcodes
26 CVTTP Convert Trailing Numeric to Packed
Description
The source trailing numeric string specied by the source length and source address operands is converted to a packed decimal string, and the destination packed decimal string specied by the destination address and destination length operands is replaced by the result. Conversion is effected by using the highest-addressed (trailing) byte of the source string as an unsigned index into a 256-byte table whose rst entry (entry number 0) is specied by the table address operand. The byte read from the table replaces the highest-addressed byte of the destination string (the byte containing the sign and the least signicant digit). The remaining packed digits of the destination string are replaced by the low-order 4 bits of the corresponding bytes in the source string. Notes 1. A reserved operand abort occurs if: The length of the source trailing numeric string is outside the range 0 to 31 The length of the destination packed decimal string is outside the range 0 to 31 The source string contains an invalid byte. An invalid byte is any value other than ASCII 0 to 9 in any high-order byte (that is, any byte except the least signicant byte) The translation of the least signicant digit produces an invalid packed decimal digit or sign nibble
3. The destination string, R0 to R3, and the condition codes are UNPREDICTABLE if the destination string overlaps the source string or the table, or if a reserved operand abort occurs. 4. If the convert instruction produces a -0 without overow, the destination packed decimal string is changed to a +0 representation, condition code N is cleared, and Z is set. 5. If the length of the source string is zero, the destination packed decimal string is set equal to zero, and the translation table is not referenced. 6. By appropriate specication of the table, you can convert any form of trailing numeric string. See Chapter 8 for the preferred form of trailing overpunch, zoned and unsigned data. In addition, the table can be set up for absolute value, negative absolute value, or negated conversions. 7. If the table translation produces a sign nibble containing any valid sign, the preferred sign representation is stored in the destination packed decimal string.
DIVP
Divide Packed
Format
opcode divrlen.rw, divraddr.ab, divdlen.rw, divdaddr.ab, quolen.rw, quoaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow divide by zero < < < < {quo string} LSS 0; {quo string} EQL 0; {decimal overow}; 0;
Opcodes
27 DIVP Divide Packed
Description
The dividend string specied by the dividend length and dividend address operands is divided by the divisor string specied by the divisor length and divisor address operands. The quotient string specied by the quotient length and quotient address operands is replaced by the result. Notes 1. This instruction allocates a 16-byte workspace on the stack. After execution, the stack pointer (SP) is restored to its original contents, and the contents of {(SP)-16}:{(SP)-1} are UNPREDICTABLE. 2. The division is performed, resulting in the following conditions: The absolute value of the remainder (which is lost) is less than the absolute value of the divisor The product of the absolute value of the quotient times the absolute value of the divisor is less than or equal to the absolute value of the dividend The sign of the quotient is determined by the rules of algebra from the signs of the dividend and the divisor; if the value of the quotient is zero, the sign is always positive
3. After execution: R0 = 0
4. The quotient string, R0 to R5, and the condition codes are UNPREDICTABLE if: the quotient string overlaps the divisor or dividend strings; the divisor or dividend string contains an invalid nibble; the divisor is zero; or a reserved operand abort occurs.
MOVP
Move Packed
Format
opcode len.rw, srcaddr.ab, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand < < < < {dst string} LSS 0; {dst string} EQL 0; 0; C;
Opcodes
34 MOVP Move Packed
Description
The destination string specied by the length and destination address operands is replaced by the source string specied by the length and source address operands. Notes 1. After execution: R0 = R1 = R2 = R3 = 0 Address of the byte containing the most signicant digit of the source string 0 Address of the byte containing the most signicant digit of the destination string
2. The destination string, R0 to R3, and the condition codes are UNPREDICTABLE if: the destination string overlaps the source string; the source string contains an invalid nibble; or a reserved operand abort occurs. 3. If the source is -0, the result is +0, N is cleared, and Z is set.
MULP
Multiply Packed
Format
opcode mulrlen.rw, mulraddr.ab, muldlen.rw, muldaddr.ab, prodlen.rw, prodaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {prod string} LSS 0; {prod string} EQL 0; {decimal overow}; 0;
Opcodes
25 MULP Multiply Packed
Description
The multiplicand string specied by the multiplicand length and multiplicand address operands is multiplied by the multiplier string specied by the multiplier length and multiplier address operands. The product string specied by the product length and product address operands is replaced by the result. Notes 1. After execution: R0 = R1 = R2 = R3 = R4 = R5 = 0 Address of the byte containing the most signicant digit of the multiplier string 0 Address of the byte containing the most signicant digit of the multiplicand string 0 Address of the byte containing the most signicant digit of the product string
2. The product string, R0 to R5, and the condition codes are UNPREDICTABLE if: the product string overlaps the multiplier or multiplicand strings; the multiplier or multiplicand strings contain an invalid nibble; or a reserved operand abort occurs.
SUBP
Subtract Packed
Format
4operand: 6operand: opcode opcode sublen.rw, subaddr.ab, dien.rw, difaddr.ab sublen.rw, subaddr.ab, minlen.rw, minaddr.ab, dien.rw, difaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {dif string} LSS 0; {dif string} EQL 0; {decimal overow}; 0;
Opcodes
22 23 SUBP4 SUBP6 Subtract Packed 4 Operand Subtract Packed 6 Operand
Description
In 4 operand format, the subtrahend string specied by the subtrahend length and subtrahend address operands is subtracted from the difference string specied by the difference length and difference address operands, and the difference string is replaced by the result. In 6 operand format, the subtrahend string specied by the subtrahend length and subtrahend address operands is subtracted from the minuend string specied by the minuend length and minuend address operands. The difference string specied by the difference length and difference address operands is replaced by the result. Notes 1. After execution of SUBP4: R0 = R1 = R2 = 0 Address of the byte containing the most signicant digit of the subtrahend string 0
2. After execution of SUBP6: R0 = R1 = R2 = R3 = R4 = R5 = 0 Address of the byte containing the most signicant digit of the subtrahend string 0 Address of the byte containing the most signicant digit of the minuend string 0 Address of the byte containing the most signicant digit of the difference string
3. The difference string, R0 to R3 (R0 to R5 for SUBP6), and the condition codes are UNPREDICTABLE if: the difference string overlaps the subtrahend or minuend strings; the subtrahend, minuend, or difference (4 operand only) strings contain an invalid nibble; or a reserved operand abort occurs.
VAX Instruction Set SUBP 9.2.12 The EDITPC Instruction and Its Pattern Operators
The EDITPC instruction implements the common editing functions that occur when handling xed-format output. The operation consists of converting an input packed decimal number to an output character string and generating characters for the output. When converting digits, options include lling in leading zeros, protecting leading zeros, insertion of oating sign, insertion of oating currency symbol, insertion of special sign representations, and blanking an entire eld when it is zero. An example of this operation is a MOVE to a numeric edited (PICTURE) item in COBOL or PL/I. Many other applications are possible. The operands to the EDITPC instruction are as follows: 1. A packed decimal string descriptor (as input). This is a standard VAX operand pair consisting of the length of the decimal string in digits (up to 31) and the starting address of the string. 2. A pattern specication, consisting of the starting address of a pattern operation editing sequence. VAX MACRO interprets a pattern specication in the same way as it interprets normal instructions. 3. The starting address of the output string. The output string is described by its starting address only, because the pattern denes the length unambiguously. The EDITPC instruction manipulates two character registers and the four condition codes: The ll register (R2<7:0>) contains the ll character. This is normally an ASCII blank but could be changed to an asterisk ( * ), for instance, for check protection. The sign register (R2<15:8>) contains the sign character. Initially this register contains either an ASCII blank or a minus sign ( - ), depending upon the sign of the input. You can change the contents of this register to allow other sign representations such as plus/minus or plus/blank. You can also manipulate it to output special notations such as CR or DB. To implement a oating currency sign, you can change the sign register to the currency sign. After execution, the condition codes describe the following:
N Z V C The sign of the input The presence of a zero source An overow condition The presence of signicant digits
Condition code N is determined at the start of the instruction and remains unchanged (except for correcting a -0 input). The processor computes and updates the other condition codes as the instruction proceeds. When the EDITPC instruction completes processing, registers R0 to R5 contain the values they would normally have after a decimal instruction.
EDITPC
Edit Packed to Character String
Format
opcode srclen.rw, srcaddr.ab, pattern.ab, dstaddr.ab
Condition Codes
N Z V C Exceptions reserved operand decimal overow < < < < {src string} LSS 0; !N <- 0 if src is -0 {src string} EQL 0; {decimal overow}; !nonzero digits lost {signicance};
Opcodes
38 EDITPC Edit Packed to Character String
Description
The destination string specied by the pattern and destination address operands is replaced by the edited version of the source string specied by the source length and source address operands. The editing is performed according to the pattern string, starting at the address of the pattern operand and extending until a pattern end pattern operator (EO$END) is encountered. The pattern string consists of 1-byte pattern operators. Some pattern operators take no operands. Some take a repeat count that is contained in the rightmost nibble of the pattern operator itself. The rest take a 1-byte operand that immediately follows the pattern operator. This operand is either an unsigned integer length or a byte character. Table 91 lists the pattern operators that can be used with the EDITPC instruction to form a pattern. Subsequent pages dene each pattern operator in a format similar to that of the normal instruction descriptions. In each case, if there is an operand, it is either a repeat count (r) from 1 to 15, an unsigned byte length (len), or a character byte (ch). The encoding of the pattern operators is represented graphically in Table 92. See Appendix E for information about exceptions that affect the EDITPC instruction. Notes 1. A reserved operand abort occurs if srclen GTRU 31. 2. The destination string is UNPREDICTABLE if any of the following is true: The source string contains an invalid nibble. The EO$ADJUST_INPUT operand is outside the range 1 to 31.
3. After execution, the following general registers have contents as specied: R0 = R1 = R2 R3 R4 R5 = = = = Length of source string Address of the byte containing the most signicant digit of the source string 0 Address of the byte containing the EO$END pattern operator 0 Address of 1 byte beyond the last byte of the destination string
If the destination string is UNPREDICTABLE, R0 to R5 and the condition codes are UNPREDICTABLE. 4. If V is set at the end and DV is enabled, a numeric overow trap occurs unless the conditions in note 9 are satised. 5. The destination length is specied exactly by the pattern operators in the pattern string. If the pattern is incorrectly formed or if it is modied during the execution of the instruction, the length of the destination string is UNPREDICTABLE. 6. If the source is -0, the result may be -0 unless a xup pattern operator is included (EO$BLANK_ZERO or EO$REPLACE_SIGN). 7. The contents of the destination string and the memory preceding it are UNPREDICTABLE if the length covered by EO$BLANK_ZERO or EO$REPLACE_SIGN is zero, or if it is outside the destination string. 8. If more input digits are requested by the pattern than are specied, a reserved operand abort is taken with R0 = -1 and R3 = location of the pattern operator that requested the extra digit. The condition codes and other registers are as specied in note 11. This abort cannot be continued. 9. If fewer input digits are requested by the pattern than are specied, a reserved operand abort is taken with R3 = location of EO$END pattern operator. The condition codes and other registers are as specied in note 11. This abort cannot be continued. 10. On an unimplemented or reserved pattern operator, a reserved operand fault is taken with R3 = location of the faulting pattern operator. The condition codes and other registers are as specied in note 11. This fault can be continued as long as the dened register state is manipulated according to the pattern operator description and the state specied as implementation dependent is preserved.
ch r
r r
Move digits, ll if insignicant Move digits, oating sign End oating sign
EO$BLANK_ZERO EO$REPLACE_SIGN
Load operators
len len
ch ch ch ch
chOne character rRepeat count in the range 1 to 15 lenLength in the range 1 to 255
len
chOne character rRepeat count in the range 1 to 15 lenLength in the range 1 to 255
00 01 02 03 04 05 . . . 1F 20 . . . 3F 40 41 42 43 44 45 46 47 48 . . . 5F 60 . . . 7F 80,90,A0 81 . . . 8F 91 . . . 9F A1 . . . AF B0 . . . FE FF
EO$END EO$END_FLOAT EO$CLEAR_SIGNIF EO$SET_SIGNIF EO$STORE_SIGN EO$LOAD_FILL EO$LOAD_SIGN EO$LOAD_PLUS EO$LOAD_MINUS EO$INSERT EO$BLANK_ZERO EO$REPLACE_SIGN EO$ADJUST_INPUT EO$FILL EO$MOVE EO$FLOAT
Reserved to Compaq Reserved for all time Character is in next byte Character is in next byte Character is in next byte Character is in next byte Character is in next byte Unsigned length is in next byte Unsigned length is in next byte Unsigned length is in next byte Reserved to Compaq Reserved to CSS and customers Reserved to Compaq Repeat count is <3:0> Reserved to Compaq Reserved for all time
EO$ADJUST_INPUT
Adjust Input Length
Format
opcode pattern len
Pattern Operators
47 EO$ADJUST_INPUT Adjust Input Length
Description
The EO$ADJUST_INPUT pattern operator is followed by an unsigned byte integer length in the range 1 to 31. If the source string has more digits than this length, the excess leading digits are read and discarded. If any discarded digits are nonzero, the overow is set, signicance is set, and zero is cleared. If the source string has fewer digits than this length, a counter is set of the number of leading zeros to supply. This counter is stored as a negative number in R0<31:16>. Note If the length is not in the range 1 to 31, the destination string, condition codes, and R0 to R5 are UNPREDICTABLE.
EO$BLANK_ZERO
Blank Backwards when Zero
Format
opcode pattern len
Pattern Operators
45 EO$BLANK_ZERO Blank Backwards when Zero
Description
The EO$BLANK_ZERO pattern operator is followed by an unsigned byte integer length. If the value of the source string is zero, then the contents of the ll register are stored into the last length bytes of the destination string. Notes 1. The length must be nonzero and within the destination string already produced. If it is not, the contents of the destination string and the memory preceding it are UNPREDICTABLE. 2. Use this pattern operator to blank out any characters stored in the destination under a forced signicance such as a sign or the digits following the radix point.
EO$END
End Edit
Format
opcode pattern
Pattern Operators
00 EO$END End Edit
Description
The EO$END pattern operator terminates the edit operation. Notes 1. If there are still input digits, a reserved operand abort is taken. 2. If the source value is -0, the N condition code is cleared.
EO$END_FLOAT
End Floating Sign
Format
opcode pattern
Pattern Operators
01 EO$END_FLOAT End Floating Sign
Description
The EO$END_FLOAT pattern operator terminates a oating sign operation. If the oating sign has not yet been placed in the destination (if signicance is not set), the contents of the sign register are stored in the destination, and signicance is set. Note Use this pattern operator after a sequence of one or more EO$FLOAT pattern operators that start with signicance clear. The EO$FLOAT sequence can include intermixed EO$INSERTs and EO$FILLs.
EO$FILL
Store Fill
Format
opcode pattern r
Pattern Operators
8x EO$FILL Store Fill
Description
The rightmost nibble of the pattern operator is the repeat count. The EO$FILL pattern operator places the contents of the ll register into the destination the number of times specied by the repeat count. Note Use this pattern operator for ll (blank) insertion.
EO$FLOAT
Float Sign
Format
opcode pattern r
Pattern Operators
Ax EO$FLOAT Float Sign
Description
The EO$FLOAT pattern operator moves digits, oating the sign across insignicant digits. The rightmost nibble of the pattern operator is the repeat count. For the number of times specied in the repeat count, the following algorithm is executed: The next digit from the source is examined. If it is nonzero and signicance is not yet set, then the contents of the sign register are stored in the destination, signicance is set, and zero is cleared. If the digit is signicant, it is stored in the destination; otherwise, the contents of the ll register are stored in the destination. Notes 1. If r is greater than the number of digits remaining in the source string, a reserved operand abort is taken. 2. Use this pattern operator to move digits with a oating arithmetic sign. The sign must already be set up as for EO$STORE_SIGN. A sequence of one or more EO$FLOATs can include intermixed EO$INSERTs and EO$FILLs. Signicance must be clear before the rst pattern operator of the sequence. The sequence must be terminated by one EO$END_FLOAT. 3. Use this pattern operator to move digits with a oating currency sign. The sign must already be set up with an EO$LOAD_SIGN. A sequence of one or more EO$FLOATs can include intermixed EO$INSERTs and EO$FILLs. Signicance must be clear before the rst pattern operator of the sequence. The sequence must be terminated by one EO$END_FLOAT.
EO$INSERT
Insert Character
Format
opcode pattern ch
Pattern Operators
44 EO$INSERT Insert Character
Description
The EO$INSERT pattern operator is followed by a character. If signicance is set, the character is placed into the destination. If signicance is not set, the contents of the ll register are placed into the destination. Note Use this pattern operator for inserts that can be made blank (for example, comma ( , )) and xed inserts (for example, slash ( / )). Fixed inserts require that signicance be set (by EO$SET_SIGNIF or EO$END_FLOAT).
EO$LOAD_
Load Register
Format
opcode pattern ch
Pattern Operators
40 41 42 43 EO$LOAD_FILL EO$LOAD_SIGN EO$LOAD_PLUS EO$LOAD_MINUS Load Load Load Load Fill Register Sign Register Sign Register If Plus Sign Register If Minus
Description
The pattern operator is followed by a character. For EO$LOAD_FILL, this character is placed into the ll register. For EO$LOAD_SIGN, this character is placed into the sign register. For EO$LOAD_PLUS, this character is placed into the sign register if the source string has a positive sign. For EO$LOAD_MINUS, this character is placed into the sign register if the source string has a negative sign. Notes 1. Use EO$LOAD_FILL to set up check protection (* instead of space). 2. Use EO$LOAD_SIGN to set up a oating currency sign. 3. Use EO$LOAD_PLUS to set up a nonblank plus sign. 4. Use EO$LOAD_MINUS to set up a nonminus minus sign (such as CR, DB, or the PL/I +).
EO$MOVE
Move Digits
Format
opcode pattern r
Pattern Operators
9x EO$MOVE Move Digits
Description
The EO$MOVE pattern operator moves digits, lling for insignicant digits. The rightmost nibble of the pattern operator is the repeat count. For the number of times specied in the repeat count, the following algorithm is executed: The next digit is moved from the source to the destination. If the digit is nonzero, signicance is set and zero is cleared. If the digit is not signicant (that is, a leading zero), it is replaced by the contents of the ll register in the destination. Notes 1. If r is greater than the number of digits remaining in the source string, a reserved operand abort is taken. 2. Use this pattern operator to move digits without a oating sign. If leadingzero suppression is desired, signicance must be clear. If leading zeros should be explicit, signicance must be set. A string of EO$MOVEs intermixed with EO$INSERTs and EO$FILLs will handle suppression correctly. 3. If check protection (*) is desired, EO$LOAD_FILL must precede the EO$MOVE.
EO$REPLACE_SIGN
Replace Sign when Zero
Format
opcode pattern len
Pattern Operators
46 EO$REPLACE_SIGN Replace Sign when Zero
Description
The EO$REPLACE_SIGN pattern operator is followed by an unsigned byte integer length. If the value of the source string is zero (that is, if Z is set), the contents of the ll register are stored in the byte of the destination string that is len bytes before the current position. Notes 1. The length must be nonzero and within the destination string already produced. If it is not, the contents of the destination string and the memory preceding it are UNPREDICTABLE. 2. You can use this pattern operator to correct a stored sign (EO$END_FLOAT or EO$STORE_SIGN) if a minus was stored and the source value turned out to be zero.
EO$_SIGNIF
Signicance
Format
opcode pattern
Pattern Operators
02 03 EO$CLEAR_SIGNIF EO$SET_SIGNIF Clear Signicance Set Signicance
Description
The signicance indicator is set or cleared. This controls the treatment of leading zeros (leading zeros are zero digits for which the signicance indicator is clear). Notes 1. Use EO$CLEAR_SIGNIF to initialize leading-zero suppression (EO$MOVE) or oating sign (EO$FLOAT) following a xed insert (EO$INSERT with signicance set). 2. Use EO$SET_SIGNIF to avoid leading-zero suppression (before EO$MOVE) or to force a xed insert (before EO$INSERT).
EO$STORE_SIGN
Store Sign
Format
opcode pattern
Pattern Operators
04 EO$STORE_SIGN Store Sign
Description
The EO$STORE_SIGN pattern operator places contents of the sign register into the destination. Note Use this pattern operator for any nonoating arithmetic sign. Precede it with either a EO$LOAD_PLUS or EO$LOAD_MINUS, or both, if the default sign convention is not desired.
Description and Opcode 1. Probe {Read, Write} Accessibility PROBE{R,W} mode.rb, len.rw, base.ab Change Mode CHM{K,E,S,U} param.rw, {-(ySP).w*} Where y=MINU(x, PSL<current_mode>) Return from Exception or Interrupt REI {(SP)+.r*} Load Process Context LDPCTX {PCB.r*, -(KSP).w*} Save Process Context SVPCTX {(SP)+.r*, PCB.w*} Move to Process Register MTPR src.rl, procreg.rl Move from Processor Register MFPR procreg.rl, dst.wl Bugcheck with {word, longword} message identier BUG{W,L} message.bx
2.
3.
4.
5.
6.
7. 8.
1 2
PROBEx
Probe Accessibility
Format
opcode mode.rb, len.rw, base.ab
Condition Codes
N Z V C Exceptions translation not valid < < < < 0; if {both accessible} then 0 else 1; 0; C;
Opcodes
0C 0D PROBER PROBEW Probe Read Accessibility Probe Write Accessibility
Description
The PROBE instruction checks the read or write accessibility of the rst and last byte specied by the base address and the zero-extended length. Note that the bytes in between are not checked. System software must check all pages if they will be accessed between the two end bytes. The protection is checked against the larger (and therefore less privileged) of the modes specied in bits <1:0> of the mode operand and the previous mode eld of the processor status longword (PSL). Note that probing with a mode operand of zero is equivalent to probing the mode specied in the previous-mode eld of the PSL.
PROBER #0,#4,(R0)
BEQL MOVQ
violation 8(AP),R0
PROBER #0,R0,(R1)
BEQL
violation
Note that for the PROBE instruction, probing an address returns only the accessibility of the pages and has no effect on their residency. However, probing a process address may cause a page fault in the system address space on the per-process page tables. Notes 1. If the valid bit of the examined page table entry is set, it is UNPREDICTABLE whether the modify bit of the examined page table entry is set by a PROBER. If the valid bit is clear, the modify bit is not changed. 2. Except for note 1, above, the valid bit of the page table entry, PTE<31>, mapping the probed address is ignored. 3. A length violation gives a status of not-accessible. 4. On the probe of a process virtual address, if the valid bit of the system page table entry is zero, a Translation Not Valid Fault occurs. This allows for the demand paging of the process page tables. 5. On the probe of a process virtual address, if the protection eld of the system page table entry indicates No Access, a status of not-accessible is given. Thus, a single No Access page table entry in the system map is equivalent to 128 No Access page table entries in the process map.
CHM
Change Mode
Format
opcode code.rw
Condition Codes
N Z V C Exceptions halt < < < < 0; 0; 0; 0;
Opcodes
BC BD BE BF CHMK CHME CHMS CHMU Change Change Change Change Mode Mode Mode Mode to to to to Kernel Executive Supervisor User
Description
Change mode instructions allow processes to change their access mode in a controlled manner. The instruction increases privilege only (decreases the access mode). A change in mode also results in a change of stack pointers; the old pointer is saved, and the new pointer is loaded. The processor status longword (PSL), program counter (PC), and code passed by the instruction are pushed onto the stack of the new mode. The saved PC addresses the instruction following the CHMx instruction. The code is sign extended. After execution, the appearance of the new stack is as follows:
SignExtended Code PC of next instruction Old PSL
ZK 1177A GE
: (SP)
The destination mode selected by the opcode is used to obtain a location from the system control block (SCB). This location addresses the CHMx dispatcher for the specied mode. If the vector<1:0> code is NEQU 0, then the operation is UNDEFINED.
Examples
1.
#7 #4 #-2
; Request the kernel mode service ; specified by code 7 ; Request the executive mode service ; specified by code 4 ; Request the supervisor mode service ; specified by customer code -2
REI
Return from Exception or Interrupt
Format
opcode
Condition Codes
N Z V C Exceptions reserved operand < < < < saved saved saved saved PSL<3>; PSL<2>; PSL<1>; PSL<0>;
Opcodes
02 REI Return from Exception or Interrupt
Description
A longword is popped from the current stack and held in a temporary program counter (PC). A second longword is popped from the current stack and held in a temporary processor status longword (PSL). The popped PSL is checked for internal consistency. If the processor is running virtual machine (VM) mode, the popped PSL is compared with the VirtualMachine Processor Status Longword (VMPSL) to determine that the transition from current VMPSL to popped PSL is allowed, and a VM-emulation trap is taken. If the processor is running a real machine, the popped PSL is compared with the current PSL to determine that the transition from current PSL to popped PSL is allowed. If the processor is not in kernel mode and is attempting to return to a PSL with the VMPSL VM bit set, a reserved operand fault occurs. The current stack pointer (SP) is saved, and a new SP is selected according to the new PSL CUR_ MOD and IS elds. The level of the highest privilege asynchronous system trap (AST) is checked against the current mode to see whether a pending AST can be delivered. Execution resumes with the instruction being executed at the time of the exception or interrupt. After completing an REI, a processor will correctly execute a modied instruction stream. Notes 1. The exception or interrupt service routine is responsible for restoring any registers saved and for removing any parameters from the stack. 2. As usual for faults, any Access Violation or Translation Not Valid conditions on the stack pops restore the stack pointer and fault.
LDPCTX
Load Process Context
Format
opcode
Condition Codes
N Z V C Exceptions reserved operand privileged instruction < < < < N; Z; V; C;
Opcodes
06 LDPCTX Load Process Context
Description
If the processor is in virtual machine (VM) mode, and the virtual machine is in kernel mode, then a VM-emulation trap is taken. Otherwise, if the processor is not in kernel mode, a privileged-instruction fault is taken. If neither exception is taken, the processor loads the process state in the process control block (PCB) specied by the privileged process control block base register (PCBB). The general registers, process-space memory management registers, and the address space number register (if implemented) are loaded from the PCB into the scalar processor. Execution is switched to the kernel stack. The program counter (PC) and processor status longword (PSL) are moved from the PCB to the stack, suitable for use by a subsequent REI instruction. If the processor implements an address space number (ASN) register, the process translation buffer (TB) state associated with the new value of the ASN (that is, the one loaded by the LDPCTX instruction) is ushed if the process last ran on a different processor. This is indicated by the previous CPU (PRVCPU) eld being not equal to the CPU identication (CPUID) register. If the processor does not implement the ASN register, the process-space TB state is unconditionally ushed. Notes 1. Some processors keep a copy of each of the per-process stack pointers (SPs) in internal registers. In those processors, LDPCTX loads the internal registers from the PCB. Processors that do not keep a copy of all four per-process stack pointers in internal registers keep only the current access mode register in an internal register and switch this with the PCB contents whenever the current access mode eld changes.
SVPCTX
Save Process Context
Format
opcode
Condition Codes
N Z V C Exceptions privileged instruction < < < < N; Z; V; C;
Opcodes
07 SVPCTX Save Process Context
Description
If the processor is in virtual machine (VM) mode, and the virtual machine is in kernel mode, then a VM-emulation trap is taken. Otherwise, the process control block (PCB) is specied by the privileged process control block base register (PCBB). The general registers are saved into the PCB. The program counter (PC) and processor status longword (PSL) currently on the top of the current stack are popped and stored in the PCB. If the processor implements the adress space number (ASN) register, then the CPU identication (CPUID) register is saved in the previous CPU (PRVCPU) eld in the PCB. If a SVPCTX instruction is executed when the interrupt stack (IS) is clear, then IS is set, the interrupt stack pointer (ISP) is activated, and interrupt priority level (IPL) is maximized with 1 because of the switch to the IS. Notes 1. The map, ASTLVL, and PME contents of the process control block (PCB) are not saved because they are rarely changed. Thus, not writing them saves overhead. 2. Some processors keep a copy of each of the per-process stack pointers in internal registers. In those processors, SVPCTX stores the internal registers in the PCB. Processors that do not keep a copy of all four per-process stack pointers in internal registers keep only the current access mode register in an internal register and switch this access mode register with the PCB contents whenever the current access mode eld changes. 3. Between the SVPCTX instruction that saves the state for one process and the LDPCTX that loads the state of another, the ISPs may not be referenced by MFPR or MTPR instructions. This implies that interrupt service routines invoked at a priority higher than the lowest one used for context switching must not reference the process stack pointers (SPs).
MTPR
Move to Processor Register
Format
opcode src.rl, procreg.rl
Condition Codes
N Z V C Exceptions reserved operand fault reserved instruction fault < < < < UNPREDICTABLE UNPREDICTABLE UNPREDICTABLE UNPREDICTABLE
Opcodes
DA MTPR Move to Processor Register
Description
If the processor is in virtual machine (VM) mode, and the virtual machine is in kernel mode, then a VM-emulation trap is taken. MTPR loads the source operand specied by src into all copies of the processor register specied by procreg that are implemented on the vector and scalar processors. The procreg operand is a longword that contains the processor register number. Execution may have register-specic side effects. Notes 1. If the processor internal register does not exist, a reserved operand fault occurs. 2. A reserved instruction fault occurs if instruction execution is attempted in other than kernel mode. 3. A reserved operand fault occurs on a move to a read-only register. 4. After an MTPR instruction, the condition codes are UNPREDICTABLE, unless noted otherwise under the description of the specic processor register.
MFPR
Move from Processor Register
Format
opcode procreg.rl, dst.wl
Condition Codes
N Z V C Exceptions reserved operand fault reserved instruction fault < < < < UNPREDICTABLE UNPREDICTABLE UNPREDICTABLE UNPREDICTABLE
Opcodes
DB MFPR Move from Processor Register
Description
If the processor is in virtual machine (VM) mode, and the virtual machine is in kernel mode, then a VM-emulation trap is taken. The destination operand is replaced by the contents of the processor register specied by procreg. The procreg operand is a longword that contains the processor register number. Execution may have register-specic side effects. Notes 1. If the processor internal register does not exist, a reserved operand fault occurs. 2. A reserved instruction fault occurs if instruction execution is attempted in other than kernel mode. 3. A reserved operand fault occurs on a move from a write-only register. 4. After an MFPR instruction, the condition codes are UNPREDICTABLE, unless noted otherwise under the description of the specic processor register.
BUG
Bugcheck
Format
opcode message.bx
Condition Codes
N Z V C Exceptions reserved instruction < < < < N; Z; V; C;
Opcodes
FEFF FDFF BUGW BUGL Bugcheck with word message identier Bugcheck with longword message identier
Description
The hardware treats these opcodes as reserved to Compaq and as faults. The OpenVMS operating system treats them as requests to report software detected errors. The inline message identier is zero extended to a longword (BUGW) and interpreted as a condition value (see the VAX Procedure Calling and Condition Handling Standard in the OpenVMS Programming Interfaces: Calling a System Routine). If the process is privileged to report bugs, a log entry is made. If the process is not privileged, a reserved instruction is signaled.
Examples
1.
4 5
; Bugcheck with word message ; identifier 4 ; Bugcheck with longword ; message identifier 5
10
VAX Vector Architecture
This chapter describes an extension to the VAX architecture for integrated vector processing. Some VAX vector architecture departs from the traditional VAX scalar architecture, especially in the areas of UNPREDICTABLE results, vector processor exceptions, and instruction/memory synchronization.
Element 63
ZK 1445A GE
A vector instruction that performs a register-to-register operation is dened as a vector operate instruction. A vector operate instruction that reads or writes F_oating data, or integer data for shifts or integer arithmetic operations, reads bits <31:0> of each source element and writes bits <31:0> of each destination element. Bits <63:32> of the destination are UNPREDICTABLE for F_oating, integer arithmetic, and shift instructions. Vector logical instructions read bits <31:0> of each source element and write the result into bits <31:0> of each destination element; bits <63:32> of the destination element receive bits <63:32> of the corresponding element of the Vb source operand. For vector instructions that read longword data from memory into a vector register (VLDL and VGATHL), bits <63:32> of the destination elements are UNPREDICTABLE. If the same vector register is used as both source and destination in a Gather Memory Data into Vector Register (VGATH) instruction, the result of the VGATH instruction is UNPREDICTABLE. For the IOTA vector instruction, bits <63:32> of the destination elements are UNPREDICTABLE.
The Vector Mask Register (VMR), shown in Figure 103, has 64 bits, each corresponding to an element of a vector register. Bit <0> corresponds to vector element 0. See Section 10.3.1 for information on masked operations.
ZK 1447A GE
The 7-bit Vector Count Register (VCR), shown in Figure 104, receives the length of the offset vector generated by the IOTA instruction. Figure 104 Vector Count Register (VCR) 31 SBZ/RAZ 7 6 count
ZK 1448A GE
These registers are read and written by Move from/to Vector Processor (MFVP/MTVP) instructions.
The VPSR is shown in Figure 105, and is described in Table 101. Figure 105 Vector Processor Status Register (VPSR)
31 30 B S S Y 0 25 24 23 I I V M O P 0 8 7 6 5 4 3 2 1 0 A P M R S R V E M F 0 L T S E X F D S T N
ZK 1449A GE
<1>
<2>
<3>
<4> <5>
R R/W1C
<6>
R/W1C
<7>
R/W1C
<23:8> <24>
R R/W1C
Table 102 shows the possible settings of VPSR<3:0> in the same MTPR instruction, and the resulting action for the vector processor. The state of the vector processor is determined by the encoding of Vector Processor Enabled (VPSR<VEN>) and Vector Processor Busy (VPSR<BSY>). The vector processor state for possible encodings is shown in Table 103. Table 102 Possible VPSR<3:0> Settings for MTPR
RLD 0 0 0 0 0 1 1 STS 0 0 0 0 1 0 0 RST 0 0 1 1 0 0 0 VEN 0 1 0 1 0 0 1 Meaning Disable vector processor Enable vector processor Reset state and disable vector processor Reset state and enable vector processor Store state (must disable vector processor) Reload state and disable vector processor Reload state and then enable vector processor
0 1
1 0
Note that because the vector and scalar processors can execute asynchronously, a VPSR state transition may not be seen immediately by the scalar processor. After performing an MTPR to VPSR, software must then issue an MFPR from VPSR to ensure that the new state of VPSR (and VAER if cleared by VPSR<RST>) will affect the execution of subsequently issued vector instructions. The MFPR in this case will not complete until the new state of the vector processor becomes visible to the scalar processor. If software does not issue the MFPR, then it is UNPREDICTABLE whether this synchronization between the new state of VPSR (and VAER) and subsequently issued vector instructions occurs.
The Vector Memory Activity Check (VMAC) register, shown in Figure 107, is used to guarantee the completion of all prior vector memory accesses. For more information on this function of VMAC, refer to Section 10.7.2.2. An MFPR from VMAC also ensures that all hardware errors encountered by previous vector memory instructions are reported before the MFPR completes. For more information on this function of VMAC, refer to Section 10.9, Hardware Errors. The value returned by MFPR from VMAC is UNPREDICTABLE. Figure 107 Vector Memory Activity Check (VMAC) Register
31 0
ZK 1451A GE
The Vector Translation Buffer Invalidate All (VTBIA) register, shown in Figure 108, is a write-only register that may be omitted in some implementations. If the vector processor contains its own translation buffer, moving zero into VTBIA using the MTPR instruction invalidates the entire vector translation buffer. For more information, refer to Section 10.8, Memory Management.
ZK 1451A GE
The Vector State Address Register (VSAR), shown in Figure 109, is a read/write register that contains a quadword-aligned virtual address of memory assigned by software for storing implementation-specic vector hardware state when the asynchronous method of handling memory management exceptions is implemented. The length of this memory area is implementation specic. Software must guarantee that accessing the memory pointed to by the address does not result in a memory management exception. If the synchronous method of handling memory management exceptions is implemented, this register is omitted. For more information, refer to Section 10.6.1, Vector Memory Management Exception Handling. Figure 109 Vector State Address Register (VSAR)
31 Virtual Memory Address 3 2 SBZ
ZK 1452A GE
With the exception of VPSR (and VAER), an MTPR to any other writable vector internal processor register (IPR) ensures that the new state of the IPR affects the execution of all subsequently issued vector instructions. Vector instructions issued before an MTPR to any writable vector IPR are unaffected by the new state of the IPR (and any implicitly changed vector IPR) except in one case: when the MTPR sets VPSR<RST> while VPSR<BSY> is set. (See Table 101 for more details.) Except for the following two cases, the operations of the scalar and vector processors are UNDEFINED after execution of MTPR to a read-only vector IPR, MTPR to a nonexistent vector IPR, MTPR of a nonzero value to a MBZ eld, or MTPR of a reserved value to a vector IPR. The preferred implementation is to cause reserved-operand fault. If an implementation supports an optional vector processor, but the vector processor is not installed, MTPR to VPSR has no effect. If an implementation supports an optional vector processor, but either the vector processor is not installed, or the scalar/vector processor pair uses a common translation buffer (TB), MTPR to VTBIA has no effect.
In each of these cases, MTPR is implemented as a no-op. Except for the following two cases, the operations of the scalar and vector processors are UNDEFINED after execution of MFPR from a nonexistent vector IPR, or MFPR from a write-only vector IPR. The preferred implementation is to cause reserved-operand fault. If an implementation supports an optional vector processor, but the vector processor is not installed, MFPR from VPSR returns zero.
The internal processor register (IPR) assignments for these registers are found in Table 105. Table 105 IPR Assignments
Offset (Hex) 90 91 92 93 94 959B 9C9F IPR VPSR VAER VMAC VTBIA VSAR Reserved for vector architecture use Reserved for vector implementation use
or 15 14 13 12 11 M M M 0 O T I E F Va 8 7 Vb 4 3 Vc 0
ZK 1453A GE
<7:4> <11:8>
<12> <13>
<13>
<14>
<15>
The vector control word operand may determine some or all of the following: Enabling of masked operations Enabling of oating underow for oating-point instructions and integer overow for integer operations Which vector registers to use as sources, destinations, or both Which type of operation to perform (for the convert and compare instructions)
VAX Vector Architecture 10.3 Vector Instruction Formats 10.3.2 Exception Enable Bit
The vector processor does not use the IV and FU bits in the processor status longword (PSL) to enable integer overow and oating underow exception conditions. These exception conditions are enabled or disabled on a per instruction basis for vector integer and oating-point instructions by bit <13> in the vector control word operand (cntrl<EXC>). When cntrl<EXC> is set, oating underow is enabled for vector oating-point instructions, and integer overow is enabled for vector integer instructions. When cntrl<EXC> is clear, oating underow and integer overow are disabled. Note that for VLD/VGATH instructions bit<13> is used and labeled differently.
Vector processors that do not implement cntrl<MI> ignore the setting of this bit in the control word for VLD and VGATH. The results of VLD/VGATH and VST/VSCAT are unaffected by the setting of cntrl<MI>. This includes memory management, where access-checking is done with read intent for VLD/VGATH even if cntrl<MI> is set. However, incorrectly setting cntrl<MI> can prevent the optimization of these instructions.
b. Vector Control Word Format for VSTL and VSTQ 15 14 13 12 11 M M O T 0 0 E F 0 8 7 0 4 3 dst / src vec reg num 0
c. Vector Control Word Format for VGATHL and VGATHQ 15 14 13 12 11 M M M O T I 0 E F 0 8 7 4 3 dst / src vec reg num 0
d. Vector Control Word Format for VSCATL and VSCATQ 15 14 13 12 11 M M O T 0 0 E F 0 8 7 4 3 dst / src vec reg num 0
e. Vector Control Word Format for VVADDL/F/D/G, VVSUBL/F/D/G, and VVDIVF/D/G 15 14 13 12 11 M M E O T X 0 E F C 8 7 4 3 dst vec reg num 0
f. Vector Control Word Format for VVSLLL, VVSRLL, VVBISL, VVXORL, and VVBICL 15 14 13 12 11 M M O T 0 0 E F 8 7 4 3 dst vec reg num 0
h. Vector Control Word Format for VVCVT 15 14 13 12 11 M M E O T X 0 E F C cvt func 8 7 4 3 dst vec reg num
ZK 5053A GE
j. Vector Control Word Format for VSADDL/F/D/G, VSSUBL/F/D/G, VSMULL/F/D/G and VSDIVF/D/G 15 14 13 12 11 M M E O T X 0 E F C 0 8 7 4 3 dst vec reg num 0
k. Vector Control Word Format for VSSLLL, VSSRLL, VSBISL, VSXORL, and VSBICL 15 14 13 12 11 M M O T 0 0 E F 0 8 7 4 3 dst vec reg num 0
n. Vector Control Word Format for IOTA 15 14 13 12 11 0 M T 0 0 F 0 8 7 0 4 3 dst vec reg num
ZK 5054A GE
The following examples use several of these qualiers: VVADDF/1 VVMULD/0 VVADDL/V V0, V1, V2 V0, V1, V2 V0, V1, V2 ;Operates on elements with mask bit set ;Operates on elements with mask bit clear ;Enables exception conditions (integer overflow here) ;Enables floating underflow and ;Operates on elements with mask bit clear ;Indicates Modify Intent
The following ow details how vector instruction decode proceeds from the scalar processor: DO WHILE (the scalar processor has a decoded vector instruction for the vector processor) IF (the vector processor is viewed as disabled -- the scalar processor sees VPSR<VEN> as clear) THEN
If asynchronous memory management handling is implemented, and VPSR<MF> is set when the scalar processor sends the vector processor an instruction, the vector processor clears VPSR<MF>, and retries the faulting memory reference before any new vector instructions in the queue are executed. The VAX scalar processor need not wait for the vector processor to complete its operation before processing other instructions. Thus, the scalar processor could be processing other VAX instructions while the vector processor is performing vector operations. However, if the scalar processor issues an MFVP instruction to the vector processor, the scalar processor must wait for the MFVP result to be written before processing other instructions. Because the scalar and vector processors may execute asynchronously, it is possible to context switch the scalar processor before the vector processor is idle. Software is responsible for ensuring that scalar and vector memory management remains synchronized, and that all exceptions get reported in the context of the process where they occurred. This is achieved by making sure all vector memory accesses complete, and then disabling the vector processor before any scalar context switch. The vector processor may have its own translation buffer (TB) and cache and may have separate paths to memory, or it may share these resources with the scalar processor.
If software does not wait for VPSR<BSY> to be clear, it is possible that while a normal scalar context switch to a new process is being performed, the vector processor may still be executing non-memory-access instructions from the previous process. The required steps for Vector Context Switching are discussed in Section 10.6.4, Handling Disabled Faults and Vector Context Switching.
VAX Vector Architecture 10.5 Execution Model 10.5.3 Overlapped Instruction Execution
To improve performance, the vector processor may overlap the execution of multiple instructionsthat is, execute them concurrently. Further, when no data dependencies are present, the vector processor may complete instructions out of order relative to the order in which they were issued. A vector processor implementation can perform overlapped instruction execution by having separate function units for such operations as addition, multiplication, and memory access. Both data-dependent and data-independent instructions can be overlapped; the former by a technique known as chaining, which is described in the next section. In many instances, overlapping allows an operation from one instruction to be performed in any order with respect to an operation of another instruction. When vector arithmetic exceptions occur during overlapped instruction execution, exception handling software may not see the same instruction state and exception information that would be returned from strictly sequential execution. Most notably, the VAER could indicate the exception conditions and destination registers of a number of vector instructions that were executing concurrently and encountered exceptions. Exception reporting during chained execution is discussed further in Section 10.5.3.1. To ensure correct program results and exception reporting, the architecture does place requirements on the ordering among the operations of one vector instruction and those of another. The primary goal of these requirements is to ensure that the results obtained from both the overlapped and strictly sequential execution of data-dependent instructions are identical. A secondary goal is to establish places within the instruction stream where software is guaranteed to receive the reporting of exceptions from a chain of data-dependent instructions. In many cases, these requirements ensure the obvious: for example, an output vector register element of one arithmetic instruction must be computed before it can be used as an input element to a subsequent instruction. But, a number of the things ensured are not obvious: for example, a Memory Instruction Synchronization (MSYNC) instruction must report exceptions encountered in generating a value of Vector Mask Register (VMR) that is used in a previously issued masked store instruction. To precisely dene the requirements on the ordering among operations, Section 10.5.3.3 discusses the dependence among their results (the vector register elements and control register bits produced by the operations). 10.5.3.1 Vector Chaining The architecture allows vector chaining, where the results of one vector instruction are forwarded (chained) to another before the input vector of the rst instruction has been completely processed. In this way, the execution of data-dependent vector instructions may be overlapped. Thus, chaining is an implementation-dependent feature that is used to improve performance. With some restrictions stated below, the vector processor may chain a number of instructions. Usually, each instruction is performed by a separate function unit. The number and types of instructions allowed within a chained sequence (often referred to as a chain) are implementation dependent. Typically, implementations will attempt to chain sequences of two or three instructions such as: operate-operate, operate-store, load-operate, operate-operate-store, and load-operate-store. Load-operate-operate-store may also be possible.
For the previous example, assume that an exception is taken after the completion of the VVMULG. The VAER will indicate: Floating Overow and Floating Reserved Operand exception condition types; and V3 as a destination register. However, no default result will be found in the appropriate element of V3 because it has been overwritten by the VVMULG. The architecture allows a vector load to be chained into a vector operate instruction provided the operate instruction can be suspended and resumed to produce the correct result if the vector load gets a memory management exception. Consider this example: VLDL A, #4, V0 VVADDF V0, V1, V1 In synchronous memory management mode, the VVADDF cannot be chained into the VLDL until the VLDL is ensured to complete without a memory management exception. This occurs because the scalar processor is not even allowed to issue the VVADDF to the vector processor until the memory management checks for the VLDL have been completed. In asynchronous memory management mode, the VVADDF may be chained into the VLDL prior to the completion of memory management exception checking. This is possible because a memory management exception in asynchronous memory management mode provides sufcient state to restart both the VLDL and the VVADDF when the memory management exception is corrected.
Implicit in statements of the form: result DEPENDS on B is the requirement that the result depends only on the value of B generated by the most immediate previously issued instruction relative to the results own generating instruction. For instance, in the following example, the V3 produced by the VVMULF has the dependence: V3[i] DEPENDS on V7[i]. This means that the value of V3[i] produced by the VVMULF depends only on the value of V7[i] produced by the VVADDF.
for i = 0 to VLR-1 begin Vc[i] DEPENDS on VLR; if {MOE EQL 1} then Vc[i] DEPENDS on VMR<i>; if ( {MOE EQL 1} AND {VMR<i> EQL MTF} ) OR {MOE EQL 0} then begin Vc[i] DEPENDS on Vb[i]; if {Vector-Vector Operation} AND NOT {VVCVTxy} then Vc[i] DEPENDS on Va[i]; end; end;
for i = 0 to VLR-1 begin Vc[i] DEPENDS on VLR; if {MOE EQL 1} then Vc[i] DEPENDS on VMR<i>; if ( {MOE EQL 1} AND {VMR<i> EQL MTF} ) OR {MOE EQL 0} then if VGATH then begin Vc[i] DEPENDS on Vb[i]; k = BASE + Vb[i]; end else k = BASE + i * STRIDE; Vc[i] DEPENDS on LOAD_COMPLETED(k); end;
j = 0; for i = 0 to VLR-1 begin if ( {MOE EQL 1} AND {VMR<i> EQL MTF} ) OR {MOE EQL 0} then begin if {MOE EQL 1} then ELEMENT_STORED[j] depends on VMR<i>; ELEMENT_STORED[j] DEPENDS on Vc[i]; ELEMENT_STORED[j] DEPENDS on VLR; if VSCAT then begin ELEMENT_STORED[j] DEPENDS on Vb[i]; k = BASE + Vb[i]; end else k = BASE + i * STRIDE; STORE_COMPLETED(k) DEPENDS on ELEMENT_STORED[j]; j = j+1; end; end;
for i = 0 to VLR-1 begin VMR<i> DEPENDS on VLR; if {MOE EQL 1} then VMR<i> DEPENDS on VMR<i> if ( {MOE EQL 1} AND {VMR<i> EQL MTF} ) OR {MOE EQL 0} then begin VMR<i> DEPENDS on Vb[i]; if VVCMP then VMR<i> DEPENDS on Va[i]; end; end;
for i = 0 to VLR-1 begin Vc[i] DEPENDS on VLR; Vc[i] DEPENDS on VMR<i>; if {VMR<i> EQL MTF} then begin if VVMERGE then Vc[i] DEPENDS on Va[i]; end else Vc[i] DEPENDS on Vb[i]; end;
j = 0; for i = 0 to VLR-1 begin Vc[j] DEPENDS on VLR; if {VMR<i> EQL MTF} then begin Vc[j] DEPENDS on VMR<0..i>; j = j+1; end; end; VCR DEPENDS on VMR<0..VLR-1>;
DEPENDS on the vector register elements and vector control register bits produced and stored by all previous vector instructions DEPENDS on VMR<0..31> DEPENDS on VMR<32..63> DEPENDS on VCR DEPENDS on VLR
6 5 4 3 2 1 0 V V V A I A M P L S O L : (SP)
The length (L) bit, the Page Table Entry (PTE) reference (P) bit, and the modify or write intent (M) bit are dened in the VAX Architecture Reference Manual. Vector processor memory management exceptions set these bits in the same way as required for scalar memory management exceptions. The vector alignment exception (VAL) bit must be set when an access control violation has occurred due to a vector element not being properly aligned in memory. The vector I/O space reference (VIO) bit is set by some implementations to indicate that an access control violation has occurred due to a vector instruction reference to I/O space. The vector asynchronous memory management exception (VAS) bit must be set to indicate that a vector processor memory management exception has occurred when the following asynchronous memory management scheme is implemented.
If more than one kind of memory management exception could occur on a reference to a single page, then access control violation takes precedence over both translation not valid and modify. If more than one kind of access control violation could occur, the precedence of vector access control violation, vector alignment exception, and vector I/O space reference is UNPREDICTABLE.
With the synchronous method, no new instructions are processed by the vector or the scalar processor until the vector memory access instruction is guaranteed to complete without incurring memory management exceptions. In such an implementation, the vector memory access instruction is backed up when a memory management exception occurs and a normal VAX memory management (access control violation, translation not valid, modify) fault taken with the program counter (PC) pointing to the faulting vector memory access instruction. If the synchronous method is implemented, VSAR is omitted. After xing the vector processor memory management exception, software may REI back to the faulting vector instruction. Alternately, software may context switch to another process. For further details, see Section 10.6.4. With the asynchronous method, vector memory management exceptions set VPSR<PMF> and VPSR<MF>. The vector processor does not inform the scalar processor of the exception condition; the scalar processor continues processing instructions. All pending vector instructions that have started execution are allowed to complete if their source data is valid. The scalar processor is notied of an exception condition or conditions when it sends the next vector instruction to the vector processor and a normal VAX memory management fault is taken. The saved PC points to this instruction, which is not the vector memory access instruction that incurred the memory management exception. At this point, the vector processor clears VPSR<PMF>. After xing the vector processor memory management exception, software may allow the current scalar/vector process to continue. Before vector processor instruction execution resumes using state that already exists in the vector processor, the vector processor clears VPSR<MF> and the faulting memory reference is retried. Alternately, software may context switch to another process. For further details, see Section 10.6.4. When a vector processor memory management exception is encountered by a VLD or VGATH instruction, the contents of the destination vector register elements are UNPREDICTABLE. When a vector processor memory management exception is encountered by a VSTL or VSCAT instruction, it is UNPREDICTABLE whether the vector processor writes any result location for which an exception did not occur. In either case, if the fault condition can be eliminated by software and the instruction restarted, then the vector processor will ensure that all destination register elements or result locations are written.
The exception condition type and destination register number are always recorded in the Vector Arithmetic Exception Register (VAER) when a vector arithmetic exception occurs. Refer to Section 10.2.3, Internal Processor Registers, for more information.
In these cases, the vector processor clears VPSR<VEN> and ags the error condition by setting the appropriate bit in VPSR. (See Table 101.) Software disables the vector processor by writing a zero into VPSR<VEN> using an MTPR instruction. Once the vector processor is disabled, only software can enable it. The software does this by writing a one to VPSR<VEN> using an MTPR. Recall that after performing an MTPR to VPSR, software must then issue an MFPR from VPSR to ensure that the new state of VPSR will affect the execution of subsequently issued vector instructions. The MFPR will not complete in this case until the new state of the vector processor becomes visible to the scalar processor. When the vector processor disables itself due to a hardware error, it is implementation dependent whether the vector processor completes any pending vector instruction. However, in this case, the vector processor ensures when it is reenabled that all incompleted instructions have been ushed from the instruction queue. If the scalar processor attempts to issue a vector instruction after it views the vector processor as disabled, then a vector processor disabled fault occurs. The vector processor disabled fault uses SCB offset 68 (hex). The exception handling software (running on the scalar processor) can then read the vector internal processor registers (IPRs) with MFPR instructions to determine what exception
The MSYNC faults if exceptions occur in the production of V2[0] by the VVMULF or in the storage of V2[0] by the VSTL. MSYNC need not fault if exceptions occur in the production of: V2[1..VLR-1] by the VVMULF, V3[0..VLR-1] by the VVADDF, or V3[0..VLR-1] by the VVCVTFD.
2.
The MSYNC faults if exceptions occur in the loading of V0[0..VLR-1] from memory. MSYNC need not fault if exceptions occur in the production of V0[0..VLR-1] by the VVADDF.
3.
The MSYNC faults if exceptions occur in the loading of V1[0..VLR-1] from memory. MSYNC need not fault if exceptions occur in the production of V2[0..VLR-1] by the VVADDF.
4.
The MSYNC faults if exceptions occur: in the production of V2[0..VLR-1] by the VVMULF, in the production of VMR<0..VLR-1> by the VVGTRF, or in the storage by the VSTL/1 of elements of V0 for which the corresponding VMR bit is one. Examples of Exceptions the Processor Reports Prior to MFVP Completion The following examples illustrate which exceptions the vector processor will report prior to the completion of an MFVP from a vector control register:
1.
Unreported exceptions that occur: in the loading of V1[0] from memory by the VLDL, in the production of V2[0] by the VVMULF, and VMR<0> by the VVGTRF are reported by the vector processor prior to the completion of the MFVMRLO. The vector processor need not at that time report any exceptions that occur in the loading of V1[1..63] from memory by the VLDL or in the production of V2[1..63] by the VVMULF. Note that the vector processor need not report any exceptions before completing MFVMRHI.
V0, V1 #patt R1
For any value of i in the range of 0 to 31 inclusive: the value of VMR<i> delivered by MFVMRLO only depends on the value placed into VMR<i> by the MTVMRLO. As a result, the vector processor need not report exceptions that occur in the production of VMR by the VVGTRF prior to completing the MFVMRLO.
3.
VVMULF/1 V1, V1, V2 MTVMRLO #patt MFVMRLO R1 For any value of i in the range of 0 to 31 inclusive: the value of VMR<i> delivered by MFVMRLO only depends on the value placed into VMR<i> by the MTVMRLO. As a result, the vector processor need not report exceptions that occur in the production of V2[0..VLR-1] by the VVMULF/1 prior to completing the MFVMRLO.
4.
Prior to the completion of the MFVCR, the vector processor must report any exceptions that occurred in the production of V2[0..31] by the VVMULF and VMR<0..31> by the VVGTRF. Note that VCR produced by an IOTA depends only on VMR<0..VLR-1>. Recall that no exceptions can occur in the production of V4[0..VCR-1] by IOTA.
5.
For any value of i in the range of 0 to 31 inclusive: prior to the completion of the MFVMRLO, the vector processor must report any exceptions that occurred: in the loading of V2[i] from memory for which V0[i] is greater than V1[i], in the production of VMR<0..31> by the VVGTRF, and in the production of VMR<0..31> by the VSGTRF/1.
6.
In this example, the value of VMR<31:0> delivered by MFVMRLO only depends on the value placed into VMR<31:0> by the MTVMRLO whether this value is V1[0] or the previous value of the location is UNPREDICTABLE. As a result, the vector processor need not report exceptions that occur in the production of V1 by the VVMULF or in the storage of V1 by the VSTL.
10.7 Synchronization
For most cases, it is desirable for the vector processor to operate concurrently with the scalar processor so as to achieve good performance. However, there are cases where the operation of the vector and scalar processors must be synchronized to ensure correct program results. Rather than forcing the vector processor to detect and automatically provide synchronization in these cases, the architecture provides software with special instructions to accomplish the synchronization. These instructions synchronize the following: Exception reporting between the vector and scalar processors Memory accesses between the scalar and vector processors Memory accesses between multiple load/store units of the vector processor
Software must determine when to use these synchronization instructions to ensure correct results. The following sections describe the synchronization instructions.
When SYNC completes, a longword value (which is UNPREDICTABLE) is returned to the scalar processor. The scalar processor writes the longword value to the scalar destination of the MFVP and then proceeds to execute the next instruction. If the scalar destination is in memory, it is UNPREDICTABLE whether the new value of the destination becomes visible to the vector processor until scalar/vector memory synchronization is performed. When SYNC faults, it is not completed by the vector processor and the scalar processor does not write a longword value to the scalar destination of the MFVP. Also, depending on the exception condition encountered, the SYNC itself takes either a vector processor disabled fault or memory management fault. If both faults are encountered while the vector processor is performing SYNC, then the SYNC itself takes a vector processor disabled fault. Note that it is UNPREDICTABLE whether the vector processor is idle when the fault is
MSYNC faults when any unreported exception has occurred in the production or storage of any result (vector register element or vector control register bit) that MSYNC depends upon. Such results include all elements loaded or stored by a previously issued vector memory instruction as well as any element or control register bit that these elements depend upon. It is UNPREDICTABLE whether MSYNC faults due to exceptions that occur in the production and storage of results (vector register elements and vector control register bits) that MSYNC does not depend upon. Software should not rely on such exceptions being reported by MSYNC for program correctness. When MSYNC completes, a longword value (which is UNPREDICTABLE) is returned to the scalar processor, which writes it to the scalar destination of the MFVP. The scalar processor then proceeds to execute the next instruction. If the scalar destination is in memory, it is UNPREDICTABLE whether the new value of the destination becomes visible to the vector processor until another scalar/vector memory synchronization instruction is performed. When MSYNC faults, it is not ensured that all previously issued scalar and vector memory instructions have nished. In this case, the scalar processor writes no longword value to the scalar destination of the MFVP. Depending on the exception encountered by the vector processor, the MSYNC takes a vector processor disabled fault or memory management fault. Note that it is UNPREDICTABLE whether the vector processor is idle when the fault is generated. After the fault has been serviced, the MSYNC may be returned to through an REI. Section 10.5.3.3 gives the necessary rules and examples to determine what vector control register elements and vector control register bits MSYNC depends upon. 10.7.2.2 Memory Activity Completion Synchronization (VMAC) Privileged software needs a way to ensure scalar/vector memory synchronization that will not result in any exceptions being reported. Reading the VMAC internal processor register (IPR) with the privileged MFPR instruction is provided for these situations. It is especially useful for context switching. Once a MFPR from VMAC is issued by the scalar processor, the scalar processor executes no further instructions until VMAC completes, which it does when the following events occur: All vector and scalar memory activities have ceased. All resultant memory write operations have been made visible to both the scalar and vector processor. A longword value (which is UNPREDICTABLE) is returned to the scalar processor.
After writing the longword value to the scalar destination of the MFPR, the scalar processor then proceeds to execute the next instruction. If the scalar destination is in memory, it is UNPREDICTABLE whether the new value of the destination becomes visible to the vector processor until another scalar/vector memory synchronization operation is performed.
VAX Vector Architecture 10.7 Synchronization 10.7.5 Required Use of Memory Synchronization Instructions
Table 1015 shows for all possible pairs of vector or scalar read and write operations to a common memory location, whether one of the scalar/vector memory synchronization instructions or the VSYNC instruction must be issued after the rst reference and before the second. Since the MSYNC instruction also includes the VSYNC function, it can always be used instead of VSYNC. In general, these rules apply to any sequence of instructions that access a common memory location, no matter how many other vector or scalar instructions are issued between the rst instruction that accesses the common location and the second instruction that accesses the same location. For example, the following code sequence depicts a vector load followed by a scalar write operation to the same memory location. Between these two instructions are other scalar/vector instructions that do not access the common memory location. A scalar/vector memory synchronization instruction (MSYNC or VMAC) must be executed sometime after the vector read operation and before the scalar write operation to the common location. (Here MSYNC is shown.) VLDL A, #4, V0 . other scalar/vector instructions that do not access A . MSYNC Dst MOVL R0, A In most cases, MSYNC is the preferred method for ensuring scalar/vector memory synchronization. However, there are special cases, usually encountered by an operating system, when VMAC is more appropriate. Cases when scalar/vector memory synchronization is required are as follows: After a vector instruction that stores to memory and before a peripheral (I/O) data transfer of the stored location is initiated by an application program. This ensures that the value stored will be transferred to the output device. The application must ensure that this requirement is met by using MSYNC. Using VMAC in this case is not sufcient because unlike MSYNC, VMAC does not ensure that all previous vector memory instructions have successfully completed. After a vector instruction that stores to memory and before the associated scalar processor can execute a HALT instruction. This ensures that a read operation or modify operation by another processor will access the updated memory value. VMAC is the preferred method for this case. Before the vector processor state is saved as a result of power failure. A read or modify operation of the same memory must read the updated value (provided that the duration of the power failure does not exceed the maximum nonvolatile period of the main memory). Also, software is responsible for saving any pending vector processor exception status. VMAC is the preferred method for this case. Before a context switch. Software is responsible for ensuring that the vector processor has completed all its memory accesses before performing a context switch. Software is also responsible for saving any pending vector processor exception status. VMAC is the preferred method for this case.
Scalar Scalar
Scalar Vector
Vector Scalar
Vector Vector
No1;2 No No
2
No1 No M4 M
4 3
No1 M M M
No1 V5 V V
No2
2
memory synchronization or VSYNC is never required between two read accesses to a memory location. memory synchronization is never required between two accesses by the VAX scalar processor to a memory location. scalar read is synchronous and will have completed before a vector memory operation is issued.
4 Although
a scalar write operation is a synchronous instruction, scalar/vector memory synchronization is required to ensure that the written data is visible to the vector processor before the vector memory reference is executed. 5 See Section 10.7.5.1 for the conditions when VSYNC is not required between a vector memory read/write pair.
10.7.5.1 When VSYNC Is Not Required There exist conditions when VSYNC is not required between conicting vector memory accesses. A VSYNC is not required before a vector memory store instruction (VST/VSCAT) if, for each memory location to be accessed by the store, both of the following conditions are met: Each of the stores accesses to the location does not conict with any access to the location by previously issued vector store instructions. Conict is avoided in this case because one of the following events occurred: The location is not shared. All accesses to the location by previous store instructions were forced to complete by the issue of an MSYNC or VMAC. Each of the stores accesses to the location does not conict with any access to the location by previously issued vector load (VLD/VGATH) instructions. Conict is avoided in this case because one of the following events occurred: The location is not shared. All accesses to the location by previous load instructions were forced to complete by the issue of an MSYNC or VMAC. Each of the stores accesses to the location depends on the completion (as seen by the vector processor) of all accesses to the location by previous LOAD instructions. (The examples immediately following demonstrate this concept.) In all other cases of conicting vector memory accesses, VSYNC is necessary to ensure correct results. Examples Where VSYNC Is Not Required In the following examples, VSYNC is not required because both of the previous conditions have been met for each location accessed by the store instruction:
VLDL VSTL
A, #4, V0 V0, A, #4
2.
3.
4.
Examples Where VSYNC Is Required In the following examples, VSYNC is required before the vector memory store instruction:
1.
If the VSYNC is not included, V0 could contain incorrect data at the end of the sequence since the vector processor is allowed to begin the VSTL before the VLDL is nished. This occurs because there is no dependence between the VMR value used by the VLDL and the VSTL.
2.
VLDL A, #4, V0 VVMERGE/0 V0, V1, V1 VSYNC VSTL V1, A, #4 Unless the programmer can ensure that the VMR mask being used by the VVMERGE will force the access of each location by the VSTL to depend on the access to that location by the VLDL, a VSYNC is required. Note that in general, when masked operations provide a conditional path of dependence between conicting memory accesses, a VSYNC is usually necessary to ensure correct results.
In this example, the VSTL writes locations A to A+255 and the VLDL reads locations A+128 to A+255. Without the VSYNC, the vector processor is allowed to start reading locations A+128 to A+255 for the VLDL before the vector processor completes (or even starts) writing locations A+128 to A+255 for the VSTL. Consequently, V2[0:31] will not contain V1[32:63], which is the intended result. Note that the rules on when VSYNC is not required (found in Section 10.7.5.1) only apply to waiving the use of VSYNC prior to VST/VSCAT instructions.
4.
The VSYNC is needed in this example because the VSCATL may store elements of V1 into a common location before the VGATHL has nished loading that location into all the appropriate elements of V0. As a result, elements of V0 fetched from the same location may be unequal. Suppose in the example that V2[0] = V2[63] = 0 and that the original value of location A before the sequence starts is X. Then it is possible without the VSYNC that V0[63] = X*V9[0] and that (A)= V1[63] = V9[63]*V9[0]*X after the sequence completes.
5.
The VSYNC is needed in this example because the VSTL may store elements of V1 into A before the VLDL has nished loading all elements of V0 from A. As a result, the elements of V0 may be unequal and so produce incorrect results.
VMAC does not ensure that hardware errors encountered by pending nonmemory-access instructions will be reported. Waiting for VPSR<BSY> to become clear does not ensure that vector-processor hardware errors encountered by vector memory instructions are reported. Software can force the reporting of hardware errors encountered during the execution of previous vector instructions (both memory and non-memory) by waiting for VPSR<BSY> to become clear and then by issuing an MFPR from VMAC. This technique can be used during scalar context switching to cause hardware errors resulting from the execution of vector instructions for the current process to be reported before that process is context-switched.
VAX Vector Architecture 10.10 Vector Memory Access Instructions 10.10.4 Access Mode
A vector memory access instruction is executed using the access mode in effect when the instruction is issued by the scalar processor.
VLD
Load Memory Data into Vector Register
Format
VLDL [/M[0 | 1]] VLDQ [/M[0 | 1]] base, stride, Vc base, stride, Vc
Architecture
Format opcode Opcodes 34FD 36FD VLDL VLDQ Load Longword Vector from Memory to Vector Register Load Quadword Vector from Memory to Vector Register
ZK 1457A GE
Description
The source operand vector is fetched from memory and is written to vector destination register Vc. The length of the vector is specied by VLR. The virtual address of the source vector is computed using the base address and the stride. The address of element i (0 LEQU i LEQU (VLR-1)) is computed as {base+{i*stride}}. The stride can be positive, negative, or zero. In VLDL, bits <31:0> of each destination vector element receive the memory data and bits <63:32> are UNPREDICTABLE. If any vector element operated upon is not naturally aligned in memory, a vector alignment exception occurs. The results of VLD are unaffected by the setting of cntrl<MI>. For more details about the use of cntrl<MI>, see Section 10.3.3, Modify Intent bit. If the addressing mode of the BASE operand is immediate, the results of the instruction are UNPREDICTABLE.
VGATH
Gather Memory Data into Vector Register
Format
VGATHL [/M[0 | 1]] VGATHQ [/M[0 | 1]] base, Vb, Vc base, Vb, Vc
Architecture
Format opcode Opcodes 35FD 37FD VGATHL VGATHQ Gather Longword Vector from Memory to Vector Register Gather Quadword Vector from Memory to Vector Register
cntrl.rw, base.ab
vector_control_word 15 14 13 12 11 M M M O T I 0 E F 0 8 7 Vb 43 Vc 0
ZK 1458A GE
Description
The source operand vector is fetched from memory and is written to vector destination register Vc. The length of the vector is specied by VLR. The virtual address of the vector is computed using the base address and the 32-bit offsets in vector register Vb. The address of element i (0 LEQU i LEQU (VLR-1)) is computed as {base+Vb[i]}. The 32-bit offset can be positive, negative, or zero. In VGATHL, bits <31:0> of each destination vector element receive the memory data and bits <63:32> are UNPREDICTABLE. If any vector element operated upon is not naturally aligned in memory, a vector alignment exception occurs. The results of VGATH are unaffected by the setting of cntrl<MI>. For more details about the use of cntrl<MI>, see Section 10.3.3, Modify Intent bit. If the addressing mode of the BASE operand is immediate, the results of the instruction are UNPREDICTABLE.
VST
Store Vector Register Data into Memory
Format
VSTL [/0 | 1] VSTQ [/0 | 1] Vc, base, stride Vc, base, stride
Architecture
Format opcode Opcodes 9CFD 9EFD VSTL VSTQ Store Longword Vector from Vector Register to Memory Store Quadword Vector from Vector Register to Memory
vector_control_word 15 14 13 12 11 M M O T 0 0 E F 0 8 7 0 43 Vc 0
ZK 1459A GE
Exceptions access control violation translation not valid vector alignment modify
Description
The source operand in vector register Vc is written to memory. The length of the vector is specied by the Vector Length Register (VLR). The virtual address of the destination vector is computed using the base address and the stride. The address of element i (0 LEQU i LEQU (VLR-1)) is computed as {base+{i*stride}}. The stride can be positive, negative, or zero. If any vector element operated upon is not naturally aligned in memory, a vector alignment exception occurs. For a nonzero stride value, an implementation may store the vector elements in parallel; therefore the order in which these elements are stored is UNPREDICTABLE. Furthermore, if the nonzero stride causes result locations in memory to overlap, then the values stored in the overlapping result locations are also UNPREDICTABLE. For a stride value of zero, the highest numbered register element destined for the single memory location becomes the nal value of that location.
VSCAT
Scatter Vector Register Data into Memory
Format
VSCATL [/0 | 1] VSCATQ [/0 | 1] Vc, base, Vb Vc, base, Vb
Architecture
Format opcode Opcodes 9DFD 9FFD VSCATL VSCATQ Scatter Longword Vector from Vector Register to Memory Scatter Quadword Vector from Vector Register to Memory
cntrl.rw, base.ab
vector_control_word 15 14 13 12 11 M M O T 0 0 E F 0 8 7 Vb 43 Vc 0
ZK 1460A GE
Exceptions access control violation translation not valid vector alignment modify
Description
The source vector operand Vc is written to memory. The length of the vector is specied by the Vector Length Register (VLR) register. The virtual address of the destination vector is computed using the base address operand and the 32-bit offsets in vector register Vb. The address of element i (0 LEQU i LEQU (VLR-1)) is computed as {base+Vb[i]}. The 32-bit offset can be positive, negative, or zero. If any vector element operated upon is not naturally aligned in memory, a vector alignment exception occurs. An implementation may store the vector elements in parallel; therefore, the order in which elements are stored to different memory locations is UNPREDICTABLE. In the case where multiple elements are destined for the same memory location, the highest numbered element among them becomes the nal value of that location.
VADDL
Vector Integer Add
Format
vector + vector: VVADDL [/0 | 1] scalar + vector: VSADDL [/0 | 1] scalar, Vb, Vc Va, Vb, Vc
Architecture
Format vector + vector: scalar + vector: Opcodes 80FD 81FD VVADDL VSADDL Vector Vector Add Longword Vector Scalar Add Longword
opcode opcode
vector_control_word 15 14 13 12 11 M M E O T X 0 E F C Va or 0 8 7 Vb 43 Vc 0
ZK 1461A GE
Description
The scalar addend or Va operand is added, elementwise, to vector register Vb and the 32-bit sum is written to vector register Vc. Only bits <31:0> of each vector element participate in the operation. Bits <63:32> of the elements of vector register Vc are UNPREDICTABLE. The length of the vector is specied by the Vector Length Register (VLR). If integer overow is detected and cntrl<EXC> is set, the exception type and destination register number are recorded in the Vector Arithmetic Exception Register (VAER) and the vector operation is allowed to complete. On integer overow, the low-order 32 bits of the true result are stored in the destination element.
VCMPL
Vector Integer Compare
Format
[/0 | 1]
Va, Vb
scalarvector: 8 9 VSGTRL > > > > > > < VSEQLL = VSLSSL > VSLEQL > > > > : VSNEQL > ; VSGEQL
[/0 | 1]
src, Vb
Architecture
Format vectorvector: scalarvector: Opcodes C0FD C1FD VVCMPL VSCMPL Vector Vector Compare Longword Vector Scalar Compare Longword
opcode opcode
0 1 2 3 4 5 6 7
1 Vector
Greater than Equal Less than Reserved1 Less than or equal Not equal Greater than or equal Reserved1
integer compare instructions that specify reserved values of cntrl<2:0> produce UNPREDICTABLE results.
Description
The scalar or Va operand is compared, elementwise, with vector register Vb. The length of the vector is specied by the Vector Length Register (VLR). For each element comparison, if the specied relationship is true, the Vector Mask Register bit (VMR<i>) corresponding to the vector element is set to one; otherwise, it is cleared. If cntrl<MOE> is set, VMR bits corresponding to elements that do not match cntrl<MTF> are left unchanged. VMR bits beyond the vector length are left unchanged. Only bits <31:0> of each vector element participate in the operation.
VMULL
Vector Integer Multiply
Format
vector * vector: VVMULL [/V[0 | 1]] scalar * vector: VSMULL [/V[0 | 1]] scalar, Vb, Vc Va, Vb, Vc
Architecture
Format vector * vector: scalar * vector: Opcodes A0FD A1FD VVMULL VSMULL Vector Vector Multiply Longword Vector Scalar Multiply Longword
opcode opcode
vector_control_word 15 14 13 12 11 M M O T 0 0 E F Va or 0 8 7 Vb 43 Vc 0
ZK 1463A GE
Description
The scalar multiplier or vector operand Va is multiplied, elementwise, by vector operand Vb and the least signicant 32 bits of the signed 64-bit product are written to vector register Vc. Only bits <31:0> of each vector element participate in the operation. Bits <63:32> of the elements of vector register Vc are UNPREDICTABLE. The length of the vector is specied by the Vector Length Register (VLR).
VSUBL
Vector Integer Subtract
Format
vectorvector: VVSUBL [/V[0 | 1]] scalarvector: VSSUBL [/V[0 | 1]] scalar, Vb, Vc Va, Vb, Vc
Architecture
Format vectorvector: scalarvector: Opcodes 88FD 89FD VVSUBL VSSUBL Vector Vector Subtract Longword Vector Scalar Subtract Longword
opcode opcode
vector_control_word 15 14 13 12 11 M M E O T X 0 E F C Va or 0 8 7 Vb 43 Vc 0
ZK 1461A GE
Description
The vector operand Vb is subtracted, elementwise, from the scalar minuend or vector operand Va. The 32-bit difference is written to vector register Vc. Only bits <31:0> of each vector element participate in the operation. Bits <63:32> of the elements of vector register Vc are UNPREDICTABLE. The length of the vector is specied by the Vector Length Register (VLR). If integer overow is detected and cntrl<EXC> is set, the exception condition type and destination register number are recorded in the Vector Arithmetic Exception Register (VAER) and the vector operation is allowed to complete. On integer overow, the low-order 32 bits of the true result are stored in the destination element.
Format
vector op vector:
( VVBISL )
VVXORL VVBICL
[/V[0 | 1]]
Va, Vb, Vc
( VSBISL )
VSXORL VSBICL
Architecture
Format vector op vector: vector op scalar: Opcodes C8FD E8FD CCFD C9FD E9FD CDFD VVBISL VVXORL VVBICL VSBISL VSXORL VSBICL Vector Vector Vector Vector Vector Vector Vector Bit Set Longword Vector Exclusive-OR Longword Vector Bit Clear Longword Scalar Bit Set Longword Scalar Exclusive-OR Longword Scalar Bit Clear Longword
opcode opcode
vector_control_word 15 14 13 12 11 M M O T 0 0 E F Va or 0 8 7 Vb 43 Vc 0
ZK 1463A GE
Exceptions None.
VSL
Vector Shift Logical
Format
n n
vector shift count: VVSRLL [/V[0 | 1]] VVSLLL scalar shift count: VSSRLL [/V[0 | 1]] VSSLLL
Va, Vb, Vc
cnt, Vb, Vc
Architecture
Format vector shift count: scalar shift count: Opcodes E0FD E4FD E1FD E5FD VVSRLL VVSLLL VSSRLL VSSLLL Vector Vector Vector Vector Vector Shift Right Logical Longword Vector Shift Left Logical Longword Scalar Shift Right Logical Longword Scalar Shift Left Logical Longword
opcode opcode
vector_control_word 15 14 13 12 11 M M O T 0 0 E F Va or 0 8 7 Vb 43 Vc 0
ZK 1463A GE
Exceptions None.
Description
Each element in vector register Vb is shifted logically left or right 0 to 31 bits as specied by a scalar count operand or vector register Va. The shifted results are written to vector register Vc. Zero bits are propagated into the vacated bit positions. Only bits <4:0> of the count operand and bits <31:0> of each Vb element participate in the operation. Bits <63:32> of the elements of vector register Vc are UNPREDICTABLE. The length of the vector is specied by the Vector Length Register (VLR).
VADD
Vector Floating Add
Format
vector + vector: VVADDF [/U[0 | 1]] VVADDD VVADDG scalar + vector: ( ) VSADDF VSADDD VSADDG [/U[0 | 1]]
Va, Vb, Vc
scalar, Vb, Vc
Architecture
Format vector + vector: opcode cntrl.rw
scalar + vector (D_ and G_oating): opcode Opcodes 84FD 85FD 86FD 87FD 82FD 83FD VVADDF VSADDF VVADDD VSADDD VVADDG VSADDG Vector Vector Vector Vector Vector Vector Vector Add F_Floating Scalar Add F_Floating Vector Add D_Floating Scalar Add D_Floating Vector Add G_Floating Scalar Add G_Floating cntrl.rw, addend.rq
vector_control_word 15 14 13 12 11 M M E O T X 0 E F C Va or 0 8 7 Vb 43 Vc 0
ZK 1461A GE
VCMP
Vector Floating Compare
Format
8 > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > :
vectorvector: VVGTRF VVGTRD VVGTRG VVEQLF VVEQLD VVEQLG VVLSSF VVLSSD VVLSSG VVLEQF VVLEQD VVLEQG VVNEQF VVNEQD VVNEQG VVGEQF VVGEQD VVGEQG
9 > > > > > > > > > > > > > > > = > > > > > > > > > > > > > > > ;
[/U[0 | 1]]
Va, Vb
scalarvector: 8 9 VSGTRF > > > VSGTRD > > > > VSGTRG > > > > VSEQLF > > > > VSEQLD > > > > VSEQLG > > > > VSLSSF > > > > VSLSSD > > < VSLSSG > = > VSLEQF > > > > VSLEQD > > > > VSLEQG > > > > VSNEQF > > > > VSNEQD > > > > VSNEQG > > > > VSGEQF > > > > : VSGEQD > ; VSGEQG
[/U[0 | 1]]
src, Vb
Architecture
Format vectorvector: opcode cntrl.rw
scalarvector (D_ and G_oating): opcode Opcodes C4FD C5FD C6FD C7FD C2FD C3FD VVCMPF VSCMPF VVCMPD VSCMPD VVCMPG VSCMPG Vector Vector Vector Vector Vector Vector Vector Compare F_oating Scalar Compare F_oating Vector Compare D_oating Scalar Compare D_oating Vector Compare G_oating Scalar Compare G_oating cntrl.rw, src.rq
0 1 2 3 4 5 6 7
1 Vector
Greater than Equal Less than Reserved1 Less than or equal Not equal Greater than or equal Reserved1
integer compare instructions that specify reserved values of cntrl<2:0> produce UNPREDICTABLE results.
Description
The scalar or vector operand Va is compared, elementwise, with vector register Vb. The length of the vector is specied by the Vector Length Register (VLR). For each element comparison, if the specied relationship is true, the Vector Mask Register bit (VMR<i>) corresponding to the vector element is set to one, otherwise it is cleared. If cntrl<MOE> is set, VMR bits corresponding to elements that do not match cntrl<MTF> are left unchanged. VMR bits beyond the vector length are left unchanged. If an element being compared is a reserved operand, VMR<i> is UNPREDICTABLE. In VxCMPF, only bits <31:0> of each vector element participate in the operation. If a oating reserved operand exception occurs, the exception condition type is recorded in the Vector Arithmetic Exception Register (VAER) and the vector operation is allowed to complete. Note that for this instruction, no bits are set in the VAER destination register mask when an exception occurs.
VVCVT
Vector Convert
8 VVCVTLF > > VVCVTLD > > VVCVTLG > > VVCVTFL > > VVCVTRFL > > VVCVTFD < VVCVTFG > > VVCVTDL > > VVCVTDF > > VVCVTRDL > > VVCVTGL > > VVCVTGF :
Format
VVCVTRGL
9 > > > > > > > > > > = > > > > > > > > > > ;
[/U[0 | 1]]
Vb, Vc
Architecture
Format opcode Opcodes ECFD VVCVT Vector Convert
cntrl.rw
ZK 1465A GE
1 1 1 1 1 1
1 1 1 1 0 0
1 1 0 0 1 1
1 0 1 0 1 0
CVTRGL (Convert Rounded G_Floating to Longword) Reserved1 CVTGF (Convert Rounded G_Floating to F_Floating) CVTGL (Convert Truncated G_Floating to Longword) Reserved1 CVTRD (Convert Rounded D_Floating to Longword)
1 Vector
results.
1 1 0 0 0 0 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 1 1 0 0 1 1 0 0
1 0 1 0 1 0 1 0 1 0
CVTDF (Convert Rounded D_Floating to F_Floating) CVTDL (Convert Truncated D_Floating to Longword) CVTFG (Convert F_Floating to G_Floating (exact)) CVTFD (Convert F_Floating to D_Floating (exact)) CVTRF (Convert Rounded F_Floating to Longword) CVTFL (Convert Truncated F_Floating to Longword) CVTLG (Convert Longword to G_Floating (exact)) CVTLD (Convert Longword to D_Floating (exact)) CVTLF (Convert Rounded Longword to F_Floating) Reserved1
1 Vector
results.
Exceptions oating overow oating reserved operand oating underow integer overow
Description
The vector elements in vector register Vb are converted and results are written to vector register Vc. Cntrl<11:8> species the conversion to be performed. The length of the vector is specied by the Vector Length Register (VLR). Bits <63:32> of Vc are UNPREDICTABLE for instructions that convert from D_ oating or G_oating to F_oating or longword. When CVTRGL, CVTRDL, and CVTRFL round, the rounding is done in sign magnitude, before conversion to twos complement. If an integer overow occurs when cntrl<EXC> is set, the low-order 32 bits of the true result are written to the destination element as the result, and the exception condition type and destination register number are recorded in the Vector Arithmetic Exception Register (VAER). The vector operation is then allowed to complete. If integer overow occurs when cntrl<EXC> is clear, the low-order 32 bits of the true result are written to the destination element, and no other action is taken. For vector convert oating to integer, where the source element is a reserved operand, the value written to the destination element is UNPREDICTABLE. In addition, the exception type and destination register number are recorded in the VAER. The vector operation is then allowed to complete. For vector convert oating to oating instructions, if oating underow occurs when cntrl<EXC> is clear, zero is written to the destination element, and no other action is taken. The vector operation is then allowed to complete. For vector convert oating to oating instructions, if oating underow occurs with cntrl<EXC> set or if a oating overow or reserved operand occurs, an encoded reserved operand is written to the destination element, and the exception condition type and destination register number are recorded in the VAER. The vector operation is then allowed to complete.
VDIV
Vector Floating Divide
Format
)
[/U[0 | 1]] Va, Vb, Vc
Architecture
Format vector/vector: opcode cntrl.rw
scalar/vector (D_ and G_oating): opcode Opcodes ACFD ADFD AEFD AFFD AAFD ABFD VVDIVF VSDIVF VVDIVD VSDIVD VVDIVG VSDIVG Vector Vector Vector Vector Vector Vector Vector Divide F_oating Scalar Divide F_oating Vector Divide D_oating Scalar Divide D_oating Vector Divide G_oating Scalar Divide G_oating cntrl.rw, divd.rq
vector_control_word 15 14 13 12 11 M M E O T X 0 E F C Va or 0 8 7 Vb 43 Vc 0
ZK 1461A GE
Description
The scalar dividend or vector register Va is divided, elementwise, by the divisor in vector register Vb and the quotient is written to vector register Vc. The length of the vector is specied by the Vector Length Register (VLR). In VxDIVF, only bits <31:0> of each vector element participate in the operation; bits <63:32> of the destination vector elements are UNPREDICTABLE. If a oating underow occurs when cntrl<EXC> is set or if a oating overow, divide by zero, or reserved operand occurs, an encoded reserved operand is stored as the result and the exception condition type and destination register number are recorded in the Vector Arithmetic Exception Register (VAER). The vector operation is then allowed to complete. If cntrl<EXC> is clear, zero is written to the destination element when an exponent underow occurs and no other action is taken.
VMUL
Vector Floating Multiply
Format
vector * vector: VVMULF [/U[0 | 1]] VVMULD VVMULG
Va, Vb, Vc
scalar, Vb, Vc
Architecture
Format vector * vector: opcode cntrl.rw
scalar * vector (D_ and G_oating): opcode Opcodes A4FD A5FD A6FD A7FD A2FD A3FD VVMULF VSMULF VVMULD VSMULD VVMULG VSMULG Vector Vector Vector Vector Vector Vector Vector Multiply F_oating Scalar Multiply F_oating Vector Multiply F_oating Scalar Multiply D_oating Vector Multiply G_oating Scalar Multiply G_oating cntrl.rw, mulr.rq
vector_control_word 15 14 13 12 11 M M E O T X 0 E F C Va or 0 8 7 Vb 43 Vc 0
ZK 1461A GE
VSUB
Vector Floating Subtract
Format
)
[/U[0 | 1]] Va, Vb, Vc
Architecture
Format vectorvector: opcode cntrl.rw
scalarvector (D_ and G_oating): opcode Opcodes 8CFD 8DFD 8EFD 8FFD 8AFD 8BFD VVSUBF VSSUBF VVSUBD VSSUBD VVSUBG VSSUBG Vector Vector Vector Vector Vector Vector Vector Subtract F_oating Scalar Subtract F_oating Vector Subtract D_oating Scalar Subtract D_oating Vector Subtract G_oating Scalar Subtract G_oating cntrl.rw, min.rq
vector_control_word 15 14 13 12 11 M M E O T X 0 E F C Va or 0 8 7 Vb 43 Vc 0
ZK 1461A GE
VMERGE
Vector Merge
Format
vector vector merge: VVMERGE [/0 | 1] vector scalar merge: Va, Vb, Vc
VSMERGEG
src, Vb, Vc
opcode opcode
cntrl.rw cntrl.rw,src.rq
VVMERGE VSMERGE
vector_control_word 15 14 13 12 11 M 0 T 0 0 F Va or 0 8 7 Vb 43 Vc 0
ZK 1466A GE
Exceptions None.
Description
The scalar src or vector operand Va is merged, elementwise, with vector register Vb and the resulting vector is written to vector register Vc. The length of the vector operation is specied by the Vector Length Register (VLR). For each vector element, i, if the corresponding Vector Mask Register bit (VMR<i>) matches cntrl<MTF>, src or Va[i] is written to the destination vector element Vc[i]. If VMR<i> does not match cntrl<MTF>, Vb[i] is written to the destination vector element.
IOTA
Generate Compressed Iota Vector
Format
IOTA [/0 | 1] stride, Vc
Architecture
Format opcode Opcodes EDFD IOTA Generate Compressed Iota Vector
cntrl.rw, stride.rl
vector_control_word 15 14 13 12 11 M 0 T 0 0 F 0 8 7 0 43 Vc 0
ZK 1467A GE
Exceptions None.
Description
IOTA constructs a vector of offsets for use by the vector gather/scatter instructions VGATH and VSCAT. IOTA rst generates an iota vector of length VLR using the stride operand. An iota vector is a vector whose rst element is zero and whose subsequent elements are spaced by the stride increment. The stride can be positive, negative, or zero. For example: 0*stride, 1*stride, 2*stride, 3*stride, ..., {VLR-1}*stride The iota vector is then compressed using the contents of the Vector Mask Register (VMR). Elements of the iota vector for which the corresponding Vector Mask Register bit matches cntrl<MTF> are written in contiguous elements of the destination vector register Vc. Only bits <31:0> of each iota and destination vector element participate in the operation. Bits <63:32> of the destination vector elements are UNPREDICTABLE. The number of elements written to Vc is returned in the Vector Count Register (VCR). The values of elements in the destination vector register between the new value of VCR and the vector length are UNPREDICTABLE.
MFVP
Move from Vector Processor
8 MFVCR > > > MFVLR < MFVMRLO > MFVMRHI > > SYNCH :
MSYNCH
Format
dst
Architecture
Format opcode Opcodes 31FD MFVP Move from Vector Processor
regnum.rw, dst.wl
vector_control_word None. Exceptions None. MFVP instructions that specify reserved values of the regnum operand produce UNPREDICTABLE results.
Description
This instruction can be used to read the Vector Count, Length, and Mask Registers, and to synchronize a scalar processor with its associated vector processor. When the scalar processor issues an MFVP instruction to the vector processor, the scalar processor waits for the MFVP result to be written before processing other instructions. MFVP from VCR or VLR does not read that register until all previous write operations to the register are completed. MFVP from VMR<31:0> or VMR<63:32> does not read that longword of VMR until all previous write operations to the same longword of VMR are completed; however, this is not true for previous write operations to the other longword. SYNC allows software to ensure that the unreported exceptions of all previously issued vector instructions (including vector memory instructions in asynchronous memory management mode) are detected and reported to the scalar processor before the scalar processor proceeds with further instructions. For more details about SYNC and its exception reporting nature refer to Section 10.7.1, Scalar/Vector Instruction Synchronization.
After the appropriate fault has been serviced, the MFVP may be returned to through an REI. If both exception conditions are encountered by an MFVP, then the MFVP itself takes a vector processor disabled fault. In this case, after the vector processor disabled fault has been serviced, returning to the MFVP instruction will cause the asynchronous memory management exception to be reported.
MTVP
Move to Vector Processor
Format
9 > = > ;
src
Architecture
Format opcode Opcodes A9FD MTVP Move to Vector Processor
regnum.rw, src.rl
vector_control_word None. Exceptions None. Move to Vector Processor instructions that specify reserved values of the regnum operand produce UNPREDICTABLE results.
Description
This instruction can be used to write the Vector Count, Length, and Mask Registers. The new value of VCR, VLR, or VMR does not affect any prior instructions. The new value remains in effect for all subsequent vector instructions executed until a new value is loaded.
VSYNC
Synchronize Vector Memory Access
Format
VSYNCH
Architecture
Format opcode Opcodes A8FD VSYNC Synchronize Vector Memory Access
regnum.rw
vector_control_word None. Exceptions None. Synchronize Vector Memory Access instructions that specify reserved values of the regnum operand produce UNPREDICTABLE results.
Description
The VSYNC instruction can be used to synchronize memory access within the vector processor. The instruction allows software to order the conicting memory accesses of vector-memory instructions issued after VSYNC with those of vectormemory instructions issued before VSYNC. Specically, VSYNC forces the access of a memory location by any subsequent vector-memory instruction to wait for (depend upon) the completion of all prior conicting accesses of that location by previous vector-memory instructions. See Section 10.7.1 for more details. See Section 10.7.5, Required Use of Memory Synchronization Instructions, for the conditions when VSYNC is not required before a vector store instruction.
A
ASCII Character Set
Dec 0010 0110 0210 0310 0410 0510 0610 0710 0810 0910 1010 1110 1210 1310 1410 1510 1610 1710 1810 1910 2010 2110 2210 2310 2410 2510 2610 2710 2810 2910 3010 3110 Hex 0016 0116 0216 0316 0416 0516 0616 0716 0816 0916 0A16 0B16 0C16 0D16 0E16 0F16 1016 1116 1216 1316 1416 1516 1616 1716 1816 1916 1A16 1B16 1C16 1D16 1E16 1F16 ASCII NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US Dec 3210 3310 3410 3510 3610 3710 3810 3910 4010 4110 4210 4310 4410 4510 4610 4710 4810 4910 5010 5110 5210 5310 5410 5510 5610 5710 5810 5910 6010 6110 6210 6310 Hex 2016 2116 2216 2316 2416 2516 2616 2716 2816 2916 2A16 2B16 2C16 2D16 2E16 2F16 3016 3116 3216 3316 3416 3516 3616 3716 3816 3916 3A16 3B16 3C16 3D16 3E16 3F16 ! " # $ % & ( ) * + , . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? ASCII SP Dec 6410 6510 6610 6710 6810 6910 7010 7110 7210 7310 7410 7510 7610 7710 7810 7910 8010 8110 8210 8310 8410 8510 8610 8710 8810 8910 9010 9110 9210 9310 9410 9510 Hex 4016 4116 4216 4316 4416 4516 4616 4716 4816 4916 4A16 4B16 4C16 4D16 4E16 4F16 5016 5116 5216 5316 5416 5516 5616 5716 5816 5916 5A16 5B16 5C16 5D16 5E16 5F16 ASCII @ A B C D E F G H I J K l M N O P Q R S T U V W X Y Z [ \ ] ^ _ Dec 9610 9710 9810 9910 10010 10110 10210 10310 10410 10510 10610 10710 10810 10910 11010 11110 11210 11310 11410 11510 11610 11710 11810 11910 12010 12110 12210 12310 12410 12510 12610 12710 Hex 6016 6116 6216 6316 6416 6516 6616 6716 6816 6916 6A16 6B16 6C16 6D16 6E16 6F16 7016 7116 7216 7316 7416 7516 7616 7716 7816 7916 7A16 7B16 7C16 7D16 7E16 7F16 ASCII a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ DEL
B
Hexadecimal/Decimal Conversion
The following table lists the decimal value for each possible hexadecimal value in each byte of a longword. The following sections contain instructions to use the table to convert hexadecimal numbers to decimal and decimal numbers to hexadecimal.
Hexadecimal to Decimal Conversion Table 8 HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F DEC HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F 7 DEC HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F 6 DEC 5 4 3 2 1
HEX DEC HEX DEC HEX DEC HEX DEC HEX DEC 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 65,536 131,072 196,608 262,144 327,680 393,216 458,752 524,288 589,824 655,360 720,896 786,432 851,968 917,504 983,040 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 4,096 8,192 12,288 16,384 20,480 24,576 28,672 32,768 36,864 40,960 45,056 49,152 53,248 57,344 61,440 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 256 512 768 1,024 1,280 1,536 1,792 2,048 2,304 2,560 2,816 3,072 3,328 3,584 3,840 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 268,435,456 536,870,912 805,306,368 1,073,741,824 1,342,177,280 1,610,612,736 1,879,048,192 2,147,483,648 2,415,919,104 2,684,354,560 2,952,790,016 3,221,225,472 3,489,660,928 3,758,096,384 4,026,531,840
0 16,777,216 33,554,432 50,331,648 67,108,864 83,886,080 100,663,296 117,440,512 134,217,728 150,994,944 167,772,160 184,549,376 201,326,592 218,103,808 234,881,024 251,658,240
0 1,048,576 2,097,152 3,145,728 4,194,304 5,242,880 6,291,456 7,340,032 8,388,608 9,437,184 10,485,760 11,534,336 12,582,912 13,631,488 14,680,064 15,728,640
ZK2013GE
Hexadecimal/Decimal Conversion B1
B2 Hexadecimal/Decimal Conversion
C
VAX MACRO Assembler Directives and Language Summary
This appendix summarizes the general assembler and macro directives (in alphabetical order), special characters, unary operators, binary operators, and addressing modes.
.ASCII string .ASCIZ string .BLKA expression .BLKB expression .BLKD expression .BLKF expression .BLKG expression .BLKH expression .BLKL expression
VAX MACRO Assembler Directives and Language Summary C.1 Assembler Directives
Table C1 (Cont.) Assembler Directives
Format .BLKO expression .BLKQ expression .BLKW expression .BYTE expression-list Operation Reserves octawords for data Reserves quadwords for data Reserves words for data Generates successive bytes of data; each byte contains the value of the specied expression Enables cross-referencing of all symbols Cross-references specied symbols Makes symbol names known to the debugger Species the default displacement length for the relative addressing modes Generates 8-byte double-precision oating-point data Disables functions specied in argument-list Equivalent to .D_FLOATING Equivalent to .DISABLE Equivalent to .ENABLE Enables functions specied in argument-list Indicates logical end of source program; optional symbol species transfer address Indicates end of conditional assembly block Indicates end of macro denition Indicates end of repeat block Procedure entry directive Displays specied error message Ensures that the current location counter has an even value (adds 1 if it is odd) Indicates specied symbols are externally dened Equivalent to .EXTERNAL Generates 4-byte single-precision oating-point data Equivalent to .F_FLOATING Generates 8-byte G_oating-point data (continued on next page)
.D_FLOATING literal-list .DISABLE argument-list .DOUBLE literal-list .DSABL argument-list .ENABL argument-list .ENABLE argument-list .END [symbol]
.ENDC .ENDM [macro-name] .ENDR .ENTRY symbol [,expression] .ERROR [expression] ;comment .EVEN
.EXTERNAL symbol-list .EXTRN symbol-list .F_FLOATING literal-list .FLOAT literal-list .G_FLOATING literal-list
VAX MACRO Assembler Directives and Language Summary C.1 Assembler Directives
Table C1 (Cont.) Assembler Directives
Format .GLOBAL symbol-list .GLOBL .H_FLOATING literal-list .IDENT string .IF condition [,] argument( s ) Operation Indicates specied symbols are global symbols Equivalent to .GLOBAL Generates 16-byte extended-precision H_oating-point data Provides means of labeling object module with additional data Begins a conditional assembly block of source code, which is included in the assembly only if the stated condition is met with respect to the arguments specied Equivalent to .IF_FALSE Appears only within a conditional assembly block; begins block of code to be assembled if the original condition tests false Equivalent to .IF_TRUE Equivalent to .IF_TRUE_FALSE Appears only within a conditional assembly block; begins block of code to be assembled if the original condition tests true Appears only within a conditional assembly block; begins block of code to be assembled unconditionally Acts as a 1-line conditional assembly block where the condition is tested for the argument specied; the statement is assembled only if the condition tests true Replaces a formal argument with successive actual arguments specied in an argument list Replaces a formal argument with successive single characters specied in string Species a macro library Includes linker option records in object module Equivalent to .SHOW Generates successive longwords of data; each longword contains the value of the specied expression Begins a macro denition Reserves a word for and copies a register save mask (continued on next page)
.IFF .IF_FALSE
.IF_TRUE_FALSE
.IRPC symbol,<BIT_STRING>
VAX MACRO Assembler Directives and Language Summary C.1 Assembler Directives
Table C1 (Cont.) Assembler Directives
Format .MCALL macro-name-list Operation Species the system or user-dened macros, or both, in libraries that are required to assemble the source program Deletes from memory the macro denitions of the macros in the list Exits from the expansion of a macro before the end of the macro is encountered Determines the number of arguments in the current macro call Determines the number of characters in a specied character string Equivalent to .NOSHOW Disables cross-referencing of all symbols Disables cross-referencing of specied symbols Decrements listing level count Controls listing of macros and conditional assembly blocks Can appear only within a macro denition; equates the symbol to the addressing mode of the specied operand Stores 16 bytes of data Stores 16 bytes of data Ensures that the current location counter has an odd value (adds 1 if it is even) Denes an opcode and its operand list Generates packed decimal data, 2 digits per byte Causes the assembly listing to skip to the top of the next page and to increment the page count Displays the specied message Begins or resumes the blank program section Begins or resumes a user-dened program section Stores 8 bytes of data Stores 8 bytes of data Generates byte operand Generates word operand (continued on next page)
.NARG symbol .NCHR symbol,<BIT_STRING> .NLIST [argument-list] .NOCROSS .NOCROSS symbol-list .NOSHOW .NOSHOW argument-list .NTYPE symbol,operand
.PRINT [expression] ;comment .PSECT .PSECT section-name argument list .QUAD literal .QUAD symbol .REF1 operand .REF2 operand
VAX MACRO Assembler Directives and Language Summary C.1 Assembler Directives
Table C1 (Cont.) Assembler Directives
Format .REF4 operand .REF8 operand .REF16 operand .REPEAT expression Operation Generates longword operand Generates quadword operand Generates octaword operand Begins a repeat block; the section of code up to the next .ENDR directive is repeated the number of times specied by the expression Equivalent to .REPEAT Equivalent to .RESTORE_PSECT Restores program section context from the program section context stack Equivalent to .SAVE_PSECT Saves current program section context on the program section context stack Equivalent to .SUBTITLE Increments listing level count Controls listing of macros and conditional assembly blocks Stores successive bytes of signed data Stores successive words of signed data Causes the specied string to be printed as part of the assembly listing page header; the string component of each .SUBTITLE is collected into a table of contents at the beginning of the assembly listing Assigns the rst 15 characters in the string as an object module name and causes the string to appear on each page of the assembly listing Directs the linker to redene the value of the global symbol for use in a shareable image Displays specied warning message Indicates that each of the listed symbols has the weak attribute Generates successive words of data; each word contains the value of the corresponding specied expression
.REPT .RESTORE .RESTORE_PSECT .SAVE [LOCAL_BLOCK] .SAVE_PSECT [LOCAL_BLOCK] .SBTTL comment-string .SHOW .SHOW argument-list .SIGNED_BYTE expression-list .SIGNED_WORD expression-list .SUBTITLE comment-string
.TRANSFER symbol
VAX MACRO Assembler Directives and Language Summary C.2 Special Characters
Table C2 Special Characters Used in VAX MACRO Statements
Character _ $ . : = Character Name Underscore Dollar sign Period Colon Equal sign Tab Space # @ , ; + Number sign At sign Comma Semicolon Plus sign Functions Character in symbol names Character in symbol names Character in symbol names, current location counter, and decimal point Label terminator Direct assignment operator and macro keyword argument terminator Field terminator Field terminator Immediate addressing mode indicator Deferred addressing mode indicator and arithmetic shift operator Field, operand, and item separator Comment eld indicator Autoincrement addressing mode indicator, unary plus operator, and arithmetic addition operator Autodecrement addressing mode indicator, unary minus operator, arithmetic subtraction operator, and line continuation indicator Arithmetic multiplication operator Arithmetic division operator Logical AND operator Logical inclusive OR operator Logical exclusive OR and numeric conversion indicator in macro arguments Unary operator indicator and macro argument delimiter Index addressing mode and repeat count indicators Register deferred addressing mode indicators Argument or expression grouping delimiters Created label indicator in macro arguments Macro argument concatenation indicator Macro string operators
Minus sign
* / & ! \ ^ [] () <> ? %
Asterisk Slash Ampersand Exclamation point Backslash Circumex Square brackets Parentheses Angle brackets Question mark Apostrophe Percent sign
C.3 Operators
This section lists the VAX MACRO unary, binary, and macro string operators.
VAX MACRO Assembler Directives and Language Summary C.3 Operators C.3.1 Unary Operators
Table C3 summarizes the VAX MACRO unary operators. Table C3 Summary of Unary Operators
Unary Operator + Operator Name Plus sign Minus sign Example +A -A Effect Results in the positive value of A (default) Results in the negative (twos complement) value of A Species that 11000111 is a binary number Species that 127 is a decimal number Species that 34 is an octal number Species that FCF9 is a hexadecimal number Produces an ASCII string; the characters between the matching delimiters are converted to ASCII representation Species the registers R3, R4, and R5 in the register mask Species that 3.0 is a oating-point number Produces the ones complement value of 24 (decimal)
^B ^D ^O ^X ^A
^M
Register mask
^M<R3,R4,R5>
^F ^C
^F3.0 ^C24
%EXTRACT(symbol1,symbol2,string)
VAX MACRO Assembler Directives and Language Summary C.4 Addressing Modes
Autoincrement deferred
@(Rn)+
Yes
Autodecrement
-(Rn)
Yes
Displacement
Yes
A C E
Displacement deferred
Yes
B D F
Literal
No
0-3
Program Counter
Relative
Yes
A C E
Key: RnAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rn. RxAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rx. Rx cannot be the same as the Rn specied in the base-mode for certain base modes (see Section 5.3). disAn expression specifying a displacement. addressAn expression specifying an address. literalAn expression, an integer constant, or a oating-point constant.
VAX MACRO Assembler Directives and Language Summary C.4 Addressing Modes
Table C6 (Cont.) Summary of Addressing Modes
Type Addressing Mode Relative deferred Format @address @B^address @W^address @L^address Hex Value B D F Description The address specied is the address of the operand address; the address specied is stored as a displacement from the PC; B^, W^, and L^ indicate byte, word, and longword displacement, respectively. The address specied is the address of the operand; the address specied is stored as an absolute virtual address, not as a displacement. The literal specied is the operand; the literal is stored as a byte, word, longword, or quadword. The address specied is the address of the operand; if the address is dened as relocatable, the linker stores the address as a displacement from the PC; if the address is dened as an absolute virtual address, the linker stores the address as an absolute value. The base-mode species the base address, and the register species the index; the sum of the base address and the product of the contents of Rx and the size of the operand data type is the address of the operand; base mode can be any addressing mode except register, immediate, literal, index, or branch. The address specied is the operand; this address is stored as a displacement from the PC; branch mode can only be used with the branch instructions. Can Be Indexed? Yes
Absolute
@#address
Yes
Immediate
#literal I^#literal
No
General
G^address
Yes
Index
Index
base-mode[Rx]
No
Branch
Branch
address
No
Key: RnAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rn. RxAny general register R0 to R12. Note that the AP, FP, or SP register can be used in place of Rx. Rx cannot be the same as the Rn specied in the base-mode for certain base modes (see Section 5.3). disAn expression specifying a displacement. addressAn expression specifying an address. literalAn expression, an integer constant, or a oating-point constant.
D
Permanent Symbol Table Dened for Use with VAX MACRO
The permanent symbol table (PST) contains the symbols that VAX MACRO automatically recognizes. These symbols consist of both opcodes and assembler directives. Table D1, Table D2, and Table D3 present the opcodes (instruction set) in alphabetical and numerical order. Section C.1 (in Appendix C) presents the assembler directives. See Chapter 9 and Chapter 10 for detailed descriptions of the instruction set. Table D1 Opcodes (Alphabetic Order) and Functions
Hex Value 9D 6F 4F 4FFD 6FFD F1 3D 58 80 81 60 61 40 41 40FD 41FD 60FD 61FD C0 C1 20 21 Mnemonic ACBB ACBD ACBF ACBG ACBH ACBL ACBW ADAWI ADDB2 ADDB3 ADDD2 ADDD3 ADDF2 ADDF3 ADDG2 ADDG3 ADDH2 ADDH3 ADDL2 ADDL3 ADDP4 ADDP6 Functional Name Add compare and branch byte Add compare and branch D_oating Add compare and branch F_oating Add compare and branch G_oating Add compare and branch H_oating Add compare and branch longword Add compare and branch word Add aligned word interlocked Add byte 2 operand Add byte 3 operand Add D_oating 2 operand Add D_oating 3 operand Add F_oating 2 operand Add F_oating 3 operand Add G_oating 2 operand Add G_oating 3 operand Add H_oating 2 operand Add H_oating 3 operand Add longword 2 operand Add longword 3 operand Add packed 4 operand Add packed 6 operand (continued on next page)
D10 Permanent Symbol Table Dened for Use with VAX MACRO
Permanent Symbol Table Dened for Use with VAX MACRO D11
D12 Permanent Symbol Table Dened for Use with VAX MACRO
Permanent Symbol Table Dened for Use with VAX MACRO D13
D14 Permanent Symbol Table Dened for Use with VAX MACRO
Permanent Symbol Table Dened for Use with VAX MACRO D15
D16 Permanent Symbol Table Dened for Use with VAX MACRO
Permanent Symbol Table Dened for Use with VAX MACRO D17
D18 Permanent Symbol Table Dened for Use with VAX MACRO
Permanent Symbol Table Dened for Use with VAX MACRO D19
E
Exceptions That May Occur During Instruction Execution
Exceptions can be grouped into the following six classes: Arithmetic traps and faults Memory management exceptions Exceptions detected during operand reference Tracing Serious system failures
Exceptions That May Occur During Instruction Execution E.1 Arithmetic Traps and Faults
Table E1 (Cont.) Arithmetic Exception Type Codes
Exception Type oating underow Mnemonic SS$_FLTUND_F Decimal Value 10 Hexadecimal Value A
Exceptions That May Occur During Instruction Execution E.1 Arithmetic Traps and Faults
The condition codes are set on the nal result in POLYx. The type code pushed onto the stack is 5 (SS$_FLTUND).
Exceptions That May Occur During Instruction Execution E.2 Memory Management Exceptions E.2.2 Translation Not Valid Fault
A translation not valid fault is an exception indicating that the process attempted a reference to a page for which the valid bit in the page table had not been set. Note that if a process attempts to reference a page for which the page table entry species both translation not valid fault and access control violation, an access control violation fault occurs.
Exceptions That May Occur During Instruction Execution E.3 Exceptions Detected During Operand Reference
A oating-point number that has the sign bit set and the exponent zero in the polynomial evaluation (POLY) instruction table (fault) POLY degree too large (fault) Decimal string too long (abort) Invalid digit in convert trailing numeric to packed (CVTTP) or convert separate numeric to packed (CVTSP) instructions (abort) Reserved pattern operator in the edit packed to character string (EDITPC) instruction (fault) Incorrect source string length at completion of EDITPC (abort)
Exceptions That May Occur During Instruction Execution E.4 Exceptions Occurring as the Consequence of an Instruction E.4.3 Instruction Emulation Exceptions
When a subset processor executes a string instruction that is omitted from its instruction set, an emulation exception results. An emulation exception can occur through either of two system control block (SCB) vectors, depending on whether or not the rst-part-done (FPD) bit in the program status longword was set at the beginning of the instruction. If the FPD bit is clear, a subset emulation trap occurs through the SCB vector at offset CB (hex), and a subset emulation trap frame is pushed onto the current stack. If the FPD bit is set, a suspended emulation fault occurs through the SCB vector at offset CC (hex), and the PC and the PSL are pushed onto the current stack.
:(SP)
ZK6351GE The compatibility type codes are shown in Table E2. Table E2 Compatibility Mode Exception Type Codes
Exception Type Faults reserved opcode BPT instruction IOT instruction EMT instruction TRAP instruction illegal instruction Aborts odd address 6 0 1 2 3 4 5 Decimal Value
All other exceptions in compatibility mode, including the access control violation fault, the translation not valid fault, and the machine check abort, occur by means of the regular native-mode vector.
Exceptions That May Occur During Instruction Execution E.4 Exceptions Occurring as the Consequence of an Instruction E.4.5 Change Mode Trap
A change mode trap is an exception occurring when one of the change mode instructions (CHMK, CHME, CHMS, or CHMU) is executed. The instruction operand is pushed onto the exception stack.
Exceptions That May Occur During Instruction Execution E.5 Trace Fault
3. The detection of interrupts and other exceptions can occur during instruction execution. In this case, TP is cleared before the exception or interrupt is initiated. The system saves the entire PSL including the T bit and TP bit on interrupt or exception initiation and restores the PSL at the end with an REI. This makes interrupts and benign exceptions totally transparent to the executing program. The following are conditions and results that might occur during instruction execution or before the next instruction: a. If the instruction faults or an interrupt is serviced, the PSL TP bit is cleared before the PSL is saved on the stack. The saved PC (the next lower word on the stack after the saved PSL) is set to the start of the faulting or interrupted instruction. Instruction execution is resumed at step 1. b. If the instruction aborts or takes an arithmetic trap, the PSL TP bit is not changed before the PSL is saved on the stack. c. If an interrupt is serviced after instruction completion and arithmetic traps but before the presence of tracing is checked at the start of the next instruction, the PSL TP bit is not changed before the PSL is saved on the stack.
Exceptions That May Occur During Instruction Execution E.6 Serious System Failures
Index
A
Abort kernel stack not valid, E9 Absolute expression, 38 Absolute mode, 512 assembling relative mode as, 622 Absolute queue, 982 manipulating, 985 ACBB (Add Compare and Branch Byte) instruction, 944 ACBD (Add Compare and Branch D_oating) instruction, 944 ACBF (Add Compare and Branch F_oating) instruction, 944 ACBG (Add Compare and Branch G_oating) instruction, 944 ACBH (Add Compare and Branch H_oating) instruction, 944 ACBL (Add Compare and Branch Long) instruction, 944 ACBW (Add Compare and Branch Word) instruction, 944 Access mode vector, 1016, 1037, 1044 ADAWI (Add Aligned Word Interlocked) instruction, 97 ADDB2 (Add Byte 2 Operand) instruction, 98 ADDB3 (Add Byte 3 Operand) instruction, 98 ADDD2 (Add D_oating 2 Operand) instruction, 9106 ADDD3 (Add D_oating 3 Operand) instruction, 9106 ADDF2 (Add F_oating 2 Operand) instruction, 9106 ADDF3 (Add F_oating 3 Operand) instruction, 9106 ADDG2 (ADD G_oating 2 Operand) instruction, 9106 ADDG3 (ADD G_oating 3 Operand) instruction, 9106 ADDH2 (ADD H_oating 2 Operand) instruction, 9106 ADDH3 (ADD H_oating 3 Operand) instruction, 9106 ADDL2 (Add Long 2 Operand) instruction, 98 ADDL3 (Add Long 3 Operand) instruction, 98 ADDP4 (Add Packed 4 Operand) instruction, 9146 ADDP6 (Add Packed 6 Operand) instruction, 9146 Address access type, 816 instructions, 933 storage directive (.ADDRESS), 64 translation vector, 1041 virtual, 82 .ADDRESS directive, 64 Addressing mode, 51 absolute, 512, 622 autodecrement, 56 autoincrement, 54 autoincrement deferred, 55 branch, 516 determining, 668 displacement, 56 displacement deferred, 58 general, 514 general register, 51 summary, 825 immediate, 512 usage restricted in vector memory instructions, 1045, 1047 index, 514 literal, 59, 513 operand specier formats, 816 program counter, 510 summary, 826 register, 53 register deferred, 54 relative, 510, 619, 622 relative deferred, 511, 619 summary, 51, C9 Address storage directive (.ADDRESS), 64 ADDW2 (Add Word 2 Operand) instruction, 98 ADDW3 (Add Word 3 Operand) instruction, 98 ADWC (Add with Carry) instruction, 99 .ALIGN directive, 65 Alignment vector, 1025, 1043 AND operator, 315
Index1
AOBLEQ (Add One and Branch Less Than or Equal) instruction, 946 AOBLSS (Add One and Branch Less Than) instruction, 947 Architecture description of basic VAX, 81 Argument actual, 41 in a macro, 41 length, 664 number of, 663 Arithmetic instruction decimal string, 9142 oating-point, 9101 integer, 95 Arithmetic shift operator, 314 .ASCIC directive, 68 .ASCID directive, 69 ASCII character set, A1 operator, 311 .ASCII directive, 610 ASCII string storage directive, 67 counted (.ASCIC), 68 string (.ASCII), 610 string-descriptor (.ASCID), 69 zero-terminated (.ASCIZ), 611 .ASCIZ directive, 611 ASHL (Arithmetic Shift Long) instruction, 910 ASHP (Arithmetic Shift and Round Packed) instruction, 9148 ASHQ (Arithmetic Shift Quad) instruction, 910 Assembler directives, summary, C1 Assembler notation, 1014 Assembly termination, 625 Assembly termination directive (.END), 625 Assignment statement, 11, 315 Asynchronous memory management exception handling, 1016, 1026 Autodecrement mode, 56 operand specier format, 819 Autoincrement deferred mode, 55 operand specier format, 818 Autoincrement mode, 54 operand specier format, 818
B
Base operand specier, 823 BBC (Branch on Bit Clear) instruction, 950 BBCC (Branch on Bit Clear and Clear) instruction, 951 BBCCI (Branch on Bit Clear and Clear Interlocked) instruction, 952
BBCS (Branch on Bit Clear and Set) instruction, 951 BBS (Branch on Bit Set) instruction, 950 BBSC (Branch on Bit Set and Clear) instruction, 951 BBSS (Branch on Bit Set and Set) instruction, 951 BBSSI (Branch on Bit Set and Set Interlocked) instruction, 952 BCC (Branch on Carry Clear) instruction, 948 BCS (Branch on Carry Set) instruction, 948 BEQL (Branch on Equal) instruction, 948 BEQLU (Branch on Equal Unsigned) instruction, 948 BGEQ (Branch on Greater Than or Equal) instruction, 948 BGEQU (Branch on Greater Than or Equal Unsigned) instruction, 948 BGTR (Branch on Greater Than) instruction, 948 BGTRU (Branch on Greater Than Unsigned) instruction, 948 BICB2 (Bit Clear Byte 2 Operand) instruction, 911 BICB3 (Bit Clear Byte 3 Operand) instruction, 911 BICL2 (Bit Clear Long 2 Operand) instruction, 911 BICL3 (Bit Clear Long 3 Operand) instruction, 911 BICPSW (Bit Clear PSW) instruction, 971 BICW2 (Bit Clear Word 2 Operand) instruction, 911 BICW3 (Bit Clear Word 3 Operand) instruction, 911 Binary operator, 314 summary, C7 BISB2 (Bit Set Byte 2 Operand) instruction, 912 BISB3 (Bit Set Byte 3 Operand) instruction, 912 BISL2 (Bit Set Long 2 Operand) instruction, 912 BISL3 (Bit Set Long 3 Operand) instruction, 912 BISPSW (Bit Set PSW) instruction, 972 BISW2 (Bit Set Word 2 Operand) instruction, 912 BISW3 (Bit Set Word 3 Operand) instruction, 912 BITB (Bit Test Byte) instruction, 913 BITL (Bit Test Long) instruction, 913 BITW (Bit Test Word) instruction, 913 BLBC (Branch on Low Bit Clear) instruction, 953 BLBS (Branch on Low Bit Set) instruction, 953 BLEQ (Branch on Less Than or Equal) instruction, 948 BLEQU (Branch on Less Than or Equal Unsigned) instruction, 948
Index2
Block storage allocation directives (.BLKx), 612 BLSS (Branch on Less Than) instruction, 948 BLSSU (Branch on Less Than Unsigned) instruction, 948 BNEQ (Branch on Not Equal) instruction, 948 BNEQU (Branch on Not Equal Unsigned) instruction, 948 BPT (Breakpoint Fault) instruction, 973 Branch access type, 816 Branch mode, 516 operand specier format, 826 BRB (Branch Byte Displacement) instruction, 954 BRW (Branch Word Displacement) instruction, 954 BSBB (Branch to Subroutine Byte Displacement) instruction, 955 BSBW (Branch to Subroutine Word Displacement) instruction, 955 BUGL (Bugcheck Longword Message Identier) instruction, 9196 BUGW (Bugcheck Word Message Identier) instruction, 9196 BVC (Branch on Overow Clear) instruction, 948 BVS (Branch on Overow Set) instruction, 948 Byte data type, 82 .BYTE directive, 614 Byte storage directive (.BYTE), 614
C
Call frame, 963 CALLG (Call Procedure With General Argument List) instruction, 965 CALLS (Call Procedure with Stack Argument List) instruction, 967 Carry condition code (C), 814 CASEB (Case Byte) instruction, 956 CASEL (Case Long) instruction, 956 CASEW (Case Word) instruction, 956 Chaining of vector instructions, 1018 Character set in source statement, 31 special characters, C5 table, A1 Character string data type, 87 instructions, 9124 length, 664 CHME (Change Mode to Executive) instruction, 9187 CHMK (Change Mode to Kernel) instruction, 9187 CHMS (Change Mode to Supervisor) instruction, 9187 CHMU (Change Mode to User) instruction, 9187
CLRB (Clear Byte) instruction, 914 CLRD (Clear D_oating) instruction, 9107 CLRF (Clear F_oating) instruction, 9107 CLRG (Clear G_oating) instruction, 9107 CLRH (Clear H_oating) instruction, 9107 CLRL (Clear Long) instruction, 914 CLRO (Clear Octa) instruction, 914 CLRQ (Clear Quad) instruction, 914 CLRW (Clear Word) instruction, 914 CMPB (Compare Byte) instruction, 915 CMPC3 (Compare Characters 3 Operand) instruction, 9126 CMPC5 (Compare Characters 5 Operand) instruction, 9126 CMPD (Compare D_oating) instruction, 9108 CMPF (Compare F_oating) instruction, 9108 CMPG (Compare G_oating) instruction, 9108 CMPH (Compare H_oating) instruction, 9108 CMPL (Compare Long) instruction, 915 CMPP3 (Compare Packed 3 Operand) instruction, 9150 CMPP4 (Compare Packed 4 Operand) instruction, 9150 CMPV (Compare Field) instruction, 938 CMPW (Compare Word) instruction, 915 CMPZV (Compare Zero Extended Field) instruction, 938 Colon ( : ) in label eld, 22 Complement operator, 313 Conditional assembly block directive .ENDC, 626 (.IF), 640 listing unsatised code, 688 Condition code, 813, 94 carry (C), 814 negative (N), 814 overow (V), 814 zero (Z), 814 Context switch scalar, 1016, 1017, 1037 vector, 1028 Continuation character ( - ) in listing le, 38 in source statement, 21 Control instructions, 942 CRC (Calculate Cyclic Redundancy Check) instruction, 9140 Created local label, 46 range, 37 .CROSS directive, 616 Cross-reference directive .CROSS, 616 .NOCROSS, 616 (.NOCROSS), 666 Current location counter, 316
Index3
CVTBD (Convert Byte to D_oating) instruction, 9109 CVTBF (Convert Byte to F_oating) instruction, 9109 CVTBG (Convert Byte to G_oating) instruction, 9109 CVTBH (Convert Byte to H_oating) instruction, 9109 CVTBL (Convert Byte to Long) instruction, 916 CVTBW (Convert Byte to Word) instruction, 916 CVTDB (Convert D_oating to Byte) instruction, 9109 CVTDF (Convert D_oating to F_oating) instruction, 9109 CVTDH (Convert D_oating to H_oating) instruction, 9109 CVTDL (Convert D_oating to Long) instruction, 9109 CVTDW (Convert D_oating to Word) instruction, 9109 CVTFB (Convert F_oating to Byte) instruction, 9109 CVTFD (Convert F_oating to D_oating) instruction, 9109 CVTFG (Convert F_oating to G_oating) instruction, 9109 CVTFH (Convert F_oating to H_oating) instruction, 9109 CVTFL (Convert F_oating to Long) instruction, 9109 CVTFW (Convert F_oating to Word) instruction, 9109 CVTGB (Convert G_oating to Byte) instruction, 9109 CVTGF (Convert G_oating to F_oating) instruction, 9109 CVTGH (Convert G_oating to H_oating) instruction, 9109 CVTGL (Convert G_oating to Long) instruction, 9109 CVTGW (Convert G_oating to Word) instruction, 9109 CVTHB (Convert H_oating to Byte) instruction, 9109 CVTHD (Convert H_oating to D_oating) instruction, 9109 CVTHF (Convert H_oating to F_oating) instruction, 9109 CVTHG (Convert H_oating to G_oating) instruction, 9109 CVTHL (Convert H_oating to Long) instruction, 9109 CVTHW (Convert H_oating to Word) instruction, 9109 CVTLB (Convert Long to Byte) instruction, 916
CVTLD (Convert Long to D_oating) instruction, 9109 CVTLF (Convert Long to F_oating) instruction, 9109 CVTLG (Convert Long to G_oating) instruction, 9109 CVTLH (Convert Long to H_oating) instruction, 9109 CVTLP (Convert Long to Packed) instruction, 9151 CVTLW (Convert Long to Word) instruction, 916 CVTPL (Convert Packed to Long) instruction, 9152 CVTPS (Convert Packed to Leading Separate Numeric) instruction, 9153 CVTPT (Convert Packed to Trailing Numeric) instruction, 9155 CVTRDL (Convert Rounded D_oating to Long) instruction, 9109 CVTRFL (Convert Rounded F_oating to Long) instruction, 9109 CVTRGL (Convert Rounded G_oating to Long) instruction, 9109 CVTRHL (Convert Rounded H_oating to Long) instruction, 9109 CVTSP (Convert Leading Separate Numeric to Packed) instruction, 9157 CVTTP (Convert Trailing Numeric to Packed) instruction, 9159 CVTWB (Convert Word to Byte) instruction, 916 CVTWD (Convert Word to D_oating) instruction, 9109 CVTWF (Convert Word to F_oating) instruction, 9109 CVTWG (Convert Word to G_oating) instruction, 9109 CVTWH (Convert Word to H_oating) instruction, 9109 CVTWL (Convert Word to Long) instruction, 916 Cyclic redundancy check instruction, 9139
D
Data storage directive .ADDRESS, 64 .ASCIC, 68 .ASCID, 69 .ASCII, 610 .ASCIZ, 611 .BYTE, 614 .D_FLOATING, 620 .F_FLOATING, 635 .G_FLOATING, 636 .H_FLOATING, 638 .LONG, 656 .OCTA, 670 .PACKED, 674 .QUAD, 681
Index4
Data storage directive (contd) .SIGNED_BYTE, 690 .SIGNED_WORD, 691 .WORD, 6101 Data type, 82 byte, 82 character string, 87 oating-point, 84, 85, 86, 9101 integer, 82 leading separate numeric string, 811 longword, 83 octaword, 83 packed decimal string, 812 quadword, 83 string, 87 trailing numeric string, 88 variable-length bit eld, 86 word, 82 .DEBUG directive, 618 Debug directive (.DEBUG), 618 Debugger module name, 623 routine name, 623 DECB (Decrement Byte) instruction, 917 Decimal/hexadecimal conversion, B2 table, B1 Decimal overow enable (DV), 815 Decimal string instructions, 9142 DECL (Decrement Long) instruction, 917 DECW (Decrement Word) instruction, 917 .DEFAULT directive, 619 Default displacement length directive (.DEFAULT), 619 Default result vector arithmetic exceptions, 105, 1026, 1063 Delimiter string argument, 43 Dependencies vector results, 1020 Direct assignment statement, 11, 315 Directive, 11, 61 as operator, 23 general assembler, 11, 61 macro, 11, 61, 62 summary, C1 Disable assembler functions directive (.DISABLE), 621 Disabled fault vector processor, 1027, 1028 .DISABLE directive, 621 Displacement deferred mode, 58 operand specier formats, 820 Displacement mode, 56 operand specier formats, 819 DIVB2 (Divide Byte 2 Operand) instruction, 918
DIVB3 (Divide Byte 3 Operand) instruction, 918 DIVD2 (Divide D_oating 2 Operand) instruction, 9111 DIVD3 (Divide D_oating 3 Operand) instruction, 9111 DIVF2 (Divide F_oating 2 Operand) instruction, 9111 DIVF3 (Divide F_oating 3 Operand) instruction, 9111 DIVG2 (Divide G_oating 2 Operand) instruction, 9111 DIVG3 (Divide G_oating 3 Operand) instruction, 9111 DIVH2 (Divide H_oating 2 Operand) instruction, 9111 DIVH3 (Divide H_oating 3 Operand) instruction, 9111 Divide-by-zero trap, 815 DIVL2 (Divide Long 2 Operand) instruction, 918 DIVL3 (Divide Long 3 Operand) instruction, 918 DIVP (Divide Packed) instruction, 9161 DIVW2 (Divide Word 2 Operand) instruction, 918 DIVW3 (Divide Word 3 Operand) instruction, 918 .DOUBLE directive, 620 D_oating data type, 84, 9102 .D_FLOATING directive, 620
E
Edit instruction, 9167 vector, 1077 pattern operator, 9168, 9170 EDITPC (Edit Packed to Character String) instruction, 9168 EDIV (Extended Divide) instruction, 919 EMODD (Extended Multiply and Integerize D_oating) instruction, 9113 EMODF (Extended Multiply and Integerize F_oating) instruction, 9113 EMODG (Extended Multiply and Integerize G_oating) instruction, 9113 EMODH (Extended Multiply and Integerize H_oating) instruction, 9113 EMUL (Extended Multiply) instruction, 920 Enable assembler functions, 622 .ENABLE directive, 622, 634 .ENDC directive, 626 End conditional assembly directive (.END), 626 .END directive, 625 End macro denition directive (.ENDM), 627 .ENDM directive, 627 .ENDR directive, 628 .ENTRY directive, 629
Index5
Entry mask, 963 Entry point dening, 629 Entry point directive (.ENTRY), 629 EO$ADJUST_INPUT (Adjust Input Length) pattern operator, 9172 EO$BLANK_ZERO (Blank Backwards when Zero) pattern operator, 9173 EO$CLEAR_SIGNIF (Clear Signicance) pattern operator, 9182 EO$END (End Edit) pattern operator, 9174 EO$END_FLOAT (End Floating Sign) pattern operator, 9175 EO$FILL (Store Fill) pattern operator, 9176 EO$FLOAT (Float Sign) pattern operator, 9177 EO$INSERT (Insert Character) pattern operator, 9178 EO$LOAD_FILL (Load Fill Register) pattern operator, 9179 EO$LOAD_MINUS (Load Sign Register If Minus) pattern operator, 9179 EO$LOAD_PLUS (Load Sign Register If Plus) pattern operator, 9179 EO$LOAD_SIGN (Load Sign Register) pattern operator, 9179 EO$MOVE (Move Digits) pattern operator, 9180 EO$REPLACE_SIGN (Replace Sign when Zero) pattern operator, 9181 EO$SET_SIGNIF (Set Signicance) pattern operator, 9182 EO$STORE_SIGN (Store Sign) pattern operator, 9183 .ERROR directive, 631 ETYPE, 106, 1064 .EVEN directive, 633 Exception, E1 access control violation, E3 arithmetic, E1 arithmetic type code, E1 breakpoint, E7 change mode, E7 compatibility mode, E6 type code, E6 control, 813 customer reserved opcode, E5 decimal string overow, E3 oating divide-by-zero, E2, E3 overow, E2, E3 underow, E2, E3 instruction emulation, E6 execution, E5 integer divide-by-zero, E2 overow, E2 kernel stack not valid, E9
Exception (contd) machine check, E9 memory managment, E3 operand reference, E4 reserved addressing mode, E4 operand, E4 subscript-range, E3 trace, E7 trace operation, E7 translation not valid, E4 vector processor, 1010, 1024, 1030 arithmetic, 105, 1019, 1024, 1026, 1063 oating-point, 1063 memory management, 1025 Processor Status Longword, 814 Exception Condition Type See ETYPE Exclusive OR operator, 315 Execution model vector processor, 1015 Expression, 38 absolute, 38 evaluation of, 38 example of, 39 external, 39 global, 38 relocatable, 38, 316 Extent syntax, 71 .EXTERNAL directive, 634 External expression, 39 External symbol, 6100 attribute directive (.EXTERNAL), 634 dening, 622, 634 %EXTRACT operator, 410 EXTV (Extract Field) instruction, 939 EXTZV (Extract Zero Extended Field) instruction, 939
F
Fault access control violation, E3, E4 arithmetic, E1 arithmetic type code, E1 breakpoint, E7 customer reserved opcode, E5 oating divide-by-zero, E3 overow, E2, E3 underow, E3 instruction execution, E5 memory management, E3 privileged instruction, E5 reserved addressing mode, E4
Index6
Fault reserved (contd) opcode, E5 trace, E7 translation not valid, E4 FFC (Find First Clear) instruction, 940 FFS (Find First Set) instruction, 940 Field, 21 comment, 21, 23 label, 21, 22 must be zero (MBZ), 71 operand, 23 operator, 23 read as zero (RAZ), 72 should be zero (SBZ), 72 variable-length bit, 86 .FLOAT directive, 635 Floating overow fault, 815 Floating-point accuracy, 9103 rounding, 9103 zero, 9102 Floating-point constants (.D_FLOATING), 620 Floating-point data type, 84, 9101 D_oating, 84 G_oating, 85 H_oating, 86 Floating-point instructions, 9101 vector, 1063 Floating-point number, 9101 format, 33 .F_FLOATING, 635 .G_FLOATING, 636 .H_FLOATING, 638 in source statement, 33 rounding, 623 storage, 620 storing, 635, 636, 638 truncating, 623 Floating-point operator, 313 Floating-point storage directive .D_FLOATING, 620 (.F_FLOATING), 635 (.G_FLOATING), 636 Floating underow enable (FU), 814 Formal argument, 41 Frame call, 963 stack, 963 F_oating data type, 84, 9102 .F_FLOATING directive, 635
.GLOBAL directive, 637 Global expression, 38 Global label, 22 Global symbol, 36, 6100 attribute directive (.GLOBAL), 637 dening, 622, 634, 637 dening for shareable image, 695 G_oating data type, 85, 9102 .G_FLOATING directive, 636
H
HALT (Halt) instruction, 974, 1037 interrupt stack not valid, E9 synchronizing vector memory before, 1037 Hardware errors vector, 1027, 1042 Hexadecimal/decimal conversion, B1 table, B1 H_oating data type, 86 .H_FLOATING directive, 638 H_oating-point storage directive (.H_FLOATING), 638
I
I/O space references vector, 1025, 1037, 1042 .IDENT directive, 639 Identication directive (.IDENT), 639 .IF directive, 640 .IF_FALSE directive, 643 .IF_TRUE directive, 643 .IF_TRUE_FALSE directive, 643 .IIF directive, 646 Immediate conditional assembly block directive (.IIF), 646 Immediate mode, 512 contrasted with literal mode, 513 Immediate mode addressing usage restricted in vector memory instructions, 1045, 1047 INCB (Increment Byte) instruction, 921 INCL (Increment Long) instruction, 921 Inclusive OR operator, 315 INCW (Increment Word) instruction, 921 Indenite repeat argument directive (.IRP), 647 Indenite repeat character directive (.IRPC), 649 INDEX (Compute Index) instruction, 975 Index mode, 514 operand specier format, 823 INSQHI (Insert Entry into Queue at Head, Interlocked) instruction, 989 INSQTI (Insert Entry into Queue at Tail, Interlocked) instruction, 991
G
General mode, 514 General register mode, 51 summary, 825
Index7
INSQUE (Insert Entry in Queue) instruction, 993 Instruction, 11, 91 address, 933 arithmetic, 95, 9101, 9142 as operator, 23 character string, 9124 control, 942 decimal string, 9142 oating-point, 9101 format, 815 integer, 95 logical, 95 packed decimal, 9142 procedure call, 963 queue, 982 set, 91 string, 9124, 9142 variable-length bit eld, 936 vector, 108, 1015, 1018 Instruction notation operand specier, 92 operation description, 93 INSV (Insert Field) instruction, 941 Integer data type, 82 in source statement, 33 unsigned, 82, 83 Integer instructions, 95 vector, 1052 Integer overow enable (IV), 814 Interlocked instructions, 1037 Internal processor register See IPR Interrupts, 1037 IOTA (Generate Compressed Iota Vector) instruction, 1079 IPR (internal processor register) vector, 103, 108 .IRPC directive, 649 .IRP directive, 647
J
JMP (Jump) instruction, 958 JSB (Jump to Subroutine) instruction, 959
K
Keyword argument, 42
L
Label created local, 46 global, 22 user-dened local, 36, 46
LDPCTX (Load Process Context) instruction, 9191, 1041 Leading separate numeric string data type, 811 %LENGTH operator, 47 .LIBRARY directive, 651 .LINK directive, 652 /INCLUDE qualier, 652 /LIBRARY qualier, 652 /SELECTIVE_SEARCH qualier, 652 /SHAREABLE qualier, 653 .LIST directive, 655 See also .SHOW directive Listing control directive .IDENT, 639 .LIST, 655 .NLIST, 665 .NOSHOW, 667, 688 .PAGE, 675 .SHOW, 688 Listing level count, 689 Listing table of contents, 693 Literal mode, 59 contrasted with immediate mode, 513 operand specier format, 821 Local label saving, 686 user-dened, 36 Local label block ending, 622 starting, 622 Local symbol, 36 %LOCATE operator, 48 Location control directive .ALIGN, 65 .BLKx, 612 Location counter alignment directive (.ODD), 671 Location counter control directive (.EVEN), 633 LOCC (Locate Character) instruction, 9128 Logical AND operator See AND operator Logical exclusive OR operator See Exclusive OR operator Logical functions, vector, 1059 Logical inclusive OR operator See Inclusive OR operator Logical instruction, 95 .LONG directive, 656 Longword data type, 83 Longword storage directive (.LONG), 656
Index8
M
Machine checks, 1037, 1042 Macro, 41 nested, 44 passing numeric value to, 46 with the same name as an opcode, 658 Macro argument, 41 actual, 41 concatenated, 45 delimited, 43, 45 formal, 41 keyword, 42 positional, 42 string, 43 Macro call, 41 as operator, 23 listing, 688 number of arguments, 663 Macro call directive (.MCALL), 660 Macro denition, 41 default value, 42 end, 627 labeling in, 46 listing, 688 Macro denition directive (.MACRO), 657 Macro deletion directive (.MDELETE), 661 .MACRO directive, 657 Macro exit directive (.MEXIT), 662 Macro expansion listing, 688 printing, 41 terminating, 662 Macroinstruction See Macro Macro library adding a name to, 651 Macro library directive (.LIBRARY), 651 Macro link directive (.LINK), 652 Macro name, 35 Macro operator %EXTRACT, 410 %LENGTH, 47 %LOCATE, 48 string, 47 Macro string operator summary, C8 Mask entry, 963 register, 312 register save, 629, 659 .MASK directive, 659 Masked vector operations, 109 MATCHC (Match Characters) instruction, 9129
MBZ eld, 71 .MCALL directive, 660 MCOMB (Move Complemented Byte) instruction, 922 MCOML (Move Complemented Long) instruction, 922 MCOMW (Move Complemented Word) instruction, 922 .MDELETE directive, 661 Memory See Vector memory Memory management exception, E3 fault, E3 vector, 1041 memory management disabled, 1042 TB, 106, 107, 1016, 1028, 1029, 1036, 1041 Memory management exceptions vector, 1025 asynchronous MME handling, 1026 fault parameter, 1025 PTE bit, 1025 VAL bit, 1025 VAS bit, 1025 VIO bit, 1025 fault stack frame, 1025 synchronous MME handling, 1026 system control block (SCB), 1025 Memory synchronization required use of, 1037 Message display directive (.ERROR), 631 (.PRINT), 676 Message warning display directive (.WARN), 698 .MEXIT directive, 662 MFPR (Move from Processor Register) instruction, 9195 vector IPRs, 103, 107, 1028 VPSR, 105, 1027, 1036 MFVP (Move from Vector Processor) instruction, 1016, 1030 MNEGB (Move Negated Byte) instruction, 923 MNEGD (Move Negated D_oating) instruction, 9115 MNEGF (Move Negated F_oating) instruction, 9115 MNEGG (Move Negated G_oating) instruction, 9115 MNEGH (Move Negated H_oating) instruction, 9115 MNEGL (Move Negated Long) instruction, 923 MNEGW (Move Negated Word) instruction, 923 Modify access type, 815
Index9
Modify-fault vector, 1042 Module name made available to debugger, 623 MOVAB (Move Address Byte) instruction, 934 MOVAD (Move Address D_oating) instruction, 934 MOVAF (Move Address F_oating) instruction, 934 MOVAG (Move Address G_oating) instruction, 934 MOVAH (Move Address H_oating) instruction, 934 MOVAL (Move Address Long) instruction, 934 MOVAO (Move Address Octa) instruction, 934 MOVAQ (Move Address Quad) instruction, 934 MOVAW (Move Address Word) instruction, 934 MOVB (Move Byte) instruction, 924 MOVC3 (Move Character 3 Operand) instruction, 9130 MOVC5 (Move Character 5 Operand) instruction, 9130 MOVD (Move D_oating) instruction, 9116 MOVF (Move F_oating) instruction, 9116 MOVG (Move G_oating) instruction, 9116 MOVH (Move H_oating) instruction, 9116 MOVL (Move Long) instruction, 924 MOVO (Move Octa) instruction, 924 MOVP (Move Packed) instruction, 9163 MOVPSL (Move PSL) instruction, 977 MOVQ (Move Quad) instruction, 924 MOVTC (Move Translated Characters) instruction, 9132 MOVTUC (Move Translated Until Character) instruction, 9134 MOVW (Move Word) instruction, 924 MOVZBL (Move Zero-Extended Byte to Long) instruction, 925 MOVZBW (Move Zero-Extended Byte to Word) instruction, 925 MOVZWL (Move Zero-Extended Word to Long) instruction, 925 MSYNC (Memory Instruction Synchronization) instruction, 1030, 1034, 1037, 1039, 1081 MTPR (Move to Processor Register) instruction, 9194, 1041 vector IPRs, 107, 1041 MTVP (Move to Vector Processor) instruction, 1083 MULB2 (Multiply Byte 2 Operand) instruction, 926 MULB3 (Multiply Byte 3 Operand) instruction, 926 MULD2 (Multiply D_oating 2 Operand) instruction, 9117
MULD3 (Multiply D_oating 3 Operand) instruction, 9117 MULF2 (Multiply F_oating 2 Operand) instruction, 9117 MULF3 (Multiply F_oating 3 Operand) instruction, 9117 MULG2 (Multiply G_oating 2 Operand) instruction, 9117 MULG3 (Multiply G_oating 3 Operand) instruction, 9117 MULH2 (Multiply H_oating 2 Operand) instruction, 9117 MULH3 (Multiply H_oating 3 Operand) instruction, 9117 MULL2 (Multiply Long 2 Operand) instruction, 926 MULL3 (Multiply Long 3 Operand) instruction, 926 MULP (Multiply Packed) instruction, 9164 MULW2 (Multiply Word 2 Operand) instruction, 926 MULW3 (Multiply Word 3 Operand) instruction, 926 Must Be Zero See also MBZ See Field
N
.NARG directive, 663 .NCHR directive, 664 Negative condition code (N), 814 .NLIST directive, 665 See also .NOSHOW directive .NOCROSS directive, 616, 666 NOP (No Operation) instruction, 978 .NOSHOW directive, 667, 688 .NTYPE directive, 668 Number See also Integer, Floating-point number, and Packed decimal string in source statement, 32 Number of arguments directive (.NARG), 663 Number of characters directive (.NCHR), 664 Numeric control operator, 313 Numeric string leading separate, 811 trailing, 88
O
Object module identifying, 639 naming, 694 title, 694 .OCTA directive, 670
Index10
Octaword data type, 83 Octaword storage directive (.OCTA), 670 .ODD directive, 671 Ones complement of expression, 313 Opcode creating, 672 dening, 682 format, 815 illegal vector, 1014 redening, 658, 672 summary, D1 alphabetic order, D1 numeric order, D11 with the same name as a macro, 658 Opcode denition directive (.OPDEF), 672 .OPDEF directive, 672 Operand, 23 determining addressing mode of, 668 primary, 823 reserved, 9102, 9103, 9143 Operand generation directive (.REF16), 682 (.REF2), 682 (.REF4), 682 (.REF8), 682 Operand specier, 815 access type notation, 92 access types, 815 base, 823 data type notation, 92 data types, 816 notation, 92 restrictions on usage for vector instructions, 1013 Operand specier addressing mode formats, 816 autodecrement mode, 819 autoincrement deferred mode, 818 autoincrement mode, 818 branch mode, 826 displacement deferred mode, 820 displacement mode, 819 index mode, 823 literal mode, 821 register deferred mode, 817 register mode, 817 Operand type directive (.NTYPE), 668 Operator, 23 AND, 315 arithmetic shift, 314 ASCII, 311 binary, 314, C7 complement, 313 exclusive OR, 315 oating-point, 313 inclusive OR, 315 macro, 47 macro string, C8
Operator (contd) numeric control, 313 pattern, 9170 radix control, 310 register, 312 summary, C6 textual, 311 unary, 39, C7 Overow condition code (V), 814 Overlapped vector instruction execution, 1018
P
Packed decimal instructions, 9142 Packed decimal string, 9142 data type, 812 format, 34 in source statement, 34 storing, 674 Packed decimal string directive (.PACKED), 674 .PACKED directive, 674 Page ejection directive (.PAGE), 675 Pattern operator, 9168, 9170 Period (.) current location counter, 316 Permanent symbol, 34, 35 Permanent symbol table, D1 POLYD (Polynomial Evaluation D_oating) instruction, 9118 POLYF (Polynomial Evaluation F_oating) instruction, 9118 POLYG (Polynomial Evaluation G_oating) instruction, 9118 POLYH (Polynomial Evaluation H_oating) instruction, 9118 POPL instruction, 927 POPR (Pop Registers) instruction, 979 Positional argument, 42 Power failure, 1037 Primary operand, 823 .PRINT directive, 676 PROBER (Probe Read) instruction, 9185 PROBEW (Probe Write) instruction, 9185 Procedure call instructions, 963 Processor status longword (PSL), 813 Processor status word (PSW), 813 condition codes, 813 decimal overow enable (DV), 815 oating underow enable (FU), 814 integer overow enable (IV), 814 trace trap enable (T), 814 Program counter mode, 510 summary, 826 Program execution time delaying, 978 Program section absolute, 679, 680 alignment, 680
Index11
Program section (contd) attributes, 677, 680 dening, 677 directive (.PSECT), 677 (.RESTORE_PSECT), 685 (.SAVE_PSECT), 686 name, 677, 680 restoring context of, 685 saving context of, 686 saving local label, 686 unnamed, 679, 680 .PSECT directive, 677 PSL See Processor status longword PSW See Processor status word PUSHAB (Push Address Byte) instruction, 935 PUSHAD (Push Address D_oating) instruction, 935 PUSHAF (Push Address F_oating) instruction, 935 PUSHAG (Push Address G_oating) instruction, 935 PUSHAH (Push Address H_oating) instruction, 935 PUSHAL (Push Address Long) instruction, 935 PUSHAQ (Push Address Quad) instruction, 935 PUSHAW (Push Address Word) instruction, 935 PUSHL (Push Long) instruction, 927 PUSHR (Push Registers) instruction, 980
Q
.QUAD directive, 681 Quadword, 83 Quadword storage directive (.QUAD), 681 Queue, 982 absolute, 982 header, 982, 985 inserting entries, 982, 985 removing entries, 984, 987 self-relative, 985 Queue instructions, 982
R
Radix control operator, 310 Range syntax, 71 RAZ eld, 72 Read access type, 815 Read As Zero See RAZ eld .REFn directive, 682
Register vector, 101 control registers, 102 internal processor registers, 103 Register conict vector, 1020 Register deferred mode, 54 operand specier format, 817 Register mask operator, 312, 629 Register mode, 53 operand specier format, 817 Register name, 34, 36 Register save mask, 629, 659 Register save mask directive (.MASK), 659 REI (Return from Exception or Interrupt) instruction, 9189 Relative deferred mode, 511 setting default displacement length, 619 Relative mode, 510 assembled as absolute mode, 622 setting default displacement length, 619 Relocatable expression, 38 REMQHI (Remove Entry from Queue at Head, Interlocked) instruction, 995 REMQTI (Remove Entry from Queue at Tail, Interlocked) instruction, 997 REMQUE (Remove Entry from Queue) instruction, 999 Repeat block argument substitution, 647 character substitution, 649 end, 628 listing range denitions of, 688 listing range expansions of, 688 listing speciers, 688 terminating repetition, 662 Repeat block directive (.REPEAT), 683 .REPEAT directive, 683 Repeat range end directive (.ENDR), 628 Reserved operand, 9102, 9103, 9143 .RESTORE_PSECT directive, 685 RET (Return from Procedure) instruction, 969 ROTL (Rotate Long) instruction, 928 Routine name made available to debugger, 623 RSB (Return from Subroutine) instruction, 960
S
.SAVE_PSECT directive, 686 SBWC (Subtract with Carry) instruction, 929 SBZ eld, 72 Scalar/vector memory synchronization, 1034 SCANC (Scan Characters) instruction, 9136 Section name made available to debugger, 623
Index12
Self-relative queue, 985 Shift instruction vector, 1062 Shift operator, 314 Short literal mode usage restricted in vector oating-point instructions, 1013 Should Be Zero See SBZ eld .SHOW directive, 688 Signed byte storage directive (.SIGNED BYTE), 690 Signed word storage directive (.SIGNED_WORD), 691 .SIGNED_BYTE directive, 690 .SIGNED_WORD directive, 691 Signicance indicator, 9182 SKPC (Skip Character) instruction, 9137 SOBGEQ (Subtract One and Branch Greater Than or Equal) instruction, 961 SOBGTR (Subtract One and Branch Greater Than) instruction, 962 Source statement See Statement SPANC (Span Characters) instruction, 9138 Stack frame, 963 Statement, 11 character set, 31 comment, 23 continuation of, 21 format, 21 label, 22 operand, 23 operator, 23, C6 special characters, C5 Stride vector, 1043 String argument, 43 String data type character, 87 leading separate numeric, 811 packed decimal, 812 trailing numeric, 88 String instructions, 9124, 9142 String operator in macro, 47 SUBB2 (Subtract Byte 2 Operand) instruction, 930 SUBB3 (Subtract Byte 3 Operand) instruction, 930 Subconditional assembly block directive, 643 .IF_FALSE, 643 .IF_TRUE, 643 .IF_TRUE_FALSE, 643
Subconditional assembly block directive (.IF_x), 643 SUBD2 (Subtract D_oating 2 Operand) instruction, 9121 SUBD3 (Subtract D_oating 3 Operand) instruction, 9121 SUBF2 (Subtract F_oating 2 Operand) instruction, 9121 SUBF3 (Subtract F_oating 3 Operand) instruction, 9121 SUBG2 (Subtract G_oating 2 Operand) instruction, 9121 SUBG3 (Subtract G_oating 3 Operand) instruction, 9121 SUBH2 (Subtract H_oating 2 Operand) instruction, 9121 SUBH3 (Subtract H_oating 3 Operand) instruction, 9121 SUBL2 (Subtract Long 2 Operand) instruction, 930 SUBL3 (Subtract Long 3 Operand) instruction, 930 SUBP4 (Subtract Packed 4 Operand) instruction, 9165 SUBP6 (Subtract Packed 6 Operand) instruction, 9165 .SUBTITLE directive, 693 Subtitle listing control directive (.SUBTITLE), 693 SUBW2 (Subtract Word 2 Operand) instruction, 930 SUBW3 (Subtract Word 3 Operand) instruction, 930 Summary of OPCODES alphabetic order, D1 numeric order, D11 SVPCTX (Save Process Context) instruction, 9193 Symbol, 34 cross-referencing, 616, 666 determining value of, 35 external, 634, 6100 global, 36, 634, 637, 695, 6100 in operand eld, 36 in operator eld, 35 local, 36 macro name, 35 made available to debugger, 622 permanent, 34, 35 register name, 34, 36 suppressing, 623 transferral to VAX Symbolic Debugger, 618 undened, 622 user-dened, 35, 36 Symbol attribute directive (.WEAK), 6100
Index13
Symbol denition for shareable image, 695 Symbol for shareable image directive (.TRANSFER), 695 SYNC (Scalar/Vector Instruction Synchronization) instruction, 1016, 1033, 1081 Synchronization, 1033 Synchronous memory management exception handling, 1026 System Control Block (SCB) vector, 1025 System failure, E9
TSTL (Test Long) instruction, 931 TSTW (Test Word) instruction, 931
U
Unary operator, 39 summary, C7 UNDEFINED results, 71 UNPREDICTABLE results, 71 User-dened local label, 36 range, 37 User-dened symbol, 35, 36
T
Tab stops in source statement, 21 TB (Translation buffer) vector, 106, 107, 1016, 1028, 1029, 1036, 1041 TBIA (TB Invalidate All) instruction, 1041 TBIS (TB Invalidate Single) instruction, 1041 Term in MACRO statement, 38 Textual operator, 311 .TITLE directive, 694 Title listing control directive (.TITLE), 694 Traceback, 623 Trace trap enable (T), 814 Trailing numeric string data type, 88 .TRANSFER directive, 695 Translation buffer See TB Trap arithmetic, E1 arithmetic type code, E1 change mode, E7 decimal string overow, E3 decimal overow, 815 divide by zero, 815 oating divide-by-zero, E2 overow, E2 underow, E2 integer divide-by-zero, E2 overow, E2 integer overow, 814 subscript-range, E3 trace, 814 TSTB (Test Byte) instruction, 931 TSTD (Test D_oating) instruction, 9123 TSTF (Test F_oating) instruction, 9123 TSTG (Test G_oating) instruction, 9123 TSTH (Test H_oating) instruction, 9123
V
VADD (Vector Floating Add) instruction, 1065 VADDL (Vector Integer Add) instruction, 1052 VAER (Vector Arithmetic Exception Register), 105 Variable bit base address access type, 816 Variable-length bit eld bytes referenced, 87 data type, 86 Variable-length bit eld instructions, 936 VAX architecture, 81 scalar, 82 vector, 82 VAX condition codes, 1014 VBIC (Vector Bit Clear) instruction, 1059 VBIS (Vector Bit Set) instruction, 1059 VCMP (Vector Floating Compare) instruction, 1067 VCMPL (Vector Integer Compare) instruction, 1054 VCR (Vector Count Register), 103, 1081, 1083 VDIV (Vector Floating Divide) instruction, 1072 Vector address translation, 1041 Vector code assembling, 623 Vector control word, 108, 1010, 1014 EXC (Exception Enable) bit, 109, 1010, 1011, 1014, 1025, 1053, 1056, 1058, 1063, 1066, 1071, 1073, 1075, 1077 MI (Modify Intent) bit, 109, 1010, 1015, 1045, 1047 MOE (Masked Operations Enable) bit, 109, 1014 MTF (Match True/False) bit, 109, 1014 register specier elds, 1010 Vector Count Register See VCR Vector instruction decoding, 1015 execution, 1018 formats, 108
Index14
Vector Length Register See VLR Vector Logical Functions, 1059 Vector Mask Register See VMR Vector memory accessing page tables, 1042 access mode, 1016, 1044 alignment, 1043 HALT considerations, 1037 indicating intent to modify, 1010 instructions, 1043 management See Memory management required use of synchronization instructions, 1037 scalar/vector synchronization of, 1034 stride, 1043 Vector Memory Activity Check Register SeeVMAC Vector opcode See Appendix D Vector processor disabled, 1027, 1028 Vector Processor Status Register See VPSR Vector registers, 101 Vector State Address Register See VSAR VGATH (Gather Memory Data into Vector Register) instruction, 1010, 1013, 1039 Virtual address, 82 Virtual-machine processor status longword (VMPSL), 9189 VLD (Load Memory Data into Vector Register) instruction, 1010, 1013, 1039, 1045 VLR (Vector Length Register), 102, 1081, 1083 VMAC (Vector Memory Activity Check) Register, 106, 1017, 1035, 1037, 1039, 1042 VMERGE (Vector Merge) instruction, 1078 VMPSL See Virtual-machine processor status longword VMR (Vector Mask Register), 102, 1020, 1081, 1083 VMUL (Vector Floating Multiply) instruction, 1074 VMULL (Vector Integer Multiply) instruction, 1056 VPSR (Vector Processor Status Register), 104, 105 AEX (Arithmetic Exception) bit, 104, 1027, 1028, 1029, 1030 BSY (Busy) bit, 104, 105, 107, 1017, 1029, 1034, 1042 IMP (Implementation-Specic Hardware Error) bit, 104, 1027, 1028, 1029, 1030, 1042, 1043
VPSR (Vector Processor Status Register) (contd) IVO (Illegal Vector Opcode) bit, 104, 1014, 1027, 1028, 1029, 1030 MF (Memory Fault) bit, 104, 1016, 1026, 1030 PMF (Pending Memory Fault) bit, 104, 1016, 1026, 1029, 1030 RLD (State Reload) bit, 104, 105, 1030 RST (State Reset) bit, 104, 105, 107, 1029, 1036 STS (State Store) bit, 104, 105, 1029 VEN (Enable) bit, 104, 105, 1015, 1017, 1027, 1028, 1029, 1030, 1042, 1043 VSAR (Vector State Address Register), 107 VSCAT (Scatter Vector Register Data into Memory) instruction, 1010, 1013, 1039, 1051 VSL (Vector Shift Logical) instruction, 1062 VST (Store Vector Register Data into Memory) instruction, 1010, 1013, 1039, 1049 VSUB (Vector Floating Subtract) instruction, 1076 VSUBL (Vector Integer Subtract) instruction, 1058 VSYNC (Synchronize Vector Memory Access) instruction, 1036, 1037, 1039, 1084 VTBIA (Vector TB Invalidate All) instruction, 106, 107, 1028, 1029, 1036, 1041 VVCVT (Vector Convert) instruction, 1070 VXOR (Vector Exclusive Or) instruction, 1059
W
.WARN directive, 698 .WEAK directive, 6100 Word data type, 82 .WORD directive, 6101 Word storage directive (.WORD), 6101 Write access type, 815
X
XFC (Extended Function Call) instruction, 981 XORB2 (Exclusive OR Byte 2 Operand) instruction, 932 XORB3 (Exclusive OR Byte 3 Operand) instruction, 932 XORL2 (Exclusive OR Long 2 Operand) instruction, 932 XORL3 (Exclusive OR Long 3 Operand) instruction, 932 XORW2 (Exclusive OR Word 2 Operand) instruction, 932 XORW3 (Exclusive OR Word 3 Operand) instruction, 932
Index15
Z
Zero condition code (Z), 814
Index16