User manual

39
In the core of the programme, the skip commands that are already known are used. If the
respective button is not pushed, the associated command to increase or reduce the accumulator
content is skipped. The problem is that this can usually lead to an overrun from 15 to 0 or from 0
to 15. Preventing this overrun requires somewhat more effort. For this, you have to query
whether the lower end (0) or the upper end (15) has already been reached. Since the
accumulator is always involved in a comparison, its content must be put in interim memory. This
is used by setting variable C.
Address
Command
Data
Comment
00
8
0
AdrHi = 0
01
5
9
PWM = A
02
2
7
200 ms
03
5
2
C = A
04
4
F
A = 15
05
5
1
B = A
06
6
2
A = C
07
C
2
Skip if A<B
08
9
B
Jump 0B
09
C
F
Skip if S2 = 1
0A
7
1
A = A + 1
0B
5
2
C = A
0C
4
0
A = 0
0D
5
1
B = A
0E
6
2
A = C
0F
C
1
Skip if A>B
10
9
0
Jump 00
11
C
E
Skip if S1 = 1
12
7
2
A = A 1
15
9
0
Jump 00
80 59 27 52 4F 51 62 C2 9B CF 71 52 40 51 62 C1 90 CE 72 90
Listing 24: Brightness control