New instructions in gas2ack

pause
mfence
rdtsc
rdpmc
This commit is contained in:
Tomas Hruby 2009-11-16 21:32:48 +00:00
parent 2dc9e354f7
commit 6515c93ecf
3 changed files with 16 additions and 12 deletions

View file

@ -129,6 +129,7 @@ typedef enum opcode { /* 80486 opcodes, from the i486 reference manual.
LOOP, LOOPE, LOOPNE,
LSL,
LTR,
MFENCE,
MOV,
MOVS,
MOVSX,
@ -142,6 +143,7 @@ typedef enum opcode { /* 80486 opcodes, from the i486 reference manual.
OR,
OUT,
OUTS,
PAUSE,
POP,
POPA,
POPAD,
@ -151,8 +153,10 @@ typedef enum opcode { /* 80486 opcodes, from the i486 reference manual.
PUSHAD,
PUSHF,
RCL, RCR, ROL, ROR,
RET, RETF, /* RETF added */
RDMSR,
RDPMC,
RDTSC,
RET, RETF, /* RETF added */
SAHF,
SAL, SAR, SHL, SHR,
SBB,

View file

@ -224,6 +224,7 @@ static mnemonic_t mnemtab[] = {
{ LSL, "lsl" },
{ LSS, "lss" },
{ LTR, "ltr" },
{ MFENCE, ".data1 0x0f, 0xae, 0x0f"},
{ MOV, "mov%" },
{ MOVS, "movs%" },
{ MOVSX, "movsx" },
@ -237,6 +238,7 @@ static mnemonic_t mnemtab[] = {
{ OR, "or%" },
{ OUT, "out%" },
{ OUTS, "outs%" },
{ PAUSE, ".data1 0xf3, 0x90"},
{ POP, "pop" },
{ POPA, "popa" },
{ POPAD, "popad" },
@ -249,7 +251,9 @@ static mnemonic_t mnemtab[] = {
{ RCR, "rcr%" },
{ RET, "ret" },
{ RETF, "retf" },
{ RDMSR, "rdmsr" },
{ RDMSR, ".data1 0x0f, 0x32"},
{ RDPMC, ".data1 0x0f, 0x33"},
{ RDTSC, ".data1 0x0f, 0x31"},
{ ROL, "rol%" },
{ ROR, "ror%" },
{ SAHF, "sahf" },
@ -292,7 +296,7 @@ static mnemonic_t mnemtab[] = {
{ VERW, "verw" },
{ WAIT, "wait" },
{ WBINVD, "wbinvd" },
{ WRMSR, "wrmsr" },
{ WRMSR, ".data1 0x0f, 0x30"},
{ XADD, "xadd" },
{ XCHG, "xchg%" },
{ XLAT, "xlat" },
@ -607,14 +611,6 @@ 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

@ -282,6 +282,7 @@ static mnemonic_t mnemtab[] = { /* This array is sorted. */
{ "lsl", LSL, WORD },
{ "lss", LSS, WORD },
{ "ltr", LTR, WORD },
{ "mfence", MFENCE, WORD },
{ "movb", MOV, BYTE },
{ "movl", MOV, WORD },
{ "movsb", MOVS, BYTE },
@ -313,6 +314,7 @@ static mnemonic_t mnemtab[] = { /* This array is sorted. */
{ "outsl", OUTS, WORD },
{ "outsw", OUTS, OWORD },
{ "outw", OUT, OWORD },
{ "pause", PAUSE, WORD },
{ "pop", POP, WORD },
{ "popa", POPA, WORD },
{ "popal", POPAD, WORD },
@ -332,9 +334,11 @@ static mnemonic_t mnemtab[] = { /* This array is sorted. */
{ "rcrb", RCR, BYTE },
{ "rcrl", RCR, WORD },
{ "rcrw", RCR, OWORD },
{ "rdmsr", RDMSR, WORD },
{ "rdpmc", RDPMC, WORD },
{ "rdtsc", RDTSC, WORD },
{ "ret", RET, JUMP },
{ "retf", RETF, JUMP },
{ "rdmsr", RDMSR, WORD },
{ "rolb", ROL, BYTE },
{ "roll", ROL, WORD },
{ "rolw", ROL, OWORD },