1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-18 00:07:21 +00:00
cc65/libsrc/atari/dio_cts.s
cpg 16d52709b0 dio functions and types now have no leading _ anymore
git-svn-id: svn://svn.cc65.org/cc65/trunk@435 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-11-16 21:27:42 +00:00

70 lines
1.1 KiB
ArmAsm

;
; Christian Groessler, October 2000
;
; this file provides the _dio_phys_to_log function
; (previously called _dio_chs_to_snum, so the filename)
;
; on the Atari this function is a dummy, it ignores
; cylinder and head and returns as sector number the
; sector number it got
;
; unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle,
; dio_phys_pos *physpos, /* input */
; sectnum_t *sectnum); /* output */
;
; dhandle_t - 16bit (ptr)
; sectnum_t - 16bit
;
.export _dio_phys_to_log
.import popax,__oserror
.importzp ptr1,ptr2,ptr3
.include "atari.inc"
.proc _dio_phys_to_log
sta ptr1
stx ptr1+1 ; pointer to result
jsr popax
sta ptr2
stx ptr2+1 ; pointer to input structure
jsr popax
sta ptr3
stx ptr3+1 ; pointer to handle
ldy #sst_flag
lda (ptr3),y
and #128
beq _inv_hand ; handle not open or invalid
; ignore head and track and return the sector value
ldy #diopp_sector
lda (ptr2),y
tax
iny
lda (ptr2),y
ldy #1
sta (ptr1),y
dey
txa
sta (ptr1),y
ldx #0
txa
ret:
sta __oserror
rts ; return success
; invalid handle
_inv_hand:
ldx #0
lda #BADIOC
bne ret
.endproc