Computer Architecture & Assembly Language MCQs with Answers
Practice important Computer Architecture & Assembly Language MCQs with answers and explanations.
Chapter: 7
Q181:
Which register is used to hold the value when using the STOS instruction to store data?
A. SI
B. DI
C. AL or AX
D. CX
Correct Answer:
C
Chapter: 7
Q182:
What is the purpose of the printstr subroutine?
A. To calculate string length
B. To print a string to the screen
C. To clear the screen
D. To compare two strings
Correct Answer:
B
Chapter: 7
Q183:
What register does the strlen subroutine use to return the length of the string?
A. BX
B. CX
C. AX
D. DX
Correct Answer:
C
Chapter: 7
Q184:
How does the scrollup subroutine handle the screen's data?
A. Moves data from the bottom to the top of the screen
B. Moves data from the top to the bottom of the screen
C. Moves data from left to right
D. Moves data from right to left
Correct Answer:
A
Chapter: 7
Q185:
What does the cmp cx, ax instruction do in the strcmp subroutine?
A. Compares the length of two strings
B. Compares the content of two strings
C. Compares the attributes of two strings
D. Compares the segment registers
Correct Answer:
A
Chapter: 7
Q186:
In the scrollup subroutine, which register is used to hold the number of lines to clear?
A. AX
B. BX
C. CX
D. DX
Correct Answer:
C
Chapter: 7
Q187:
How does the LES instruction operate?
A. Loads ES and DS from memory
B. Loads DS and ES from memory
C. Loads DS and SI from memory
D. Loads ES and DI from memory
Correct Answer:
D
Chapter: 7
Q188:
What is the result if the strings compared by strcmp are different?
A. AX is set to 1
B. AX is set to 0
C. The program halts
D. No change in AX
Correct Answer:
B
Chapter: 7
Q189:
What is the main advantage of using REP MOVSB for screen scrolling?
A. It uses less memory
B. It minimizes the time required for scrolling
C. It simplifies the code
D. It increases the CPU usage
Correct Answer:
B
Chapter: 7
Q190:
What is the function of the cld instruction in the printstr subroutine?
A. Clears the screen
B. Sets the direction flag to auto-increment
C. Loads a value into a register
D. Compares two strings
Correct Answer:
B
Chapter: 7
Q191:
What is the purpose of the jmp start instruction in the provided code examples?
A. To jump to the printstr subroutine
B. To start execution of the main program
C. To jump to a label for screen clearing
D. To return from a subroutine
Correct Answer:
B
Chapter: 7
Q192:
Which instruction is used to scroll the screen up by a given number of lines?
A. MOVSW
B. SCASB
C. REP MOVSB
D. REP STOSW
Correct Answer:
C
Chapter: 7
Q193:
What does the shl instruction do in the context of printstr?
A. Shifts the value in AX left by one bit
B. Shifts the value in AX right by one bit
C. Adds a value to AX
D. Multiplies the value in AX
Correct Answer:
A
Chapter: 7
Q194:
How does the scrolldown subroutine differ from scrollup?
A. It uses std for auto-decrement mode
B. It uses cld for auto-increment mode
C. It clears lines at the top of the screen
D. It scrolls data from top to bottom
Correct Answer:
A
Chapter: 7
Q195:
In the strlen subroutine, what happens if the string length is zero?
A. AX is set to 0
B. AX is set to 1
C. The program halts
D. The subroutine returns immediately
Correct Answer:
A
Chapter: 7
Q196:
What type of register pair is involved in the LES and LDS instructions?
A. Segment
B. Offset
C. General purpose
D. General purpose
Correct Answer:
A
Chapter: 8
Q197:
What does an interrupt allow the processor to do?
A. Process instructions sequentially
B. Handle events from external sources
C. Increase processing speed
D. Ignore system errors
Correct Answer:
B
Chapter: 8
Q198:
What type of interrupt is generated internally by the processor?
A. Software interrupt
B. Hardware interrupt
C. Real-time interrupt
D. External interrupt
Correct Answer:
A
Chapter: 8
Q199:
What is the primary function of the INT instruction?
A. Terminate a program
B. Call a subroutine
C. Generate an interrupt
D. Execute a loop
Correct Answer:
C
Chapter: 8
Q200:
Which register is pushed onto the stack first during an interrupt?
A. IP
B. CS
C. FLAGS
D. AX
Correct Answer:
C