Low-level language

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Low-level language

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which of these is a low-level language?
A Assembly language
B Python
2. A low-level language is close to...
A everyday English
B the instructions the CPU understands
3. In a low-level language, each instruction usually does...
A one simple CPU operation
B many complex tasks at once
4. Which statement is true?
A Machine code is a high-level language
B Machine code is a low-level language
5. Why are low-level programs harder for people to read?
A They use simple CPU-level instructions instead of English-like commands
B They are always written in a different alphabet

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1LDA 5 ALow-level languages are close to the hardware, not to English, so they are harder for people to read.
210110000 01100001 BADD R1, R2
3Each low-level instruction is one simple CPU operation, such as adding two values Ctotal = a + b -> LDA a / ADD b / STA total
4Low-level code is close to the hardware, so one high-level line becomes many instructions DAssembly language is low-level, not high-level. Its mnemonics map closely to CPU instructions.
5Assembly language is a high-level language because it uses words EAn assembly language instruction that loads a value into the CPU, so it is a low-level language
6Low-level languages are easy for people to read because they are close to English FMachine code, the binary instructions the CPU understands directly

Definitions

low-level language

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
___ 10 ; load 10 into the accumulator
2.
LDA 10 ___ 5 ; add 5 to the accumulator
3.
LDA 10 ADD 5 ___ total ; store the result
4.
LDA __ ; load twenty into the accumulator
5.
STO total ___ ; stop the program

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A LDA 10
B AAD 11
C STO 12
D END
Question 2
A LOAD 20
B SUB 21
C STO 22
D END
Question 3
A LDA 5
B ADD 6
C STO 7,8
D END
Question 4
A 00000001 00002010
B 00000010 00001011
C 00000011 00001100
Question 5
A 00000001 00000101
B 00000010 00000110
C 0000011 00000111
D 11111111

Answer Key

Low-level language
Section A: Quick Questions
Q1
A — Assembly language
Q2
B — the instructions the CPU understands
Q3
A — one simple CPU operation
Q4
B — Machine code is a low-level language
Q5
A — They use simple CPU-level instructions instead of English-like commands
Section B: Match the Pairs
Q1
LDA 5 → An assembly language instruction that loads a value into the CPU, so it is a low-level language
Q2
10110000 01100001 → Machine code, the binary instructions the CPU understands directly
Q3
Each low-level instruction is one simple CPU operation, such as adding two values → ADD R1, R2
Q4
Low-level code is close to the hardware, so one high-level line becomes many instructions → total = a + b -> LDA a / ADD b / STA total
Q5
Assembly language is a high-level language because it uses words → Assembly language is low-level, not high-level. Its mnemonics map closely to CPU instructions.
Q6
Low-level languages are easy for people to read because they are close to English → Low-level languages are close to the hardware, not to English, so they are harder for people to read.
Section C: Definitions
Q1
low-level language — A programming language close to the CPU's instructions, such as machine code or assembly language. Each instruction is one simple CPU operation, so it is harder for people to read.
Section D: Fill in the Blanks
Q1
LDA 10 ; load 10 into the accumulator
Q2
LDA 10 ADD 5 ; add 5 to the accumulator
Q3
LDA 10 ADD 5 STO total ; store the result
Q4
LDA 20 ; load twenty into the accumulator
Q5
STO total END ; stop the program
Section E: Spot the Error
Q1
B — The assembly mnemonic for adding is ADD, not AAD. Each mnemonic stands for exactly one simple CPU operation, so it must be spelled correctly. The line should be ADD 11.
Q2
A — In this assembly language the mnemonic that loads a value into the accumulator is LDA. LOAD is not a valid instruction. The line should be LDA 20.
Q3
C — A low-level instruction does one simple operation, so STO takes a single address. It cannot store to two places at once. The line should be STO 7.
Q4
A — Machine code is written only in binary, using 0s and 1s. The digit 2 is not allowed. The line should be 00000001 00001010.
Q5
C — Every machine code instruction here has an 8-bit opcode. This one is missing a bit, so the CPU would read it wrongly. The line should be 00000011 00000111.