In the computer architecture, there is a concept of Addressing mode. This is a different ways to specify the place where an operand resides in memory or register. It means that operand(data) can exist in memory or register. It can give some versatility to the user.
This is a definition of the place that actual address of the location containing the referenced operand.
There are many types of addressing mode however, we just use some of that.
This mode doesn't give any information. It consider there must be data(operand).
In the Instruction, it contains operand field and it contains the actual operand value. It means that this instruction doesn't access memory. So, it will be fast but, it has a problem that instruction has just 32-bits so, it will limit available numbers.
This addressing mode has register's address. If this instruction execute, it just uses their value. In other words, this instruction doesn't access memory.
This addressing mode has register's address and this register has real address of data in memory. So, it will access memory once.
Insturction has the address part and in this part, there is effective address in memory. It means there is a memory access at once.
There is a address field and it gives the address where the effective address is stored. It means that there is memory access at twice. If memory access occured, this insturction takes more times.
PC is Program Counter. It saved the address or next instruction. This insturction mode can modify the value of PC. By doing that, we can use the concept of Jump. If the next instruction's address is changed, we can express while, for, if expression in high-level language.
It is similar with PC Relative address mode. It use base register and offset. The effective address value is sum of base register and offset in the address field of instruction.
This concept is important in computer architecture. If we choose some computer, we expect this computer do everything that other computers can.
There are three categories that should be covered.
- Arithmetic / Logical Expression
- Data Transfer (including I/O)
- Control Transfer
The structure of computer must covered these categories.
The computer instruction are orthogonal if they don't overlap, or perform same function. In other words, we must covered all instructions but, in this way, we don't overlap.
The computer must covered all of them. However, it will be better as simple as possible. So, we can express many instructions to using few instructions. For example, Subtract instruction can be expressed in Add instruction and 2's complement. In this way, we can use more Opcode. Also, it related to CISC and RISC.
CISC Complex Instruction Set Computer
In the first computer architecture, more people considered that it is better computer that it can have more instruction and functions. However, if a computer has more complexity rather than other computer, it will be more complexity structure, finally, it will increase total time to calculate.
RISC Reduced Instruction Set Computer
Over time, people think the time complexity is more important so, they tried to reduce computer's function by replacing other functions.
It is related to the transfer of data. Always data are located in memory. If we want to use them, we must access to memory and get to use. So, data trasfer is important point of the computer.
We always use high-level programming language. In our high-level language, we usally use for, while, if statement. These have specific case to move other instruction, and there are many cases. So, we should use jump concept. This concept is related to control transfer instruction. For that reason, it is important to computer architecture.