C Programming & Assembly Language Nptel Week 1 Answers

Are you looking for C Programming & Assembly Language Nptel Week 1 Answers ? All weeks solutions of this Swayam course are available here.


C Programming & Assembly Language Nptel Week 1 Answers
C Programming & Assembly Language Nptel Week 1 Answers

C Programming & Assembly Language Nptel Week 1 Answers (July-Dec 2025)

Course link: Click here to visit course on Nptel Website


Question 1. What are the values of the registers AX and BX after the following assembly code executes?

MOV AX, 0x05
MOV BX, 0x02
SUB AX, BX
XOR BX,BX
ADD AX, BX

a) AX=0x05, BX=0x02
b) AX=0x03, BX=0x02
c) AX=0x05, BX=0x00
d) AX=0x03, BX=0x00

View Answer


Question 2. Which of the following flags are set (value becomes 1) at any point in the following sequence of programs? (Assuming they are all unset initially)

MOV BX, 14
MOV AX, 3
MOV CX, AX
SUB AX, BX
ADD CX, 6
CMP BX, CX

a) Direction Flag
b) Overflow Flag
c) Sign Flag
d) Zero Flag

View Answer


Question 3. For the following instructions: When MOV AL,01 is reached it is necessarily the case that CL= 0
a) True
b) False

View Answer


Question 4. Find the value of DL (in decimal) after the following assembly instruction

MOV EAX, 0xFFFFFFFF
MOV EDX, 5
MOV ECX, 2
MUL ECX

a) 1
b) 2
c) 5
d) 10

View Answer


Question 5. If the address of element 28 is 34 (in decimal), what is the value stored in EDI after executing the following code?

MOV AL, 28
MOV EDI, START_ADDR
MOV ECX, 8
CLD
REPNE SCASB

a) 34
b) 35
c) 36
d) 37

View Answer

These are C Programming & Assembly Language Nptel Week 1 Answers

See also  C Programming & Assembly Language Nptel Week 3 Answers

Question 6. Value of ECX upon completion of the code:
a) 0
b) 1
c) 2
d) 3

View Answer


Question 7. Which of the following segments does the destination pointer point to?
a) Stack
b) Data
c) Code
d) Extra

View Answer


Question 8. After the following snippet code executes, what will be the values in Array-1, Array-2?

image

View Answer


Question 9. Which type of addressing is being done in the above question?
a) Register Direct
b) Indirect
c) Indirect with offset
d) None of the Above

View Answer


Question 10. If in the above question, the value in EAX is given to be 0x38, the complete address accessed is (in hexadecimal without the 0x):
a) 1438
b) 01438
c) 14138
d) 014138

View Answer


Question 11. Which of the following functions are performed by the RET N instruction (for the architecture used in this course)?
a) It increments N to the stack pointer
b) It decrements N from the stack pointer
c) It pops the top of stack into the EIP
d) It pushes the EIP to the top of the stack

View Answer

These are C Programming & Assembly Language Nptel Week 1 Answers


Question 12. If EAX=0x2117, ECX=0x2434, ESS=0x1041 and ESP=0xF612. Analyse the following assembly code snippet. What is the value of ESP after the following code executes?

PUSH EAX
PUSH ECX
POP DWORD PTR [ECX]
ADD EAX, ECX
POP WORD PTR [ECX]

a) 0xF610
b) 0xF611
c) 0xF612
d) 0xF613

View Answer


Question 13. Which of the following statements are true?
a) CMPS compares strings between the data and extra segments.
b) MOVSB copies data within the data segment.
c) PUSH operation places data in the extra segment.
d) POP operation removes data from the stack segment.

See also  C Programming & Assembly Language Nptel Week 2 Answers

View Answer


These are C Programming & Assembly Language Nptel Week 1 Answers

Click here for all nptel assignment answers