Running of Applications
• Operating System (OS) provides the platform for application software to
run.
• When a computer is turned on, it performs a boot-up process.
o BIOS (Basic Input/Output System) helps locate and load the OS into
RAM.
o BIOS is stored in EEPROM (a type of flash memory ROM).
o BIOS settings (like clock speed) are stored in CMOS, which is battery-
powered.
o If the battery is removed, BIOS settings reset to factory defaults.
• The OS controls application software and loads necessary device drivers.
• Parts of the OS are loaded in and out of RAM as needed.
Interrupts
• An interrupt is a signal that tells the processor to stop and deal with
something urgent.
• Types of interrupts,
o Timing signals
o I/O operations (e.g. printer or disk needing data)
o Hardware faults (e.g. printer jam)
o User input (e.g. keyboard shortcut)
o Software errors (e.g. missing .exe file or divide by zero)
The processor
• Saves current task data (Program Counter & registers).
• Executes Interrupt Service Routine (ISR).
• Restores previous task and continues.
Buffers
• A buffer is a temporary memory area used to hold data during transfer.
• Buffers help manage speed differences between devices (e.g., internet vs.
media player).
• Example - While watching a video online, data is stored in a buffer to
prevent freezing.
• Used with interrupts to allow multitasking.
Programming Languages, Translators, and IDEs
1. Programming Languages
• Computers only understand machine code (binary).
• Programs must be translated into machine code to run on a computer.
• Programming allows us to control what the computer does, how it does it,
and when.
Types of Programming Languages
A. High-Level Languages
• Closer to human language (English-like syntax).
• Do not require knowledge of hardware or instruction sets.
• Portable – can run on different types of computers.
B. Low-Level Languages
• Closely tied to the computer's hardware and architecture.
• Two types:
o Machine Code – binary code directly understood by the computer.
o Assembly Language – uses symbolic codes and needs to be translated
into machine code.
Note: Programmers rarely write directly in machine code because it is difficult to
read and manage.
3. Translators
Programs that convert high-level or assembly language into machine code.
Types of translators:
• Compiler – Translates the entire program at once into machine code.
• Interpreter – Translates and runs the program line by line.
• Assembler – Converts assembly language into machine code.
Differences between high-level and low-level languages
High-level language ---Advantages
• independent of the type of computer being used
• easier to read, write and understand programs
• quicker to write programs
• programs are easier and quicker to debug
• easier to maintain programs in use
High -level language ---disadvantages
• programs can be larger
• programs can take longer to execute
• programs may not be able make use of special hardware
Low- level languages --- Advantages
• can make use of special hardware
• includes special machine-dependent instructions
• can write code that doesn’t take up much space in primary memory
• can write code that performs a task very quickly
Low- level languages --- Disadvantages
• it takes a longer time to write and debug programs
• programs are more difficult to understand
Assembly Languages
Disadvantages
• Programs may not be able to use special hardware directly unless designed
for it.
• Takes longer to write and debug programs.
• Programs are more difficult to understand than high-level languages.
• Fewer programmers use assembly language due to its complexity and low
readability.
Why Some Still Use Assembly Language
• To make use of special hardware.
• To access machine-dependent instructions.
• To write compact code that uses very little memory.
• To write high-speed code for time-critical tasks.
Example Program – Adding Two Numbers
• LDA First → Load the value of variable First into the accumulator.
• ADD Second → Add the value of variable Second to what’s already in the accumulator.
• STO Sum → Store the result from the accumulator into the variable Sum.
Assembly language programs need to be translated into machine code using an assembler
before they can run on a computer.
Computer Programs and Translation
Human vs Machine Understanding
• Programs are written by humans in a readable high-level language (HLL) or assembly
language.
• Computers only understand machine code (binary instructions).
• Therefore, programs must be translated into machine code using a translator.
Translator Programs
There are three main types of translator programs
1️⃣ Compiler
• Translates the entire high-level program into machine code all at once.
• Once compiled, the machine code can be reused without recompiling.
• If errors exist, it will produce an error report instead of a compiled file.
2️⃣ Interpreter
• Translates and executes a high-level program line-by-line.
• Stops execution and displays an error if any line has an issue.
• Must re-interpret the program every time it runs.
3️⃣ Assembler
• Translates assembly language into machine code.
• Like a compiler, once assembled, the code can be run multiple times without re-
assembling.
Translation programs summary
Advantages and disadvantages of compilers and interpreters
Integrated Development Environment (IDE)
An Integrated Development Environment (IDE) is used by programmers
to aid the writing and development of programs.
IDE Features
1. Code Editor
• Allows writing and editing of programs within the IDE.
• Eliminates the need for a separate text editor.
• Speeds up development by enabling quick corrections and
additions.
2. Translator (Compiler/Interpreter)
• Most IDEs include a translator,
o Interpreter: Executes code line by line, useful during
development.
o Compiler: Converts the entire program into machine code
for final execution.
3. Runtime Environment with Debugger
• Debugger helps track and fix logic errors,
o Allows single stepping (line-by-line execution).
o Supports breakpoints to pause execution at specific lines.
o Displays variable values and expressions in a report window
to help identify issues.
4. Error Diagnostics and Auto-correction
• Dynamic error checking alerts the programmer about issues
while typing.
• Provides suggestions for corrections.
• Helps identify and fix errors before program execution.
5. Autocompletion
• Offers context-sensitive suggestions while typing.
• Completes variable names and reserved keywords to reduce typing
effort and minimize errors.
6. Auto-documenter and Pretty-printing
• Auto-documenter generates comments to describe the purpose of
code automatically.
• Pretty-printing formats code using,
o Color coding for syntax highlighting.
o Indentation and layout for readability.