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 practice to use a symbolic representation of machine instructions. Opcodes are represented by abbreviations, called mnemonics, that indicate the operation. Common examples include
ADD | Add |
SUB | Subtract |
MPY | Multiply |
DIV | Divide |
LOAD | Load data from memory |
STOR | Store 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 location, not on its address.
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
Data storage (main memory) : Memory instructions
Data movement (I/O) : I/O instructions
Program flow control : Test and branch instructions
0 comments: