Assembly Programming Language Quiz - 1

Description: Assembly Programming Language Quiz - 1
Number of Questions: 10
Created by:
Tags: assembly
Attempted 0/10 Correct 0 Score 0

What is the value of Zero (Z) flag after the instruction: SUB AX,AX

  1. Set

  2. Cleared

  3. Unknown

  4. none of the above


Correct Option: A
Explanation:

To solve the question, the user needs to know about the Zero flag and the SUB instruction in assembly language.

The Zero flag is a status flag in the processor's flag register that indicates whether the result of an arithmetic or logical operation is zero. When a program performs a subtraction operation, the Zero flag is set if the result of the operation is zero, and it is cleared otherwise.

The SUB instruction is used for subtraction operations in assembly language. In the instruction SUB AX, AX, the value of register AX is subtracted from itself, resulting in a zero value.

Now, let's go through each option and explain why it is right or wrong:

A. Set: This option is correct. Since the result of the SUB AX, AX operation is zero, the Zero flag is set.

B. Cleared: This option is incorrect. The Zero flag is set because the result of the SUB AX, AX operation is zero.

C. Unknown: This option is incorrect. The Zero flag is set because the result of the SUB AX, AX operation is zero.

D. None of the above: This option is incorrect because option A is the correct answer.

Therefore, The Answer is: A. Set

If you add positive number plus negative number the over flow flag will be set if:

  1. The result is negative

  2. The result is positive

  3. The result is zero

  4. There is no over flow when adding ( ve) (-ve) numbers


Correct Option: D

AI Explanation

To answer this question, we need to understand how overflow occurs when adding positive and negative numbers.

Overflow occurs when the result of an arithmetic operation exceeds the maximum value that can be represented in the given number format. In the case of adding positive and negative numbers, the overflow flag will only be set if the result is outside the range of representable values.

When adding a positive number and a negative number, the result can be positive, negative, or zero, depending on the magnitudes of the numbers. However, the overflow flag will not be set because the result will always be within the range of representable values for signed numbers.

Therefore, option D is correct because there is no overflow when adding positive and negative numbers.

  1. LOOP

  2. MUL, DIV, CBW

  3. ADD, SUB

  4. none of the above


Correct Option: A
Explanation:

To determine which instruction(s) can be performed only in the CX register, we need to understand the purpose and limitations of the CX register.

The CX register is a 16-bit general-purpose register in the x86 architecture. It is commonly used as a loop counter in assembly language programming. The CX register can be modified by instructions such as LOOP and is used for controlling the number of iterations in a loop.

Now let's go through each option and explain why it is right or wrong:

A. LOOP: This option is correct. The LOOP instruction is used to create a loop in assembly language programming. It decrements the CX register by 1 and jumps to the specified label as long as the CX register is not zero. The LOOP instruction relies on the CX register and is commonly used for iterative operations.

B. MUL, DIV, CBW: This option is incorrect. The MUL (multiply), DIV (divide), and CBW (convert byte to word) instructions do not specifically depend on the CX register. These instructions can work with other registers, such as AX, DX, and AL, based on the requirements of the specific instruction. They are not exclusive to the CX register.

C. ADD, SUB: This option is incorrect. The ADD (addition) and SUB (subtraction) instructions do not depend on any specific register. They can be used with various registers, including the CX register, based on the instructions' requirements. They are not limited to the CX register.

D. none of the above: This option is incorrect. As explained above, the LOOP instruction can only be performed in the CX register. Therefore, option A is the correct answer.

The answer is: A. LOOP

  1. Retrieve the assembly program instructions from the disk

  2. Retrieve the assembly program instructions from the RAM

  3. Convert the machine code stored in memory into assembly equivalent

  4. none of the above


Correct Option: C

The assembly directive is a command to:

  1. The Assembler program

  2. The Microprocessor

  3. both (a) and (b) are correct

  4. both (a) and (b) are wrong


Correct Option: A
Explanation:

To solve this question, the user needs to have knowledge of assembly language programming and the purpose of assembly directives.

Assembly directives are commands or instructions in assembly language that are used to provide information to the assembler program. These directives are not executed by the microprocessor, but they instruct the assembler on how to process the assembly code.

