Help reviewing processor features

lars brinkhoff lars at nocrew.org
Wed Jun 14 19:32:07 AEST 2000


The following is source code taken verbatim from my PDP-11 support code
for the GNU assembler.  Any help correcting errors would be appreciated.

This code tells the assembler what instruction set features to recognize
depending on what processor the user wants to assemble for.  Individual
features can also be enabled, e.g. if a processor option is installed.

The instruction set features are:
        cis             Commersial instruction set (optional on all
                        processors?).
        csm             CSM instruction.
        eis             Extended instruction set: MUL, DIV, ASH, ASHC, and
                        all of limited-eis.
        fis             KEV11 floating-point instructions.
        fpp             FP-11 floating-point instructions.
        limited-eis     Limited extended instruction set: RTT, MARK, SXT,
                        XOR, SOB.
        mfpt            MFPT instruction.
        multiproc       Multiprocessor instructions: TSTSET, WRTLCK.
        mxps            MFPS and MTPS instructions.
        spl             SPLx instructions.
        ucode           Microcode instructions: LDUB, MED, XFC.

  if (strncmp (buf, "a", 1) == 0)               /* KA11 (11/15/20) */
    return 1; /* no extensions */

  else if (strncmp (buf, "b", 1) == 0)          /* KB11 (11/45/50/55/70) */
    return set_option ("eis") &&
           set_option ("spl");

  else if (strncmp (buf, "da", 2) == 0)         /* KD11-A (11/35/40) */
    return set_option ("limited-eis");

  else if (strncmp (buf, "db", 2) == 0 ||       /* KD11-B (11/05/10) */
           strncmp (buf, "dd", 2) == 0)         /* KD11-D (11/04) */
    return 1; /* no extensions */

  else if (strncmp (buf, "de", 2) == 0)         /* KD11-E (11/34) */
    return set_option ("eis") &&
           set_option ("mxps");

  else if (strncmp (buf, "df", 2) == 0 ||       /* KD11-F (11/03) */
           strncmp (buf, "dh", 2) == 0 ||       /* KD11-H (11/03) */
           strncmp (buf, "dq", 2) == 0)         /* KD11-Q (11/03) */
    return set_option ("limited-eis") &&
           set_option ("mxps");

  else if (strncmp (buf, "dk", 2) == 0)         /* KD11-K (11/60) */
    return set_option ("eis") &&
           set_option ("mxps") &&
           set_option ("ucode");

  else if (strncmp (buf, "dz", 2) == 0)         /* KD11-Z (11/44) */
    return set_option ("csm") &&
           set_option ("eis") &&
           set_option ("mfpt") &&
           set_option ("mxps") &&
           set_option ("spl");

  else if (strncmp (buf, "f", 1) == 0)          /* F11 (11/24) */
    return set_option ("eis") &&
           set_option ("mfpt") &&
           set_option ("mxps");

  else if (strncmp (buf, "j", 1) == 0)          /* J11 (11/53/73/83/84/93/94)*/
    return set_option ("csm") &&
           set_option ("eis") &&
           set_option ("mfpt") &&
           set_option ("multiproc") &&
           set_option ("mxps") &&
           set_option ("spl");

  else if (strncmp (buf, "t", 1) == 0)          /* T11 (11/21) */
    return set_option ("limited-eis") &&
           set_option ("mxps");



More information about the TUHS mailing list