]> git.sur5r.net Git - cc65/blob - libsrc/cbm610/peeksys.s
Protect random counter against ProDOS.
[cc65] / libsrc / cbm610 / peeksys.s
1 ;
2 ; Ullrich von Bassewitz, 14.09.2001
3 ;
4
5         .export         _peekbsys, _peekwsys
6         .importzp       ptr1
7
8         .include        "cbm610.inc"
9
10
11 ; ------------------------------------------------------------------------
12 ; unsigned char __fastcall__ peekbsys (unsigned addr);
13
14 .proc   _peekbsys
15
16         sta     ptr1            ; Store argument pointer
17         stx     ptr1+1
18         ldx     IndReg
19         lda     #$0F
20         sta     IndReg
21         ldy     #$00
22         lda     (ptr1),y
23         stx     IndReg
24         ldx     #$00            ; Extend to word
25         rts
26
27 .endproc
28
29 ; ------------------------------------------------------------------------
30 ; unsigned __fastcall__ peekwsys (unsigned addr);
31
32 .proc   _peekwsys
33
34         sta     ptr1            ; Store argument pointer
35         stx     ptr1+1
36         ldx     IndReg
37         lda     #$0F
38         sta     IndReg
39         ldy     #$00
40         lda     (ptr1),y        ; Get low byte
41         pha
42         iny
43         lda     (ptr1),y        ; Get high byte
44         stx     IndReg
45         tax                     ; High byte -> X
46         pla                     ; Low byte -> A
47         rts
48
49 .endproc
50