2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 05.10.1998
|
2017-03-12 22:21:43 +00:00
|
|
|
; Christian Krueger, 11-Mar-2017, optimization
|
2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; CC65 runtime: Make boolean according to flags
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export boolne, booleq, boollt, boolle, boolgt, boolge
|
|
|
|
.export boolult, boolule, boolugt, booluge
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
boolne: bne ret1
|
2017-03-12 22:21:43 +00:00
|
|
|
ret0: ldx #$00
|
2013-05-09 11:56:54 +00:00
|
|
|
txa
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
2017-03-12 22:21:43 +00:00
|
|
|
booleq: bne ret0
|
|
|
|
ret1: ldx #$00
|
|
|
|
lda #$01
|
2013-05-09 11:56:54 +00:00
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
boolle: beq ret1
|
|
|
|
boollt: bmi ret1
|
|
|
|
ldx #$00
|
|
|
|
txa
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
boolgt: beq L0
|
|
|
|
boolge: bpl ret1
|
|
|
|
L0: ldx #$00
|
|
|
|
txa
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
boolule:
|
2013-05-09 11:56:54 +00:00
|
|
|
beq ret1
|
2000-05-28 13:40:48 +00:00
|
|
|
boolult:
|
2013-05-09 11:56:54 +00:00
|
|
|
bcc ret1
|
|
|
|
ldx #$00
|
|
|
|
txa
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
boolugt:
|
2017-03-12 22:21:43 +00:00
|
|
|
beq ret0
|
2000-05-28 13:40:48 +00:00
|
|
|
booluge:
|
2017-03-12 22:21:43 +00:00
|
|
|
ldx #$00
|
2013-05-09 11:56:54 +00:00
|
|
|
txa
|
2017-03-12 22:21:43 +00:00
|
|
|
rol a
|
2013-05-09 11:56:54 +00:00
|
|
|
rts
|