summaryrefslogtreecommitdiff
path: root/dynasm/dasm_x86.lua
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2012-03-24 12:28:43 -0700
committerJosh Haberman <jhaberman@gmail.com>2012-03-24 12:28:43 -0700
commitc16c9781939eb8cf175ae82b647c86ed7ea1d767 (patch)
treece7e61052636b388d629590af0dde8d5dd018215 /dynasm/dasm_x86.lua
parent86bad61b76a260ffc442acffbe58feee67df45e5 (diff)
Updated DynASM from upstream (Lua 5.2 support).
Diffstat (limited to 'dynasm/dasm_x86.lua')
-rw-r--r--dynasm/dasm_x86.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/dynasm/dasm_x86.lua b/dynasm/dasm_x86.lua
index 0d4bd4c..3bebb83 100644
--- a/dynasm/dasm_x86.lua
+++ b/dynasm/dasm_x86.lua
@@ -1,7 +1,7 @@
------------------------------------------------------------------------------
-- DynASM x86/x64 module.
--
--- Copyright (C) 2005-2011 Mike Pall. All rights reserved.
+-- Copyright (C) 2005-2012 Mike Pall. All rights reserved.
-- See dynasm.lua for full copyright notice.
------------------------------------------------------------------------------
@@ -11,9 +11,9 @@ local x64 = x64
local _info = {
arch = x64 and "x64" or "x86",
description = "DynASM x86/x64 module",
- version = "1.2.2",
- vernum = 10202,
- release = "2011-01-09",
+ version = "1.3.0",
+ vernum = 10300,
+ release = "2011-05-05",
author = "Mike Pall",
license = "MIT",
}
@@ -23,7 +23,7 @@ local _M = { _info = _info }
-- Cache library functions.
local type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs
-local assert, unpack, setmetatable = assert, unpack, setmetatable
+local assert, unpack, setmetatable = assert, unpack or table.unpack, setmetatable
local _s = string
local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char
local find, match, gmatch, gsub = _s.find, _s.match, _s.gmatch, _s.gsub
@@ -525,12 +525,13 @@ local function wputmrmsib(t, imark, s, vsreg)
-- Pure 32 bit displacement.
if x64 and tdisp ~= "table" then
wputmodrm(0, s, 4) -- [disp] -> (0, s, esp) (0, esp, ebp)
+ if imark == "I" then waction("MARK") end
wputmodrm(0, 4, 5)
else
riprel = x64
wputmodrm(0, s, 5) -- [disp|rip-label] -> (0, s, ebp)
+ if imark == "I" then waction("MARK") end
end
- if imark == "I" then waction("MARK") end
if vsreg then waction("VREG", vsreg); wputxb(2) end
end
if riprel then -- Emit rip-relative displacement.
@@ -1521,7 +1522,7 @@ local function dopattern(pat, args, sz, op, needrex)
if szov == "q" and rex == 0 then rex = rex + 8 end
if needrex then rex = rex + 16 end
if addin and addin.reg == -1 then
- wputop(szov, opcode + 1, rex)
+ wputop(szov, opcode - 7, rex)
waction("VREG", addin.vreg); wputxb(0)
else
if addin and addin.reg > 7 then rex = rex + 1 end
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback