Browse files

Switch around the order of arguments to create a SIB reference.

Put the offset last and make it optional.
  • Loading branch information...
1 parent 0a79628 commit 28b6d0c46facfb01fb414a40e101b8c2e07916c1 @nelhage committed Aug 6, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 bt.cpp
  2. +1 −1 x86.h
View
4 bt.cpp
@@ -508,7 +508,7 @@ inline void bt_translate_other(X86Assembler *buf, byteptr pc, bdecode *inst) {
bt_save_fault_entry(buf, pc);
#ifdef __x86_64__
- buf->mov(X86ECX, X86Mem(0, X86RDI, X86RAX));
+ buf->mov(X86ECX, X86Mem(X86RDI, X86RAX));
#else
buf->byte(PREFIX_SEG_FS);
buf->mov(X86ECX, X86Mem(X86EAX));
@@ -525,7 +525,7 @@ inline void bt_translate_other(X86Assembler *buf, byteptr pc, bdecode *inst) {
bt_save_fault_entry(buf, pc);
#ifdef __x86_64__
- buf->mov(X86Mem(0, X86RDI, X86RAX), X86EAX);
+ buf->mov(X86Mem(X86RDI, X86RAX), X86EAX);
#else
buf->byte(PREFIX_SEG_FS);
buf->mov(X86Mem(X86EAX), X86EAX);
View
2 x86.h
@@ -408,7 +408,7 @@ static inline X86ReferenceAbs X86Mem(uint32_t addr) {
X86ReferenceAbs r = {addr};
return r;
}
-static inline X86ReferenceSIB X86Mem(uint32_t off, X86Register base, X86Register index, uint8_t scale = 1) {
+static inline X86ReferenceSIB X86Mem(X86Register base, X86Register index, uint8_t scale = 1, uint32_t off = 0) {
X86ReferenceSIB r = {off, base, index, scale};
return r;
}

0 comments on commit 28b6d0c

Please sign in to comment.