5 missions. Guess, learn, then check. Your place is saved.
Mission 1One CPU core, three apps at once. How is that possible?
Mission 2You tap a key mid-game. How does the CPU notice straight away?
Mission 3Why write a 1999 hit game almost entirely in assembly?
Mission 4Why do some languages show all your errors, and others just one?
Mission 5How can a program tell you which line your bug is on?
The specification points and sources are listed under the lesson: see Sources.
Mission 1
One CPU core, three apps at once. How is that possible?
Make a guess: One CPU core, three apps at once. How is that possible?
Systems software · operating systems
The manager between apps and hardware
The operating system (OS) is system software that manages the hardware and provides a platform for applications to run on.
Apps don't control the hardware themselves: they ask the OS.
The OS loads apps into memory, starts them and closes them.
System software manages the computer's resources, e.g. the OS and utility software. Application software does tasks for the user, e.g. a web browser or a game.
Systems software · operating systems
Sharing the processor and memory
Each running program is a process. One core runs one instruction at a time.
The OS schedules processes: each gets a short time slice on the CPU, then the OS switches to the next.
Switching is so fast that programs seem to run at once: multitasking.
Memory management: the OS gives each program its own area of RAM, keeps programs apart, and frees the area when a program closes.
Quick check
?On a single-core laptop you play music, download a file and type an essay. What keeps all three going?
Systems software · operating systems
Devices and files
The OS manages peripherals (input, output and storage devices) and the data passing between them and the processor.
A device driver lets the OS communicate with one particular device. It translates OS commands into ones that device understands.
File management: the OS organises files into folders and lets you name, save, move, copy and delete them.
Systems software · operating systems
Interface, users and security
The user interface lets you control the computer, e.g. a graphical user interface (GUI) with windows, icons, menus and a pointer, or a command-line interface where you type commands.
User management: the OS creates user accounts, checks logins and gives each account access rights to particular files and programs.
Security: the OS asks for a password or other login, blocks unauthorised access to files and memory, and installs security updates.
Systems software · operating systems
From power-on to apps
Hardware is the physical parts of the computer.
Firmware is software stored permanently on a chip in the hardware. The bootloader is firmware.
At switch-on, the bootloader runs on the hardware and loads the OS into memory.
The OS runs on the firmware, and applications run on the OS: an app needs every layer below it.
The OS also handles interrupts from hardware and software.
Quick check
?A new printer is detected, but every page comes out as strange symbols. Which software most likely needs installing or updating?
Mission check
?One CPU core, three apps at once. How is that possible?
They don't really run at the same moment. The operating system schedules the processes, giving each a short time slice on the core and switching between them so quickly that all three appear to run at once.
Mission 2
You tap a key mid-game. How does the CPU notice straight away?
Make a guess: You tap a key mid-game. How does the CPU notice straight away?
Systems software · interrupts
A signal that asks for attention
An interrupt is a signal to the processor that something needs attention.
Hardware interrupts come from devices, e.g. pressing a key, moving the mouse, or a printer running out of paper.
Software interrupts come from programs, e.g. a division by zero, or two processes trying to access the same memory location.
With interrupts, the CPU doesn't waste time repeatedly checking each device.
Quick check
?Which of these generates a software interrupt?
Systems software · interrupts
Handling an interrupt
The CPU checks for interrupts at the end of each fetch–decode–execute cycle.
If one is waiting with a higher priority than the current task, the CPU saves its current state: the contents of its registers.
It runs the interrupt service routine (ISR): code that deals with that interrupt, e.g. reading which key was pressed.
Then it restores the saved registers and carries on exactly where it stopped.
Systems software · interrupts
Priorities and results
The operating system manages interrupts: it gives each type a priority and runs the right ISR.
Higher-priority interrupts are handled first; others wait their turn. A power failure comes before a mouse movement.
The result depends on the interrupt: a letter appears on screen, a "paper out" message is shown, or a program that divided by zero stops with an error.
Quick check
?The CPU finds a waiting interrupt with a higher priority than its current task. What does it do first?
Quick check
?Three interrupts are waiting: the mouse moved, a printer ran out of paper, and the power supply is failing. Which ISR runs first?
Mission check
?You tap a key mid-game. How does the CPU notice straight away?
Pressing the key sends a hardware interrupt to the CPU. The CPU checks for interrupts at the end of every fetch–decode–execute cycle, so within moments it saves its registers, runs the interrupt service routine for the keyboard, then restores its registers and carries on with the game.
Mission 3
Why write a 1999 hit game almost entirely in assembly?
Make a guess: Why write a 1999 hit game almost entirely in assembly?
Languages · levels of programming language
What the processor actually runs
A CPU can only execute machine code: instructions in binary.
Each instruction is a simple step, such as load a value, add, store a result or jump.
Each processor family has its own instruction set, so machine code for one family won't run on another.
Machine code and assembly language are low-level languages: they work directly with the processor's own instructions.
Languages · levels of programming language
Assembly language
Assembly language replaces binary with short mnemonics such as LDA (load), ADD and STA (store).
Each assembly instruction matches exactly one machine code instruction: a 1:1 correspondence.
Like machine code, it is specific to one processor family.
An assembler translates assembly language into machine code.
Assembly language (illustrative)
LDA price ; load price into the processor
ADD tax ; add tax to it
STA total ; store the result in total
Languages · levels of programming language
High-level languages
High-level languages use English-like keywords and maths-style expressions.
One statement often becomes several machine code instructions: the line below becomes the three assembly instructions you just met.
They are machine independent: the same source code can be translated to run on different processor families.
A compiler or interpreter must translate the code before the CPU can run it.
Most programs are high-level: they are quicker to write, read and debug.
Cambridge pseudocode
Total ← Price + Tax
Quick check
?A programmer writes the line STA total. What kind of code is this?
Calculate
?An assembly program has these 3 lines: LDA price, ADD tax, STA total. How many machine code instructions will it become?
Languages · levels of programming language
Choosing a level
High-level
Low-level
Reading and writing
easier: English-like
harder: mnemonics or binary
Debugging
easier to find and fix errors
harder
Portability
machine independent
works on one processor family
Hardware control
indirect, through the OS
direct control of registers and memory
Speed and memory
translated code may be less efficient
can be very fast and compact
Use low-level for device drivers, embedded systems and code where speed or memory is critical.
Use high-level for most applications, where quick development matters more.
Quick check
?A smart thermostat has a tiny chip with very little memory, and its program must control a temperature sensor directly. Which level of language suits it best?
Mission check
?Why write a 1999 hit game almost entirely in assembly?
Assembly gives the programmer direct control of the processor's own instructions, so the code can be very fast and compact. Its creator said a high-level language would have run too slowly on the PCs of 1999, or forced a simpler game. The price was code that is much harder to write, read and debug.
Mission 4
Why do some languages show all your errors, and others just one?
Make a guess: Why do some languages show all your errors, and others just one?
Languages · translators
Why translate?
The CPU can only execute machine code, so the source code that programmers write must be translated first.
A translator is a program that converts source code into a form the CPU can execute.
High-level code is translated by a compiler or an interpreter.
Assembly is translated by an assembler: each assembly instruction becomes one machine code instruction.
Languages · translators
Compiler or interpreter?
A compiler translates the whole program before it runs, producing an executable file of machine code that runs without the compiler.
An interpreter translates and runs the code one line at a time. It is needed every time the program runs.
Errors: a compiler gives an error report for the whole program; an interpreter stops at the first error.
Quick check
?An 8-line program has errors on lines 4 and 7. What happens when you run it with an interpreter?
Languages · translators
Choosing a translator
Compiler
Interpreter
Translates
the whole program, before it runs
one line at a time, as it runs
Produces
an executable file
no executable file
Running speed
fast: already translated
slower: translated again every run
Finding errors
report after translating everything
stops at the error, easy to see where
After a change
must recompile the whole program
just run it again
Sharing
send the executable; source stays private
users need the source and an interpreter
An interpreter is mostly used while developing and testing a program; a compiler translates the final program for release.
An assembler is used when a program is written in assembly, e.g. for embedded systems or device drivers.
Quick check
?A games studio is ready to release its finished game and doesn't want players to see its source code. Which translator should it use?
Mission check
?Why do some languages show all your errors, and others just one?
A compiler translates the whole program before it runs, so it can list every error it finds in one report. An interpreter translates and runs one line at a time, so it stops as soon as it reaches the first error.
Mission 5
How can a program tell you which line your bug is on?
Make a guess: How can a program tell you which line your bug is on?
Languages · IDEs
One program for writing, running and fixing code
An Integrated Development Environment (IDE) is software that puts tools for writing, translating, running and debugging code in one place.
The editor is where you write and edit code. It shows line numbers, colours keywords and indents code automatically, so code is easier to read.
Auto-completion suggests the rest of a word as you type; auto-correction fixes common typing mistakes; prettyprint lays code out with clear indents and colours.
Languages · IDEs
Translate, run and diagnose
The IDE includes a translator, so you can compile or interpret your code with one click.
The run-time environment runs your program inside the IDE: you see its output and enter input, and if it crashes the IDE shows what went wrong.
Error diagnostics report each error with a message and its line number, and highlight that line.
Calculate
?You run this program in an IDE. Which line number will the error diagnostics highlight?
Cambridge pseudocode
Total ← 0
FOR Count ← 1 TO 3
Total ← Total + Count
NXET Count
OUTPUT Total
Quick check
?As you type OUTP, the IDE offers to finish it as OUTPUT. Which IDE function is this?
Quick check
?A classmate's long program has no indentation and is hard to follow. Which IDE feature helps most?
Mission check
?How can a program tell you which line your bug is on?
The IDE translates your code, and when the translator (or the running program) hits a problem, the error diagnostics report a message with the line number. Because the editor numbers every line, you can go straight to the bug.
Recap
Big ideas
The OS is system software that manages the hardware and gives applications a platform to run on.
It shares the processor between processes (multitasking) and shares out memory, and manages peripherals using device drivers.
It also manages files, the user interface, user accounts and security.
An interrupt is a signal to the CPU that something needs attention; it can come from hardware or software.
The CPU checks for interrupts after each fetch–decode–execute cycle, saves its registers, runs the interrupt service routine, then restores its registers and carries on.
The operating system manages interrupts by priority, so urgent ones are handled first.
The CPU only runs machine code (binary); assembly uses mnemonics with a 1:1 match to machine code. Both are low-level and tied to one processor family.
High-level languages are easier to write, read and debug and are machine independent, but must be translated.
Low-level suits device drivers, embedded systems and speed-critical code; high-level suits most applications.
Source code must be translated before the CPU can run it: a compiler translates the whole program into an executable; an interpreter translates and runs it line by line.
Interpreters suit development and testing; compilers suit the final program; assemblers translate assembly language.
An IDE puts an editor, a translator, a run-time environment and error diagnostics in one program.
Editor features such as line numbers, colour coding and auto-completion and prettyprint make code easier to write and read.
🏆
Mini-lesson complete!
⭐⭐⭐
You've worked through Software for Cambridge IGCSE Computer Science (0478/0984). 🎉
Mission 1One CPU core, three apps at once. How is that possible?
Mission 2You tap a key mid-game. How does the CPU notice straight away?
Mission 3Why write a 1999 hit game almost entirely in assembly?
Mission 4Why do some languages show all your errors, and others just one?
Mission 5How can a program tell you which line your bug is on?
Specification points and sources for this lesson are listed at the bottom of the page.
Sources (8)
The specification points and sources behind this lesson.
1 Cambridge 0478 syllabus 2026–2028, 4.1.1–4.1.3
2 Cambridge 0478 syllabus 2026–2028, 4.1.2 and 4.1.4
3 Cambridge 0478 syllabus 2026–2028, 4.2.1–4.2.2
4 Cambridge 0478 syllabus 2026–2028, 4.2.2–4.2.4
5 Cambridge 0478 syllabus 2026–2028, 4.2.5
6 Chris Sawyer (the game's creator), official site: FAQ "Chris Sawyer Software Development", Q "What language was RollerCoaster Tycoon programmed in?" ("99% written in x86 assembler/machine code … with a small amount of C code used to interface to MS Windows and DirectX"), https://chrissawyergames.com/faq3.htm; release "early in 1999": https://chrissawyergames.com/info.htm
7 Atari (publisher of the RollerCoaster Tycoon series), "Interview with RollerCoaster Tycoon's creator Chris Sawyer", Atari's own Medium publication Atari Club, Carly Francis, 27 March 2024; Sawyer's own answer to "Why did you write RollerCoaster Tycoon in assembly language … rather than a high level language like C?", https://medium.com/atari-club/interview-with-rollercoaster-tycoons-creator-chris-sawyer-684a0efb0f13