User manual
31
C6: if Din.2 = 1 then Adr = Adr + 1
C7: if Din.3 = 1 then Adr = Adr + 1
C8: if Din.0 = 0 then Adr = Adr + 1
C9: if Din.1 = 0 then Adr = Adr + 1
CA: if Din.2 = 0 then Adr = Adr + 1
CB: if Din.3 = 0 then Adr = Adr + 1
CC: if S1 = 0 then Adr = Adr + 1
CD: if S2 = 0 then Adr = Adr + 1
CE: if S1 = 1 then Adr = Adr + 1
CF: if S2 = 1 then Adr = Adr + 1
D0–DF: Subprogramme call Adr-high, Adr-low (0-15)
E0–EF: Return from subprogramme
One example of using conditional jump commands is found in the example programme in
chapter 6. Here, it has been slightly modified and put in address 0. Since the upper part of the
address (Adr-hi) is in the quiescent condition 0, and the controller starts on page 0, the
command 80 does not need to be used here. The length of a push of a button is measured and
displayed again. All waiting commands have been removed from the programme so that it now
works with a higher resolution.
Address
Command
Data
Comment
00
C
C
S1 = 0?
01
3
1
Jump –1
02
4
0
A = 0
03
7
1
A = A + 1
04
5
4
Port = A
05
C
E
S1 = 1?
06
3
3
Jump –3
07
3
7
Jump –7
CC 31 40 71 54 CE 33 37
Listing 15: Reactions to button S1
The jump command CC in address 00 evaluates the condition at buttons S1. In the quiescent
condition, S1 = 1. The condition therefore is not true and the command in address 01 is not
skipped. There is a relative jump command to the start. The programme repeats the commands
in addresses 00 and 01 until the button is pushed. The the condition becomes true and address
01 is skipped. This starts the actual measuring process. The accumulator is deleted and then
increased by 1 continually and output to the LEDs. Another conditional jump command CE is
placed in address 05. Here, the condition for skipping of a command is S1 = 1. Since the button
is still pushed at first, the condition is not true. The command in 06 therefore is performed and
causes a return to 03. Only when the button is released will the programme get to address 07
and thus a return to the start.