Page 158 - Handout of Computer Architecture (1)..
P. 158
Figure 13.13 Thumb- 2 Encoding
■ With compilers optimized for performance, Thumb- 2 performance on the benchmark suite was 98% of
ARM performance and 125% of original Thumb performance. These results confirm that Thumb- 2 meets
its design objectives. Figure 13.13 shows how the new 32-bit Thumb instructions are encoded. The
encoding is compatible with the existing Thumb unconditional branch instructions, which has the bit
pattern 11100 in the five leftmost bits of the instruction.
No other 16-bit instruction begins with the pattern 111 in the three leftmost bits, so the bit patterns
11101, 11110, and 11111 indicate that this is a 32-bit Thumb instruction.
ASSEMBLY LANGUAGE
A processor can understand and execute machine instructions. Such instructions are simply binary
numbers stored in the computer. If a programmer wished to program directly in machine language, then
it would be necessary to enter the program as binary data. Consider the simple BASIC statement
N = I + J + K
Suppose we wished to program this statement in machine language and to initialize I, J, and K to 2, 3, and
4, respectively. This is shown in Figure 13.14a. The program starts in location 101 (hexadecimal). Memory
is reserved for the four variables starting at location 201. The program consists of four instructions:
1. Load the contents of location 201 into the AC.
2. Add the contents of location 202 to the AC.
3. Add the contents of location 203 to the AC.
4. Store the contents of the AC in location 204. This is clearly a tedious and very error- prone process. A
slight improvement is to write the program in hexadecimal rather than binary notation (Figure 13.14b).
We could write the program as a series of lines. Each
158

