CISC 3310 MWO Exam 1 Fall 2017 16. A processor executes the 4-byte jal x1, Proce
ID: 3708559 • Letter: C
Question
CISC 3310 MWO Exam 1 Fall 2017 16. A processor executes the 4-byte jal x1, Procedurelabel instruction. As a result x1-4-x, where X is a register. Which of the following is X? (16A) SP (Stack Pointer) (16B). FP (Frame Pointer) (16c). PC (Program Counter) (160) RA (Return Address) 17, Just after a processor executes the jal x1, Procedurelabel instruction, a procedure will start to execute. What is the address of the procedure? (17A). PC+ Procedurelabel (178) Procedurelabel (17C). SP (17D) PC+4 18. Which instruction will zero out all bits of 64-bit register x7 except for bit 5 (bit 5 is to remain unchanged)? (Bits are numbered from left to-right from 63-to-0 (or 63,62, (18A) addi x7, x7, 32 6.54,3,2,1,o)) BB), andi 17, 17, 32 (18C). xori x7, x7, 32 (180) andi x7, x7, 5 which instruction will toggle bit 3 (if bit 3 is a 1 make it ?, if a 0 make bit 3 a 1) of 64-bit register 16, leaving all other bits of x6 unchanged? (Bits are numbered from left-to-right from 63-to-0) (19A) andi x6, x6, 3 (198) andi x6, x6, 8 (19c), xori x6, x6, 3 (19b), xori x6, x6,8 19 20. Which instruction will multiple 64-bit register x4 by 47 (20A) srli x4, x4, 2 (208) srlx4, x4, 4 (20C) sll x4, x4, 2 (200), s x4, x4, 4 Page 4 of 4Explanation / Answer
Answer is as follows :
a) Correct option is PC i.e. Program Counter
becaue it stores the address of next instruction bu adding the contencts of PC to 4.
b) Correct Option is PC + 4
Because the procedure label is calculated by PC after jump at that label
c) The correct Option is andi x7,x7,32
It perform the AND operation on all bits with 0 except 5 bit i.e. calculated by 25 = 32.
d) The Correct option is xori x6,x6,3
it change the bit 3 except all other bits.
e) The correct option is slli x4,x4,4
that multiply the contents of x4 with 4 and store back to x4.
if there is any query please ask in comments..