User manual
37
Subprogramme:
Address
Command
Data
Comment
08
7
2
A = A-1
09
E
0
Ret
80 D8 54 29 D8 54 28 37 72 E0
Listing 21: Subprogramme calls
The result of the programme is a downwards counting binary counter with uneven time delays.
Also test other commands in the subprogramme.
There are several useful subprogrammes for general use among the example programmes in
the delivery condition. They are listed completely in the Appendix. Only the entrance address
needs to be known for using them:
50: Subprogramme: Long sound
52: Subprogramme: Short sound
53: Subprogramme: Any sound, length in A
60: Subprogramme: Wait for pushed button S1
68: Subprogramme: Wait for pushed button S2
70: Subprogramme: Number input with S1 and S2
The subprogramme from address 60 onwards is only used to set up a counter that is controlled
via button S1. The counter reading starts at 0. The main programme is relatively short because
the complex task of the button queries has been outsourced into the subprogramme.
Address
Command
Data
Comment
00
4
0
A = 0
01
5
4
Output
02
7
1
A = A+1
03
8
6
Page 6
04
D
0
Call 60, button S1
05
3
4
Jump –4
40 54 71 86 D0 34
Listing 22: Counter controlled via S1
Test the programme. If you push S1 ten times, the result should be 1010. Change the
programme so that the subprogramme is used from address 68. Now the counter reacts to S2.