0

I've learned first that I've to add a "h" as suffix to a hexadecimal number for the characterize it as hex-number.

Now I've seen that some programmers use a "0x" prefix. Obviously for the same task.

I've tinkered a bit with the notations:

mov eax, 0x1a;

... and ...

mov eax, 1ah;

The result seems to be equal in both cases.

So my question:

**Are both notations are basically the same. Is it just a matter of preference which one I choose?

Or exists a significant difference?**

cluster1
  • 4,968
  • 6
  • 32
  • 49
  • 1
    Depends on the `assembler`, they are just ways to represent same value – Prateek Gupta Sep 18 '16 at 08:21
  • Specifically, [my answer on the duplicate-target](http://stackoverflow.com/a/37152498/224132) compares 0xDEADBEEF vs. 0DEADBEEFh support in various x86 assemblers. Mostly it's only Windows / DOS assemblers that don't support 0xDEADBEEF and require the trailing H. – Peter Cordes Sep 18 '16 at 08:29
  • Okay. Got it. It's some platform-dependent thing. Like with line breaks ... – cluster1 Sep 18 '16 at 08:33

0 Answers0