Professional Documents
Culture Documents
INPUT
PROCESS DECISION OUTPUT START
CONNECTO
SUB R
ROUTINE TERMINATION
Program development steps
• Example flowchart START
READ VALUE
FROM SENSOR
ADD 7
STORE RESULT
IN MEMORY
WAIT 1 HOUR
24
SAMPLES?
STOP
Program development steps
• Pseudocodes
– English-like statements used to represent the commonly used
structures:
• SEQUENCE, IF-THEN-ELSE, WHILE-DO
– Early days approach: structured programming – breaking problem into
independent modules (or reverse)
• E.g IF Temperature is less than 70 degrees THEN
Turn on heater
ELSE
Turn off heater
Program development steps
• Reading assignment:
– Standard Program Structures
• SEQUENCE
• IF – THEN
• IF – THEN – ELSE
• WHILE – DO
• REPEAT UNTIL
• CASE
Addressing Modes
• Addressing modes:
– The different ways in which a processor can access data that it
operates on
– Indicated in the instruction in assembly languages
– E.g. Move instruction format:
MOV destination, source
Source – could be a number, register or memory location
Destination – can be register or memory (1 of 24 ways)
NB: both source and destination can’t be memory locations in an instruction
Addressing Modes