Now, let's go through each option and explain why it is right or wrong:

A. The Assembler program: This option is correct. Assembly directives are commands to the assembler program, telling it how to process the assembly code. The assembler program reads the assembly code, processes the directives, and generates the corresponding machine code.

B. The Microprocessor: This option is incorrect. Assembly directives are not commands to the microprocessor. The microprocessor executes machine code, not assembly code. Assembly directives are used by the assembler program to generate the appropriate machine code.

Therefore, the correct answer is:

The Answer is: A

When you power on the computer it starts executing instructions in:

  1. ROM

  2. RAM

  3. Hard Disk

  4. none of the above


Correct Option: A

AI Explanation

To answer this question, you need to understand the basic components of a computer and their functions.

When you power on a computer, it starts executing instructions from the ROM (Read-Only Memory). ROM is a type of memory that contains firmware or permanent instructions that the computer needs to start up and perform basic functions. It is non-volatile, meaning that the data stored in ROM is not lost when the power is turned off.

RAM (Random Access Memory) is a volatile memory that is used by the computer to temporarily store data and instructions that are actively being used. It is not used to execute instructions when the computer is powered on.

Hard Disk is a storage device that stores data and programs in a non-volatile manner. It is not involved in executing instructions when the computer is powered on.

Therefore, the correct answer is A) ROM. When you power on the computer, it starts executing instructions from the ROM.

  1. Mov AX,[100], Mov [200],AX

  2. Mov AH,[100], Mov [200],AH

  3. Mov [200],[100]

  4. none of the above


Correct Option: A
  1. It has only 14 registers

  2. The register size was 16 bits

  3. The address bus width was 20 bits

  4. none of the above


Correct Option: C
Explanation:

To answer this question, the user needs to have knowledge of the 8086 processor and its limitations.

Now, let's go through each option and explain why it is right or wrong:

A. It has only 14 registers: This option is incorrect. The number of registers in the 8086 processor does not determine the maximum memory space addressable. The registers in the 8086 are used for various purposes, but they do not directly limit the addressable memory space.

B. The register size was 16 bits: This option is incorrect. The size of the registers in the 8086 processor does not directly determine the maximum memory space addressable. The register size affects the size of the data that can be stored and manipulated within the registers, but it does not limit the overall addressable memory space.

C. The address bus width was 20 bits: This option is correct. The address bus width of the 8086 processor is 20 bits, which means it can address up to 2^20 (1,048,576) memory locations. Each memory location can hold a byte of data. Therefore, the 8086 processor can address a maximum of 1,048,576 bytes or 1 megabyte of memory.

D. none of the above: This option is incorrect. Option C, which states that the address bus width was 20 bits, is the correct answer.

The Answer is: C

What is the memory-addressing mode of the first operand in the MOV instruction? for the following program segment:

Age DB 100 
MOV Age,123

  1. Immediate addressing mode

  2. direct addressing mode

  3. Indirect addressing mode

  4. none of the above


Correct Option: C

AI Explanation

To answer this question, we need to understand the different memory-addressing modes in assembly language.

In the given program segment:

Age DB 100
MOV Age,123

The instruction MOV Age,123 is used to move the immediate value 123 into the memory location labeled as "Age".

Let's go through each option to understand why it is correct or incorrect:

Option A) Immediate addressing mode - This option is incorrect because immediate addressing mode involves directly specifying the value to be operated on, rather than specifying a memory location.

Option B) Direct addressing mode - This option is incorrect because direct addressing mode involves specifying a memory location directly, without any indirection or additional steps. In this case, "Age" is a memory location, but it is not directly specified as the operand.

Option C) Indirect addressing mode - This option is correct because indirect addressing mode involves specifying a memory location indirectly through a register or pointer. In this case, "Age" is indirectly specified as the operand.

Option D) None of the above - This option is incorrect because the correct answer is option C, indirect addressing mode.

Therefore, the correct answer is option C. The memory-addressing mode of the first operand in the MOV instruction is indirect addressing mode.

The operating system (DOS / Windows) generally loaded (system boot) from:

  1. ROM

  2. RAM

  3. Hard/ Floppy Disk

  4. none of the above


Correct Option: C
- Hide questions