O'Reilly logo

Windows Debugging: Practical Foundations by Dmitry Vostokov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Bytes, Words and Double Words

Using Hexadecimal Numbers

If we want to use hexadecimal numbers in C language we prefix them with 0x, for example:

a = 12;    // 12dec

a = 0xC;   // Chex

In WinDbg disassembly output and when entering commands numbers are interpreted as hexadecimal by default although we can still prefix them with 0x. If we want a number to be interpreted as decimal we prefix it with 0n, for example:

mov [a], 0n12
mov [a], C
mov [a], 0xC

or the suffix 'h' is used to disambiguate between decimal and hexadecimal, for example:

mov [a], 52h

Byte Granularity

Picture 5.1 shows the difference between bytes, words and double words in terms of byte granularity. We see that each successive size is the double of the previous. There are also quad ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required