Commit f390f2e6 authored by Julian Kranz's avatar Julian Kranz

X86 Pretty Printer

...

- Bug fixes
...
parent 11bf49b0
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
// Copyright (c) 2012 Axel Simon. All rights reserved. // Copyright (c) 2012 Axel Simon. All rights reserved.
// //
#include <stdint.h>
#include <strings.h> #include <strings.h>
#include "Segment.h" #include "Segment.h"
#include <sys/mman.h> #include <sys/mman.h>
......
...@@ -5,9 +5,72 @@ ...@@ -5,9 +5,72 @@
* Author: jucs * Author: jucs
*/ */
#include <stdlib.h> #include <stdint.h>
#include <stdio.h> #include <iostream>
#include <fstream>
#include "Segment.h"
#include "RReil.h"
#include <vector>
#include <fcntl.h>
int main(void) { int main(int argc, const char * argv[]) {
printf(":-)\n"); char *file_name = "/bin/echo";
SegmentSet segments;
// Read in what code/data segments there are and store them in
// uint32_t cmd_buf[header.sizeofcmds/sizeof(uint32_t)];
// char* cp = (char*) &cmd_buf;
// f.read(cp, header.sizeofcmds);
// uint32_t ncmds = header.ncmds;
// while ((cp-(char*) &cmd_buf)<header.sizeofcmds && ncmds--) {
// struct load_command* lc = (struct load_command*) cp;
// switch (lc->cmd) {
// case LC_SEGMENT_64: {
// struct segment_command_64* cmd = (struct segment_command_64*) cp;
// char name[17];
// name[16]=0;
// memcpy(&name[0], &cmd->segname[0], 16);
// std::cout << "found " << &name[0] << " segment" << std::endl;
// uint32_t nsect = cmd->nsects;
// struct section_64* sect = (struct section_64*) (cp+sizeof(struct segment_command_64));
// for (int i=0; i<nsect; i++, sect++) {
// sect->sectname[15]=0;
// Segment* s = new Segment(&(sect->sectname[0]), sect->addr, sect->size, sect->offset);
// segments.addSegment(s);
// }
// }
// }
// cp = cp+lc->cmdsize;
// }
Segment* s = new Segment("text", 0x401170, 0xbd, 0x1170);
segments.addSegment(s);
// f.close();
int fd = open(file_name, O_RDONLY);
if (fd== -1) return 1;
bool res = segments.map(fd);
if (!res) {
std::cout << "Cannot map segment sections." << std::endl;
return 1;
}
//std::cout << segments;
Segment* text = segments.findByName("text");
if (text==NULL) {
std::cout << "Segment containing code not found." << std::endl;
return 1;
}
std::cout << segments << std::endl;
uint64_t start = text->getBase();
char* limit;
char* addr = segments.resolve(start, &limit);
//std::cout << "first byte of text segment is " << std::hex << start << ": " << std::hex << (uint8_t) (*addr) << std::dec << std::endl;
RReilBB* b = translate(addr,limit);
if (b!=NULL) std::cout << "basic block:" << std::endl << *b << std::endl;
return 0;
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#define __RT_HEAP_SIZE (4*1024*1024) #define __RT_HEAP_SIZE (8*1024*1024)
#define __CHECK_HEAP(n) /* TODO: check for heap-overflow */ #define __CHECK_HEAP(n) /* TODO: check for heap-overflow */
#define __ALLOC1() --hp /* TODO: check for heap-overflow */ #define __ALLOC1() --hp /* TODO: check for heap-overflow */
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
all: cmusl-cli all: cmusl-cli
ccmp: ccmp:
gcc -O2 -Wall -static -I. -I../.. -I../../resources/xed/xed2-intel64/include -L../../resources/xed/xed2-intel64/lib -Wfatal-errors cmp.c ../../dis.c pretty.c -lbfd -liberty -ldl -lz -lxed -DRELAXEDFATAL -o cmp clang -O2 -Wall -static -I. -I../.. -I../../resources/xed/xed2-intel64/include -L../../resources/xed/xed2-intel64/lib -Wfatal-errors cmp.c ../../dis.c pretty.c -lbfd -liberty -ldl -lz -lxed -DRELAXEDFATAL -o cmp
cxedcmp: cxedcmp:
gcc -O2 -Wall -Wfatal-errors -static -I. -I../.. -I../../resources/xed/xed2-intel64/include -L../../resources/xed/xed2-intel64/lib xed-cmp.c pretty.c ../../dis.c -lbfd -liberty -ldl -lz -lxed -DRELAXEDFATAL -o xed-cmp clang -O2 -Wall -Wfatal-errors -static -I. -I../.. -I../../resources/xed/xed2-intel64/include -L../../resources/xed/xed2-intel64/lib xed-cmp.c pretty.c ../../dis.c -lbfd -liberty -ldl -lz -lxed -DRELAXEDFATAL -o xed-cmp
ccli: ccli:
gcc -pipe -O2 -Wall -static -I. -I../.. -Wfatal-errors cli.c pretty.c ../../dis.c -DRELAXEDFATAL -o cli clang -pipe -O2 -Wall -static -I. -I../.. -Wfatal-errors cli.c pretty.c ../../dis.c -DRELAXEDFATAL -o cli
cmusl-cli: cmusl-cli:
/usr/musl/bin/musl-gcc -pipe -O3 -Wall -static -I. -I../.. -Wfatal-errors cli.c pretty.c ../../dis.c -DRELAXEDFATAL -o musl-cli /usr/musl/bin/musl-gcc -pipe -O3 -Wall -static -I. -I../.. -Wfatal-errors cli.c pretty.c ../../dis.c -DRELAXEDFATAL -o musl-cli
...@@ -17,4 +17,4 @@ cmusl-cli-println: ...@@ -17,4 +17,4 @@ cmusl-cli-println:
/usr/musl/bin/musl-gcc -pipe -O3 -Wall -static -I. -I../.. -Wfatal-errors cli-println.c ../../dis.c -DRELAXEDFATAL -o musl-cli-println /usr/musl/bin/musl-gcc -pipe -O3 -Wall -static -I. -I../.. -Wfatal-errors cli-println.c ../../dis.c -DRELAXEDFATAL -o musl-cli-println
ccli-println: ccli-println:
gcc -O2 -Wall -static -I. -I../.. -Wfatal-errors cli-println.c ../../dis.c -DRELAXEDFATAL -o cli-println clang -O2 -Wall -static -I. -I../.. -Wfatal-errors cli-println.c ../../dis.c -DRELAXEDFATAL -o cli-println
...@@ -11,7 +11,7 @@ val show/arity4 x = show/arity3 x +++ ", " +++ show/operand x.opnd4 ...@@ -11,7 +11,7 @@ val show/arity4 x = show/arity3 x +++ ", " +++ show/operand x.opnd4
val show/flow1 x = show/flowoperand x.opnd1 val show/flow1 x = show/flowoperand x.opnd1
val show/varity x = val show/varity x =
case x of case x of
VA0: "" VA0 x: ""
| VA1 x: show/arity1 x | VA1 x: show/arity1 x
| VA2 x: show/arity2 x | VA2 x: show/arity2 x
| VA3 x: show/arity3 x | VA3 x: show/arity3 x
...@@ -164,8 +164,12 @@ val show/memsz sz = ...@@ -164,8 +164,12 @@ val show/memsz sz =
val show/segment s = val show/segment s =
case s of case s of
DS: "" SEG_NONE: ""
| _: show/register s +++ ":" | SEG_OVERRIDE r:
case r of
DS: ""
| s: show/register s +++ ":"
end
end end
val show/scale s = val show/scale s =
...@@ -200,10 +204,10 @@ val show/flowoperand op = ...@@ -200,10 +204,10 @@ val show/flowoperand op =
val show/instruction insn = val show/instruction insn =
case insn of case insn of
AAA: "AAA" AAA x: "AAA"
| AAD x: "AAD" -++ show/arity1 x | AAD x: "AAD" -++ show/arity1 x
| AAM x: "AAM" -++ show/arity1 x | AAM x: "AAM" -++ show/arity1 x
| AAS: "AAS" | AAS x: "AAS"
| ADC x: "ADC" -++ show/arity2 x | ADC x: "ADC" -++ show/arity2 x
| ADD x: "ADD" -++ show/arity2 x | ADD x: "ADD" -++ show/arity2 x
| ADDPD x: "ADDPD" -++ show/arity2 x | ADDPD x: "ADDPD" -++ show/arity2 x
...@@ -237,15 +241,15 @@ val show/instruction insn = ...@@ -237,15 +241,15 @@ val show/instruction insn =
| BTR x: "BTR" -++ show/arity2 x | BTR x: "BTR" -++ show/arity2 x
| BTS x: "BTS" -++ show/arity2 x | BTS x: "BTS" -++ show/arity2 x
| CALL x: "CALL" -++ show/flow1 x | CALL x: "CALL" -++ show/flow1 x
| CBW: "CBW" | CBW x: "CBW"
| CDQ: "CDQ" | CDQ x: "CDQ"
| CDQE: "CDQE" | CDQE x: "CDQE"
| CLC: "CLC" | CLC x: "CLC"
| CLD: "CLD" | CLD x: "CLD"
| CLFLUSH x: "CLFLUSH" -++ show/arity1 x | CLFLUSH x: "CLFLUSH" -++ show/arity1 x
| CLI: "CLI" | CLI x: "CLI"
| CLTS: "CLTS" | CLTS x: "CLTS"
| CMC: "CMC" | CMC x: "CMC"
| CMOVA x: "CMOVA" -++ show/arity2 x | CMOVA x: "CMOVA" -++ show/arity2 x
| CMOVAE x: "CMOVAE" -++ show/arity2 x | CMOVAE x: "CMOVAE" -++ show/arity2 x
| CMOVB x: "CMOVB" -++ show/arity2 x | CMOVB x: "CMOVB" -++ show/arity2 x
...@@ -279,7 +283,7 @@ val show/instruction insn = ...@@ -279,7 +283,7 @@ val show/instruction insn =
| CMP x: "CMP" -++ show/arity2 x | CMP x: "CMP" -++ show/arity2 x
| CMPPD x: "CMPPD" -++ show/arity3 x | CMPPD x: "CMPPD" -++ show/arity3 x
| CMPPS x: "CMPPS" -++ show/arity3 x | CMPPS x: "CMPPS" -++ show/arity3 x
| CMPS x: "CMPS" -++ show/arity2 | CMPS x: "CMPS" -++ show/arity2 x
| CMPSD x: "CMPSD" -++ show/arity3 x | CMPSD x: "CMPSD" -++ show/arity3 x
| CMPSS x: "CMPSS" -++ show/arity3 x | CMPSS x: "CMPSS" -++ show/arity3 x
| CMPXCHG x: "CMPXCHG" -++ show/arity2 x | CMPXCHG x: "CMPXCHG" -++ show/arity2 x
...@@ -287,8 +291,8 @@ val show/instruction insn = ...@@ -287,8 +291,8 @@ val show/instruction insn =
| CMPXCHG8B x: "CMPXCHG8B" -++ show/arity1 x | CMPXCHG8B x: "CMPXCHG8B" -++ show/arity1 x
| COMISD x: "COMISD" -++ show/arity2 x | COMISD x: "COMISD" -++ show/arity2 x
| COMISS x: "COMISS" -++ show/arity2 x | COMISS x: "COMISS" -++ show/arity2 x
| CPUID: "CPUID" | CPUID x: "CPUID"
| CQO: "CQO" | CQO x: "CQO"
| CRC32 x: "CRC32" -++ show/arity2 x | CRC32 x: "CRC32" -++ show/arity2 x
| CVTDQ2PD x: "CVTDQ2PD" -++ show/arity2 x | CVTDQ2PD x: "CVTDQ2PD" -++ show/arity2 x
| CVTDQ2PS x: "CVTDQ2PS" -++ show/arity2 x | CVTDQ2PS x: "CVTDQ2PS" -++ show/arity2 x
...@@ -312,10 +316,10 @@ val show/instruction insn = ...@@ -312,10 +316,10 @@ val show/instruction insn =
| CVTTPS2PI x: "CVTTPS2PI" -++ show/arity2 x | CVTTPS2PI x: "CVTTPS2PI" -++ show/arity2 x
| CVTTSD2SI x: "CVTTSD2SI" -++ show/arity2 x | CVTTSD2SI x: "CVTTSD2SI" -++ show/arity2 x
| CVTTSS2SI x: "CVTTSS2SI" -++ show/arity2 x | CVTTSS2SI x: "CVTTSS2SI" -++ show/arity2 x
| CWD: "CWD" | CWD x: "CWD"
| CWDE: "CWDE" | CWDE x: "CWDE"
| DAA: "DAA" | DAA x: "DAA"
| DAS: "DAS" | DAS x: "DAS"
| DEC x: "DEC" -++ show/arity1 x | DEC x: "DEC" -++ show/arity1 x
| DIV x: "DIV" -++ show/arity1 x | DIV x: "DIV" -++ show/arity1 x
| DIVPD x: "DIVPD" -++ show/arity2 x | DIVPD x: "DIVPD" -++ show/arity2 x
...@@ -324,17 +328,17 @@ val show/instruction insn = ...@@ -324,17 +328,17 @@ val show/instruction insn =
| DIVSS x: "DIVSS" -++ show/arity2 x | DIVSS x: "DIVSS" -++ show/arity2 x
| DPPD x: "DPPD" -++ show/arity3 x | DPPD x: "DPPD" -++ show/arity3 x
| DPPS x: "DPPS" -++ show/arity3 x | DPPS x: "DPPS" -++ show/arity3 x
| EMMS: "EMMS" | EMMS x: "EMMS"
| ENTER x: "ENTER" -++ show/arity2 x | ENTER x: "ENTER" -++ show/arity2 x
| EXTRACTPS x: "EXTRACTPS" -++ show/arity3 x | EXTRACTPS x: "EXTRACTPS" -++ show/arity3 x
| F2XM1: "F2XM1" | F2XM1 x: "F2XM1"
| FABS: "FABS" | FABS x: "FABS"
| FADD x: "FADD" -++ show/arity2 x | FADD x: "FADD" -++ show/arity2 x
| FADDP x: "FADDP" -++ show/arity2 x | FADDP x: "FADDP" -++ show/arity2 x
| FBLD x: "FBLD" -++ show/arity1 x | FBLD x: "FBLD" -++ show/arity1 x
| FBSTP x: "FBSTP" -++ show/arity1 x | FBSTP x: "FBSTP" -++ show/arity1 x
| FCHS: "FCHS" | FCHS x: "FCHS"
| FCLEX: "FCLEX" | FCLEX x: "FCLEX"
| FCMOVB x: "FCMOVB" -++ show/arity2 x | FCMOVB x: "FCMOVB" -++ show/arity2 x
| FCMOVBE x: "FCMOVBE" -++ show/arity2 x | FCMOVBE x: "FCMOVBE" -++ show/arity2 x
| FCMOVE x: "FCMOVE" -++ show/arity2 x | FCMOVE x: "FCMOVE" -++ show/arity2 x
...@@ -347,9 +351,9 @@ val show/instruction insn = ...@@ -347,9 +351,9 @@ val show/instruction insn =
| FCOMI x: "FCOMI" -++ show/arity2 x | FCOMI x: "FCOMI" -++ show/arity2 x
| FCOMIP x: "FCOMIP" -++ show/arity2 x | FCOMIP x: "FCOMIP" -++ show/arity2 x
| FCOMP x: "FCOMP" -++ show/arity1 x | FCOMP x: "FCOMP" -++ show/arity1 x
| FCOMPP: "FCOMPP" | FCOMPP x: "FCOMPP"
| FCOS: "FCOS" | FCOS x: "FCOS"
| FDECSTP: "FDECSTP" | FDECSTP x: "FDECSTP"
| FDIV x: "FDIV" -++ show/arity2 x | FDIV x: "FDIV" -++ show/arity2 x
| FDIVP x: "FDIVP" -++ show/arity2 x | FDIVP x: "FDIVP" -++ show/arity2 x
| FDIVR x: "FDIVR" -++ show/arity2 x | FDIVR x: "FDIVR" -++ show/arity2 x
...@@ -362,43 +366,43 @@ val show/instruction insn = ...@@ -362,43 +366,43 @@ val show/instruction insn =
| FIDIVR x: "FIDIVR" -++ show/arity1 x | FIDIVR x: "FIDIVR" -++ show/arity1 x
| FILD x: "FILD" -++ show/arity1 x | FILD x: "FILD" -++ show/arity1 x
| FIMUL x: "FIMUL" -++ show/arity1 x | FIMUL x: "FIMUL" -++ show/arity1 x
| FINCSTP: "FINCSTP" | FINCSTP x: "FINCSTP"
| FINIT: "FINIT" | FINIT x: "FINIT"
| FIST x: "FIST" -++ show/arity1 x | FIST x: "FIST" -++ show/arity1 x
| FISTP x: "FISTP" -++ show/arity1 x | FISTP x: "FISTP" -++ show/arity1 x
| FISTTP x: "FISTTP" -++ show/arity1 x | FISTTP x: "FISTTP" -++ show/arity1 x
| FISUB x: "FISUB" -++ show/arity1 x | FISUB x: "FISUB" -++ show/arity1 x
| FISUBR x: "FISUBR" -++ show/arity1 x | FISUBR x: "FISUBR" -++ show/arity1 x
| FLD x: "FLD" -++ show/arity1 x | FLD x: "FLD" -++ show/arity1 x
| FLD1: "FLD1" | FLD1 x: "FLD1"
| FLDCW x: "FLDCW" -++ show/arity1 x | FLDCW x: "FLDCW" -++ show/arity1 x
| FLDENV x: "FLDENV" -++ show/arity1 x | FLDENV x: "FLDENV" -++ show/arity1 x
| FLDL2E: "FLDL2E" | FLDL2E x: "FLDL2E"
| FLDL2T: "FLDL2T" | FLDL2T x: "FLDL2T"
| FLDLG2: "FLDLG2" | FLDLG2 x: "FLDLG2"
| FLDLN2: "FLDLN2" | FLDLN2 x: "FLDLN2"
| FLDPI: "FLDPI" | FLDPI x: "FLDPI"
| FLDZ: "FLDZ" | FLDZ x: "FLDZ"
| FMUL x: "FMUL" -++ show/arity2 x | FMUL x: "FMUL" -++ show/arity2 x
| FMULP x: "FMULP" -++ show/arity2 x | FMULP x: "FMULP" -++ show/arity2 x
| FNCLEX: "FNCLEX" | FNCLEX x: "FNCLEX"
| FNINIT: "FNINIT" | FNINIT x: "FNINIT"
| FNOP: "FNOP" | FNOP x: "FNOP"
| FNSAVE x: "FNSAVE" -++ show/arity1 x | FNSAVE x: "FNSAVE" -++ show/arity1 x
| FNSTCW x: "FNSTCW" -++ show/arity1 x | FNSTCW x: "FNSTCW" -++ show/arity1 x
| FNSTENV x: "FNSTENV" -++ show/arity1 x | FNSTENV x: "FNSTENV" -++ show/arity1 x
| FNSTSW x: "FNSTSW" -++ show/arity1 x | FNSTSW x: "FNSTSW" -++ show/arity1 x
| FPATAN: "FPATAN" | FPATAN x: "FPATAN"
| FPREM1: "FPREM1" | FPREM1 x: "FPREM1"
| FPREM: "FPREM" | FPREM x: "FPREM"
| FPTAN: "FPTAN" | FPTAN x: "FPTAN"
| FRNDINT: "FRNDINT" | FRNDINT x: "FRNDINT"
| FRSTOR x: "FRSTOR" -++ show/arity1 x | FRSTOR x: "FRSTOR" -++ show/arity1 x
| FSAVE x: "FSAVE" -++ show/arity1 x | FSAVE x: "FSAVE" -++ show/arity1 x
| FSCALE: "FSCALE" | FSCALE x: "FSCALE"
| FSIN: "FSIN" | FSIN x: "FSIN"
| FSINCOS: "FSINCOS" | FSINCOS x: "FSINCOS"
| FSQRT: "FSQRT" | FSQRT x: "FSQRT"
| FST x: "FST" -++ show/arity1 x | FST x: "FST" -++ show/arity1 x
| FSTCW x: "FSTCW" -++ show/arity1 x | FSTCW x: "FSTCW" -++ show/arity1 x
| FSTENV x: "FSTENV" -++ show/arity1 x | FSTENV x: "FSTENV" -++ show/arity1 x
...@@ -408,43 +412,43 @@ val show/instruction insn = ...@@ -408,43 +412,43 @@ val show/instruction insn =
| FSUBP x: "FSUBP" -++ show/arity2 x | FSUBP x: "FSUBP" -++ show/arity2 x
| FSUBR x: "FSUBR" -++ show/arity2 x | FSUBR x: "FSUBR" -++ show/arity2 x
| FSUBRP x: "FSUBRP" -++ show/arity2 x | FSUBRP x: "FSUBRP" -++ show/arity2 x
| FTST: "FTST" | FTST x: "FTST"
| FUCOM x: "FUCOM" -++ show/arity1 x | FUCOM x: "FUCOM" -++ show/arity1 x
| FUCOMI x: "FUCOMI" -++ show/arity1 x | FUCOMI x: "FUCOMI" -++ show/arity1 x
| FUCOMIP x: "FUCOMIP" -++ show/arity1 x | FUCOMIP x: "FUCOMIP" -++ show/arity1 x
| FUCOMP x: "FUCOMP" -++ show/arity1 x | FUCOMP x: "FUCOMP" -++ show/arity1 x
| FUCOMPP: "FUCOMPP" | FUCOMPP x: "FUCOMPP"
| FXAM: "FXAM" | FXAM x: "FXAM"
| FXCH x: "FXCH" -++ show/arity1 x | FXCH x: "FXCH" -++ show/arity1 x
| FXRSTOR x: "FXRSTOR" -++ show/arity1 x | FXRSTOR x: "FXRSTOR" -++ show/arity1 x
| FXRSTOR64 x: "FXRSTOR64" -++ show/arity1 x | FXRSTOR64 x: "FXRSTOR64" -++ show/arity1 x
| FXSAVE x: "FXSAVE" -++ show/arity1 x | FXSAVE x: "FXSAVE" -++ show/arity1 x
| FXSAVE64 x: "FXSAVE64" -++ show/arity1 x | FXSAVE64 x: "FXSAVE64" -++ show/arity1 x
| FXTRACT: "FXTRACT" | FXTRACT x: "FXTRACT"
| FYL2X: "FYL2X" | FYL2X x: "FYL2X"
| FYL2XP1: "FYL2XP1" | FYL2XP1 x: "FYL2XP1"
| HADDPD x: "HADDPD" -++ show/arity2 x | HADDPD x: "HADDPD" -++ show/arity2 x
| HADDPS x: "HADDPS" -++ show/arity2 x | HADDPS x: "HADDPS" -++ show/arity2 x
| HLT: "HLT" | HLT x: "HLT"
| HSUBPD x: "HSUBPD" -++ show/arity2 x | HSUBPD x: "HSUBPD" -++ show/arity2 x
| HSUBPS x: "HSUBPS" -++ show/arity2 x | HSUBPS x: "HSUBPS" -++ show/arity2 x
| IDIV x: "IDIV" -++ show/arity1 x | IDIV x: "IDIV" -++ show/arity1 x
| IMUL x: "IMUL" -++ show/varity x | IMUL x: "IMUL" -++ show/varity x
| IN x: "IN" -++ show/arity2 x | IN x: "IN" -++ show/arity2 x
| INC x: "INC" -++ show/arity1 x | INC x: "INC" -++ show/arity1 x
| INSB: "INSB" | INSB x: "INSB"
| INSD: "INSD" | INSD x: "INSD"
| INSERTPS x: "INSERTPS" -++ show/arity3 x | INSERTPS x: "INSERTPS" -++ show/arity3 x
| INSW: "INSW" | INSW x: "INSW"
| INT x: "INT" -++ show/arity1 x | INT x: "INT" -++ show/arity1 x
| INT0: "INT0" | INT0 x: "INT0"
| INT3: "INT3" | INT3 x: "INT3"
| INVD: "INVD" | INVD x: "INVD"
| INVLPG x: "INVLPG" -++ show/arity1 x | INVLPG x: "INVLPG" -++ show/arity1 x
| INVPCID x: "INVPCID" -++ show/arity2 x | INVPCID x: "INVPCID" -++ show/arity2 x
| IRET: "IRET" | IRET x: "IRET"
| IRETD: "IRETD" | IRETD x: "IRETD"
| IRETQ: "IRETQ" | IRETQ x: "IRETQ"
| JA x: "JA" -++ show/flow1 x | JA x: "JA" -++ show/flow1 x
| JAE x: "JAE" -++ show/flow1 x | JAE x: "JAE" -++ show/flow1 x
| JB x: "JB" -++ show/flow1 x | JB x: "JB" -++ show/flow1 x
...@@ -479,15 +483,15 @@ val show/instruction insn = ...@@ -479,15 +483,15 @@ val show/instruction insn =
| JRCXZ x: "JRCXZ" -++ show/flow1 x | JRCXZ x: "JRCXZ" -++ show/flow1 x
| JS x: "JS" -++ show/flow1 x | JS x: "JS" -++ show/flow1 x
| JZ x: "JZ" -++ show/flow1 x | JZ x: "JZ" -++ show/flow1 x
| LAHF: "LAHF" | LAHF x: "LAHF"
| LAR x: "LAR" -++ show/arity2 x | LAR x: "LAR" -++ show/arity2 x
| LDDQU x: "LDDQU" -++ show/arity2 x | LDDQU x: "LDDQU" -++ show/arity2 x
| LDMXCSR x: "LDMXCSR" -++ show/arity1 x | LDMXCSR x: "LDMXCSR" -++ show/arity1 x
| LDS x: "LDS" -++ show/arity2 x | LDS x: "LDS" -++ show/arity2 x
| LEA x: "LEA" -++ show/arity2 x | LEA x: "LEA" -++ show/arity2 x
| LEAVE: "LEAVE" | LEAVE x: "LEAVE"
| LES x: "LES" -++ show/arity2 x | LES x: "LES" -++ show/arity2 x
| LFENCE: "LFENCE" | LFENCE x: "LFENCE"
| LFS x: "LFS" -++ show/arity2 x | LFS x: "LFS" -++ show/arity2 x
| LGDT x: "LGDT" -++ show/arity1 x | LGDT x: "LGDT" -++ show/arity1 x
| LGS x: "LGS" -++ show/arity2 x | LGS x: "LGS" -++ show/arity2 x
...@@ -507,12 +511,12 @@ val show/instruction insn = ...@@ -507,12 +511,12 @@ val show/instruction insn =
| MAXPS x: "MAXPS" -++ show/arity2 x | MAXPS x: "MAXPS" -++ show/arity2 x
| MAXSD x: "MAXSD" -++ show/arity2 x | MAXSD x: "MAXSD" -++ show/arity2 x
| MAXSS x: "MAXSS" -++ show/arity2 x | MAXSS x: "MAXSS" -++ show/arity2 x
| MFENCE: "MFENCE" | MFENCE x: "MFENCE"
| MINPD x: "MINPD" -++ show/arity2 x | MINPD x: "MINPD" -++ show/arity2 x
| MINPS x: "MINPS" -++ show/arity2 x | MINPS x: "MINPS" -++ show/arity2 x
| MINSD x: "MINSD" -++ show/arity2 x | MINSD x: "MINSD" -++ show/arity2 x
| MINSS x: "MINSS" -++ show/arity2 x | MINSS x: "MINSS" -++ show/arity2 x
| MONITOR: "MONITOR" | MONITOR x: "MONITOR"
| MOV x: "MOV" -++ show/arity2 x | MOV x: "MOV" -++ show/arity2 x
| MOVAPD x: "MOVAPD" -++ show/arity2 x | MOVAPD x: "MOVAPD" -++ show/arity2 x
| MOVAPS x: "MOVAPS" -++ show/arity2 x | MOVAPS x: "MOVAPS" -++ show/arity2 x
...@@ -555,7 +559,7 @@ val show/instruction insn = ...@@ -555,7 +559,7 @@ val show/instruction insn =
| MULPS x: "MULPS" -++ show/arity2 x | MULPS x: "MULPS" -++ show/arity2 x
| MULSD x: "MULSD" -++ show/arity2 x | MULSD x: "MULSD" -++ show/arity2 x
| MULSS x: "MULSS" -++ show/arity2 x | MULSS x: "MULSS" -++ show/arity2 x
| MWAIT: "MWAIT" | MWAIT x: "MWAIT"
| NEG x: "NEG" -++ show/arity1 x | NEG x: "NEG" -++ show/arity1 x
| NOP x: "NOP" -++ show/varity x | NOP x: "NOP" -++ show/varity x
| NOT x: "NOT" -++ show/arity1 x | NOT x: "NOT" -++ show/arity1 x
...@@ -563,10 +567,10 @@ val show/instruction insn = ...@@ -563,10 +567,10 @@ val show/instruction insn =
| ORPD x: "ORPD" -++ show/arity2 x | ORPD x: "ORPD" -++ show/arity2 x
| ORPS x: "ORPS" -++ show/arity2 x | ORPS x: "ORPS" -++ show/arity2 x
| OUT x: "OUT" -++ show/arity2 x | OUT x: "OUT" -++ show/arity2 x
| OUTS: "OUTS" | OUTS x: "OUTS"
| OUTSB: "OUTSB" | OUTSB x: "OUTSB"
| OUTSD: "OUTSD" | OUTSD x: "OUTSD"
| OUTSW: "OUTSW" | OUTSW x: "OUTSW"
| PABSB x: "PABSB" -++ show/arity2 x | PABSB x: "PABSB" -++ show/arity2 x
| PABSD x: "PABSD" -++ show/arity2 x | PABSD x: "PABSD" -++ show/arity2 x
| PABSW x: "PABSW" -++ show/arity2 x | PABSW x: "PABSW" -++ show/arity2 x
...@@ -585,7 +589,7 @@ val show/instruction insn = ...@@ -585,7 +589,7 @@ val show/instruction insn =
| PALIGNR x: "PALIGNR" -++ show/arity3 x | PALIGNR x: "PALIGNR" -++ show/arity3 x
| PAND x: "PAND" -++ show/arity2 x | PAND x: "PAND" -++ show/arity2 x
| PANDN x: "PANDN" -++ show/arity2 x | PANDN x: "PANDN" -++ show/arity2 x
| PAUSE: "PAUSE" | PAUSE x: "PAUSE"
| PAVGB x: "PAVGB" -++ show/arity2 x | PAVGB x: "PAVGB" -++ show/arity2 x
| PAVGW x: "PAVGW" -++ show/arity2 x | PAVGW x: "PAVGW" -++ show/arity2 x
| PBLENDVB x: "PBLENDVB" -++ show/arity2 x | PBLENDVB x: "PBLENDVB" -++ show/arity2 x
...@@ -654,12 +658,12 @@ val show/instruction insn = ...@@ -654,12 +658,12 @@ val show/instruction insn =
| PMULLW x: "PMULLW" -++ show/arity2 x | PMULLW x: "PMULLW" -++ show/arity2 x
| PMULUDQ x: "PMULUDQ" -++ show/arity2 x | PMULUDQ x: "PMULUDQ" -++ show/arity2 x
| POP x: "POP" -++ show/arity1 x | POP x: "POP" -++ show/arity1 x
| POPA: "POPA" | POPA x: "POPA"
| POPAD: "POPAD" | POPAD x: "POPAD"
| POPCNT x: "POPCNT" -++ show/arity2 x | POPCNT x: "POPCNT" -++ show/arity2 x
| POPF: "POPF" | POPF x: "POPF"
| POPFD: "POPFD" | POPFD x: "POPFD"
| POPFQ: "POPFQ" | POPFQ x: "POPFQ"
| POR x: "POR" -++ show/arity2 x | POR x: "POR" -++ show/arity2 x
| PREFETCHNTA x: "PREFETCHNTA" -++ show/arity1 x | PREFETCHNTA x: "PREFETCHNTA" -++ show/arity1 x
| PREFETCHT0 x: "PREFETCHT0" -++ show/arity1 x