libmach: fix wrong formating for arm LDRH/STRH/LDRSB/LDRSH (MOVHU/MOVBU) instructions Reference: /n/atom/patch/applied2013/armmovhudbg Date: Thu Oct 3 20:42:40 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/libmach/5db.c Thu Oct 3 20:42:32 2013 +++ /sys/src/libmach/5db.c Thu Oct 3 20:42:33 2013 @@ -498,7 +498,7 @@ armhwby(Opcode *o, Instr *i) { i->store = ((i->w >> 23) & 0x2) | ((i->w >>21) & 0x1); - i->imm = (i->w & 0xf) | ((i->w >> 8) & 0xf); + i->imm = (i->w & 0xf) | ((i->w >> 4) & 0xf0); if (!(i->w & (1 << 23))) i->imm = - i->imm; i->rn = (i->w >> 16) & 0xf; @@ -929,9 +929,9 @@ "SWPB", armdpi, 0, "R%s,(R%n),R%d", /* 48+16+4 */ - "MOV%u%C%p", armhwby, 0, "R%d,(R%n%UR%M)", + "MOV%u%C%p", armhwby, 0, "R%d,(R%n%UR%s)", "MOV%u%C%p", armhwby, 0, "R%d,%I", - "MOV%u%C%p", armhwby, armfmov, "(R%n%UR%M),R%d", + "MOV%u%C%p", armhwby, armfmov, "(R%n%UR%s),R%d", "MOV%u%C%p", armhwby, armfmov, "%I,R%d", /* 48+24 */