Instruction set overview Flashcards
In general, an instruction consists of the instruction or ___________ itself and the __________.
Operation and operands.
It refer to the where the data is coming from and/or where the result is to be placed.
Operands
What is the general form of the move instruction?
mov <destination>, <source></source></destination>
In mov command, source operand is _________ into the destination operand.
Copied
In data movement, the destination and source operand must be ________________.
same size
In data movement, operands cannot be _____________________.
both memory variables
In using a memory variable in an instruction, what is the format?
<size>[<variable>]
ex. dword[myVariable]
</variable></size>
How do you code the following?
value = 27
ans = num
section .data
value dd 0
num db 19
ans db 0
mov byte[value], 27
mov al, byte[num]
mov byte[ans], al
What are the basic addressing modes?
Register, immediate, memory
In register mode addressing, the operand is a ____________.
CPU register
In immediate mode addressing, the operand is _______________.
an immediate value
In the instruction:
mov eax, 130
eax and 130 is/are in what mode/s
eax is in register mode
130 is in immediate mode
In memory mode addressing, the operand is a _________________ referred to as indirection or dereferencing.
location in memory (accessed via an address)
What is the general form of integer addition instruction?
add <dest>, <src></src></dest>
What is the equivalent of the code below in C?
add <dest>, <src></src></dest>
<dest> = <dest> + <src>
</src></dest></dest>
What are the restrictions/limitations in addition instruction?
Destination and source operand must be of the same size or operands cannot be both memory variable
What is the assembly code of ans = num1 + num2 if all of these variables are in byte size.
mov al, byte[num1]
add al, byte[num2]
mov byte[ans], al
What is the general form of the increment instruction?
inc <operand></operand>
What is the general form of integer subtraction instruction?
sub <dest>, <src></src></dest>
What is the equivalent of
sub <dest>, <src>
in C language?</src></dest>
<dest> = <dest> - <src>
</src></dest></dest>
What are the restrictions/limitations in subtraction instruction?
Destination and source operand must be of the same size or operands cannot be both memory variable
What is the assembly code of
ans = num1 - num2
if all of these variables are in byte size.
mov al, byte[num1]
sub al, byte[num2]
mov byte[ans], al
What is the general form of unsigned multiplication?
mul <src></src>
In mul <src>, the source operand must be a \_\_\_\_\_\_\_\_\_.</src>
register or memory location