- Assembly Programming Language
- Fundamental of Assembly Programming Language
- Assembly Programming Language Quiz - 1
Assembly Programming Language Quiz - 1
Description: Assembly Programming Language Quiz - 1 | |
Number of Questions: 10 | |
Created by: Aliensbrain Bot | |
Tags: assembly |
What is the value of Zero (Z) flag after the instruction: SUB AX,AX
-
Set
-
Cleared
-
Unknown
-
none of the above
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:
-
The result is negative
-
The result is positive
-
The result is zero
-
There is no over flow when adding ( ve) (-ve) numbers
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.
Which of the following instruction(s) can be performed only in CX register:
-
LOOP
-
MUL, DIV, CBW
-
ADD, SUB
-
none of the above
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
The debug command U
-
Retrieve the assembly program instructions from the disk
-
Retrieve the assembly program instructions from the RAM
-
Convert the machine code stored in memory into assembly equivalent
-
none of the above
-
The Assembler program
-
The Microprocessor
-
both (a) and (b) are correct
-
both (a) and (b) are wrong
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:
-
ROM
-
RAM
-
Hard Disk
-
none of the above
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.
You want to move two bytes from address 100 to 200, so what is the proper instruction:
-
Mov AX,[100], Mov [200],AX
-
Mov AH,[100], Mov [200],AH
-
Mov [200],[100]
-
none of the above
AI Explanation
To move two bytes from address 100 to address 200, the proper instruction is:
A. Mov AX,[100], Mov [200],AX
Let's go through each option to understand why it is correct or incorrect:
Option A) Mov AX,[100], Mov [200],AX - This option is correct because it uses the MOV
instruction to move the value at address 100 into the AX register, and then moves the value in the AX register to address 200.
Option B) Mov AH,[100], Mov [200],AH - This option is incorrect because it only moves the value of the AH register to address 200. It does not move the value from address 100.
Option C) Mov [200],[100] - This option is incorrect because it attempts to move the value at address 100 directly to address 200 without using any registers. This is not a valid instruction.
Option D) none of the above - This option is incorrect because option A is the correct instruction to move two bytes from address 100 to address 200.
Therefore, the correct answer is option A.
The limitation on The maximum memory space addressable by 8086 processor because:
-
It has only 14 registers
-
The register size was 16 bits
-
The address bus width was 20 bits
-
none of the above
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
-
Immediate addressing mode
-
direct addressing mode
-
Indirect addressing mode
-
none of the above
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:
-
ROM
-
RAM
-
Hard/ Floppy Disk
-
none of the above