Microprocessor (ECE-3153)
Microprocessor (ECE-3153)
1A. Explain the following approaches to passing parameters to subroutine with complete
coding example specified for each approach:
i. Passing parameters by reference --- Example: To find largest among array of 8 words
ii. Passing parameters on the stack --- Example: To add two 32-bit numbers
Assume that the array and 32-bit numbers for the above approaches are defined in the code
memory and store the result in memory in both the cases.
1B. Explain with a diagram why and how the link register needs to be adjusted while handling
exceptions. How much is the offset value that needs to be adjusted for data abort exception?
1C. Explain the following assembler directives with suitable example:
i. AREA directive along with its 4 important attributes ii. EXPORT
(4+3+3)
2A. Given that a word is stored in the memory with a variable name “NUM”, write an ALP to
reverse the bits and store the result as “RES” in the memory.
2B. Assume memory access violation occurred when a program was running in user mode.
Identify the switching mode of the processor. Describe with diagram, the effect on registers
during the switch-in and switch-out between the above two modes.
2C. Describe the following indirect memory addressing modes with example for each:
i. Preindex with immediate offset
ii. Preindex writeback with scaled register offset
iii. Register postindex
(4+3+3)
3A. With relevant diagram describe the functional block diagram of ARM7TDMI processor.
3B. i. Processor is executing 4 instructions of the same type in a sequence using a 3-stage
pipeline (assuming that there are no interrupts or exceptions while executing). If an
instruction takes 3 cycles for execution, then how many cycles are needed for executing
4 instructions?
ii. If the initial register contents were R0=0x00000000, R1=0x02040608,
R2=0x10305070. Assume R0 is the result register, after one of the operation was
performed on R1 and R2, R0 has been modified to 0x12345678. What was the operation
performed on the contents of R2 and R1?