📄 instrs
字号:
#### Copyright (c) 1982 Regents of the University of California## @(#)instrs 4.9 6/30/83#### Robert R. Henry## University of California, Berkeley## Berkeley, CA## February 6, 1982#### Updated 20 Nov 89 to include vector support.#### Updated 19 May 83 to include the page number in the## architecture reference manual (1981 edition) the instruction## is documented on, and to enumerate the instructions in the same## order as the reference manual does.#### Updated 08-May-86 to provide C2 with .stab directive info (vjh).#### THIS FILE IS BOTH AN AWK SCRIPT AND THE DATA#### Instruction definitions for the VAX#### This file is processed by an awk script, viz:## (echo "FLAVOR AS"; cat instrs) | awk -f instrs > as.instrs## (echo "FLAVOR ADB"; cat instrs) | awk -f instrs > as.instrs## (echo "FLAVOR SDB"; cat instrs) | awk -f instrs > as.instrs## (echo "FLAVOR C2"; cat instrs) | awk -f instrs > c2.instrs#### The data in this file is shared between:## as assembler## c2 optimizer## adb debugger## sdb symbolic debugger#### The awk script reads itself, and produces macros understood## by the appropriate consumer. The awk script determines how## to interpret the file by looking for a line of the form:## FLAVOR AS## FLAVOR ADB (same as AS, but without pseudo instructions)## FLAVOR SDB (same as ADB)## FLAVOR C2 (radically different format for instructions)## and proceeding accordingly. This line should be prepended to## the front of this file.#### Lines starting with # are always comments to awk## Lines starting with ## are always comments## Lines starting with a single # are data lines, to be output.#### Empty lines are passed through#### field user(s) what#### $2 awk #: comment to awk#### $3 as, c2, adb instruction name#### $4 c2 instruction class## $5 c2 instruction sub class## HARD, TN1, TN2, TN3, TNX2, OP#### $6 as, adb escape opcode byte (NONE, NEW, ESCD, ESCF)## $7 as, adb primary opcode byte## ## $8 as, adb number of arguments## $9 as, adb 1st operand: access A,V,R,W,M,I,B## $10 as, adb 1st operand: type, BWLQOFDGH#### $11 as, adb 2nd operand: access## ...###### These are the definitions used in this file:## instruction class (c2)## understood only by c2. If it is HARD, the second field## is ignored.## instruction subclass: (c2)## HARD paired with the class## S single valued attribute to C2## TN1 class + type of 1st operand## TN2 class + type of 2nd operand## TN3 class + type of 3rd operand## TNX2 class + type of 1st and 2nd operand## OP class + type of 1st operand and # of args## default class + subclass#### escape byte:## CORE 1 byte opcodes in all VAXen## NEW 1 byte opcodes only in newer VAXen## ESCD 2 byte opcodes, escape byte of 0xFD, newer VAXen## ESCF 2 byte opcodes, escape byte of 0xFF, newer VAXen## code byte## number of arguments## Access type## A for address, only in memory## V for address [sic], either in memory or register## W for writing## R for reading## M for modifying## B for branch displacement## I for xfc code## Data types## B byte## W word## L long## Q quad## O octa## F f_float## D d_float## G g_float## H h_float#### The order of instructions in this table is not critical;## the clients take care of their own table construction and ordering.## The instructions are grouped (more or less) into functional groups.#### The following is the awk program to interpret this table.BEGIN{ flavor = AS; ## ## magic padding before the string for AS ## 4 bytes of 0's: seek position of the string ## 2 bytes, value 2, indicating core resident ## 2 bytes, value 0, length ## ASpad = "\\0\\0\\0\\0" "\\2\\0";}{ if (NF == 0){ printf("\n"); next; } if ($1 == "FLAVOR"){ flavor = $2; if (flavor == "SDB"){ flavor = "ADB"; } next; } if ($1 != "#"){ next; } if ($6 == "MACR"){ if (flavor == "ADB"){ next; } if (flavor == "AS"){ if ($4 == "CBR") $4 = "IJXXX"; printf("PSEUDO(\"%s\\0%o\\0%s\",", ASpad,length($3),$3); printf("%s, %s),\n", $7, $4); next; } if (flavor == "C2"){ if ($5 == "C2X") next; printf("\"%s\",", $3); if ($4 == "CBR" && $5 != "JBR"){ printf("T(CBR,%s),\n", $5); } else { printf("%s,\n",$5); } next; } } if (flavor == "C2"){ if (($6 == "VINSTn") || ($6 == "VINST0")) next; printf("\"%s\",", $3); if ($4 == "HARD"){ # 0 value printf("0,\n"); next; } if ($5 == "S"){ # single value printf("%s,\n", $4); next; } if ($5 == "TN1"){ # use type of 1st operand printf("T(%s,TYP%s),\n", $4, $10); next; } if ($5 == "TN3"){ # use type of 3rd operand printf("T(%s,TYP%s),\n", $4, $14); next; } if ($5 == "TNX2"){ # cross product of 1st and 2nd operand printf("T(%s,U(TYP%s,TYP%s)),\n", $4, $10, $12); next; } if ($5 == "OP"){ # arithmetic operator printf("T(%s,U(TYP%s,OP%d)),\n", $4, $10, $8); next; } printf("T(%s,%s),\n", $4, $5); # special value next; } if (flavor == "AS"){ if (($6 == "VINSTn") || ($6 == "VINST0")){ printf("VOP(\"%s\\0%o\\0%s\", ", ASpad, length($3), $3); printf("%s, %s, %s, %s, %s, %d", $6, "ESCD", $7, $4, $5, $8); } else { printf("OP(\"%s\\0%o\\0%s\", ", ASpad, length($3), $3); printf("%s, %s, %d", $6, $7, $8); } } else { if (flavor == "ADB") { if (($6 == "VINSTn") || ($6 == "VINST0")){ printf("OP(\"%s\", %s, %s, %s, %d", $3, "ESCD", $7, $4, $8); } else printf("OP(\"%s\", %s, %s, 0, %d", $3, $6, $7, $8); } else printf("OP(\"%s\", %s, %s, %d", $3, $6, $7, $8); } if (flavor == "AS" || flavor == "ADB"){ for (i = 9; i+1 <= NF; i = i + 2){ printf(", A_%s%s", $i, $(i+1)); } for (i = $8; i < 6; i++){ printf(",0"); } printf("),\n"); }}####-------------------------------------------------------##1 2 3 4 5 6 7 8 9###### PSEUDO (MACR) operators come first## Data initializers# 000a .byte IBYTE C2X MACR 0 VAR# 000b .word IWORD WGEN MACR 0 VAR# 000c .int IINT LGEN MACR 0 VAR# 000d .long ILONG LGEN MACR 0 VAR# 000a .quad IQUAD C2X MACR 0 VAR# 000a .octa IOCTA C2X MACR 0 VAR# 000a .float IFFLOAT C2X MACR 0 VAR# 000a .double IDFLOAT C2X MACR 0 VAR# 000a .ffloat IFFLOAT C2X MACR 0 VAR# 000a .dfloat IDFLOAT C2X MACR 0 VAR# 000a .gfloat IGFLOAT C2X MACR 0 VAR# 000a .hfloat IHFLOAT C2X MACR 0 VAR# 000a .space ISPACE C2X MACR 0 1# 000a .fill IFILL C2X MACR 0 2# 000a .ascii IASCII C2X MACR 0 VAR# 000a .asciz IASCIZ C2X MACR 0 VAR# 000a .data IDATA DATA MACR 0 1# 000a .text ITEXT TEXT MACR 0 1# 000a .align IALIGN ALIGN MACR 0 1 # 000a .line ILINENO C2X MACR 0 1# 000a .file IFILE C2X MACR 0 1# 000a .globl IGLOBAL EROU MACR 0 1# 000a .comm ICOMM COMM MACR 0 2# 000a .lcomm ILCOMM LCOMM MACR 0 2# 000a .set ISET SET MACR 0 2# 000a .lsym ILSYM C2X MACR 0 2# 000a .org IORG C2X MACR 0 1# 000a .stab ISTAB STAB MACR 0 6# 000a .stabd ISTABDOT STAB MACR 0 3# 000a .stabn ISTABNONE STAB MACR 0 3# 000a .stabs ISTABSTR STAB MACR 0 3# 000a .ABORT IABORT C2X MACR 0 0## Pseudo jumps# 000a jbc CBR JBC MACR 0xe1 1 B B# 000a jlbc CBR JLBC MACR 0xe9 1 B B# 000a jbs CBR JBS MACR 0xe0 1 B B# 000a jlbs CBR JLBS MACR 0xe8 1 B B# 000a jbcc CBR JBCC MACR 0xe5 1 B B# 000a jbsc CBR JBSC MACR 0xe4 1 B B# 000a jbcs CBR JBCS MACR 0xe3 1 B B# 000a jbss CBR JBSS MACR 0xe2 1 B B# 000a jbr CBR JBR MACR 0x11 1 B B# 000a jcc CBR C2X MACR 0x1e 1 B B# 000a jcs CBR C2X MACR 0x1f 1 B B# 000a jvc CBR C2X MACR 0x1c 1 B B# 000a jvs CBR C2X MACR 0x1d 1 B B# 000a jlss CBR JLT MACR 0x19 1 B B# 000a jlssu CBR JLO MACR 0x1f 1 B B# 000a jleq CBR JLE MACR 0x15 1 B B# 000a jlequ CBR JLOS MACR 0x1b 1 B B# 000a jeql CBR JEQ MACR 0x13 1 B B# 000a jeqlu CBR JEQ MACR 0x13 1 B B# 000a jneq CBR JNE MACR 0x12 1 B B# 000a jnequ CBR JNE MACR 0x12 1 B B# 000a jgeq CBR JGE MACR 0x18 1 B B# 000a jgequ CBR JHIS MACR 0x1e 1 B B# 000a jgtr CBR JGT MACR 0x14 1 B B# 000a jgtru CBR JHI MACR 0x1a 1 B B#### Registers### 000a r0 REG C2X MACR 0 0# 000a r1 REG C2X MACR 1 0# 000a r2 REG C2X MACR 2 0# 000a r3 REG C2X MACR 3 0# 000a r4 REG C2X MACR 4 0# 000a r5 REG C2X MACR 5 0# 000a r6 REG C2X MACR 6 0# 000a r7 REG C2X MACR 7 0# 000a r8 REG C2X MACR 8 0# 000a r9 REG C2X MACR 9 0# 000a r10 REG C2X MACR 10 0# 000a r11 REG C2X MACR 11 0# 000a r12 REG C2X MACR 12 0# 000a r13 REG C2X MACR 13 0# 000a r14 REG C2X MACR 14 0# 000a r15 REG C2X MACR 15 0# 000a ap REG C2X MACR 12 0# 000a fp REG C2X MACR 13 0# 000a sp REG C2X MACR 14 0# 000a pc REG C2X MACR 15 0#### Vector Registers### 000a v0 VREG C2X MACR 0 0# 000a v1 VREG C2X MACR 1 0# 000a v2 VREG C2X MACR 2 0# 000a v3 VREG C2X MACR 3 0# 000a v4 VREG C2X MACR 4 0# 000a v5 VREG C2X MACR 5 0# 000a v6 VREG C2X MACR 6 0# 000a v7 VREG C2X MACR 7 0# 000a v8 VREG C2X MACR 8 0# 000a v9 VREG C2X MACR 9 0# 000a v10 VREG C2X MACR 10 0# 000a v11 VREG C2X MACR 11 0# 000a v12 VREG C2X MACR 12 0# 000a v13 VREG C2X MACR 13 0# 000a v14 VREG C2X MACR 14 0# 000a v15 VREG C2X MACR 15 0## Normal instructions# 158a chmk HARD HARD CORE 0xbc 1 R W # 158b chme HARD HARD CORE 0xbd 1 R W # 158c chms HARD HARD CORE 0xbe 1 R W # 158d chmu HARD HARD CORE 0xbf 1 R W # 160a prober PROBER TN1 CORE 0x0c 3 R B R W A B # 160a probew PROBEW TN1 CORE 0x0d 3 R B R W A B # 161a rei HARD HARD CORE 0x02 0 # 163a ldpctx HARD HARD CORE 0x06 0 # 163b svpctx HARD HARD CORE 0x07 0 # 165a mtpr MTPR TN1 CORE 0xda 2 R L R L # 165b mfpr MFPR TN1 CORE 0xdb 2 R L W L # 168a xfc HARD HARD CORE 0xfc 0 # 169a bpt HARD HARD CORE 0x03 0 # 170a bugw HARD HARD ESCF 0xfe 1 R W # 170b bugl HARD HARD ESCF 0xfd 1 R L # 171a halt HARD HARD CORE 0x00 0 # 179a movb MOV TN1 CORE 0x90 2 R B W B # 179b movw MOV TN1 CORE 0xb0 2 R W W W # 179c movl MOV TN1 CORE 0xd0 2 R L W L # 179d movq MOV TN1 CORE 0x7d 2 R Q W Q # 179e movo MOV TN1 ESCD 0x7d 2 R O W O # 179f movf MOV TN1 CORE 0x50 2 R F W F # 179g movd MOV TN1 CORE 0x70 2 R D W D # 179h movg MOV TN1 ESCD 0x50 2 R G W G # 179i movh MOV TN1 ESCD 0x70 2 R H W H # 180a pushl PUSH TN1 CORE 0xdd 1 R L # 181a clrb CLR TN1 CORE 0x94 1 W B # 181b clrw CLR TN1 CORE 0xb4 1 W W # 181c clrf CLR TN1 CORE 0xd4 1 W F # 181c clrl CLR TN1 CORE 0xd4 1 W L # 181d clrd CLR TN1 CORE 0x7c 1 W D # 181d clrg CLR TN1 CORE 0x7c 1 W G # 181d clrq CLR TN1 CORE 0x7c 1 W Q # 181e clrh CLR TN1 ESCD 0x7c 1 W H # 181e clro CLR TN1 ESCD 0x7c 1 W O # 182a mnegb NEG TN1 CORE 0x8e 2 R B W B # 182b mnegw NEG TN1 CORE 0xae 2 R W W W # 182c mnegl NEG TN1 CORE 0xce 2 R L W L # 182d mnegf NEG TN1 CORE 0x52 2 R F W F # 182e mnegg NEG TN1 ESCD 0x52 2 R G W G # 182f mnegd NEG TN1 CORE 0x72 2 R D W D # 182g mnegh NEG TN1 ESCD 0x72 2 R H W H # 183a mcomb COM TN1 CORE 0x92 2 R B W B # 183b mcomw COM TN1 CORE 0xb2 2 R W W W # 183c mcoml COM TN1 CORE 0xd2 2 R L W L # 184A cvtbw CVT TNX2 CORE 0x99 2 R B W W # 184B cvtbl CVT TNX2 CORE 0x98 2 R B W L # 184C cvtwb CVT TNX2 CORE 0x33 2 R W W B # 184D cvtwl CVT TNX2 CORE 0x32 2 R W W L # 184E cvtlb CVT TNX2 CORE 0xf6 2 R L W B # 184F cvtlw CVT TNX2 CORE 0xf7 2 R L W W # 184G cvtbf CVT TNX2 CORE 0x4c 2 R B W F # 184H cvtbd CVT TNX2 CORE 0x6c 2 R B W D # 184I cvtbg CVT TNX2 ESCD 0x4c 2 R B W G # 184J cvtbh CVT TNX2 ESCD 0x6c 2 R B W H # 184K cvtwf CVT TNX2 CORE 0x4d 2 R W W F # 184L cvtwd CVT TNX2 CORE 0x6d 2 R W W D # 184M cvtwg CVT TNX2 ESCD 0x4d 2 R W W G # 184N cvtwh CVT TNX2 ESCD 0x6d 2 R W W H # 184O cvtlf CVT TNX2 CORE 0x4e 2 R L W F # 184P cvtld CVT TNX2 CORE 0x6e 2 R L W D # 184Q cvtlg CVT TNX2 ESCD 0x4e 2 R L W G # 184R cvtlh CVT TNX2 ESCD 0x6e 2 R L W H # 184S cvtfb CVT TNX2 CORE 0x48 2 R F W B # 184T cvtdb CVT TNX2 CORE 0x68 2 R D W B # 184U cvtgb CVT TNX2 ESCD 0x48 2 R G W B # 184V cvthb CVT TNX2 ESCD 0x68 2 R H W B # 184W cvtfw CVT TNX2 CORE 0x49 2 R F W W # 184X cvtdw CVT TNX2 CORE 0x69 2 R D W W # 184Y cvtgw CVT TNX2 ESCD 0x49 2 R G W W # 184Z cvthw CVT TNX2 ESCD 0x69 2 R H W W # 184a cvtfl CVT TNX2 CORE 0x4a 2 R F W L # 184b cvtrfl CVT TNX2 CORE 0x4b 2 R F W L # 184c cvtdl CVT TNX2 CORE 0x6a 2 R D W L # 184d cvtrdl CVT TNX2 CORE 0x6b 2 R D W L # 184e cvtgl CVT TNX2 ESCD 0x4a 2 R G W L # 184f cvtrgl CVT TNX2 ESCD 0x4b 2 R G W L # 184g cvthl CVT TNX2 ESCD 0x6a 2 R H W L # 184h cvtrhl CVT TNX2 ESCD 0x6b 2 R H W L # 184i cvtfd CVT TNX2 CORE 0x56 2 R F W D # 184j cvtfg CVT TNX2 ESCD 0x99 2 R F W G # 184k cvtfh CVT TNX2 ESCD 0x98 2 R F W H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -