1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-31 11:32:00 +00:00

Added peekxsys functions for the 610

git-svn-id: svn://svn.cc65.org/cc65/trunk@918 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-09-14 08:42:17 +00:00
parent 0dd35700c9
commit cd1598fa89
2 changed files with 51 additions and 0 deletions

View File

@ -25,6 +25,7 @@ OBJS = _scrsize.o \
kplot.o \
kscnkey.o \
kudtim.o \
peeksys.o \
pokesys.o \
rs232.o

50
libsrc/cbm610/peeksys.s Normal file
View File

@ -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