Navi

Instruction Representation

Within the computer, each instruction is represented by a sequence of bits. The instruction is divided into fields, corresponding to the constituent elements of the instruction. During instruction execution, an instruction is read into an instruction register (IR) in the CPU. The CPU must be able to extract the data from the various instruction fields to perform the required operation.

It is difficult for both the programmer and the reader of textbooks to deal with binary representations of machine instructions. Thus, it has become common prac­tice to use a symbolic representation of machine instructions. Opcodes are represented by abbreviations, called mnemonics, that indicate the operation. Common examples include

TABLE 1
ADDAdd
SUBSubtract
MPYMultiply
DIVDivide
LOADLoad data from memory
STORStore data to memory
Operands are also represented symbolically. For example, the instruction
ADD R, Y
may mean add the value contained in data location Y to the contents of register R. In this example. Y refers to the address of a location in memory, and R refers to a particular register. Note that the operation is performed on the contents of a loca­tion, not on its address.
Simple Instruction Format :


Instruction Type:
Data processing : Arithmetic and logic instructions
Data storage (main memory) : Memory instructions
Data movement (I/O) : I/O instructions
Program flow control : Test and branch instructions



0 comments: