Wednesday, 22 June 2011

3.12

3.12

Assembly language is machine code short hand (E.g + = 011001001). Kinda like how the keyboard works. Press the 'z' character and an assembler takes the mnemomics and shows a 'z' It's short hand machine code

An interpreter takes one sentence at a time, translates it and runs the instruction when it goes through a computer, it interprets the next instruction. It is used when not enough memory to hold compiled propgram (Multiple instructions)
Used by come languages (VB) to debug
Error can be reported per line of execution, this makes error checking easier.


A compiler is when all instructions are translated simultaneously. A program is compiled into 1 file and has been translated beforehand so it can be read straightaway.
It's faster to load but requires more memory.


Lexical analysis - Prepares the translator/compiler if your sentence makes sense. Looks up in it's 'dictionary' if your sentence makes sense. E.g Sentence should be = 


Dim 'variable' as (Assignment, same as equal sign) 'Data taype'.

Keyword = Token

The dictionary is stored in each of the programs.

Syntax analysis - Sentence is checked horizontally to see if it makes sense

Intermediate code - Code that has been checked and is halfway through execution

Linkers - 

Loaders do the loading

Library routines - DLL Files - Littles slices of code, modules. Seperately saved files that contain a set of instructions




Von Neumann - Came up with the idea of Apps, 'Stored program using the same memory space where instructions where stored with data.

A queue of info is put through a register which then puts the data into Memory address register.

1. Load the address from (PC) into Mar (Memory address register)
2. Increment the (PC) by 1
Load the instruction from the MAR address into the MDR
Load this instruction from MRP into CIR
Decode the instruction that is in the CIR
If the instructions is a jump instruction then a. Load the address part of the instruction into the PC, b. Reset by going to step 1 else step 7
7. Execute the instruction
8. Reset by going to step 1.

CIR - Current instruction register.
MDR - memory data register
PC - Program counter

No comments:

Post a Comment