Programming languages Flashcards
Define a programming paradigm
The approach a programming language takes to defining a program
What’s in assembly language
- Mnemonics are used in place of machine code instruction
- The set of instructions varies from processor to processor
- Low level languages offer a high level of control
Name 4 high-level paradigms
- Procedural
- Object-oriented
- Functional
- Declarative
What is a procedural language and give examples
Instructions are given in sequence. These instructions can be grouped into subroutines that can be called throughout the program.
e.g. C, Python
What is a object-oriented language
The solution is represented by objects that interact. e.g. Java, C++
What is a functional language
A description of the solution to a problem is built up through a collection of functions.
e.g. Haskell, ML
What is a declarative language
The characteristics of a solution are stated, rather than stating how the problem is solved. e.g. Prolog, SQL
What are the 11 instructions in LMC and their functions
ADD - Add
SUB - Sub
STA - Store value from ACC to memory
LDA - Load value from memory to ACC
BRA - Branch always
BRP - Branch if positive
BRZ - Branch if zero
INP - Input
OUT - Output
HLT - End program
DAT - Data location