You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers the classification of programming languages into low-level (machine code and assembly) and high-level languages. For the OCR H446 exam, you must understand the characteristics of each level, compare them, and explain when each type is appropriate.
Programming languages exist on a spectrum from low-level (close to hardware) to high-level (close to human language).
Human Language
|
High-Level Languages (Python, Java, C#, JavaScript)
|
Assembly Language
|
Machine Code
|
Hardware (CPU)
Machine code is the lowest-level programming language — it consists of binary instructions (sequences of 0s and 1s) that the CPU can execute directly.
| Feature | Detail |
|---|---|
| Format | Binary (e.g. 0011 0001 0000 1010) |
| Readability | Virtually unreadable to humans |
| Portability | Specific to a particular CPU architecture — code written for an x86 processor will not run on ARM |
| Execution | Executed directly by the CPU with no translation needed |
| Speed | Fastest possible — no translation overhead |
| Use today | Almost never written by hand; generated by compilers and assemblers |
Each machine code instruction consists of an opcode (the operation) and an operand (the data or address).
Assembly language is a low-level language that uses mnemonics (short, human-readable abbreviations) to represent machine code instructions.
| Feature | Detail |
|---|---|
| Format | Mnemonics (e.g. LDA 50, ADD R1 R2, MOV AX BX) |
| Readability | Much more readable than binary, but still requires knowledge of the specific processor |
| Portability | Not portable — tied to a specific CPU architecture. ARM assembly is different from x86 assembly |
| Translation | Must be translated into machine code by an assembler before execution |
| Relationship to machine code | One-to-one — each assembly instruction corresponds to exactly one machine code instruction |
| Assembly (ARM-like) | Machine Code (binary) | Meaning |
|---|---|---|
| LDA #5 | 0001 0000 0000 0101 | Load the value 5 into the accumulator |
| ADD #3 | 0010 0000 0000 0011 | Add 3 to the accumulator |
| STA 100 | 0011 0000 0110 0100 | Store the accumulator value at address 100 |
| Use Case | Why Assembly? |
|---|---|
| Device drivers | Need direct hardware access and precise control over timing |
| Embedded systems | Tight memory and performance constraints; every byte and cycle matters |
| Operating system kernels | Low-level hardware interaction (e.g. interrupt handlers, context switching) |
| Real-time systems | Predictable execution time is critical |
| Reverse engineering | Analysing compiled programs |
| Performance-critical code | Inner loops in games or scientific simulations where every nanosecond counts |
High-level languages use syntax that is closer to human language and mathematical notation. They abstract away the details of the hardware.
| Feature | Detail |
|---|---|
| Format | English-like syntax (e.g. if, while, for, print, function) |
| Readability | Easy to read and write for humans |
| Portability | Portable — the same source code can run on different hardware if a suitable compiler/interpreter is available |
| Translation | Must be translated into machine code by a compiler or interpreter |
| Relationship to machine code | One-to-many — one high-level statement typically translates to multiple machine code instructions |
| Abstraction | Programmer does not need to know about registers, memory addresses or CPU-specific instructions |
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.