0% found this document useful (0 votes)
7 views2 pages

Workshop 8

Uploaded by

Abdullah Don
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Workshop 8

Uploaded by

Abdullah Don
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. How many operands does the x86 ADD assembly instruction have?

- Answer: The x86 ADD assembly instruction typically has two operands. For example, `ADD
destination, source` adds the source operand to the destination operand.

2. How many operands does the x86 INC assembly instruction have?
- Answer: The x86 INC assembly instruction typically has one operand. It increments the value
of the specified operand by 1. For example, `INC destination` increments the value in the
destination operand.

3. Which is a more efficient x86 assembly language instruction to increment an integer by 1, INC
or ADD?
- Answer: The INC instruction is more efficient for incrementing an integer by 1 in x86
assembly language. INC is specifically designed for incrementing by 1 and is often more concise
and optimized for this purpose compared to the more general-purpose ADD instruction.

4. For a DIV instruction which is correct?


- Answer: The correct syntax for the DIV instruction in x86 assembly is `DIV operand`. It
divides the unsigned value in the DX:AX register pair by the specified operand. The result is
stored in AX, and the remainder is stored in DX.

5. Which instruction does not affect the FLAGS register?


- Answer: The MOV (Move) instruction typically does not affect the FLAGS register. MOV is
used to move data from one location to another without performing any arithmetic or logical
operations that would alter the flags.

6. Which is not a valid assembly instruction?


- Answer: Without specific options, it's challenging to determine an invalid instruction.
However, an example of an invalid instruction might be something like "ADD AX, BX, CX," as
the ADD instruction in x86 assembly generally takes two operands.

7. When MUL BL is executed, which registers will hold the product?


- Answer: When the MUL (Multiply) instruction is executed with BL as the operand (`MUL
BL`), the product is stored in the DX:AX register pair. AX contains the low-order bits of the
product, and DX contains the high-order bits.

8. What will be the content of AL?


```
MOV AL, 48
SUB AL, 30h
```
- Answer: The content of AL will be the ASCII value of the character '0'. The MOV instruction
loads the decimal value 48 into AL, and then the SUB instruction subtracts the hexadecimal
value 30h (which is 48 in decimal) from AL.

9. What will be content of AX register after the following operation?


```
MOV AX, 64h
MOV BL, 10h
DIV BL
```
- Answer: After these operations, AX will contain the result of the division of 64h by 10h,
which is 6 in decimal. The quotient is stored in AX, and any remainder is discarded.

10. What will be content of AX register after the following operation?


```
MOV AX, 5050h
XOR AX, AX
```
- Answer: After these operations, the content of AX will be 0. The XOR operation with AX,
AX effectively sets AX to zero, as XORing a value with itself results in zero.

You might also like