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(_driveid_t drive_id,
10 ; _sectnum_t sect_num,
12 ; unsigned int sio_val);
15 ; sio_cal is (sio_command | sio_direction << 8)
24 sta DCOMND ; set command into DCB
25 stx DSTATS ; set data flow directon
26 jsr popax ; get buffer address
27 sta DBUFLO ; set buffer address into DCB
30 sta DAUX1 ; set sector #
34 bcs _inv_dev ; invalid device #
36 sta DUNIT ; unit number (d1,d2,d3,...)
37 lda #$31 ; D1 (drive_id == 0) has id $31
40 sta DBYTHI ; high byte of bytes to transfer
42 sta DTIMLO ; value got from DOS source
44 sta DBYTLO ; low byte of bytes to transfer
50 bmi _req_err ; error occurred
51 txa ; no error occurred
57 lda #NONDEV ; non-existent device error