1/9
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is the typical format of machine code?
Each instruction is split into two parts: the opcode and the operand
The first few bits hold the opcode, the remaining bits hold the operand
The number of bits allocated to each varies between processor designs
What is meant by opcode?
Specifies the type of operation the CPU should perform
e.g. ADD, LOAD, STORE, JUMP
What is meant by operand?
The data to be operated on, or the memory address where that data is held
A single instruction can have one or more operands
What is meant by low-level programming language?
Code that closely reflects how the CPU actually executes instructions
What is meant by high-level programming language?
Code written closer to natural language, describing what to do rather than how the CPU should do it
How is assembly language an improvement to machine code?
Mnemonics replace binary opcodes - short, descriptive codes that are easier to remember and read
e.g. STO instead of 0001, ADD instead of 0010
Symbolic addresses/labels replace binary operands, making code easier to follow
e.g. STO 2 instead of 0001 0010
What is an advantage of writing code in an low-level language?
Fast and Memory efficient as it directly controls hardware
Useful for time-critical or memory-constrained systems e.g. embedded systems, device drivers
What is an disadvantage of writing code in an low-level language?
Difficult to write, read and debug
Requires lots code for simple tasks
Code written for one processor will not work on a different processor architecture
What is an advantage of writing code in an high-level language?
Easier to write, read, debug and maintain
The same code can run on different hardware with little or no modification
What is an disadvantage of writing code in an high-level language?
Less control over hardware
Generally slower than low-level
A compiler or interpreter is needed before the CPU can execute it