Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Section B (Use a separate answer book for this Section) Name a special register

ID: 3712778 • Letter: S

Question

Section B (Use a separate answer book for this Section) Name a special register in the Central Processing Unit (CPU) that contains the address of the next assembly instruction to be executed 2a i) i) Starting with the address in the register named in part i), outline a few steps to illustrate how the instruction is executed in the CPU. ii) Name two generic instructions by which assembly programmers can change the content of register named in part i). What is the net effect of changing the register content to the program execution'? b Desigen the insrueion format by using he minimum number ofbis to support pport the following features: An instruction set of 8 different operations. Each operation allows at most 2 operands where both operands can be stored in general-purposed registers or one operand is in a register and the other one in memory i) ii) 4 general-purposed registers, and ii) 1K addressable memory locations.

Explanation / Answer

ANS:-

i) PC - PC stands for Program Counter is a register which holds the location of the next instruction to be executed from memory.

Register updation : This register is automatically incremented to the next instruction when the current instruction is being executed.

Data copy instruction or data transfer instruction can be used to change the content of register explicitly.

Eg: ADD, SUB,MOV...

ii) Call instruction: This instruction interrupts the flow of a program by passing the control to a subroutine. CALL passes the control to a program name that is written after the CALL keyword. The processing state information is saved when a CALL is made and this information is restored when the function returns back to the calling function.

The processing state info is:

pending control structures, command address settings(current and saved locations), pending condition handler information, elapsed time clock, trace options, return address, etc.,.

All the above information is stored in stack.

Return instruction: This instruction returns the control from the subroutine back to the calling program with/without a value.

iii) The programmer need not take any extra care for saving/storing the state of process before calling any function as the processor stores all the neccessary information so that it knows where it should start over again to continue the process after the subroutine returns.

iv) An interrupt is generated by hardware where as a function call is program generated.

The function call or subroutines are programmed by the programmer where as the interrupts are physically programmed or designed inside the hardware for sake for other hardware.

We can know when a function call happens and also why but this is not the same case with interrupts as they can occur at any time.

For interrupt,, the return instruction is RETI where as it is RET for function call. RETI clears the source of interrupt.

Function call can have a return value but an interrupt cannot have any return value.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote