diff --git a/dynasm/dasm_s390x.h b/dynasm/dasm_s390x.h index b327e7a6..254db8b8 100644 --- a/dynasm/dasm_s390x.h +++ b/dynasm/dasm_s390x.h @@ -9,7 +9,7 @@ #include #include -#define DASM_ARCH "s390" +#define DASM_ARCH "s390x" #ifndef DASM_EXTERN #define DASM_EXTERN(a,b,c,d) 0 @@ -49,7 +49,7 @@ enum { #define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos)) /* Action list type. */ -typedef const unsigned int *dasm_ActList; +typedef const unsigned short *dasm_ActList; /* Per-section structure. */ typedef struct dasm_Section { diff --git a/dynasm/dasm_s390x.lua b/dynasm/dasm_s390x.lua index 556f7fe4..c73e317e 100644 --- a/dynasm/dasm_s390x.lua +++ b/dynasm/dasm_s390x.lua @@ -970,6 +970,19 @@ local function parse_template(params, template, nparams, pos) end end + + -- TODO + -- 12-bit displacements (DISP12) and 16-bit immediates (IMM16) can be put at + -- one of two locations relative to the end of the instruction. + -- To make decoding easier we should insert the actions for these immediately + -- after the halfword they modify. + -- For example, take the instruction ahik, which is laid out as follows (each + -- char is 4 bits): + -- o = op code, r = register, i = immediate + -- oorr iiii 00oo + -- This should be emitted as oorr, followed by the immediate action, followed by + -- 00oo. + wputpos(pos, op) end function op_template(params, template, nparams)