#C, C++ and C#
Definition of Computer Function
Computer Function Parts
Computer Function Assembler
- Assembler is a program that converts or translates the program written in assembly language code into equivalent machine language code.
- The assembly language program contains pneumonic to perform the task. The assembler takes such program code as input and converts it into equivalent machine code for execution.
- MASM(micro Assembler) and TASM (Turbo Assembler) are examples of popular assemblers.
- The interpreter is the software tool that converts the high-level language code into executable machine code in a step-by-step manner”.
- The interpreter reads a single line of source code, converts it into machine code then executes it and up the next instruction for processing.
- The compiler is the program that converts the high-level language program code into low-level language code.
- The difference between compiler and interpreter is that the compiler converts the entire program at once whereas the interpreter does so in parts.
- The C compiler accepts source code (i.e. file) as the input and converts it into low-level language code called object code (i.e.obj file).
- The linker is the program that performs the task of linking several object modules together into a single executable code.
- The need for a linker arises when a particular program is made up of several object modules.
- The original source program may be in a high-level language.
- Once others are converted within machine code, they must be linked commonly to last executed as a single program. That task is performed through the linker.
- The linker resolves external references made into the individual modules.
- The final object module created by the linker has to be loaded into memory for execution.
- The loader is the program that performs the task of loading the executable code into memory.
- The executable code of the program resides in secondary memory, to run it, that code must be loaded from secondary memory into primary memory. This task is done by the loader.
- There are two types of loader, absolute loader and relocating loader.
- Absolute loader the executable code into the memory location specified in the object modules.
- Relocating loader, on the other hand, load the object code into a memory location which is decided at load time.
Arithmetic logic unit
- The arithmetic logic unit (ALU) Performs all the arithmetic calculations and takes logical decisions.
- This unit takes the instructions to form the control unit, reads the data from memory and performs the operations on data, sends the result back to memory.
- The arithmetic operations include +, _, *, /, % etc.
- Logical operations include the operations like >, >=, <, <=, ==,!=.
- The control unit controls and coordinates the activities of all other units of the computer.
- It accepts instructions from a unit or memory.
- Decodes the accepted instruction.
- Interprets the instruction and gets it executed by sending the command to various hardware devices.
- The program is a set of well-defined instructions arranged in a particular sequence to solve the problem
- The algorithms are expressed in the form of computer programs using programming languages like C, C++, Java, C#, etc.
- Most of the programs are written in a high-level language, which must be converted into low-level language code using a compiler or interpreted.
The instruction in the Computer Function program can be
- Type Declaration Instruction
- Arithmetic Instruction
- Control Instruction
- Input/ Output instruction.
- Software is the collection of different programs that performs a specific task.
- There are two types of software, application software and system software.
- Application software is written for an individual user or enterprise to achieve a specific goal. for e.g. music players, payroll systems, Library management systems, etc.
- The system software is a program written to enhance the capabilities of the computer system for e.g Operation system, computer, interpreter, etc.