diff --git a/source/MKTABLES.C b/source/MKTABLES.C
--- a/source/MKTABLES.C
+++ b/source/MKTABLES.C
@@ -85,6 +85,7 @@
 struct keytab *keyord1[MAX_N_ORDS];
 struct keytab *keyord2[MAX_N_ORDS];
 Boolean ordsmall[MAX_OL_TYPES];
+Boolean debug_print;
 
 /*
  * Equates for the assembler table.
@@ -287,11 +288,12 @@
 		linenofail("Assembler table overflow.");
 	if (byte > 0xFF)
 		linenofail("Internal error: Assembler table value overflows byte.");
+if (debug_print) { printf("10 byte=%02Xh=%u @ pos=%04X\n",byte,byte, n_asm_tab); };
 	asmtab[n_asm_tab++] = byte;
 }
 
 
-unsigned char getmachine(char **pp)
+unsigned char getmachine(char **pp, Boolean dis_only)
 {
 	char *p = *pp;
 	unsigned char value;
@@ -301,7 +303,8 @@
 	if (*p <= '0' || *p > '6')
 		linenofail("bad machine type");
 	value = *p++ - '0';
-	add_to_asmtab(ASM_MACH1 - 1 + value);
+	if (!dis_only)
+		add_to_asmtab(ASM_MACH1 - 1 + value);
 	*pp = p;
 	return value;
 }
@@ -707,6 +710,7 @@
 			unsigned long	atab_inf;
 			unsigned short	atab_key;
 			unsigned char	atab_xtra = 0;
+if (strstr(line, "shl") && !strstr(line, "shld")) { debug_print=1; } else { debug_print=0; };
 
 			while (*p == ' ') ++p;
 			asm_only = asm_only_line;
@@ -718,6 +722,7 @@
 			else if (*p == 'D') {	/* if disassembler only */
 				++p;
 				dis_only = True;
+if (debug_print) { printf("1 disonly p=%s\n",p); };
 			}
 			lockable = False;
 			if (*p == 'L') {
@@ -733,8 +738,11 @@
 				i += SPARSE_BASE;
 			}
 			if (optype[i] == OPGROUP) {
-				int j = getslash(&p);
+				int j;
 				int k;
+if (debug_print) { printf("2 p=%s\n",p); };
+				j = getslash(&p);
+if (debug_print) { printf("3 p=%s\n",p); };
 
 				for (k = 0;; ++k) {
 					if (k >= n_agroups) {
@@ -766,6 +774,7 @@
 				}
 			}
 			if ( (mnflags & MNFLAGS_LOCKREPSEG) != 0 ) {
+if (debug_print) { printf("4 p=%s\n",p); };
 				add_to_asmtab(ASM_SPECIAL);
 				add_to_asmtab(atab_inf);	/* Special case: store the prefix. */
 				atab_addendum = '\0';
@@ -773,7 +782,7 @@
 			}
 			switch (*p++) {
 			case '.':
-				machine = getmachine(&p);
+				machine = getmachine(&p, dis_only);
 				if (!asm_only) {
 					entertable(i, OPSIMPLE, mnem);
 					opmach[i] = machine;
@@ -786,7 +795,8 @@
 				int width = kp->width;
 				int j;
 
-				machine = getmachine(&p);
+				machine = getmachine(&p, dis_only);
+if (debug_print) { printf("5 p=%s\n",p); };
 				if (dis_only)
 					; //atab_addendum = '\0';
 				else {
@@ -822,8 +832,10 @@
 				linenofail("Syntax error. (Unhandled character %c)",*(p-1));
 			}
 			if (atab_addendum != '\0' && dis_only == False ) {
+if (debug_print) { printf("6 p=%s inf=%02X key=%02X",p,(unsigned)atab_inf,(unsigned)atab_key); };
 				atab_inf = atab_inf * (unsigned short) (n_ol_types + 1)
 					+ atab_key;
+if (debug_print) { printf(" combined=%04X\n",(unsigned)atab_inf); };
 				escaped = (unsigned long)atab_inf >> 8;
 				escapes = 0;
 				while ( escaped >= ASM_FIRST ) {
@@ -1051,7 +1063,7 @@
 				j++;
 			}
 			fprintf(f2, "\t; ofs=%Xh\n", i );
-
+if (i == 0x6BA) { debug_print=1; } else { debug_print=0; };
 			for (; j < n_asm_tab;) {
 				Boolean lockable = False;
 				unsigned char machine = 0;
@@ -1063,6 +1075,7 @@
 
 				/* Process and note lockability byte */
 				if ( asmtab[j] == ASM_LOCKABLE) {
+if (debug_print) { printf("20 lockable\n"); };
 					lockable = True;
 					j++;
 				}
@@ -1078,6 +1091,7 @@
 				/* Process and note a machine requirement */
 				if ( asmtab[j] >= ASM_MACH1 && asmtab[j] <= ASM_MACH6) {
 					machine = asmtab[j] - ASM_MACH1 + 1;
+if (debug_print) { printf("21 machine=%i\n", machine); };
 					j++;
 				}
 
@@ -1087,12 +1101,14 @@
 				   in our internal table though because of the same reasons. */
 				while ( asmtab[j] == ASM_ESCAPE ) {
 					escape_adj += ( (unsigned long)ASM_ESCAPE<<8);
+if (debug_print) { printf("22 escape\n"); };
 					j++;
 				}
 
 				/* Decode the assembler table entry:
 				    get a big-endian word, */
 				k = ((unsigned long)asmtab[j]<<8) + (unsigned long)asmtab[j+1];
+if (debug_print) { printf("23 k=%04X j=%04X\n", k, j); };
 				j += 2;
 				/*  add in escaping adjustment */
 				k += escape_adj;
@@ -1100,6 +1116,7 @@
 				l = k % (n_ol_types+1);
 				/*  the result is the information on the actual opcode. */
 				k = k / (unsigned long)(n_ol_types+1);
+if (debug_print) { printf("24 k=%02X l=%02X j=%04X\n", k, l, j); };
 
 				/* Single-byte opcodes D8..DF are FPU variants. */
 				if ( k >= 0xD8 && k <= 0xDF)
@@ -1133,6 +1150,7 @@
 
 				/* End of this variant */
 				fprintf(f2, "\n");
+if (debug_print) { printf("25 [j]=%02X j=%04X\n", asmtab[j], j); };
 			}
 			fprintf(f2, "\t endvariant\n");
 			i = j;
