]> git.sur5r.net Git - cc65/blob - libsrc/apple2/revers.s
New version from Oliver Schmidt
[cc65] / libsrc / apple2 / revers.s
1 ;
2 ; Kevin Ruland
3 ;
4 ; unsigned char __fastcall__ revers (unsigned char onoff)
5 ;
6
7         .export         _revers
8
9         .include        "apple2.inc"
10
11 _revers:
12         ldy     INVFLG          ; Stash old value
13         and     #$FF            ; Test for any bit
14         beq     normal          ; Nothing set
15         lda     #~$3F           ; Not Inverse
16 normal: eor     #$FF            ; Xor Normal
17         sta     INVFLG
18         tya                     ; What was the old value?
19         eor     #$FF            ; Normal = $FF, Inverse = $3F
20         beq     :+
21         lda     #$01
22 :       ldx     #$00
23         rts