# Assembly Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
| By Amalaljoaid
A
Amalaljoaid
Community Contributor
Quizzes Created: 1 | Total Attempts: 430
Questions: 5 | Attempts: 430

Settings

• 1.

### What the value of x after exeuting following code:.model small.stack 100h.dataX db 100.codeMain procMov ax,@dataMov ds,axMov cx,3For:Dec xLoop ForMain endpEnd main

• A.

96

• B.

95

• C.

103

• D.

97

D. 97
Explanation
The code provided initializes the value of X to 100 and then enters a loop that decrements X by 1 three times. After each iteration of the loop, the value of X is printed. Therefore, the final value of X will be 97.

Rate this question:

• 2.

### What the output of the following code:Mov al,'A'repeat:add al,1cmp al,'H'JNE repeatMov ah,2Mov dl,alint 21h

• A.

ABCDEFG

• B.

ABCDEFGH

• C.

H

• D.

No output

C. H
Explanation
The code initializes the AL register with the ASCII value of 'A'. It then enters a loop where 1 is added to the AL register in each iteration. After each addition, the code compares the value in AL with the ASCII value of 'H'. If they are not equal, the code jumps back to the "repeat" label and continues the loop. Once the value in AL is equal to 'H', the code exits the loop and moves the value in AL to the AH register. Finally, the code moves the value in AL to the DL register and performs an interrupt to display the character represented by the ASCII value in DL. Therefore, the output will be 'H'.

Rate this question:

• 3.

### Following statement is legal or illegal in assembly language:cmp al,bx

• A.

Legal

• B.

Illegal

B. Illegal
Explanation
The given statement "cmp al, bx" is illegal in assembly language because the "cmp" instruction in assembly language can only compare two registers or a register and an immediate value. In this case, "al" and "bx" are both registers, but they are of different sizes (al is 8-bit and bx is 16-bit). The "cmp" instruction requires both operands to be of the same size. Therefore, the statement is not valid in assembly language.

Rate this question:

• 4.

### What the output of the following code:Mov cl,'9'Mov ah,2While: Mov dl,clInt 21h Sub cl,2Cmp cl,'5'JL while_end Jmp while While_end:

• A.

9876

• B.

97

• C.

975

• D.

98765

C. 975
Explanation
The code starts by moving the value 9 into the CL register and 2 into the AH register. Then, it enters a loop labeled "While". Inside the loop, it moves the value in the CL register into the DL register and performs an interrupt 21h, which outputs the character in the DL register. It then subtracts 2 from the value in the CL register. If the value in the CL register is less than 5, it jumps to the "While_end" label. Otherwise, it jumps back to the "While" label. The loop continues until the value in the CL register is less than 5. The output of the code is 975.

Rate this question:

• 5.

### What the value of bx register after executing following code:Mov bx,70Cmp bx,30JNG elseMov bx,90Jmp end_ifelse:Mov bx,0end_if:

• A.

100

• B.

0

• C.

70

• D.

90

D. 90
Explanation
The value of the bx register will be 90. This is because the code first moves the value 70 into the bx register. Then it compares bx with 30. Since 70 is greater than 30, the jump if not greater (JNG) condition is not met, and the code moves on to the next line. It then moves the value 90 into the bx register. Therefore, the final value of bx is 90.

Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

• Current Version
• Mar 20, 2023
Quiz Edited by
ProProfs Editorial Team
• Dec 14, 2016
Quiz Created by
Amalaljoaid