date and time created 88/07/22 16:08:01 by bostic
[unix-history] / usr / src / old / as.vax / instrs
index 0e46adf..414f842 100644 (file)
@@ -1,6 +1,9 @@
 ##
 ##
-##     Copyright (c) 1982 Regents of the University of California
-##     @(#)instrs 4.8 %G%
+## Copyright (c) 1982 Regents of the University of California.
+## All rights reserved.  The Berkeley software License Agreement
+## specifies the terms and conditions for redistribution.
+##
+##     @(#)instrs      5.1 (Berkeley) %G%
 ##
 ##     Robert R. Henry
 ##     University of California, Berkeley
 ##
 ##     Robert R. Henry
 ##     University of California, Berkeley
 
 BEGIN{
        flavor = AS;
 
 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){
 }
 {
        if (NF == 0){
@@ -137,7 +147,8 @@ BEGIN{
                if (flavor == "AS"){
                        if ($4 == "CBR")
                                $4 = "IJXXX";
                if (flavor == "AS"){
                        if ($4 == "CBR")
                                $4 = "IJXXX";
-                       printf("PSEUDO(\"%s\", %s, %s),\n", $3, $7, $4);
+                       printf("PSEUDO(\"%s\\0%o\\0%s\",", ASpad,length($3),$3);
+                       printf("%s, %s),\n", $7, $4);
                        next;
                }
                if (flavor == "C2"){
                        next;
                }
                if (flavor == "C2"){
@@ -182,8 +193,13 @@ BEGIN{
                printf("T(%s,%s),\n", $4, $5);  # special value
                next;
        }
                printf("T(%s,%s),\n", $4, $5);  # special value
                next;
        }
-       if (flavor == "AS" || flavor == "ADB"){
+       if (flavor == "AS"){
+               printf("OP(\"%s\\0%o\\0%s\", ", ASpad, length($3), $3);
+               printf("%s, %s, %d", $6, $7, $8);
+       } else {
                printf("OP(\"%s\", %s, %s, %d", $3, $6, $7, $8);
                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 = 9; i+1 <= NF; i = i + 2){
                        printf(", A_%s%s", $i, $(i+1));
                }