summaryrefslogtreecommitdiff
path: root/ldmicro/reg/tests/integers.ld
blob: d38a59766669d5314c7ce11cbd603210294363df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
LDmicro0.1
MICRO=Atmel AVR ATmega162 40-PDIP
CYCLE=50000
CRYSTAL=10000000
BAUD=2400
COMPILED=C:\depot\ldmicro\reg\expected\integers.hex

IO LIST
    Xa at 1
    Yno at 16
    Yok at 37
END

PROGRAM
RUNG
    COMMENT Test integer variable manipulations: move, arithmetic, comparison. Also test\r\na 50 ms cycle time, and the ATmega162 (odd timer register locations).
END
RUNG
    PARALLEL
        SERIES
            CONTACTS Xa 0
            MOVE a 1323
        END
        SERIES
            CONTACTS Xa 1
            MOVE a -12
        END
    END
END
RUNG
    PARALLEL
        ADD c a 1000
        SUB d a 5
        MUL e a 3
        DIV f e 3
    END
END
RUNG
    PARALLEL
        EQU a 1323
        SHORT
    END
    PARALLEL
        LES c 0
        LEQ d 1318
        SHORT
    END
    SHORT
    PARALLEL
        GRT c 20000
        GEQ e 3969
        OPEN
    END
    COIL Yok 0 0 0
END
RUNG
    NEQ e -36
    GRT a 0
    TON Ton 1000000
    COIL Yno 0 0 0
END