]> git.sur5r.net Git - cc65/commitdiff
Added peekxsys functions for the 610
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 14 Sep 2001 08:42:17 +0000 (08:42 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 14 Sep 2001 08:42:17 +0000 (08:42 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@918 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/cbm610/Makefile
libsrc/cbm610/peeksys.s [new file with mode: 0644]

index ea51689c802c939fd8527dad1355a502405b2d27..d6575c5ef87dc47aed1e0e92d8d9ec0db0aa2069 100644 (file)
@@ -25,6 +25,7 @@ OBJS =        _scrsize.o      \
                kplot.o         \
        kscnkey.o       \
        kudtim.o        \
+       peeksys.o       \
        pokesys.o       \
        rs232.o
 
diff --git a/libsrc/cbm610/peeksys.s b/libsrc/cbm610/peeksys.s
new file mode 100644 (file)
index 0000000..e311060
--- /dev/null
@@ -0,0 +1,50 @@
+;
+; Ullrich von Bassewitz, 14.09.2001
+;
+
+       .export         _peekbsys, _peekwsys
+       .importzp       ptr1
+
+       .include        "zeropage.inc"
+
+
+; ------------------------------------------------------------------------
+; unsigned char __fastcall__ peekbsys (unsigned addr);
+
+.proc  _peekbsys
+
+       sta     ptr1            ; Store argument pointer
+       stx     ptr1+1
+               ldx     IndReg
+       lda     #$0F
+       sta     IndReg
+       ldy     #$00
+       lda     (ptr1),y
+       stx     IndReg
+       ldx     #$00            ; Extend to word
+       rts
+
+.endproc
+
+; ------------------------------------------------------------------------
+; unsigned __fastcall__ peekwsys (unsigned addr);
+
+.proc  _peekwsys
+
+       sta     ptr1            ; Store argument pointer
+       stx     ptr1+1
+               ldx     IndReg
+       lda     #$0F
+       sta     IndReg
+       ldy     #$00
+       lda     (ptr1),y        ; Get low byte
+       pha
+       iny
+       lda     (ptr1),y        ; Get high byte
+       stx     IndReg
+       tax                     ; High byte -> X
+       pla                     ; Low byte -> A
+       rts
+
+.endproc
+