Coa Module 2
Coa Module 2
bits are not handled individually. The usual approach is to deal with
them in groups of fixed size.
For this purpose, the memory is organized so that a group of n bits
the lower byte addresses are used for the less significant
bytes(the right most bytes)of the word.
addresses.
• if the word length is 16(2 bytes), aligned words begin
address.
• In many applications, it is necessary to handle character
the string:
shown in the figure(b). In this case processor first reads the contents of
memory location A, then requests a second read operation using the
value B as an address to obtain the operand.
The register or memory location that contains the address of an
Effective Address:
EA= [Ri]+[Rj]
Syntax:
X(Ri,Rj)
EA=[Ri]+[Rj]+X
1) Autoincrement Mode
2) Autodecrement Mode
Autoincrement mode:
The effective address of an operand is contents of register specified in
the instruction. After accessing the operand, the contents of the register
are automatically incremented to point to the next item in the list.
We denote autoincrement mode by putting the specified register in
parentheses, to show that contents of register are used as the effective
address.
Subtract #4,SP
Move NEWITEM,(SP)
These two instructions move the word from location NEWITEM onto
the top of the STACK decrementing the stack pointer before the
move.
The stack pointer is loaded initially with the address value 2004.
an item off an empty stack the single instruction push and pop
operations can be replaced by the instruction sequences shown in
the figure.
RETURN Instruction:
Loads the program counter(PC) with the contents of link register
efficient.
Figure shows how the program for adding a list of numbers can be
implemented as subroutine.
created at the time the subroutine is entered and freed up when the
subroutine returns control to the calling program. Such a space is
called a stack frame.
If the subroutine requires more space for local memory variables,
First Possibility:
The processor hardware ignores the interrupt-request line until
the execution of the first instruction of interrupt-service routine
has been completed.
Then, by using interrupt disable instruction as the first
instruction in the interrupt-service routine.
Typically the interrupt-enable instruction will be the last
instruction in the interrupt-service routine.
92
interrupts. Friday, December 13, 20
24
Vectored Interrupts
To reduce the time involved in the polling process, a device
requesting an interrupt may identify itself directly to the
processor.
Then, the processor can immediately start executing the
corresponding interrupt-service routine.
A device requesting an interrupt can identify itself by sending
a special code to the processor over the bus.
This enables the processor to identify individual devices even
if they share a single interrupt-request line.
The code supplied by the device may represent the starting
address of the interrupt-service routine for that device.
The code length is typically in the range of 4 to 8 bits.