Microprocessor 4. Philippe Darche

Чтение книги онлайн.

Читать онлайн книгу Microprocessor 4 - Philippe Darche страница 7

Microprocessor 4 - Philippe Darche

Скачать книгу

and the instruction set of a generic component. Then, additional notions linked to the instruction set and execution are discussed in the third chapter. This primarily involves the notion of illegal, invalid, reserved and trusted instructions, the notion of memory alignment, orthogonality and the symmetry of the instruction set, as well as the notion of pure, re-entrant and relocatable code. Then, the subjects of execution time, memory requirements, execution modes, portability and virtualization will be discussed. Finally, it ends with aspects that are very important in industry, their hardware and software compatibilities, how to measure execution performances and the criteria for choosing a microprocessor or MPU (MicroProcessor Unit). The last two chapters study two ways of altering execution flow. These are the concepts of the sub-program and interruption.

      NOTE.– The choice has been made to write the names of registers in upper case in the text and figures but in lower case in assembly language, since the norm (IEEE 1985) does not specify which case to use. The name of the instructions is in lower case in the text and programs (MIPS (Microprocessor without Interlocked Pipeline Stages) style), sometimes also in upper case (Motorola or Arm® style). Moreover, the examples given refer to current and older microprocessors and computer processors for the purposes of instruction. This chapter is not intended to be exhaustive. It mainly presents the functions of the first MPUs. It will be completed by the following two books. The instructions cited will be complemented by MPU documentation or in a specialist work.

      1

      Coding and Addressing Modes

      This chapter focuses on two important characteristics of Instruction Set Architecture (ISA) (cf. § V1-3.5), which are instruction encoding and addressing modes.

      The instruction1 is represented in a computer using a binary word in the format i bits, a multiple of the format n of the data and, in general, a multiple of the byte. We use the expression machine code to mean all those binary words representing the instruction to be executed. Instruction encoding depends on the architecture of the target processor. It is formed at least of an instruction code and, potentially, of one or more operands as Figure 1.1 illustrates.

      Figure 1.1. Breakdown of an instruction

      Figure 1.2. An example of the structure of an operation code

      Figure 1.3. Format of an instruction with two operands

      Table 1.1 shows the different address combinations for IA-32 instruction set (IA for Intel Architecture, also called i386). Combinations not indicated are not possible either due to the architecture or to their incoherence. We cite impossible memory (to) memory combinations in most architectures, as it is necessary to pass through a register and an immediate-register or immediate-memory, which cannot be done because of the impossibility of allocating a value to a constant.

      Table 1.1. Possible address combinations in family IA-32

Operands
Destination Source
Register Immediate
Memory Immediate
Register Register
Memory Register
Register Memory

      Figure 1.4. An instruction with several operands

      By construction, the format of the instruction is fixed (fixed length), short or long, or variable (variable length). The value of a fixed format is a multiple of the byte in general. Its value will have a direct consequence for the incrementation value of the Program Counter (PC, cf. § V3-3.1.3). The benefit is that it will be possible to align the instructions (cf. § 3.1.2), thus accelerating memory reading or writing by reducing the number of memory accesses. The division of the instruction into

Скачать книгу