Day 2 Flashcards

1
Q

which register holds the instruction to be decoded and executed?

A

The IR register

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  • what is o.p?*
  • how many o.p are there?*
A
  • a short cut of operation code*
  • 5 bits - 32 operaion codes*
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain immidiate addressing

  • why is it called that way?*
  • why we can’t always use that?*
A
  • The instruction contains the operand itself(data) rather than an address which points to some data.
  • Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched; hence it is immediately available for use.
  • 10 bits are saved for the register, thus if the data is of size > 2^17 immediate addressing can’t be done.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain direct addressing

A
  • Specifying an operand in memory by giving its full address.
  • the instruction will always access exactly the
    same memory location. So while the value can change, the location cannot.
  • Direct addressing can only be used to access global variables whose address is known at compile time.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is indirect addressing

A

An address which specifies not the operand but the address of the operand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is direct register addressing?

which registers are used?

A

same as direct addressing but specifies a register instead of a memory location. Usually using a register is faster than using the memory.

It uses the 32 temporary use registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is indirect register addressing?

A
  • The operand specified comes from memory or goes to memory
  • The address is contained in a register
  • When an address is used this way it is called a pointer
  • we can now reference memory without having its full address in the instruction
  • It can use different memory words on different memory executions of the instruction.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

For each instruction determine its addressing type

A

First three instructions: (note: # means constant)

  • First operand - register direct
  • Second operand - immediate

Fourth instruction:

  • First operand - register direct
  • Second operand - register indirect

Fifth instruction:

  • First operand - register direct
  • Second operand - immediate
  • Sixth instruction:*
  • First and second operand - register direct
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is register index addressing

A
  • reference memory words at a known offset from a register.
  • register + const
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is relative addressing?

A
  • op address = address of PC register + const
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  • Which instruction use only ra and c1.*
  • That is, the instruction is of the form:*

opcode ra c1.

why is there no need for a base register?

A
  • ldr, str, lar*
  • There is no need for a base register because the base register is implicit - PC register.*
  • ldr ra, PC, c1*
  • str ra, PC, c1*
  • lar ra, PC, c1*
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the structure of an instruction?

A
  • 32 bits in total
  • 5 bits for instruction code
  • next 5 bits - ra register to which we can add
    • c1 constant - up to 22 bits
  • next 5 bits - rb register to which we can add
    • c2 constant - up to 17 bits
  • next 5 bits - rc register to which we can add
    • c3 constant - up to 12 bits

The ra,rb,rc registers describe one of the 32 registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly