Control Structures
These are examples of control structures. You may also be interested in:

 Conditional structures
 Exceptions
 Flow-control structures
 Loops



Task

Document common flow-control structures.



One common example of a flow-control structure is the    goto    construct.

Note that   Conditional Structures   and   Loop Structures   have their own articles/categories.



Related tasks

   Conditional Structures
   Loop Structures 


PrintString:
ld a,(hl)       ;HL is our pointer to the string we want to print
cp 0            ;it's better to use OR A to compare A to zero, but for demonstration purposes this is easier to read.
ret z           ;return if accumulator = zero
call PrintChar  ;prints accumulator's ascii code to screen - on Amstrad CPC for example this label points to memory address &BB5A
inc hl          ;next char
jr PrintString  ;jump back to the start of the loop. RET Z is our only exit.