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

implements _dio_snum_to_chs (dummy on Atari)

git-svn-id: svn://svn.cc65.org/cc65/trunk@364 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cpg 2000-10-12 21:02:50 +00:00
parent 068d2d3fb9
commit 65006f5909

52
libsrc/atari/dio_stc.s Normal file
View File

@ -0,0 +1,52 @@
;
; Christian Groessler, October 2000
;
; this file provides the _dio_snum_to_chs function
;
; on the Atari this function is a dummy, it returns
; cylinder and head 0 and as sector the sectnum it got
;
; void __fastcall__ _dio_snum_to_chs(_sectnum_t sect_num,
; unsigned int *cyl,
; unsigned int *head,
; unsigned int *sector);
; _sectnum_t - 16bit
;
.export __dio_snum_to_chs
.include "atari.inc"
.importzp ptr1,ptr2
.import popax
.proc __dio_snum_to_chs
sta ptr1
stx ptr1+1 ; save pointer to sector #
jsr popax ; get pointer to head
sta ptr2
stx ptr2+1
lda #0
tay
sta (ptr2),y ; set head number
iny
sta (ptr2),y
jsr popax ; get pointer to cyl
sta ptr2
stx ptr2+1
dey
tya
sta (ptr2),y ; set cylinder number
iny
sta (ptr2),y
jsr popax ; get sector #
dey
sta (ptr1),y
iny
txa
sta (ptr1),y
rts
.endproc