From 1fe2176241ec24f355ac7a7670bba9c0e9e536ab Mon Sep 17 00:00:00 2001 From: niravthakkar Date: Wed, 4 Jan 2017 17:43:53 +0530 Subject: [PATCH] Updated memory parsing The values of base and index registers have been passed as 0, if only displacement is passed the displacement is assumed to be alphanumeric (since label might be used) --- dynasm/dasm_s390x.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dynasm/dasm_s390x.lua b/dynasm/dasm_s390x.lua index 95c6927d..a62fe21a 100644 --- a/dynasm/dasm_s390x.lua +++ b/dynasm/dasm_s390x.lua @@ -325,10 +325,15 @@ local function split_memop(arg) return d, 0, parse_reg(b) end -- Assuming the two registers are passed as "(r1,r2)", and displacement(d) is not specified - local x, b = string.match(arg,"%(%s*("..reg..")%s*,%s*("..reg..")%s*%)$") + local x, b = match(arg,"%(%s*("..reg..")%s*,%s*("..reg..")%s*%)$") if b then return 0, parse_reg(x), parse_reg(b) end + -- Assuming that only displacement is passed, as either digit or label "45 or label1" + local d = match(arg,"[%w_]+") + if d then + return d, 0, 0 + end local reg, tailr = match(arg, "^([%w_:]+)%s*(.*)$") if reg then local r, tp = parse_reg(reg)