]> git.sur5r.net Git - cc65/blob - libsrc/cbm510/pokesys.s
Add a goto indirect jump from pointer
[cc65] / libsrc / cbm510 / pokesys.s
1 ;
2 ; Ullrich von Bassewitz, 13.09.2001
3 ;
4 ; void pokebsys (unsigned Addr, unsigned char Val);
5 ; void pokewsys (unsigned Addr, unsigned Val);
6
7         .export         _pokebsys, _pokewsys
8         .import         popsreg
9         .importzp       sreg, tmp1
10
11         .include        "cbm510.inc"
12
13
14 ; ------------------------------------------------------------------------
15 ;
16
17 .proc   _pokebsys
18
19         jsr     popsreg         ; Get the address
20         ldx     IndReg
21         ldy     #$0F
22         sty     IndReg          ; Switch to the system bank
23         ldy     #$00
24         sta     (sreg),y
25         stx     IndReg
26         rts
27
28 .endproc
29
30 ; ------------------------------------------------------------------------
31 ;
32
33 .proc   _pokewsys
34
35         stx     tmp1            ; Save high byte
36         jsr     popsreg         ; Get the address
37         ldx     IndReg
38         ldy     #$0F
39         sty     IndReg          ; Switch to the system bank
40         ldy     #$00
41         sta     (sreg),y
42         iny
43         lda     tmp1
44         sta     (sreg),y
45         stx     IndReg
46         rts
47
48 .endproc
49