]> git.sur5r.net Git - cc65/blob - libsrc/runtime/makebool.s
a15b24b9335dee4acc1a1aedc5de7ba1c440e38f
[cc65] / libsrc / runtime / makebool.s
1 ;
2 ; Ullrich von Bassewitz, 05.10.1998
3 ;
4 ; CC65 runtime: Make boolean according to flags
5 ;
6
7         .export         boolne, booleq, boollt, boolle, boolgt, boolge
8         .export         boolult, boolule, boolugt, booluge
9
10
11 boolne: bne     ret1
12         ldx     #$00
13         txa
14         rts
15
16
17 booleq: beq     ret1
18         ldx     #$00
19         txa
20         rts
21
22
23 boolle: beq     ret1
24 boollt: bmi     ret1
25         ldx     #$00
26         txa
27         rts
28
29
30 boolgt: beq     L0
31 boolge: bpl     ret1
32 L0:     ldx     #$00
33         txa
34         rts
35
36
37 boolule:
38         beq     ret1
39 boolult:
40         bcc     ret1
41         ldx     #$00
42         txa
43         rts
44
45
46 boolugt:
47         beq     L1
48 booluge:
49         bcs     ret1
50 L1:     ldx     #$00
51         txa
52         rts
53
54
55 ret1:   ldx     #$00
56         lda     #$01
57         rts
58
59
60