Page 35 - ARM 64 Bit Assembly Language
P. 35
18 Chapter 1
n
n
the result of x b + C(y b ) will always be greater than or equal to b , but less than 2 × b .This
means that the result of x b + C(y b ) will always begin with a ‘1’ in the n + 1 digit position.
n
n
n
Dropping the initial ‘1’ is equivalent to subtracting b , making the result x − y + b − b or
just x − y, which is the desired result. This can be reduced to a simple procedure. When y and
x are both positive and y ≤ x, there are four steps to be performed:
1. pad the subtrahend (y) with leading zeros, as necessary, so that both numbers have the
same number of digits (n)
2. find the b’s complement of the subtrahend,
3. add the complement to the minuend, and
4. discard the leading ‘1’.
The complement notation provides a very easy way to represent both positive and negative
integers using a fixed number of digits, and to perform subtraction by using addition. Since
modern computers typically use a fixed number of bits, complement notation provides a very
convenient and efficient way to store signed integers and perform mathematical operations on
them. Hardware is simplified because there is no need to build a specialized subtractor circuit.
Instead a very simple complement circuit is built and the adder is used to perform subtraction
as well as addition.
1.3.4 Representing characters
In the previous section, we discussed how the computer stores information as groups of bits,
and how we can interpret those bits as numbers in base two. Given that the computer can only
store information using groups of bits, how can we store textual information? The answer is
that we create a table, which assigns a numerical value to each character in our language.
Early in the development of computers, several computer manufacturers developed such ta-
bles, or character coding schemes. These schemes were incompatible and computers from
different manufacturers could not easily exchange textual data without the use of translation
software to convert the character codes from one coding scheme to another.
Eventually, a standard coding scheme, known as the American Standard Code for Information
Interchange (ASCII) was developed. Work on the ASCII standard began on October 6, 1960,
with the first meeting of the American Standards Association’s (ASA) X3.2 subcommittee.
The first edition of the standard was published in 1963. The standard was updated in 1967
and again in 1986. Within a few years of its development, ASCII was accepted by all major
computer manufacturers, although some continue to support their own coding schemes as
well.
ASCII was designed for American English, and does not support some of the characters that
are used by non-English languages. For this reason, ASCII has been extended to create more