Module 1
Module 1
Module 1
BTES-302
Module-1
• In Memory-reference instruction:
– 12 bits of memory is used to specify an address and one
bit to specify the addressing mode 'I'.
Register - reference instruction
• The Register-reference instructions are represented by the
Opcode 111 with a 0 in the leftmost bit (bit 15) of the
instruction.
• A Register-reference instruction specifies an operation on or a
test of the AC (Accumulator) register.
Input-Output instruction
• Just like the Register-reference instruction, an Input-Output
instruction does not need a reference to memory and
• It is recognized by the operation code 111 with a 1 in the
leftmost bit of the instruction.
• The remaining 12 bits are used to specify the type of the
input-output operation or test performed.
Key Points About Instruction Format
Fetch Instruction
Execute
Instruction
Fetch and Decode
• Initially, the program counter PC is loaded with the address of
the first instruction in the program.
• The sequence counter SC is cleared to 0, providing a
decoded timing signal To.
• After each clock pulse, SC is incremented by one, so that the
timing signals go through a sequence T0, T1, T2, and so on.
• The microoperations for the fetch and decode phases can be
specified by the following register transfer statements.
S2 S1 S0
T0 0 1 0
T1 1 1 1
Example
AR
x0C 19
x12 x0E 34
R1 x10 45
100 x12 66
x14 0
x16 13
R1←M[AR] x18 22
RAM
R1 R1
100 66
• 3. A D D
Addressing Modes
• The way the operands are chosen during
program execution is dependent on the
addressing mode of the instruction.
• The addressing mode specifies a rule for
interpreting or modifying the address field of
the instruction before the operand is actually
referenced.
• Effective Address (EA): Effective address is
the address of the exact memory
location where the value of the operand is
present.
Types of Addressing Modes
• Register Addressing Mode
• Direct Addressing Mode
• Immediate Addressing Mode
• Register Indirect Addressing Mode
• Index Addressing Mode
• Auto Increment Mode
• Auto Decrement Mode
• Relative Addressing Mode
1. Register Addressing Mode
• Every instruction includes operands; the
operands can be a memory location, a
processor register or an I/O device. The
instruction which uses processor registers to
represent operands is the instruction
in register addressing mode.
• Here, the effective address is a register where the
value of the operand is present.
• Effective Address=Register(s)
• Below we have two instructions as our examples for
register addressing mode.
• Add R4, R3
• Load R3, R2
• In the examples above, the Add instruction uses
registers to represent both of its operands. Similarly,
the Load instruction also uses registers to represent
both of its operands. So, the instruction above uses
register addressing mode to describe the address of
the operand.
Direct Addressing Mode
• The above instructions will load the register R3, R4, R5, R6 with the contents,
present at the successive memory addresses from memory location A
correspondingly.
Implied Addressing mode
Auto Increment Addressing Mode
• In auto-increment addressing mode once the content of
the register is accessed by the instruction the register’s
content is incremented to refer the next operand.
• Symbolically it is represented as below:
– (R)+
• Here, the effective address is content of the register as it
is enclosed by parenthesis.
• The content of register which is referring to a memory
location is incremented so that it could point the next
memory location where the next operand is stored.
Auto Decrement Addressing Mode
•
• It is just opposite of auto-increment mode. In auto
decrement mode the content of the register
is decremented initially and then the decremented
content of the register is used as effective address.
• Symbolically it is presented as:
• -(R)
• The auto-increment and decrement mode help to
implement the stack structure.
Relative Addressing Mode
• In the content above we have discussed the index
addressing mode. There we were adding a constant to the
register content to refer the next operand address. In some
computer instead of a register, the program counter is used.
• The symbolic representation of relative address mode is
– X(PC)
• The effective address for it would be:
– EA = X + (PC)
• As here the operand addresses are found relative to the
program counter. That’s why it is referred to as relative
address mode.
Base Register Addressing Mode
Assignment-1
• Working and types of various Input/Output
Devices.
• Types of memory in computer
• Case study – instruction set of 8085 processor
Assignment 2