1.2.4 extension Flashcards
What is the opcode?
Consists of binary digits representing the basic operations such as ADD and 2 digit code representing addressing mode
(Addressing mode attached to opcode)
How do you calculate maximum number of operations for instruction set
2^n
What indicates the the addressing mode?
Indicated by bit pattern that’s the last 2 bits of opcode
What is immediate addressing?
Operand is actual value to be operated on
(Don’t need to go to memory)
What is direct addressing?
Operand holds memory address of value to be operated on
Only addressing mode used in LMC assembly language
What is indirect addressing?
Operand is location (typically a register) which holds address of data we want
Reference to memory location where we find real address of required data
Enables larger range of addressable locations (without we can’t hold memory addresses larger than 16 if operand only 4 bits!)
What is indexed addressing?
Address of operand obtained by adding a constant value to contents of general register (called index register)
Number of index register and constant value are included in instruction code
Used to access an array whose elements are in successive memory locations
Why does array need to be stored in contiguous memory?
High level languages
3rd generation
Abstraction of machine level steps taken to solve problems
More accessible
Problem-oriented as opposed to machine orientated
One to many relationship w machine code (each instruction gives rise to many lines of machine code)
What are imperative languages?
Programs written as lists of commands which describe how problem should be solved (tell comp what to do step by step)
What is a procedural language?
Type of imperative Lang that are structured using procedures/subroutines/functions
Program where instructions given in sequence, selection used to decide what program does, iteration dictates how many times it does it
Programs broken down into key blocks called ‘procedures, functions’
Examples - BASIC, C, Pascal
What is a declarative language?
Describe problem to be solved or what program should achieve rather than how to solve it
Eg SQL
What is procedural programming
Type of imperative programming paradigm where program is built from 1 or more subroutines (procedures, functions etc)