Search code examples
assemblyx86intelx86-16machine-code

Where do assembly instruction "Intel group" categories originate?


During development of my fork of an 86-DOS application, lDebug, I came across categories of instructions referred to as "Intel groups". Specifically, group means something related to a set of instructions using the same 1 or 2 opcode bytes, differentiated by the /r field of the ModR/M byte.

The "Intel group" categories go all the way back to FreeDOS Debug 0.95 released in 1997, and can be seen in that revision of my fddebug repo:

/*
 *  Here are the tables for the main processor groups.
 */

struct {
    int seq;    /* sequence number of the group */
    int info;   /* which group number it is */
}
    grouptab[]  = {
        {0x80, GROUP(1)},   /* Intel group 1 */
        {0x81, GROUP(1)},
        {0x83, GROUP(2)},
        {0xd0, GROUP(3)},   /* Intel group 2 */
        {0xd1, GROUP(3)},
        {0xd2, GROUP(4)},
        {0xd3, GROUP(4)},
        {0xc0, GROUP(5)},   /* Intel group 2a */
        {0xc1, GROUP(5)},
        {0xf6, GROUP(6)},   /* Intel group 3 */
        {0xf7, GROUP(6)},
        {0xff, GROUP(7)},   /* Intel group 5 */
        {SPARSE_BASE + 0x00, GROUP(8)},     /* Intel group 6 */
        {SPARSE_BASE + 0x01, GROUP(9)}};    /* Intel group 7 */

/* #define  NGROUPS 9 (this was done above) */

struct {    /* sparse groups */
    int seq;    /* sequence number of the group */
    int info;   /* which group number it is */
}
    sp_grouptab[]   = {
        {0xfe, SGROUP(1)},      /* Intel group 4 */
        {SPARSE_BASE+0xba, SGROUP(2)},  /* Intel group 8 */
        {SPARSE_BASE+0xc7, SGROUP(3)},  /* Intel group 9 */
        {0x8f, SGROUP(4)},      /* Not an Intel group */
        {0xc6, SGROUP(5)},      /* Not an Intel group */
        {0xc7, SGROUP(5)}};

/* #define  NSGROUPS    5 (this was done above) */

I cannot find anything about the "Intel group" categorisation. An exact web search like "intel group 2a" only turns up a repo of the same application. Broader searches don't turn up anything matching the use in these comments.

At no time have I found any "group" categories in the Intel manuals I have read, either. For example, this 486 manual doesn't seem to list groups in its instruction set reference.


Solution

  • My 1980 copy of the "8086/8087/8088 MACRO ASSEMBLY LANGUAGE REFERENCE MANUAL for 8086-Based Development Systems" already introduced the 'group' concept albeit still somewhat incomplete.

    Opcodes 80h-83h and D0h-D3h could be linked to the named groups "immed" and "Shift" because the instructions that belong to the group have a clear common characteristic.
    Not so for the opcodes F6h-F7h and FEh-FFh, so they chose a more universal approach and gave these groups the generic name "Grp " suffixed by a number.

    Some 6 years later, the 386 manual took another shot at naming these existing groups and decided to rename the old "Grp 1" as "Unary Grp3", and the old "Grp 2" as "Indirct Grp5". Several new groups were added and once again the heterogeneous nature of these groups made the engineers fall back on generic naming.

    8086

    opcode group 000 001 010 011 100 101 110 111
    80h-83h immed ADD OR ADC SBB AND SUB XOR CMP
    D0h-D3h Shift ROL ROR RCL RCR SHL SAL SHR - SAR
    F6h-F7h Grp 1 TEST - NOT NEG MUL IMUL DIV IDIV
    FEh-FFh Grp 2 INC DEC CALL CALL JMP JMP PUSH -

    80386

    opcode group 000 001 010 011 100 101 110 111
    80h-83h Immediate Grpl ADD OR ADC SBB AND SUB XOR CMP
    C0h-C1h, D0h-D3h Shift Grp2 ROL ROR RCL RCR SHL SHR SAR
    F6h-F7h Unary Grp3 TEST NOT NEG MUL IMUL DIV IDIV
    FEh INC/DEC Grp4 INC DEC
    FFh Indirct Grp5 INC DEC CALL CALL JMP JMP PUSH
    0Fh,00h Grp6 SLDT STR LLDT LTR VERR VERW
    0Fh,01h Grp7 SGDT SIDT LGDT LIDT SMSW LMSW
    0Fh,BAh Grp-8 BT BTS BTR BTC