Chapter 4.1 Flashcards
(96 cards)
What is a data transfer instruction?
Instruction that copies data from a source operand to a destination operand
What is an operand?
A value that is used for input or output for an instruction
What types of operands can assembly language instructions have?
- Register
- Memory operand
- Integer expression
- Input–output port
What is an immediate operand?
A constant integer (8, 16, or 32 bits) encoded within the instruction
What is a register operand?
The name of a register that specifies a processor register as the source or destination of an operation
What is a memory operand?
Reference to a location in memory, specified using an address
What is the syntax of the MOV instruction?
MOV destination, source
What is a direct memory operand?
A named reference to storage in memory that is automatically dereferenced by the assembler
What are the restrictions on operands for the MOV instruction?
- No more than one memory operand permitted
- Both operands must be the same size
- CS, EIP, and IP cannot be the destination operand
- No immediate to segment moves
Why is the MOV instruction ‘mov ds, 45’ invalid?
DS register is a read-only control register managed by the processor
What does the MOVZX instruction do?
Fills the upper half of the destination with zeros when copying a smaller value into a larger destination
What does the MOVSX instruction do?
Fills the upper half of the destination with a copy of the source operand’s sign bit
What are the rules for operands in the XCHG instruction?
- At least one operand must be a register
- No immediate operands are permitted
What happens when using ‘mov al, arrayB+1’?
AL = 20h, where a constant offset is added to a data label to produce an effective address
What is an effective address (EA)?
An address produced by adding a constant offset to a data label
What must the destination be for a MOV instruction?
A register
Fill in the blank: The MOV instruction copies data from a _______ to a destination operand.
source operand
True or False: The MOV instruction can have more than one memory operand.
False
What does the instruction ‘mov ax, num2’ do?
AX is loaded with the word value stored in num2
What is the result of ‘mov al, num1’ where num1 is a byte?
AL will hold the value of num1
What is the purpose of the STC instruction?
Sets the Carry flag, indicating that an overflow occurred
What happens if you try to copy a smaller operand to a larger one directly?
MOV cannot directly copy data from a smaller operand to a larger one
What is the result of ‘mov eax, 0FFFFFFFFh’?
EAX is filled with the value 4294967295d
What occurs when ‘mov ax, [arrayW+2]’ is executed?
AX will be loaded with 2000h