© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
D. VostokovFoundations of ARM64 Linux Debugging, Disassembling, and Reversinghttps://doi.org/10.1007/978-1-4842-9082-8_5

5. Bytes, Halfwords, Words, and Doublewords

Dmitry Vostokov1  
(1)
Dublin, Ireland
 

Using Hexadecimal Numbers

If we want to use hexadecimal numbers in the C/C++ language, we prefix them with 0x, for example:
a = 12;    // 12dec
a = 0xC;   // Chex
In the GDB disassembly output, and when entering commands, numbers are interpreted as decimals by default. If we want a number to be interpreted as hexadecimal, we prefix it with 0x, for example:
mov  X0, #12
mov  X0, #0xC

Byte Granularity

Figure 5-1 shows the difference between bytes, halfwords, words, ...

Get Foundations of ARM64 Linux Debugging, Disassembling, and Reversing: Analyze Code, Understand Stack Memory Usage, and Reconstruct Original C/C++ Code with ARM64 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.