Selaa lähdekoodia

fix in cmpxchg instruction; i486 book is wrong

ceriel 28 vuotta sitten
vanhempi
commit
740f1d5f75
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 2 2
      mach/i386/as/mach3.c
  2. 2 2
      mach/i386/as/mach4.c

+ 2 - 2
mach/i386/as/mach3.c

@@ -411,8 +411,8 @@
 /* Intel 486 instructions */
 0,	EXTOPBW,	0xC0,		"xaddb",
 0,	EXTOPBW,	0xC1,		"xadd",
-0,	EXTOPBW,	0xA6,		"cmpxchgb",
-0,	EXTOPBW,	0xA7,		"cmpxchg",
+0,	EXTOPBW,	0xB0,		"cmpxchgb",
+0,	EXTOPBW,	0xB1,		"cmpxchg",
 0,	BSWAP,		0xC8,		"bswap",
 0,	NOOP_2,		017+(010<<8),	"invd",
 0,	EXTOP1,		071,		"invlpg",

+ 2 - 2
mach/i386/as/mach4.c

@@ -199,9 +199,9 @@ oper	:	NOOP_1
 	/* 486 instructions */
 	|	BSWAP R32
 			{	emit1(0xF); emit1($1|$2); }
-	|	EXTOPBW reg ',' ea_2
+	|	EXTOPBW ea_2 ',' reg
 			{	regsize($1);
-				emit1(0xF); emit1($1); ea_2($2<<3);
+				emit1(0xF); emit1($1); ea_2($4<<3);
 			}
 	;