]> git.sur5r.net Git - cc65/blob - libsrc/c64/revers.s
New EMD driver for the ISEPIC cartridge written and contributed by
[cc65] / libsrc / c64 / revers.s
1 ;
2 ; Ullrich von Bassewitz, 07.08.1998
3 ;
4 ; unsigned char revers (unsigned char onoff);
5 ;
6
7         .export         _revers
8
9         .include        "c64.inc"
10
11 .proc   _revers
12
13         ldx     #$00            ; Assume revers off
14         tay                     ; Test onoff
15         beq     L1              ; Jump if off
16         ldx     #$80            ; Load on value
17         ldy     #$00            ; Assume old value is zero
18 L1:     lda     RVS             ; Load old value
19         stx     RVS             ; Set new value
20         beq     L2              ; Jump if old value zero
21         iny                     ; Make old value = 1
22 L2:     ldx     #$00            ; Load high byte of result
23         tya                     ; Load low byte, set CC
24         rts
25
26 .endproc
27