Architecture 04 Flashcards

1
Q

What is the general form of memory addressing word in the x86 architecture?

A

disp (%reg1, %reg2, scale)
• disp is a constant integer (offset)
• reg1 is the base register of the operand
• reg2 is the index register of the operand
• scale can only be 1, 2, 4, 8

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

Show how you could use indirect mode addressing in the x86 architecutre

A

General: disp (%reg1, %reg2, scale)

Indirect mode: (%reg1)

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

Show how you could use direct mode addressing in the x86 architecutre

A

General: disp (%reg1, %reg2, scale)

Direct mode: disp

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

What is meant by AT&T syntax?

A

A convention for assembly languages, for example in AT&T syntax the destination address comes last:
• movq source, dest

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

What is the typical characteristic of a CISC instruction?

A

The instruction combines load of values and the arithmetic

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

What is meant by assembly calling convention?

A

A convention people agree on for assembly languages, declaring
• How arguments are passed
• How results are returned
• How registers may be used for storing intermediate values

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

What is the calling convention for C on x86-64 in terms of function arguments?

A

If
• A Function has N <= 6 arguments
• And all fit into 64 bits

Then the arguments are stored in the first N of
rdi rsi rdx rcx r8 r9

Additional (and longer than 64 bit) arguments go on the stack

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

What is the calling convention for C on x86-64 in terms of return value?

A

If return type fits in 64 fits, then it is returned in rax

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

What are the characteristics of a high level language?

A
  • One to many translation (each statement corresponds to multiple machine level instructions)
  • Hardware independence (Abstracts over underlying hardware)
  • Application orientation (Designed to create application programs)
  • General purpose (Not restricted to a specific task)
  • Powerful abstractions (Complex tasks can be expressed succinctly)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the characteristics of a low level language?

A
  • One to one translation (each statement correspons to one machine level instruction)
  • Hardware dependence (Dependent on type of processor)
  • Systems programming orientation (Can create software that directly controls hardware)
  • Special purpose (Used when extreme control or efficiency is needed)
  • Few abstractions (Forces programmer to construct abstractions)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly