Skip to main content
EnglandElectronicsSyllabus dot point

How is a microcontroller programmed in assembly language to read inputs, make decisions and drive outputs?

Assembly language programming: instructions and registers, reading inputs and writing outputs, branching and loops, delays, and the program development cycle (flowchart, code, assemble, test).

An Eduqas A-Level Electronics answer on assembly language programming: instructions and registers, reading input pins and writing to output pins, branching and looping for decisions and repetition, generating delays, and the flowchart-code-assemble-test development cycle required for the non-exam assessment.

Generated by Claude Opus 4.814 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

Eduqas wants you to program a microcontroller in assembly language: instructions and registers, reading inputs and writing outputs, branching and loops, delays, and the flowchart-code-assemble-test development cycle. Writing and testing an assembly program is a required task in the non-exam assessment.

The answer

Instructions and registers

Reading inputs and writing outputs

Branching and loops

Delays and the development cycle

Examples in context

Assembly-language programming is the required skill for the Eduqas non-exam assessment microcontroller task, where a student must write and test an assembly program that solves an identified problem. The read-test-branch-write loop is the pattern behind every embedded controller: a thermostat reads a temperature, decides, and switches a heater; a toy reads a button and drives lights and sound. The ports and peripherals from the architecture topic are exactly what these instructions manipulate.

Try this

Q1. State what a register is in a microcontroller. [1 mark]

  • Cue. A small, fast storage location inside the CPU used to hold data being worked on.

Q2. State the type of instruction used to make a decision in an assembly program. [1 mark]

  • Cue. A conditional branch (it tests a value and jumps accordingly).

Q3. State the stages of the program development cycle. [2 marks]

  • Cue. Flowchart (plan), write the code, assemble, download, and test/debug against the specification.

Exam-style practice questions

Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

Eduqas 20206 marksDescribe, using a flowchart or pseudocode, an assembly-language program that turns on an LED on an output pin when a switch on an input pin is pressed, and turns it off otherwise. Name the type of instruction used to make the decision.
Show worked answer →

Program structure (up to 4 marks): the program loops forever. Each pass it reads the input pin (the switch), tests whether it is pressed, and branches: if pressed, it writes a high level to the output pin (LED on); if not, it writes a low level (LED off). In pseudocode: loop { read switch; if switch pressed then output high else output low; repeat }.

Decision instruction (up to 2 marks): a conditional branch (a compare-and-branch or bit-test-and-skip instruction) makes the decision: it tests the input bit and jumps to the LED-on or LED-off code accordingly.

Markers reward the read-test-branch-write loop structure, the LED on/off outputs, and naming the conditional branch (bit test and skip / compare and branch) as the decision instruction.

Eduqas 20225 marksExplain how a delay is created in an assembly-language program using a loop, and describe the program development cycle a student should follow for the non-exam assessment.
Show worked answer →

Delay loop (up to 2 marks): a delay is made by loading a register with a count and then decrementing it in a loop until it reaches zero (a "decrement and branch if not zero" loop). Each pass takes a fixed number of clock cycles, so the total delay is the count multiplied by the loop time; nesting loops gives longer delays.

Development cycle (up to 3 marks): plan the logic with a flowchart (or pseudocode); write the assembly code from the flowchart; assemble it (translate to machine code, fixing any syntax errors); download it to the microcontroller; and test it against the specification, debugging and refining until it works. Testing should be systematic, checking each input condition and output.

Markers reward the decrement-to-zero delay loop, and the flowchart-code-assemble-download-test cycle with systematic debugging.

Related dot points

Sources & how we know this