2 ; Christian Groessler, October 2000
4 ; This file provides the __sio_call function
5 ; The function does a SIO call, it's not completely
6 ; generic (e.g. transfer size is fixed), it's used
7 ; to save space with _dio_read and _dio_write functions.
9 ; unsigned char __fastcall__ _sio_call(dhandle_t handle,
13 ; dhandle_t - 16bit (ptr)
14 ; sio_val is (sio_command | sio_direction << 8)
20 .import sectsizetab,__oserror
25 sta DCOMND ; set command into DCB
26 stx DSTATS ; set data flow directon
27 jsr popax ; get buffer address
28 sta DBUFLO ; set buffer address into DCB
31 sta DAUX1 ; set sector #
41 beq _inv_hand ; handle not open or invalid
48 sta DUNIT ; unit number (d1,d2,d3,...)
50 lda DAUX2 ; high byte sector #
53 cmp #4 ; sectors 1 to 3 are special (always 128 bytes)
62 _realsz:ldy #sst_sectsize
69 _cont: lda #DISKID ; SIO bus ID of diskette drive
72 sta DTIMLO ; value got from DOS source
78 bmi _req_err ; error occurred
79 txa ; no error occurred