Low Level Languages Flashcards
Reasons to use HLL
Reflects type of problem. Allows use of mathematical functions. Portability. Uses library routines. Complexity of problem. Easy to maintain.
Reasons to use LLL
Close to design of processor. Can access memory locations directly. Able to program very memory efficient programs which is necessary when the processor has limited memory.
Machine Code
Binary / hexadecimal notation. Set of all instructions available to the architecture. Depends on the hardware design of the processor. Instructions operate on bytes of data. No translation needed. Very difficult to write.
Assembly Language
Related closely to the computer being programmed. Low level language so machine specific. Uses descriptive names (for data stores), mnemonics (for instructions), labels to allow branching (selection). Each instruction is generally translated into one machine code instruction. Translated by an assembler. Typically used for writing drivers / easier than mc, but harder than HLL.
Registers definition
Are locations that provide fast access to data (faster than main memory)…for specific purposes. Used during fetch-execute cycle…when frequent access is needed. Used for temporary storage.
Registers why important
Low level languages make direct use of the hardware within the CPU so programmers need to know about the registers of the CPU in order to write low level code.
Program Counter
Contains the address of the next machine code instruction to be executed. During the fetch execute cycle the contents of the PC are copied to the MAR and the PC is incremented. For a jump instruction, the address from the CIR is put into the PC.
JUMP instruction
When a program is running, the PC will often just be incrementing as it addresses one instruction after the other, e.g. 305, 306, 307. However, the instructions will often modify the next address, for example, 305 becomes 39. – a jump instruction.
Current Instruction Reg.
The CIR holds the current instruction to be executed, having been fetched from memory.
Accumulator
Temp storage (in the ALU), holds data being processed during calculations, deals with the input/output in the processor.
Index Register
Used in indexed addressing, stores a number used to modify the address (in address field), provides an efficient way to access a number of consecutive locations. E.g. used for an array.
Opcode
The mnemonic part of the instruction, that indicates what it is to do. The code for the operation e.g. ADD
Mnemonic
A code that is easily remembered…used to give the opcode/command. The operation part of the instruction. Replaced by binary code during assembly.
Operand
Is the address field in an instruction which holds the data or address to be used. E.g. ADD 12, “12” is the operand.
Flow Control
The order in which instructions are executed. The order may be changed by a jump instruction / conditional jump instruction