Programming languages Flashcards

1
Q

What is machine code?

A
  • Machine Code is the set of binary instructions, the CPU uses to perform tasks.
  • Machine Code is processor dependant.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is assembly language?

A

A low level programming language which is processor-dependant; each instruction is one machine operation
- It uses mnemonics

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

What are the two types of high level programming languages?

A

Declarative and Imperative

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

What are Declarative high level languages?

Give some examples.

A

-They declare the necessary information to produce the required result.

SQL, CSS

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

What are Imperative high level languages?

A
  • The program instructions are executed in an order defined by the programmer.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Advantages of using Machine Code and Assembly language over high level languages.

A
  • Executes programs faster than high level
  • Doesn’t rely on the compiler to create optimised code
  • Low level code is memory efficient due to the lack of abstraction.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Disadvantages of using Machine Code and assembly language over high level languages.

A
  • Difficult to learn to program in a low level language
  • High level languages have more training support for learning them.
  • low level code is harder to debug
  • High level code can be self documenting
  • Machine code is processor dependant
  • low level code is machine dependant
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the 2 advantages of using assembly language over machine code

A
  • It uses mnemonics
  • The operand uses a decimal or hexadecimal number
    Both of these things make assembly language easier to read/write for humans
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give examples of processes that need to use assembly language?

A

Embedded systems, interrupt handlers, device drivers

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

What is the relationship between machine code and assembly language?

A

They have a one to one relationship, one machine code instruction = one assembly language instruction

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