24 total
By the end of this topic, you should be able to:
A programming language acts as a bridge between what humans understand and what a computer understands. Early computers required instructions to be written in binary code (just 0s and 1s), which was extremely slow and difficult. Over time, programming languages evolved to become more similar to human language, making it faster and easier for people to write programs.
Programming languages can be split into two main categories:
A low-level language is a programming language that directly translates to machine code that the processor understands. These languages allow programmers to have direct control over hardware components such as memory and registers (special storage locations inside the processor).
Low-level languages are written for specific processors to ensure they match the exact machine architecture of that processor.
Machine code is the most basic form of programming language.
Example of machine code:
10110111
00110110
11100110
Each of these binary numbers represents a specific instruction that the processor can carry out.
Assembly language is a step up from machine code. Instead of writing in binary, programmers can use short, abbreviated text commands called mnemonics (pronounced "neh-MON-iks").
Mnemonics are memory aids - short abbreviations that are easier to remember than binary code.
Common assembly language mnemonics include:
Example of assembly code:
INP X
STA X
LDA Y
Important point: One assembly language instruction translates to exactly one machine code instruction. This means assembly language and machine code have a one-to-one relationship.
However, the computer cannot directly execute assembly language - it needs to be translated into machine code first. A special program called an assembler does this translation.
| Advantages | Disadvantages |
|---|---|
| Complete control over system components - you can manipulate exactly how the hardware behaves | Difficult to write and understand - the code doesn't look like normal human language |
| Occupy less memory and execute faster because they work directly with the hardware | Machine dependent - code written for one type of processor won't work on another |
| Direct manipulation of hardware - you can access and control specific parts of the computer | More prone to errors - small mistakes can cause big problems |
| Requires knowledge of computer architecture - you need to understand how the processor works to program effectively |
Sign in to view full notes