Week 6 - 4.4 - Introduction to Addressing Modes Flashcards
How many modes can an instruction operand be specified by?
12 addressing modes.
What does an addressing mode do?
An addressing mode tells the CPU how to locate the data or address needed by instruction.
What is the actual register for a register operand?
The effective address of the operand.
How many addressing modes are available on the MC68020/30/40 processors?
18 addressing modes
What is the syntax for Absolute Long mode?
<address>
The operand is a 32 bit-unsigned number that represents the effective address of the operand. The address is a constant , a label, or an expression.
</address>
How many extension words containing the address as a long word does Absolute Long mode need?
two extension words containing the address as a long word.
What happens in Absolute Short Mode?
The memory address is accessed as a 16 bit word and is then sign-extended to 24 bits to give the effective address of the operand. The address is stored in a single extension word.
Syntax for Immediate Mode
N - the number must be given in decimal, hex, or any other permitted number system. This mode is restricted to source operands.
Data Register Direct Mode syntax?
Dn (0 <= 7)
The operand is a data register. An instruction directly accesses the data in the register, and no extension word is required.
What is the operand in Address Register Direct Mode?
The operand is an address register.
What is the address of a memory location in Address Register Direct Mode?
The content of an address register is the address of a memory location. The address register can be viewed as a pointer to a memory location.
What is the syntax for the MOVE instruction?
MOVE. ,
The contents of the source are copied to the destination.
For instruction MOVE the destination cannot be:
an address register
an immediate operand
or any of hte PC-relative modes.
What is the syntax for ADD/SUB (add/subtract)?
ADD. ,Dn ADD. Dn, ADDI. #N, SUB. ,Dn SUB. Dn, SUBI. #N,
What does ADD/SUB do?
Executes the corresponding arithmetic operation for fixed-length binary numbers of the given size.
What does MOVEA. ,An do?
The instructions allow the user to write data into an address register. The contents of the source operand are stored in the address register An. If word data is noted, it is sign-extended before being placed in the register.
What are the requirements for MOVEA .?
The destination operand must be an Address register
all addressing modes are permitted for the source operand.
The size parameter is restricted to word or long word.
What is the syntax for ADDA/SUBA ?
ADDA. ,An
SUBA. ,An
What does ADDA/SUBA do?
The contents of the source operand are added/subtracted from the contents of the ADDRESS REGISTER. If word data is specified, the 16 bit contents from the source operand is sign-extended first and then operation is performed.
What are the requirements for ADDA/SUBA?
Destination must be an address register (A0-A6)
Any addressing mode can be used for the source operand.
What does this do?
ADDA.L #100,A0
adds 100 to the value of A0 in hexadecimal.
100 base 10 = 64 base 16
A0 += 64;
What does this do?
SUBA.W ALPHA,A1
when ALPHA is $8C07
A1 is 0000 A04B
since we’re using w, 16-bit contents of ALPHA are sign-extended to long word. This value is subtracted from the value in the address register
A1 -= FFFF8C07 = 00011444;
What is LEA?
Load Effective Address
What is the syntax for LEA?
LEA ,An
What does LEA do?
The effective address of the source operand is loaded into the specified register.
What are the requirements for LEA?
The address of the source operand is loaded into the register. THE ADDRESS.
NOT THE CONTENTS.
No size specification is used.
Can you do LEA #ALPHA,A3?
No, it's an illegal instruction. #ALPHA is a constant, and does not represent an effective address.
What is Address Register Indirect Mode?
An
The operand specifies the contents of the memory location whose address is contained in An. (An) indicates indirect reference.
What is the syntax for CLR and what does it do?
CLR.
The contents at the given effective address are initialized to 0. The operand may be either a data register or memory location.
If D3 = 8C07 2A4F
CLR.B D3 results in?
8C07 2A00
D3