From 65006f590929d6358416810236e79dfc06aece14 Mon Sep 17 00:00:00 2001 From: cpg Date: Thu, 12 Oct 2000 21:02:50 +0000 Subject: [PATCH] implements _dio_snum_to_chs (dummy on Atari) git-svn-id: svn://svn.cc65.org/cc65/trunk@364 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/atari/dio_stc.s | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 libsrc/atari/dio_stc.s diff --git a/libsrc/atari/dio_stc.s b/libsrc/atari/dio_stc.s new file mode 100644 index 000000000..992eebe70 --- /dev/null +++ b/libsrc/atari/dio_stc.s @@ -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 + -- 2.39.5