gas2ack support for rdmsr and wrmsr

This commit is contained in:
Tomas Hruby 2009-11-12 16:19:01 +00:00
parent cb9faaebfd
commit d653cb457f
3 changed files with 14 additions and 0 deletions

View file

@ -152,6 +152,7 @@ typedef enum opcode { /* 80486 opcodes, from the i486 reference manual.
PUSHF,
RCL, RCR, ROL, ROR,
RET, RETF, /* RETF added */
RDMSR,
SAHF,
SAL, SAR, SHL, SHR,
SBB,
@ -173,6 +174,7 @@ typedef enum opcode { /* 80486 opcodes, from the i486 reference manual.
VERR, VERW,
WAIT,
WBINVD,
WRMSR,
XADD,
XCHG,
XLAT,

View file

@ -249,6 +249,7 @@ static mnemonic_t mnemtab[] = {
{ RCR, "rcr%" },
{ RET, "ret" },
{ RETF, "retf" },
{ RDMSR, "rdmsr" },
{ ROL, "rol%" },
{ ROR, "ror%" },
{ SAHF, "sahf" },
@ -291,6 +292,7 @@ static mnemonic_t mnemtab[] = {
{ VERW, "verw" },
{ WAIT, "wait" },
{ WBINVD, "wbinvd" },
{ WRMSR, "wrmsr" },
{ XADD, "xadd" },
{ XCHG, "xchg%" },
{ XLAT, "xlat" },
@ -605,6 +607,14 @@ void ack_emit_instruction(asm86_t *a)
return;
}
}
if (a->opcode == RDMSR) {
ack_printf(".data1 0x0f, 0x32\n");
return;
}
if (a->opcode == WRMSR) {
ack_printf(".data1 0x0f, 0x30\n");
return;
}
/* we are translating from GNU */
if (a->args && a->args->operator == ','
/* don't swap ljmp prefixed with segment */

View file

@ -335,6 +335,7 @@ static mnemonic_t mnemtab[] = { /* This array is sorted. */
{ "rcrw", RCR, OWORD },
{ "ret", RET, JUMP },
{ "retf", RETF, JUMP },
{ "rdmsr", RDMSR, WORD },
{ "rolb", ROL, BYTE },
{ "roll", ROL, WORD },
{ "rolw", ROL, OWORD },
@ -407,6 +408,7 @@ static mnemonic_t mnemtab[] = { /* This array is sorted. */
{ "verw", VERW, WORD },
{ "wait", WAIT, WORD },
{ "wbinvd", WBINVD, WORD },
{ "wrmsr", WRMSR, WORD },
{ "xadd", XADD, WORD },
{ "xchgb", XCHG, BYTE },
{ "xchgl", XCHG, WORD },