Prerequisite – Instruction Formats
1. Two-Address Instructions :
Two-address instruction is a format of machine instruction. It has one opcode and two address fields. One address field is common and can be used for either destination or source and other address field for source.
X = (A + B) x (C + D)
MOV R1, A R1 <- M[A] ADD R1, B R1 <- R1 + M[B] MOV R2, C R2 <- M[C] ADD R2, D R2 <- R2 + D MUL R1, R2 R1 <- R1 x R2 MOV X, R1 M[X] <- R1
2. One-Address Instructions :
One-Address instruction is also a format of machine instruction. It has only two fields. One for opcode and other for operand.
X = (A + B) x (C + D)
LOAD A AC <- M[A] ADD B AC <- AC + M[B] STORE T M[T] <- AC LOAD C AC <- M[C] ADD D AC <- AC + M[D] MUL T AC <- AC x M[T] STORE X M[X] <- AC
Difference between Two-Address Instruction and One-Address Instruction :
|TWO-ADDRESS INSTRUCTION||ONE-ADDRESS INSTRUCTION|
|It has three fields.||It has only two fields.|
|It has one field for opcode and two fields for address.||It has one field for opcode and one field for address.|
|It has long instruction length as compared to one-address.||While it has shorter instruction length.|
|It is slower accessing location inside processor than memory.||It is faster accessing location inside processor than memory.|
|It generally needs two memory accesses.||It generally needs one memory accesses.|
|There may be three memory accesses needed for an instruction.||There is a single memory access needed for an instruction.|
|It can’t completely eliminate three memory access.||It eliminates two memory access completely.|
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between 3-address instruction and 2-address instructions
- Computer Organization | Instruction Formats (Zero, One, Two and Three Address Instruction)
- Difference between 3-address instruction and 1-address instruction
- Difference between 3-address instruction and 0-address instruction
- Difference between CALL and JUMP instructions
- Difference between SIM and RIM instructions in 8085 microprocessor
- Instruction Set used in SIC/XE
- Machine Instructions
- Timing diagram of MVI instruction
- Microarchitecture and Instruction Set Architecture
- Vector instruction types
- COMPARE Instructions in 8085
- ROTATE Instructions in 8085
- Various Instructions for five stage Pipeline
- Essential Registers for Instruction Execution
- Instruction Set used in simplified instructional Computer (SIC)
- Computer Organization | Different Instruction Cycles
- Instruction cycle in 8085 microprocessor
- Instruction Word Size in Microprocessor
- Timing diagram of MOV Instruction in Microprocessor
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.