NAME: Fuldeore Srushti Vinod Subject: Coa ID: 201071908 BRANCH: Computer
NAME: Fuldeore Srushti Vinod Subject: Coa ID: 201071908 BRANCH: Computer
PUSH A TOP = A
PUSH B TOP = B
PUSH C TOP = C
PUSH D TOP = D
This use a implied ACCUMULATOR register for data manipulation. One operand
is in accumulator and other is in register or memory location. Implied means that
the CPU already know that one operand is in accumulator so there is no need to
specify it.
Expression: X = (A+B)*(C+D)
AC is accumulator
M[] is any memory location
M[T] is temporary location
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 * M[T]
STORE X M[X] = AC
MOV R2, C R2 = C
ADD R2, D R2 = R2 + D
MUL R1, R2 R1 = R1 * R2
MOV X, R1 M[X] = R1
4. Three Address Instructions –
This has three address field to specify a register or a memory location. Program
created are much short in size but number of bits per instruction increase. These
instructions make creation of program much easier but it does not mean that
program will run much faster because now instruction only contain more
information but each micro operation (changing content of register, loading
address in address bus etc.) will be performed in one cycle only.
Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location
1. Fetch: Read the next instruction from memory into the processor.
2. Execute: Interpret the opcode and perform the indicated operation.
3. Interrupt: If interrupts are enabled and an interrupt has occurred, save the
current process state and service the interrupt.
4. Indirect Cycle: May require memory access to fetch operands Indirect.
Addressing requires more memory accesses can be thought of as additional
instruction sub cycle.
The execution cycle for a particular instruction may involve more than one
reference to memory. Also, instead of memory references, an instruction may
specify an I/O operation. For any given instruction cycle, some states may be
null and others may be visited more than once.
The states can be described as follows:
Instruction address calculation (iac): Determine the address of the next
instruction to be executed. Usually, this involves adding a fixed number to the
address of the previous instruction
Registers are a type of computer memory used to quickly accept, store, and
transfer data and instructions that are being used immediately by the CPU. The
registers used by the CPU are often termed as Processor registers.
A processor register may hold an instruction, a storage address, or any data (such
as bit sequence or individual characters).
The computer needs processor registers for manipulating data and a register for
holding a memory address. The register holding the memory location is used to
calculate the address of the next instruction after the execution of the current
instruction is completed.
Types of Registers:
iv. Condition codes - Condition codes are bits set by the processor
hardware as the result of operations
2. Control and status registers: Used by the control unit to control the
operation of the processor and by privileged, operating system programs
to control the execution of programs.