IT Basics Prof dr Rzvan Daniel ZOTA Bucharest
IT Basics Prof. dr. Răzvan Daniel ZOTA Bucharest University of Economic Studies Faculty of Cybernetics, Statistics and Economic Informatics zota@ase. ro http: //zota. ase. ro/itb
IT Basics – part 2 • Assemblers, compilers, interpreters • The microprocessor • Intel Pentium microprocessor’s registers • ASM introduction • Memory and memory hierarchy • Memory – segmentation and pagination • Serial and parallel communication 2
Bibliography • Bazele tehnologiei informaţiei, F. Năstase, R. Zota – Ed. ASE, 2013 • Intel Architecture Users’ Manual – Intel 3
Introduction Data: • Programs (list of instructions created with a purpose in mind) • Data “HARVARD Architecture” 4
High level and low level languages • The microprocessor – has an own language – the so called “instruction set”– machine code - LLL (Low Level Language) • HLL (High Level Language) - BASIC, Pascal, FORTRAN, C, C++, C#, Java, Python, etc. 5
Example HLL (Python) ASM i=j+k MOV eax, [12011234] ADD eax, [12011238] MOV [1201123 C], eax Machine binary code 0010 0000 0011 1001 0010 0001 0010 0011 0100 1101 0000 1011 1001 0010 0001 0010 0011 1000 0011 1100 0001 0010 0001 0010 0011 1100 6
Machine code instructions can be grouped into 4 main categories. We may have instructions for: 1) Data transfer and manipulation; 2) Input/Output operations; 3) Program transfer control; 4) Machine control (it ends the processing, reset the machine, etc. ) 7
Compilers and assemblers – Compilers are translating the HLL instructions in binary machine code to be run by the computer. – Assemblers and assembly languages have been used before the compilers’ birth – The assembly language has machine code instructions called mnemonics (they come from the English words which specifies their action) like ADD, MOV, SUB, CMP or JMP. – Translating a HLL program can be done by using a compiler or an interpreter. 8
EDIT – COMPILE – LINK - LOAD 9
Link editing • The big dimensions of the programs today have led to their splitting into smaller parts, called modules. • To get an executable program, each module have to be designed, written and compiled and in the end all the resulted components must be combined together using a link editor (or linker ). • This process doesn’t imply only putting together the components but also solving the external references. When a program is being partitioned into modules, there are frequent cases when the code from one module must reference data or sub-routines from another peer module. 10
Link editing – cont. • The compilers are translating only one module at a time. When a compiler tries to determine the numerical equivalent of there symbolic references, it will discover that there are no valid values inside the current module. • These unsolved symbols are called external references and they remain symbolic (without a numerical value) till the moment when the link editor is solving these references. The interpreters are offering an alternative to run programs that are written in a HLL. 11
Interpreters Instead of translating the HLL instructions into machine code and creating an executable program, the interpreter is reading the HLL instructions one by one and execute them using an own routines’ library. In this way, the running code is not generated from the source code but it is integrated inside the interpreter. The interpreter is seeing the HLL source code as input data that have to be analyzed and then processed as to their meaning. The advantages of using an interpreter are: the quick start of the program and apparently lack of complexity connected to compiling and link editing. 12
Interpreters The disadvantage is that they are operating very slow; the compiled programs have superior speeds in terms of execution in comparison with the interpreted programs. Is something usual that the interpreters will convert the input instructions in an intermediary form made of certain symbols, before taking a decision about the actions that will be executed (see fig. 3). The generated symbols are then passed to a decoder which will select the corresponding routine to be executed. Sometimes the interpreter is seen as a “virtual machine" because it acts in some way as a hardware component: it reads instructions one by one and obeys to them. The interpreters are getting closer the level of the instructions’ execution to the level of a program designed in a HLL. 13
Interpreters 14
The Java interpreter Java programming language has an interesting method of compiling and interpreting – as shown in fig. 4. Obs. : As a result of compiling we get one or more. class files The compiled program is running using the run-time Java interpreter. 15
- Slides: 15