]> git.sur5r.net Git - cc65/commitdiff
implements _dio_snum_to_chs (dummy on Atari)
authorcpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Oct 2000 21:02:50 +0000 (21:02 +0000)
committercpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 12 Oct 2000 21:02:50 +0000 (21:02 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@364 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/atari/dio_stc.s [new file with mode: 0644]

diff --git a/libsrc/atari/dio_stc.s b/libsrc/atari/dio_stc.s
new file mode 100644 (file)
index 0000000..992eebe
--- /dev/null
@@ -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
+