Page 24 - ARM 64 Bit Assembly Language
P. 24

Introduction 7

                                                       Table 1.1: Values
                                                    represented by two bits.

                                                     Bit 1   Bit 0  Value
                                                      0       0       0
                                                      0       1       1
                                                      1       0       2
                                                      1       1       3


                     separate, with different (thought similar) assembly languages. This separation of modes re-
                     sults in a much simpler assembly language which is easier to learn. AArch64 is intended to
                     compete for the desktop and server market with other high-end processors such as the Sun
                     SPARC and Intel Xeon, and as of 2018, is the most common processor in high-end smart-
                     phones and other portable devices. Because of its ubiquity and clean design, the AArch64
                     assembly language was chosen as the target for this book.


                     1.3 Computer data


                     The basic unit of data in a digital computer is the binary digit, or bit. A bit can have a value
                     of zero or one. In order to store numbers larger than 1, bits are combined into larger units.
                     For instance, using two bits, it is possible to represent any number between zero and three.
                     This is shown in Table 1.1. When stored in the computer, all data is simply a string of binary
                     digits. There is more than one way that such a fixed-length string of binary digits can be inter-
                     preted.

                     Computers have been designed using many different bit group sizes, including 4, 8, 10, 12,
                     and 14 bits. Today most computers recognize a basic grouping of 8 bits, which we call a byte.
                     Some computers can work in units of 4 bits, which is commonly referred to as a nibble (some-
                     times spelled “nybble”). A nibble is a convenient size because it can exactly represent one
                     hexadecimal digit. Additionally, most modern computers can also work with groupings of
                     16, 32, and 64 bits. The CPU is designed with a default word size. For most modern CPUs,
                     the default word size is 32 bits. Many processors support 64 bit words, which is increasingly
                     becoming the default size.


                     1.3.1 Representing natural numbers

                     A numeral system is a writing system for expressing numbers. The most common system is
                     the Hindu-Arabic number system, which is now used throughout the world. Almost from the
                     first day of formal education, children begin learning how to add, subtract, and perform other
                     operations using the Hindu-Arabic system. After years of practice, performing basic mathe-
   19   20   21   22   23   24   25   26   27   28   29