SLR 07 - Types of Programming Language Flashcards
What are the types of Addressing Methods?
Immediate
Indexed
Direct
Indirect
What is direct Addressing?
This happens when the Operand value is the address to fetch from or execute onto. (e.g ADD 5 means add the value from address 5)
What is Immediate Addressing?
The Operands value being used for the instruction. (e.g ADD 5 means add the value of 5)
What is indirect addressing?
The operand giving an address, in said address another address value is contained for execution. (e.g in address 5, 45 is contained. ADD 5 means add the value from register by indirect addressing 45)
What is the problem with direct addressing and how does indirect addressing fix it?
Direct addressign uses 4 bits, only allowing use of registers 0-15
Registers are 8 bit, by using indirect addressing you can then access registers 16-255
What is indexed addressing?
It uses the address equal to the Operand plus the Index Register, which increments every cycle.
What is a paradigm?
An example of a way to complete a process.
What is a language with paradigms called?
Turing Complete
What can turing complete languages do?
Solve all computable problems
What is machine code?
Low levels of abstraction
It programs in 1s and 0s
What is Assembly Language?
Written in Mnemonics that are a 1:1 with sequences of machine code
What are High-Level languages?
They have high levels of abstraction
Each function has a 1:M relationship with lines of machine code
What can High-Level languages be divided into?
Imperative and Declarative
What are the 2 main Paradigms in imperative languages?
Procedural Programming
Object-Oriented Programming
What are Procedural programs?
A paradigm where programs are built on several subroutines?
What are Object-Oriented programs?
An extension of imperative programming that focuses on modular approaches
What main languages are built on OOP?
C++
Java
C#
What are the advantages of low-level languages?
They are very precise, optimised and efficient code
Direct access to system features
Complete code control
What are the disadvantages of low-level languages?
Machine dependant
Hard to write efficient code
Tedious to write and prone to bugs
Hard to understand
What is an object?
Anything including data structures, people etc.
What is a class?
An objects information divided into sections and assigned to a class
What are the 3 sections of a class?
Name
Attributes - All information related to the class
Methods - All functions associated to deriving attributes of a class
What is the exam syntax for creating a class?
- Class followed by the class name
- Private followed by attributes
- Methods, public, procedure end procedure
- End class
What is the process of turning a class into an object?
Instantiation
What is the process of inheritance?
A subclass taking the details of a superclass and placing them into a new class.
Classes can also be derived from derivations.
What can be used to override superclass attributes?
Methods can be executed to override super attributes and it takes precedence
What is encapsulation?
Bundling data with methods
Hides values or object states by unauthorised access
What can encapsulated attributes be accessed by?
The provided methods
What is Polymorphism?
Something that occurs in several forms?
What are the types of polymorphism?
Static
Dynamic
What is static Polymorphism?
Implementation of multiple methods in a class of the same name
What must differ with parameters in Polymorphism?
- a different number of parameters
- Different Data types
- Different order of paramaters expected