User manual
30
Address
Command
Data
Comment
00
6
9
A = AD1
01
5
4
Port = A
02
7
A
A = Not A
03
5
9
PWM = A
04
2
6
Wait for 100 ms
05
3
5
Jump –5
69 54 7A 59 26 35
Listing 14: Invert
12 Jumps and Branches
Up to now, there was only a simple jump back (command 3) that went back up to 15 addresses.
Now we add an absolute jump. Since the jump target can only be indicated with 4 bit, there is an
additional command that specifies the high nibble of the address. This gives you an address
space of 0–255. This is more than you need, since the EEPROM of the controller only holds 128
bytes, i.e. the area 00 to 7F (decimal 0 to 127). The memory is thus virtually divided into eight
pages, pages 0 to 7. The page of the jump target must be specified before an absolute jump.
Two counting loops with the variables C and D also perform absolute jumps, with the page of the
address having to be specified before here as well.
The conditional jumps work as skip commands. When the respective condition is true, an
address is skipped. There, e.g. a jump command or computing command might be written. The
conditions can be comparisons between A and B or direct bit queries of the input port.
There also is a subprogramme call and the associated return command. While several
subprogrammes are permitted, a subprogramme must not call another subprogramme, because
the interpreter only remembers the return address at a time.
80–8F: Adr-high = 0–15
90–0F: Direct jump to Adr-high, Adr-low (0–15)
A0–AF: Counting loop C-times Adr-high, Adr-low (0–15)
B0–BF: Counting loop D-times Adr-high, Adr-low (0–15)
C1–CF: Conditional jump: if (condition 1–15) then skip
C1: if A > B then Adr = Adr + 1
C2: if A > B then Adr = Adr + 1
C3: if A = B then Adr = Adr + 1
C4: if Din.0 = 1 then Adr = Adr + 1
C5: if Din.1 = 1 then Adr = Adr + 1