vax macro and instruction set reference manual

Upload: ranagg

Post on 14-Apr-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    1/543

    VAXMACROandInstructionSetReference Manual

    Order Number: AAPS6GDTE

    April 2001

    This document describes the features of the VAX MACRO instruction setand assembler. I t includes a detailed description of MACRO directivesand instructions, as well as information about M ACRO source programsyntax.

    Revision/Update Information: This manual supersedes the VAXMACRO and I nstruction Set ReferenceManual, Version 7.1

    Software Version: OpenVMS VAX Version 7.3

    Compaq Computer CorporationHouston, Texas

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    2/543

    2001 Compaq Computer Corporation

    Compaq, VAX, VMS, and the Compaq logo Registered in U.S. Patent and Trademark Office.

    OpenVM S is a trademark of Compaq Information Technologies Group, L .P. in the United States andother countries.

    All other product names mentioned herein may be trademarks of their respective companies.

    Confidential computer software. Valid license from Compaq required for possession, use, or copying.Consistent with FAR 12.211 and 12.212, C ommercial Computer Software, Computer SoftwareDocumentation, and Technical Data for Commercial I tems are l icensed to the U.S. Governmentunder vendors standard commercial li cense.

    Compaq shall not be liable for technical or editorial errors or omissions contained herein. Theinformation in this document is provided "as is" without warranty of any kind and is subjectto change without notice. The warranties for Compaq products are set forth in the expresslimited warranty statements accompanying such products. Nothing herein should be construed asconstituti ng an additi onal warranty.

    ZK 4515

    The Compaq OpenVMS documentation set is available on CD-ROM .

    This document was prepared using DE Cdocument, Version 3.3-1b.

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    3/543

    Contents

    Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

    VAX MACRO Language

    1 Introduction

    2 VAX MACRO Source Statement Format

    2.1 Label Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.2 Operator Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.3 Operand Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.4 Comment Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    3 Components of MACRO Source Statements

    3.1 Character Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.2 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.2.1 Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.2.2 Floating-Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.2.3 Packed Decimal Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    3.3 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3.1 Permanent Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3.2 User-Defined Symbols and Macro Names . . . . . . . . . . . . . . . . . . . . . . . 353.3.3 Determining Symbol Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.4 Local Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363.5 Terms and Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.6 Unary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393.6.1 Radix Control Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3103.6.2 Textual Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3113.6.2.1 ASCII Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3113.6.2.2 Register Mask Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3123.6.3 Numeric Control Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3133.6.3.1 Floating-Point Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

    3.6.3.2 Complement Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3133.7 Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3143.7.1 Arithmetic Shift Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3143.7.2 L ogical AND Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3153.7.3 L ogical I nclusive OR Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3153.7.4 L ogical Exclusive OR Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3153.8 Direct Assignment Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3153.9 Current L ocation Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

    iii

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    4/543

    4 Macro Arguments and String Operators

    4.1 Arguments in M acros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414.2 Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424.3 K eyword Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424.4 String Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    4.5 Argument Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.6 Passing Numeric Values of Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464.7 Created L ocal L abels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464.8 Macro String Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474.8.1 %LE NGTH Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474.8.2 %L OCATE Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484.8.3 %EXTRACT Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410

    5 VAX MACRO Addressing Modes

    5.1 General Register Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515.1.1 Register Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535.1.2 Register Deferred Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545.1.3 Autoincrement Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545.1.4 Autoincrement Deferred Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555.1.5 Autodecrement Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565.1.6 Displacement Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565.1.7 Displacement Deferred Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585.1.8 Literal Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595.2 Program Counter Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5105.2.1 Relative Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5105.2.2 Relative Deferred Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5115.2.3 Absolute Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5125.2.4 Immediate Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5125.2.5 General Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514

    5.3 Index Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5145.4 Branch Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516

    6 VAX MACRO Assembler Directives

    .ADDRESS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

    .ALI GN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

    .ASCI x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    .ASCIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    .ASCID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    .ASCII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610

    .ASCIZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611

    .BLKx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612

    .BYTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614

    .CROSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616

    .DEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618

    .DEFAULT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619

    .D_FL OATI NG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620

    .DISABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621

    .ENABL E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622

    .END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625

    iv

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    5/543

    .ENDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626

    .ENDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627

    .ENDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628

    .ENTRY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629

    .ERROR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631

    .EVEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633

    .EXTERNAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634

    .F_FLOATING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635

    .G_FL OATI NG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636

    .GLOBAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637

    .H_FLOATING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638

    .IDENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639

    .IF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640

    .IF_x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643

    .IIF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646

    .IRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647

    .IRP C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649

    .LI BRARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651

    .LI NK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652

    .LI ST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655

    .LONG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656

    .MACRO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657

    .MASK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659

    .MCALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660

    .MDELE TE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661

    .MEXIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662

    .NARG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663

    .NCHR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664

    .NL IST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665

    .NOCROSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666

    .NOSHOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667

    .NTYPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668

    .OCTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670

    .ODD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671

    .OPDEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672

    .PACK ED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674

    .PAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675

    .PRINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676

    .PSECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677

    .QUAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681

    .REFn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682

    .REPEAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683

    .RESTORE_PSECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685

    .SAVE_PSECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686

    .SHOW

    v

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    6/543

    .NOSHOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688

    .SIGNED_BYTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690

    .SIGNED_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691

    .SUBTITLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693

    .TITL E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694

    .TRANSFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695

    .WARN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698

    .WEAK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6100

    .WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6101

    VAX Data Types and Instruction Set

    7 Terminology and Conventions

    7.1 Numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.2 UNPREDICTABLE and UNDEFIN ED . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    7.3 Ranges and Extents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.4 MBZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.5 RAZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727.6 SBZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727.7 Reserved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727.8 Figure Drawing Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

    8 Basic Architecture

    8.1 Basic Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818.2 VAX Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828.3 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828.3.1 Byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

    8.3.2 Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828.3.3 Longword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838.3.4 Quadword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838.3.5 Octaword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838.3.6 F_floating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.3.7 D_floating. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.3.8 G_floating. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858.3.9 H_floating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868.3.10 Variable-Length Bit Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868.3.11 Character String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878.3.12 Trailing Numeric String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888.3.13 L eading Separate Numeric String . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8118.3.14 Packed Decimal String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812

    8.4 Processor Status Longword (PSL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8138.4.1 C Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8148.4.2 V Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8148.4.3 Z Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8148.4.4 N Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8148.4.5 T Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8148.4.6 IV Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8148.4.7 FU Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8148.4.8 DV Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8158.5 Permanent Exception Enables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8158.5.1 Divide by Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815

    vi

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    7/543

    8.5.2 Floating Overflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8158.6 I nstruction and Addressing Mode Formats . . . . . . . . . . . . . . . . . . . . . . . . 8158.6.1 Opcode Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8158.6.2 Operand Specifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8158.7 General Addressing Mode Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816

    8.7.1 Register Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8178.7.2 Register Deferred Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8178.7.3 Autoincrement Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8188.7.4 Autoincrement Deferred Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8188.7.5 Autodecrement Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8198.7.6 Displacement Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8198.7.7 Displacement Deferred Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8208.7.8 Literal Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8218.7.9 Index Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8238.8 Summary of General M ode Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . 8248.8.1 General Register Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8248.8.2 Program Counter Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8258.9 Branch M ode Addressing Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826

    9 VAX Instruction Set

    9.1 I ntroduction to the VAX I nstruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . 919.2 I nstruction Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 919.2.1 I nteger Arithmetic and L ogical I nstructions . . . . . . . . . . . . . . . . . . . . 95

    ADAWI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    ADWC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    ASH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910

    BIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911

    BIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912

    BIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914

    CMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915

    CVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916

    DEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917

    DIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 918

    EDIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 919

    EMU L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 920

    INC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921

    MCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 922

    MNEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 923

    MOV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924MOVZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925

    MUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 926

    PUSHL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927

    ROTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 928

    SBWC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929

    SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930

    TST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931

    XOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 932

    vii

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    8/543

    9.2.2 Address I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933

    MOVA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934

    PUSHA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9359.2.3 Variable-Length Bi t Fi eld I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . 936

    CMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938

    EXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 939FF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 940

    INSV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9419.2.4 Control I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 942

    ACB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 944

    AOBLEQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946

    AOBLSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947

    B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 948

    BB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 950

    BB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 951

    BB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 952

    BLB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953BR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 954

    BSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 955

    CASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956

    J M P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958

    J SB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959

    RSB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 960

    SOBGEQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961

    SOBGTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9629.2.5 Procedure Call I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963

    CALLG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965

    CALLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967RET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969

    9.2.6 Mi scellaneous Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 970

    BICPSW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 971

    BISPSW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 972

    BPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973

    HALT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974

    INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 975

    MOVPSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 977

    NOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 978

    POPR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 979

    PUSHR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 980XFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981

    9.2.7 Queue I nstructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9829.2.7.1 Absolute Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9829.2.7.2 Self-Relative Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9859.2.7.3 I nstruction Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 988

    INSQHI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989

    INSQTI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991

    INSQUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 993

    REMQHI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 995

    viii

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    9/543

    REMQTI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 997

    REMQUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9999.2.8 Floating-Point I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91019.2.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91019.2.8.2 Overview of the I nstruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . 9102

    9.2.8.3 Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91039.2.8.4 I nstruction Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9104

    ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9106

    CLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9107

    CMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9108

    CVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9109

    DIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9111

    EMOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9113

    MNEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9115

    MOV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9116

    MUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9117

    POLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9118SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9121

    TST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91239.2.9 Character String I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9124

    CMPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9126

    LOCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9128

    MATCHC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9129

    MOVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9130

    MOVTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9132

    MOVTUC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9134

    SCANC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9136

    SKPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9137

    SPANC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91389.2.10 Cyclic Redundancy Check I nstruction . . . . . . . . . . . . . . . . . . . . . . . . . 9139

    CRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91409.2.11 Decimal String I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91429.2.11.1 Decimal Overflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91439.2.11.2 Zero Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91439.2.11.3 Reserved Operand Exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91439.2.11.4 UNP REDICTABLE Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91439.2.11.5 Packed Decimal Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91439.2.11.6 Zero-Length Decimal Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91449.2.11.7 I nstruction Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9144

    ADDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9146

    ASHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9148

    CMPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9150

    CVTLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9151

    CVTPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9152

    CVTPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9153

    CVTPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9155

    CVTSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9157

    CVTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9159

    DIVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9161

    ix

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    10/543

    MOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9163

    MUL P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9164

    SUBP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91659.2.12 The EDI TP C I nstruction and I ts Pattern Operators . . . . . . . . . . . . . . 9167

    EDITPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9168

    EO$ADJ UST_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9172EO$BLANK _ZERO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9173

    EO$END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9174

    EO$END_FL OAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9175

    EO$FI LL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9176

    EO$FL OAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9177

    EO$INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9178

    EO$LOAD_ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9179

    EO$MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9180

    EO$REPLACE_SIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9181

    EO$_SIGNI F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9182

    EO$STORE_SIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91839.2.13 Other VAX Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9184

    PROBEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9185

    CHM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9187

    REI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9189

    LDPCTX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9191

    SVPCTX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9193

    MTPR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9194

    MFPR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9195

    BUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9196

    10 VAX Vector Architecture

    10.1 I ntroduction to VAX Vector Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 10110.2 VAX Vector Architecture Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10110.2.1 Vector Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10110.2.2 Vector Control Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10210.2.3 I nternal Processor Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10310.3 Vector I nstruction F ormats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10810.3.1 Masked Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10910.3.2 Exception E nable Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101010.3.3 Modify Intent Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101010.3.4 Register Specifier Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101010.3.5 Vector Control Word F ormats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1010

    10.3.6 Restrictions on Operand Specifier Usage . . . . . . . . . . . . . . . . . . . . . . . 101310.3.7 VAX Condition Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101410.3.8 I llegal Vector Opcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101410.4 Assembler Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101410.5 Execution M odel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101510.5.1 Access Mode Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101610.5.2 Scalar Context Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101710.5.3 Overlapped I nstruction E xecution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101810.5.3.1 Vector Chaining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101810.5.3.2 Register Conflict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102010.5.3.3 Dependencies Among Vector Results . . . . . . . . . . . . . . . . . . . . . . . 1020

    x

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    11/543

    10.6 Vector Processor Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102410.6.1 Vector Memory Management Exception Handling . . . . . . . . . . . . . . . . 102510.6.2 Vector Arithmetic Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102610.6.3 Vector Processor Disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102710.6.4 Handling Disabled F aults and Vector Context Switching . . . . . . . . . . . 102810.6.5

    MF VP Exception Reporting Examples . . . . . . . . . . . . . . . . . . . . . . . . .1030

    10.7 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103310.7.1 Scalar/Vector I nstruction Synchronization (SYNC) . . . . . . . . . . . . . . . 103310.7.2 Scalar/Vector Memory Synchronization . . . . . . . . . . . . . . . . . . . . . . . . 103410.7.2.1 Memory Instruction Synchronization (MSYNC) . . . . . . . . . . . . . . . 103410.7.2.2 Memory Activity Completion Synchronization (VMAC) . . . . . . . . . 103510.7.3 Other Synchronization Between the Scalar and Vector P rocessors . . . . 103610.7.4 Memory Synchronization Within the Vector Processor (VSYNC) . . . . . 103610.7.5 Required U se of Memory Synchronization I nstructions . . . . . . . . . . . . 103710.7.5.1 When VSYN C I s Not Required . . . . . . . . . . . . . . . . . . . . . . . . . . . 103910.8 Memory M anagement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104110.9 Hardware Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104210.10 Vector Memory Access I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1043

    10.10.1 Alignment Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104310.10.2 Stride Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104310.10.3 Context of A ddress Specifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104310.10.4 Access Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104410.10.5 Memory I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1044

    VLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1045

    VGATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1047

    VST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1049

    VSCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105110.11 Vector I nteger I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1052

    VADDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1053

    VCMPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1054

    VMUL L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1056VSUBL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1058

    10.12 Vector Logical and Shift Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1059

    VBIC, VBI S, and VXOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1060

    VSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106210.13 Vector Floating-Point Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106310.13.1 Vector Floating-Point Exception Conditions . . . . . . . . . . . . . . . . . . . . . 106310.13.2 Floating-Point I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064

    VADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065

    VCMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1067

    VVCVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1070

    VDIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1072

    VMUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1074

    VSUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107610.14 Vector Edit I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077

    VMERGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078

    IOTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107910.15 Mi scellaneous Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080

    MFVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1081

    MTVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083

    VSYNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084

    xi

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    12/543

    A ASCII Character Set

    B Hexadecimal/Decimal Conversion

    B.1 Hexadecimal to Decimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B1

    B.2 Decimal to Hexadecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B2B.3 Powers of 2 and 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B2

    C VAX MACRO Assembler Directives and Language Summary

    C.1 Assembler Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C1C.2 Special Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C5C.3 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C6C.3.1 Unary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C7C.3.2 Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C7C.3.3 Macro String Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C8C.4 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C9

    D Permanent Symbol Table Defined for Use with VAX MACRO

    E Exceptions That May Occur During Instruction Execution

    E.1 Arithmetic Traps and Faults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E1E.1.1 I nteger Overflow Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E2E.1.2 I nteger Divide-by-Zero Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E2E.1.3 Floating Overflow Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E2E.1.4 Divide-by-Zero Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E2E.1.5 Floating Underflow Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E2E.1.6 Decimal String Overflow Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E3E.1.7 Subscript-Range Trap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E3

    E.1.8 Floating Overflow F ault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E3E.1.9 Divide-by-Zero Floating Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E3E.1.10 Floating Underflow F ault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E3E.2 Memory M anagement E xceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E3E.2.1 Access Control Violation Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E3E.2.2 Translation N ot Valid Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E4E.3 Exceptions Detected During Operand Reference . . . . . . . . . . . . . . . . . . . . E4E.3.1 Reserved Addressing Mode Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E4E.3.2 Reserved Operand Exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E4E.4 Exceptions Occurring as the Consequence of an I nstruction . . . . . . . . . . . E5E.4.1 Reserved or Privileged Instruction Fault . . . . . . . . . . . . . . . . . . . . . . . E5E.4.2 Operand Reserved to Customers F ault . . . . . . . . . . . . . . . . . . . . . . . . E5E.4.3 I nstruction E mulation E xceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . E6

    E.4.4 Compatibility M ode Exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E6E.4.5 Change Mode Trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E7E.4.6 Breakpoint Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E7E.5 Trace Fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E7E.5.1 Trace Operation When Entering a Change Mode I nstruction . . . . . . . . E8E.5.2 Trace Operation U pon Return F rom I nterrupt . . . . . . . . . . . . . . . . . . . E8E.5.3 Trace Operation After a BI SPSW I nstruction . . . . . . . . . . . . . . . . . . . E8E.5.4 Trace Operation After a CAL L S or CAL L G I nstruction . . . . . . . . . . . . E8E.6 Serious System Failures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E9E.6.1 K ernel Stack Not Valid Abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E9E.6.2 I nterrupt Stack N ot Valid Halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E9

    xii

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    13/543

    E.6.3 Machine Check Exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E9

    Index

    Figures61 Using Transfer Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696

    101 Vector Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    102 Vector L ength Register (VLR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    103 Vector Mask R egister (VMR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    104 Vector Count Register (VCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    105 Vector Processor Status Register (VPSR) . . . . . . . . . . . . . . . . . . . . . . . 103

    106 Vector Ari thmetic Exception Register (VAE R) . . . . . . . . . . . . . . . . . . . 106

    107 Vector Memory Activity Check (VMAC) Register . . . . . . . . . . . . . . . . . 106

    108 Vector Translation Buffer I nvalidate All (VTBI A) Register . . . . . . . . . 107

    109 Vector State Address Register (VSAR) . . . . . . . . . . . . . . . . . . . . . . . . . 107

    1010 Vector Control Word Operand (cntrl) . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    1011 Vector Control Word F ormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012

    1012 Memory Management Fault Stack Frame (as Sent by the VectorProcessor). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025

    1013 Encoding of the Reserved Operand . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064

    E1 Compatibility M ode Exception Stack Fr ame . . . . . . . . . . . . . . . . . . . . E6

    Tables

    31 Special Characters Used in VAX MACRO Statements . . . . . . . . . . . . . 31

    32 Separating Characters in VAX MA CRO Statements . . . . . . . . . . . . . . 32

    33 Unary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31034 Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

    51 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    52 Floating-Point L iterals E xpressed as Decimal Numbers . . . . . . . . . . . 59

    53 Floating-Point Literals Expressed as Rational Numbers . . . . . . . . . . . 59

    54 I ndex Mode Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516

    61 Summary of General Assembler Directives . . . . . . . . . . . . . . . . . . . . . 61

    62 Summary of M acro Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

    63 .ENABL E and .DISABL E Symbolic Arguments . . . . . . . . . . . . . . . . . . 622

    64 Condition Tests for Conditional Assembly Directives . . . . . . . . . . . . . . 641

    65 Operand Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672

    66 Program Section Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67767 Default P rogram Section Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 679

    68 .SHOW and .NOSHOW Symbolic Arguments . . . . . . . . . . . . . . . . . . . 688

    81 Representation of L east-Significant Digit and Sign in Zoned Numeri cFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    82 Representation of L east-Significant Digit and Sign in OverpunchFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810

    83 Floating-Point L iterals E xpressed as Decimal Numbers . . . . . . . . . . . 822

    84 Floating-Point Literals Expressed as Rational Numbers . . . . . . . . . . . 823

    xiii

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    14/543

    85 General Register Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825

    86 Program Counter Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826

    91 Summary of EDITPC Pattern Operators . . . . . . . . . . . . . . . . . . . . . . . 9170

    92 EDI TPC Pattern Operator Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . 9171

    101 Description of the Vector Pr ocessor Status Register (VPSR) . . . . . . . . 104

    102 Possible VPSRSettings for MT PR . . . . . . . . . . . . . . . . . . . . . . . . 105

    103 State of the Vector Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

    104 VAER Exception Condition Summary Word Encoding . . . . . . . . . . . . . 106

    105 IPR Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    106 Description of the Vector Control Word Operand . . . . . . . . . . . . . . . . . 109

    107 Dependencies for Vector Operate I nstructions . . . . . . . . . . . . . . . . . . . 1021

    108 Dependencies for Vector L oad and Gather I nstructions . . . . . . . . . . . . 1022

    109 Dependencies for Vector Store and Scatter I nstructions. . . . . . . . . . . . 1022

    1010 Dependencies for Vector Compare I nstructions . . . . . . . . . . . . . . . . . . 1023

    1011 Dependencies for Vector MERGE Instructions . . . . . . . . . . . . . . . . . . . 1023

    1012 Dependencies for I OTA I nstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . 1023

    1013 Dependencies for MF VP I nstructions . . . . . . . . . . . . . . . . . . . . . . . . . . 1024

    1014 Mi scellaneous Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1024

    1015 Possible Pairs of Read and Write Operations When Scalar/VectorMemory Synchronization (M) or VSYNC (V) Is Required BetweenI nstructions That Reference the Same Memory L ocation . . . . . . . . . . 1039

    1016 Encoding of the Exception Condition Type (ETY PE ) . . . . . . . . . . . . . . 1064

    C1 Assembler Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C1

    C2 Special Characters Used in VAX MACRO Statements . . . . . . . . . . . . . C6

    C3 Summary of U nary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C7

    C4 Summary of Binary Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C7

    C5 Macro String Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C8

    C6 Summary of Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C9D1 Opcodes (Alphabetic Order) and F unctions . . . . . . . . . . . . . . . . . . . . . D1

    D2 One_Byte Opcodes (Numeric Order) . . . . . . . . . . . . . . . . . . . . . . . . . . . D11

    D3 Two_Byte Opcodes (Numeric Order) . . . . . . . . . . . . . . . . . . . . . . . . . . . D15

    E1 Arithmetic Exception Type Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E1

    E2 Compatibility M ode Exception Type Codes . . . . . . . . . . . . . . . . . . . . . E6

    xiv

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    15/543

    Preface

    Intended Audience

    This manual is intended for all programmers writing VAX MACRO programs. Youshould be familiar with assembly language programming, the VAX instructionset, and the OpenVM S 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 M ACRO language.

    Chapter 1 introduces the features of the VAX M ACRO language.

    Chapter 2 describes the format used in VAX MACR O source statements.

    Chapter 3 describes the following components of VAX MACRO sourcestatements:

    Character set

    Numbers

    Symbols

    L ocal labels

    Terms and expressions

    Unary and binary operators

    Direct assignment statements

    Curr ent location counter

    Chapter 4 describes the arguments and string operators used with macros.

    Chapter 5 summarizes and gives examples of using the VAX MACROaddressing modes.

    Chapter 6 describes the VAX M ACRO general assembler directives and the

    directives used in defining and expanding macros.

    Part I I describes the VAX data types, the instruction and addressing modeformats, and the instruction set.

    Chapter 7 summarizes the terminology and conventions used i n thedescriptions in Part II.

    Chapter 8 describes the basic VAX architecture, including the following:

    Address space

    Data types

    xv

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    16/543

    Pr ocessor status longword

    Permanent exception enables

    I nstruction 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 alphabeticallywithin each group.

    Chapter 10 describes the extension to the VAX architecture for integratedvector processing.

    This manual also contains the following five appendixes:

    Appendix A l ists the ASCI I character set used in VAX M ACRO programs.

    Appendix B gives rules for hexadecimal/decimal conversion.

    Appendix C summarizes the general assembler and macro directives (inalphabetical order), special characters, unary operators, binary operators,macro string operators, and addressing modes.

    Appendix D lists the permanent symbols (instruction set) defined for use withVAX MACRO.

    Appendix E describes the exceptions (traps and faults) that may occur duringinstruction execution.

    Related Documents

    The following documents are relevant to VAX MACRO programming:

    VAX Architecture Reference Manual

    OpenVMS DCL Dictionary

    The descriptions of the VM S L inker and Symbolic Debugger in:

    OpenVMS L inker Util ity Manual

    OpenVM S Debugger Manual

    OpenVM S Programming Concepts Manual

    For additional information about OpenVM S products and services, access thefollowing 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:I nternet [email protected]

    Mail Compaq Computer CorporationOSSG Documentation Group, ZK O3-4/U08110 Spit Brook Rd.Nashua, NH 03062-2698

    xvi

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    17/543

    How to Order Additional Documentation

    Use the following World Wide Web address to order additional documentation:

    http://www.openvms.compaq.com/

    I f you need help deciding which documentati on best meets your needs, call800-282-6672.

    Conventions

    The following conventions are used i n this manual:

    Ctrl/x A sequence such as Ctrl/x indicates that you must hold downthe key labeled Ctrl while you press another key or a pointingdevice button.

    PF 1 x A sequence such as PF 1 x indicates that you must first pressand release the key labeled PF1 and then press and releaseanother key or a pointing device button.

    Return I n examples, a key name enclosed i n a box i ndicates thatyou press a key on the keyboard. (In text, a key name is notenclosed in a box.)

    I n the HTM L version of this document, this convention appearsas brackets, rather than a box.

    . . . A horizontal ellipsis in examples indicates one of the followingpossibilities:

    Additional optional arguments in a statement have beenomitted.

    The preceding item or items can be repeated one or moretimes.

    Additional parameters, values, or other information can beentered.

    .

    .

    .

    A vertical ellipsis indicates the omission of items from a codeexample or command format; the items are omitted becausethey are not important to the topic being discussed.

    ( ) In command format descriptions, parentheses indicate that youmust enclose choices i n parentheses i f you specify more thanone.

    [ ] In command format descriptions, brackets indicate optionalchoices. 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 i n the syntax for OpenVMSdirectory specifications and for a substring specification in anassignment statement.

    | In command format descriptions, vertical bars separatechoices

    within brackets or braces. Within brackets, the choices areoptional; within braces, at least one choice is required. Do nottype the vertical bars on the command line.

    {} In command format descriptions, braces indicate requiredchoices; you must choose at l east one of the items l isted. Donot type the braces on the command line.

    bold text This typeface represents the introduction of a new term. I talso represents the name of an argument, an attribute, or areason.

    xvii

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    18/543

    italic text I talic text indicates important information, complete titlesof manuals, or variables. Variables include information thatvaries in system output (I nternal error number), in commandlines (/PRODUCER=name), and in command parameters intext (where dd represents the predefined code for the devicetype).

    UP PE RCASE TE XT Uppercase text indicates a command, the name of a routine,the name of a file, or the abbreviation for a system privilege.

    Monospace text Monospace type indicates code examples and interactive screendisplays.

    I n the C programming language, monospace type in textidentifies the following elements: keywords, the namesof independently compiled external functions and files,syntax summaries, and references to variables or identifiersintroduced in an example.

    - A hyphen at the end of a command format description,command l ine, or code line indicates that the command orstatement continues on the following line.

    numbers All numbers in text are assumed to be decimal unless

    otherwise noted. Nondecimal radixesbinary, octal, orhexadecimalare explicitly indicated.

    xviii

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    19/543

    VAX MACRO Language

    Part I provides an overview of the features of the VAX MACRO language. I tincludes an introduction to the structure and components of VAX MACRO sourcestatements. Part I also contains a detailed discussion of the VAX MACROaddressing modes, general assembler directives, and macro directives.

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    20/543

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    21/543

    1Introduction

    VAX MACR O is an assembly language for programming VAX computers usingthe OpenVMS operating system. Source programs written in VAX MACRO aretranslated into object (or binary) code by the VAX MACRO assembler, whichproduces an object module and, optionally, a listing file. The features of thelanguage are introduced in this chapter.

    VAX MACRO source programs consist of a sequence of source statements. Thesesource 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, dataconversion, and transfer of control. I nstructions are usually followed in the sourcestatement by operands, which can be any kind of data needed for the operationof the instruction. The VAX instruction set i s summarized in Appendix D of thisvolume and is described i n detail in Chapter 9. Direct assignment statementsequate symbols to values. Assembler directives guide the assembly processand provide tools for using the instructions. There are two classes of assemblerdirectives: 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 theprogram 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 certainconditions

    Control the format and content of the listing file Display informational messages

    Control the assembler options that are used to interpret the source program

    Define new opcodes

    Macro directives are used to define macros and repeat blocks. They allow you toperform the following operations:

    Repeat identical or similar sequences of source statements throughout aprogram without rewriting those sequences

    Introduction 11

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    22/543

    Introduction

    Use string operators to manipulate and test the contents of source statements

    Use of macros and repeat blocks helps minimize programmer errors and speedsthe debugging process.

    12 Introduction

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    23/543

    2VAX MACRO Source Statement Format

    A source program consists of a sequence of source statements that the assemblerinterprets and processes, one at a time, generating object code or performing aspecific assembly-time process. A source statement can occupy one source line orcan extend onto several source lines. Each source line can be up to 132 characterslong; however, to ensure that the source line fits (with its binary expansion) onone line in the listing file, no line should exceed 80 characters.

    VAX MACR O statements can consist of up to four fields, as follows:

    L abel fieldsymbolically defines a location in a program. Operator fieldspecifies the action to be performed by the statement; can be

    an instruction, an assembler directive, or a macro call.

    Operand fieldcontains the instruction operands, the assembler directivearguments, or the macro arguments.

    Comment fieldcontains a comment that explains the meaning of thestatement; does not affect program execution.

    The label field and the comment field are optional. The label field ends with acolon ( :) and the comment field begins with a semicolon ( ; ). The operand fieldmust conform to the format of the instruction, directive, or macro specified in theoperator field.

    Although statement fields can be separated by either a space or a tab (seeTable 32), formatting statements with the tab character is recommended forconsistency and clari ty and is a Compaq convention.

    Field Begins in Column Tab Characters to Reach Column

    L abel 1 0

    Operator 9 1

    Operand 17 2

    Comment 41 5

    For example:

    .TITLE ROUT1

    .ENTRY START,^M ; Beginning of routineCLRL R0 ; Clear register

    LABT: SUBL3 #10,4(AP),R2 ; Subtract 10LAB2: BRB CONT ; Branch to another routine

    Continue a single statement on several lines by using a hyphen (- ) as the lastnonblank character before the comment field, or at the end of a line (when thereis no comment). For example:

    VAX MACRO Source Statement Format 21

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    24/543

    VAX MACRO Source Statement Format

    LAB1: MOVAL W^BOO$AL_VECTOR,- ; Save boot driverRPB$L_IOVEC(R7)

    VAX M ACRO treats the preceding statement as equivalent to the followingstatement:

    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 anduser-defined symbol names on two lines. I f a symbol name is continued andthe first character on the second line is a tab or a blank, the symbol name isterminated at that character. Section 3.3 descri bes symbols in detail.

    Note that when a statement occurs in a macro definition (see Chapter 4 andChapter 6), the statement cannot contain more than 1000 characters.

    Blank lines are legal, but they have no significance in the source program exceptthat they terminate a continued line.

    The following sections describe each of the statement fields in detail.

    2.1 Label FieldA label is a user-defined symbol that identifies a location in the program. Thesymbol is assigned a value equal to the location counter where the label occurs.

    The user-defined symbol name can be up to 31 characters long and can containany alphanumeric character and the underscore ( _ ), dollar sign ( $), and period(. ) characters. See Section 3.3.2 for a description of the rules for forminguser-defined symbol names in more detail.

    I f a statement contains a label, the label must be in the first field on the line.

    A label is terminated by a colon ( : ) or a double colon ( ::). A single colon indicatesthat the label is defined only for the current module (an internal symbol). Adouble colon indicates that the label is globally defined; that is, the label can bereferenced by other object modules.

    Once a label is defined, it cannot be redefined during the source program. I f alabel is defined more than once, VAX MACRO displays an err or message whenthe label is defined and again when it is referenced.

    I f a l abel extends past column 7, place it on a line by itself so that the followingoperator field can start in column 9 of the next line.

    The following example ill ustrates some of the ways you can define labels:

    EXP: .BLKL 50 ; Table stores expected valuesDATA:: .BLKW 25 ; Data table accessed by store

    ; routine in another moduleEVAL: CLRL R0 ; Routine evaluates expressionsERROR_IN_ARG: ; The arg-list contains an error

    INCL R0 ; increment error countTEST:: MOVO EXP,R1 ; This tests routine; referenced externally

    TEST1: BRW EXIT ; Go to exit routine

    The label field is also used for the symbol in a direct assignment statement (seeSection 3.8).

    22 VAX MACRO Source Statement Format

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    25/543

    VAX MACRO Source Statement Format2.2 Operator Field

    2.2 Operator Field

    The operator field specifies the action to be performed by the statement. Thisfield can contain an instruction, an assembler directive, or a macro call.

    When the operator is an instruction, VAX MACRO generates the binary code for

    that instruction in the object module. The binary codes are listed in Appendix D;the instruction set is described in Chapter 9. When the operator is a directive,VAX MACRO performs certain control actions or processing operati ons duri ngsource program assembly. The assembler directives are described in Chapter 6.When the operator is a macro call, VAX MACRO expands the macro. Macro callsare described i n Chapter 4 and i n Chapter 6 (.MACRO directive).

    Use either a space or a tab character to terminate the operator field; however, thetab is the recommended termination character.

    2.3 Operand Field

    The operand field can contain operands for instructions or arguments for eitherassembler directives or macro calls.

    Operands for instructions identify the memory locations or the registers thatare used by the machine operation. These operands specify the addressing modefor the instruction, as described in Chapter 5. The operand field for a specificinstruction must contain the number of operands required by that i nstruction.See Chapter 9 for descriptions of the instructions and their operands.

    Arguments for a directive must meet the format requirements of that directive.Chapter 6 describes the directives and the format of their arguments.

    Operands for a macro must meet the r equirements specified i n the macrodefinition. See the description of the .MACRO directive in Chapter 6.

    I f two or more operands are specified, they must be separated by commas ( , ).VAX M ACRO also allows a space or tab to be used as a separator for arguments toany directive that does not accept expressions (see Section 3.5 for a discussion ofexpressions). However, a comma is required to separate operands for instructionsand for directives that accept expressions as arguments.

    The semicolon that starts the comment field terminates the operand field. I f aline does not have a comment field, the operand field i s terminated by the end ofthe line.

    2.4 Comment Field

    The comment field contains text that explains the function of the statement.Every line of code should have a comment. Comments do not affect assemblyprocessing or program execution. You can cause user-written messages to be

    displayed during assembly by the .ERROR, .PRI NT, and .WARN directives (seedescriptions in Chapter 6).

    The comment field must be preceded by a semicolon; it is terminated by the endof the line. The comment field can contain any printable ASCI I character (seeAppendix A).

    To continue a lengthy comment to the next line, write the comment on the nextline and precede it with another semicolon. I f a comment does not fit on oneline, it can be continued on the next, but the continuation must be preceded byanother semicolon. A comment can appear on a line by itself.

    VAX MACRO Source Statement Format 23

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    26/543

    VAX MACRO Source Statement Format2.4 Comment Field

    Write the text of a comment to convey the meaning rather than the action of thestatement. The instruction MOVAL BU F _PTR_1,R7, for example, should have acomment such as Get pointer to first buffer, not Move address of BUF_PTR_1to R7.

    For example:

    MOVAL STRING_DES_1,R0 ; Get address of string; descriptor

    MOVZWL (R0),R1 ; Get length of stringMOVL 4(R0),R0 ; Get address of string

    24 VAX MACRO Source Statement Format

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    27/543

    3Components of MACRO Source Statements

    This chapter describes the following components of VAX MACRO sourcestatements:

    Character set

    Numbers

    Symbols

    L ocal labels

    Terms and expressions

    Unary and binary operators

    Direct assignment statements

    Curr ent location counter

    3.1 Character Set

    The following characters can be used i n VAX MACRO source statements:

    The letters of the alphabet, A to Z, uppercase and lowercase. Note that theassembler considers lowercase letters equivalent to uppercase letters except

    when they appear in ASCII strings. The digits 0 to 9.

    The special characters listed in Table 31.

    Table 31 Special Characters Used in VAX MACRO Statements

    Character Character Name Function

    _ Underscore Character in symbol names

    $ Dollar sign Character in symbol names

    . P eriod Character in symbol names, current locationcounter, and decimal point

    : Colon L abel terminator= E qual sign Direct assignment operator and macro

    keyword argument terminator

    Tab Fi eld terminator

    Space Field terminator

    # N umber sign I mmediate addressing mode i ndicator

    (continued on next page)

    Components of MACRO Source Statements 31

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    28/543

    Components of MACRO Source Statements3.1 Character Set

    Table 31 (Cont.) Special Characters Used in VAX MACRO Statements

    Character Character Name Function

    @ At sign Deferred addressing mode indicator andarithmetic shift operator

    , Comma Field, operand, and item separator

    ; Semicolon Comment field indicator

    + P lus sign Autoincrement addressing mode indicator,unary plus operator, and arithmetic additionoperator

    - Minus sign orhyphen

    Autodecrement addressing mode indicator,unary minus operator, arithmetic subtractionoperator, and line continuation indicator

    * Asterisk Arithmetic multiplication operator

    / Slash Arithmetic division operator

    & Ampersand L ogical AND operator

    ! Exclamation point Logical inclusive OR operator point

    \ Backslash L ogical exclusive OR and numeric conversionindicator in macro arguments

    ^ Circumflex U nary operators and macro argumentdelimiter

    [ ] Squarebrackets Index addressing mode and repeat countindicators

    ( ) Parentheses Register deferred addressing mode indicators

    Angle brackets Argument or expression grouping delimiters

    ? Questi on mark Created l ocal l abel indi cator i n macroarguments

    Apostrophe M acro argument concatenation indicator

    % Percent sign Macro string operators

    Table 32 defines the separating characters used i n VAX MA CRO.

    Table 32 Separating Characters in VAX MACRO Statements

    Character Character Name Usage

    (space)(tab)

    Space or tab Separator between statement fields. Spaceswithi n expressions are ignored.

    , Comma Separator between symbolic arguments withinthe operand field. Mul tiple expressions in theoperand field must be separated by commas.

    3.2 Numbers

    Numbers can be integers, floating-point numbers, or packed decimal strings.

    32 Components of MACRO Source Statements

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    29/543

    Components of MACRO Source Statements3.2 Numbers

    3.2.1 Integers

    I ntegers can be used in any expression including expressions in operands and i ndirect assignment statements (Section 3.5 describes expressions).

    Format

    snn

    sAn optional sign: plus sign ( +) for positive numbers (the default) or minus sign( - ) for negative numbers.

    nnA string of numeric characters that is legal for the current radix.

    VAX MACRO interprets all integers in the source program as decimal unless thenumber is preceded by a radix control operator (see Section 3.6.1).

    I ntegers must be in the range of -2,147,483,648 to +2,147,483,647 for signed dataor in the range of 0 to 4,294,967,295 for unsigned data.

    Negative numbers must be preceded by a minus sign; VAX MACR O translatessuch numbers into twos complement form. I n positive numbers, the plus sign i soptional.

    3.2.2 Floating-Point Numbers

    A floating-point number can be used in the .F_F L OATI NG(.FLOAT),.D_FLOATING (.DOUBLE), .G_FLOATING, and .H_FLOATINGdirectives (descri bed in Chapter 6) or as an operand in a floating-pointinstruction. A floating-point number cannot be used in an expression or witha unary or binary operator except the unary plus, unary minus, and unaryfloating-point operator, F (F_F L OATI NG). Section 3.6 and Section 3.7 descri beunary and binary operators.

    A floating-point number can be specified with or without an exponent.

    Formats

    Floating-point number without exponent:

    snnsnn.nnsnn.

    Floating-point number with exponent:

    snnEsnnsnn.nnEsnnsnn.Esnn

    sAn optional sign.

    nnA string of decimal digits in the range of 0 to 9.

    The decimal point can appear anywhere to the right of the first digit. Note thata floating-point number cannot start with a decimal point because VAX MACROwill treat the number as a user-defined symbol (see Section 3.3.2).

    Components of MACRO Source Statements 33

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    30/543

    Components of MACRO Source Statements3.2 Numbers

    Floating-point numbers can be single-precision (32-bit), double-precision (64-bit),or extended-precision (128-bit) quantities. The degree of precision is 7 digits forsingle-precision numbers, 16 digits for double-precision numbers, and 33 digitsfor extended-precision numbers.

    The magnitude of a nonzero floating-point number cannot be smaller than

    approximately 0.29E-38 or greater than approximately 1.7E38.

    Single-precision floating-point numbers can be rounded (by default) or truncated.The .EN ABL E and .DI SABL E directives (described i n Chapter 6) control whethersingle-precision floating-point numbers are rounded or truncated. Double-precision and extended-precision floating-point numbers are always rounded.

    Section 8.3.6, Section 8.3.7, Section 8.3.8, and Section 8.3.9 descri be the internalformat of floating-point numbers.

    3.2.3 Packed Decimal Strings

    A packed decimal string can be used only in the .PACK ED directive (described inChapter 6).

    Formatsnn

    sAn optional sign.

    nnA string containing up to 31 decimal digits in the range of 0 to 9.

    A packed decimal string cannot have a decimal point or an exponent.

    Section 8.3.14 descri bes the internal format of packed decimal strings.

    3.3 Symbols

    Three types of symbols can be used i n VAX MA CRO source programs: permanentsymbols, user-defined symbols, and macro names.

    3.3.1 Permanent Symbols

    Permanent symbols consist of instruction mnemonics (see Appendix D), VAXMACRO directives (see Chapter 6), and register names. You need not defineinstruction mnemonics and directives before you use them in the operator field ofa VAX MACRO source statement. Also, you need not define register names beforeusing them in the addressing modes (see Chapter 5).

    Register names cannot be redefined; that is, a symbol that you define cannot beone of the register names contained in the following list. You can express the 16general registers of the VAX processor in a source program only as follows:

    RegisterName Processor Register

    R0 General register 0

    R1 General register 1

    R2 General register 2

    . .

    34 Components of MACRO Source Statements

  • 7/30/2019 VAX MACRO and Instruction Set Reference Manual

    31/543

    Components of MACRO Source Statements3.3 Symbols

    RegisterName Processor Register

    . .

    . .

    R11 General register 11R12 orAP

    General register 12 or argument pointer. I f you use R12 as an argumentpointer, the name AP is recommended; if you use R12 as a generalregister, the name R12 is recommended.

    FP Frame pointer

    SP Stack pointer

    PC Program counter

    Note that the symbols I V and DV are also permanent symbols and cannotbe redefined. These symbols are used in the register mask to set the integeroverflow trap (IV) and the decimal string overflow trap (DV). See Section 3.6.2.2for an explanation of their uses.

    3.3.2 User-Defined Symbols and Macro Names

    You can use symbols that you define as labels or you can equate them to a specificvalue by a direct assignment statement (see Section 3.8). These symbols can alsobe used in any expression (see Section 3.5).

    The following rules govern the creation of user-defined symbols:

    User-defined symbols can be composed of alphanumeri c characters,underscores (_ ), dollar signs ( $), and periods (. ). Any other characterterminates the symbol.

    The first character of a symbol must not be a number.

    The symbol must be no more than 31 characters long and must be unique.

    I n addition, by Compaq convention:

    The dollar sign ( $) is reserved for names defined by Compaq. This conventi