[net.micro.68k] Words wanted on 68000 invalid operand challenge

guy@rlgvax.UUCP (Guy Harris) (10/11/84)

Here's the fix to the MIT 68000 C compiler to keep it from generating "movb"s
into address registers:

In "table.c", before the table entry that reads something like

	ASSIGN,	INAREG|FOREFF|FORCC,
		EAA,	TSCALAR|TFLOAT,
		EA,	TSCALAR|TFLOAT,
			0,	RLEFT|RRIGHT|RESCC,
			"	moveZB	AR,AL\nT",

put an entry that reads like

	ASSIGN,	INAREG|FOREFF|FORCC,
		EAA,	TCHAR,
		SBREG|STBREG,	TCHAR,
			NAREG|NASR,	RLEFT|RRIGHT|RESCC,
			"	move.l	AR,A1\n	moveZB	A1,AL\nT",

(your mileage and exact entries may differ).  This entry forces a move of
a "char" into a "B register" (which is an address register) to proceed
first by moving the character into a scratch "A register" (data register)
and then move the data register into the address register.

This fix is thanks to somebody at MIT named, I believe, Jonathan something-
or-other, and was posted in response to an article from Steve Kramer mentioning
the bug.  (Apologies to Jonathan X, but I don't have the article any more
and don't remember his name.)

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy