From 5caf3246a45873c26bf1431603b669bb97b95b50 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 16 Mar 2023 11:18:37 -0400 Subject: [PATCH] Fix endianness error. --- book/src/appendix/numbers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/appendix/numbers.md b/book/src/appendix/numbers.md index 5480e2f..bfff14c 100644 --- a/book/src/appendix/numbers.md +++ b/book/src/appendix/numbers.md @@ -28,7 +28,7 @@ When disucssing numbers composed of multiple bytes, for example 0xFFA1 (composed ## Endianess -Let's take the example of two bytes sitting next to each other in memory: first at address 0 there is 0xFF and then at address 1 there is 0x16. If we want to read these two bytes together as a 16 bit number, should it be read as 0xFF16 or as 0x16FF? Even if one way or the other makes more sense to you, the answer is: it depends on the machine. In the case of the Game Boy the order is 0xFF16 - in other words the least significant byte is first in memory. This scheme is known as little-endian and its opposite is known as big-endian. +Let's take the example of two bytes sitting next to each other in memory: first at address 0 there is 0xFF and then at address 1 there is 0x16. If we want to read these two bytes together as a 16 bit number, should it be read as 0xFF16 or as 0x16FF? Even if one way or the other makes more sense to you, the answer is: it depends on the machine. In the case of the Game Boy it is read as 0x16FF - in other words the least significant byte is first in memory. This scheme is known as little-endian and its opposite is known as big-endian. ### Signed Numbers