Index: /trunk/include/VBox/dis.h
===================================================================
--- /trunk/include/VBox/dis.h	(revision 101545)
+++ /trunk/include/VBox/dis.h	(revision 101546)
@@ -505,5 +505,6 @@
 
 
-/** @name Flags for use with DISFormatYasmEx(), DISFormatMasmEx() and DISFormatGasEx().
+/** @name Flags for use with DISFormatYasmEx(), DISFormatMasmEx(),
+ *        DISFormatGasEx() and DISFormatArmV8Ex().
  * @{
  */
@@ -526,14 +527,24 @@
 /** Put spaces between the bytes. */
 #define DIS_FMT_FLAGS_BYTES_SPACED          RT_BIT_32(7)
+/** Gives the width (in opcode bytes) of the opcode bytes area if on the left
+ * side. If zero, then a default of 7 will be used. */
+#define DIS_FMT_FLAGS_BYTES_WIDTH_MASK      UINT32_C(0x00001f00)
+/** Shift count of the bytes width field. */
+#define DIS_FMT_FLAGS_BYTES_WIDTH_SHIFT     8
+/** Helper that makes shift the width count. */
+#define DIS_FMT_FLAGS_BYTES_WIDTH_MAKE(a_cb) ((uint32_t)(a_cb) << DIS_FMT_FLAGS_BYTES_WIDTH_SHIFT)
 /** Display the relative +/- offset of branch instructions that uses relative addresses,
  * and put the target address in parenthesis. */
-#define DIS_FMT_FLAGS_RELATIVE_BRANCH       RT_BIT_32(8)
+#define DIS_FMT_FLAGS_RELATIVE_BRANCH       RT_BIT_32(13)
 /** Strict assembly. The assembly should, when ever possible, make the
  * assembler reproduce the exact same binary. (Refers to the yasm
  * strict keyword.) */
-#define DIS_FMT_FLAGS_STRICT                RT_BIT_32(9)
+#define DIS_FMT_FLAGS_STRICT                RT_BIT_32(14)
+/** C-style hex formatting (0x01), rather than assembly style (001h). */
+#define DIS_FMT_FLAGS_C_HEX                 RT_BIT_32(15)
+
 /** Checks if the given flags are a valid combination. */
 #define DIS_FMT_FLAGS_IS_VALID(fFlags) \
-    (   !((fFlags) & ~UINT32_C(0x000003ff)) \
+    (   !((fFlags) & ~UINT32_C(0x0000ffff)) \
      && ((fFlags) & (DIS_FMT_FLAGS_ADDR_RIGHT  | DIS_FMT_FLAGS_ADDR_LEFT))  != (DIS_FMT_FLAGS_ADDR_RIGHT  | DIS_FMT_FLAGS_ADDR_LEFT) \
      && (   !((fFlags) & DIS_FMT_FLAGS_ADDR_COMMENT) \
Index: /trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp
===================================================================
--- /trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp	(revision 101545)
+++ /trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp	(revision 101546)
@@ -367,9 +367,8 @@
                  } \
             } while (0)
-/** @todo add two flags for choosing between %X / %x and h / 0x. */
-#define PUT_NUM_8(num)  PUT_NUM(4,  "0%02xh", (uint8_t)(num))
-#define PUT_NUM_16(num) PUT_NUM(6,  "0%04xh", (uint16_t)(num))
-#define PUT_NUM_32(num) PUT_NUM(10, "0%08xh", (uint32_t)(num))
-#define PUT_NUM_64(num) PUT_NUM(18, "0%016RX64h", (uint64_t)(num))
+#define PUT_NUM_8(num)  PUT_NUM(4,  !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%02xh"     : "%#04x",     (uint8_t)(num))
+#define PUT_NUM_16(num) PUT_NUM(6,  !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%04xh"     : "%#06x",     (uint16_t)(num))
+#define PUT_NUM_32(num) PUT_NUM(10, !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%08xh"     : "%#010x",    (uint32_t)(num))
+#define PUT_NUM_64(num) PUT_NUM(18, !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%016RX64h" : "%#018RX64", (uint64_t)(num))
 
 #define PUT_NUM_SIGN(cch, fmt, num, stype, utype) \
@@ -386,8 +385,8 @@
                 } \
             } while (0)
-#define PUT_NUM_S8(num)  PUT_NUM_SIGN(4,  "0%02xh", num, int8_t,  uint8_t)
-#define PUT_NUM_S16(num) PUT_NUM_SIGN(6,  "0%04xh", num, int16_t, uint16_t)
-#define PUT_NUM_S32(num) PUT_NUM_SIGN(10, "0%08xh", num, int32_t, uint32_t)
-#define PUT_NUM_S64(num) PUT_NUM_SIGN(18, "0%016RX64h", num, int64_t, uint64_t)
+#define PUT_NUM_S8(num)  PUT_NUM_SIGN(4,  !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%02xh"     : "%#04x",     num, int8_t,  uint8_t)
+#define PUT_NUM_S16(num) PUT_NUM_SIGN(6,  !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%04xh"     : "%#06x",     num, int16_t, uint16_t)
+#define PUT_NUM_S32(num) PUT_NUM_SIGN(10, !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%08xh"     : "%#010x",    num, int32_t, uint32_t)
+#define PUT_NUM_S64(num) PUT_NUM_SIGN(18, !(fFlags & DIS_FMT_FLAGS_C_HEX) ? "0%016RX64h" : "%#018RX64", num, int64_t, uint64_t)
 
 #define PUT_SYMBOL_TWO(a_rcSym, a_szStart, a_chEnd) \
@@ -457,5 +456,8 @@
 
         /* Some padding to align the instruction. */
-        size_t cchPadding = (7 * (2 + !!(fFlags & DIS_FMT_FLAGS_BYTES_SPACED)))
+        uint32_t cbWidth = (fFlags & DIS_FMT_FLAGS_BYTES_WIDTH_MASK) >> DIS_FMT_FLAGS_BYTES_WIDTH_SHIFT;
+        if (!cbWidth)
+            cbWidth = 7;
+        size_t cchPadding = (cbWidth * (2 + !!(fFlags & DIS_FMT_FLAGS_BYTES_SPACED)))
                           + !!(fFlags & DIS_FMT_FLAGS_BYTES_BRACKETS) * 2
                           + 2;
@@ -595,10 +597,10 @@
                 {
                     Assert(pDis->cbInstr >= 3);
-                    PUT_SZ("db 00fh, 01fh,");
-                    PUT_NUM_8(MAKE_MODRM(pDis->x86.ModRM.Bits.Mod, pDis->x86.ModRM.Bits.Reg, pDis->x86.ModRM.Bits.Rm));
-                    for (unsigned i = 3; i < pDis->cbInstr; i++)
+                    PUT_SZ("db 00fh, 01fh");
+                    for (unsigned off = 2; off < pDis->cbInstr; off++)
                     {
                         PUT_C(',');
-                        PUT_NUM_8(0x90); /// @todo fixme.
+                        PUT_C(' ');
+                        PUT_NUM_8(pDis->Instr.ab[off]);
                     }
                     pszFmt = "";
