Instruction Formats: T.Avinash 237R1A05C2 Cse-B
Instruction Formats: T.Avinash 237R1A05C2 Cse-B
T.Avinash
237R1A05C2
CSE-B
2
AGENDA
Introduction
What is an Instruction Format
Types of instruction formats
Description about the instruction formats
Final tips & takeaways
WHAT IS AN INSTRUCTION
FORMAT
• An instruction is a binary pattern that
specifies an operation to be performed
by the computer.
• It consists of three fields: a 1-bit field for
indirect addressing symbolized by I, a 4-
bit operation code(opcode), and an 11-
bit address field.
INSTRUCTION FORMATS…
TYPES OF INSTRUCTION
FORMATS
• Three-Address Instructions
• Two-Address Instructions
• One Address Instructions
• Zero Address Instructions
THREE ADDRESS INSTRUCTION
• Computers with three-address instruction formats can use
each address field to specify either a processor register or
a memory operand.
• The program in assembly language that evaluates X = (A
+ B) * (C + D) is shown below, together with comments
that explain the register transfer operation of each
instruction.
• The advantage of the three-address format is that it
results in short programs when evaluating arithmetic
expressions. The disadvantage is that the binary-coded
instructions require too many bits to specify three
addresses.
TWO ADDRESS INSTRUCTION
• • Two-address instructions are the most common in
commercial computers. Here again each address field can
specify either a processor register or a memory word. The
program to evaluate
X = (A + B) * (C + D) is as follows:
ONE ADDRESS INSTRUCTION
• One-address instructions use an implied accumulator (AC)
register for all data manipulation. For multiplication and
division there is a need for a second register.
• However, here we will neglect the second register and
assume that the AC contains the result of all operations.
The program to evaluate X = (A + B) * (C + D) is
ZERO ADDRESS INSTRUCTION
• A stack-organized computer does not use an address field
for the instructions ADD and MUL. The PUSH and POP
instructions, however, need an address field to specify
the operand that communicates with the stack. The
following program shows how X = (A + B)*(C + D) will be
written for a stack-organized computer. (TOS stands for
top of stack.)
10