1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

get transfer size from sectsizetab

git-svn-id: svn://svn.cc65.org/cc65/trunk@373 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cpg 2000-10-16 23:23:22 +00:00
parent a35cafa626
commit e32644afb0

View File

@ -1,10 +1,10 @@
;
; Christian Groessler, October 2000
;
; this file provides the __sio_call function
; the function does a SIO call, it's not completely
; This file provides the __sio_call function
; The function does a SIO call, it's not completely
; generic (e.g. transfer size is fixed), it's used
; to save space with _dio_read and _dio_write functions
; to save space with _dio_read and _dio_write functions.
;
; unsigned char __fastcall__ _sio_call(_driveid_t drive_id,
; _sectnum_t sect_num,
@ -12,12 +12,13 @@
; unsigned int sio_val);
; _driveid_t - 8bit
; _sectnum_t - 16bit
; sio_cal is (sio_command | sio_direction << 8)
; sio_val is (sio_command | sio_direction << 8)
;
.export __sio_call
.include "atari.inc"
.import popa,popax
.import sectsizetab
.proc __sio_call
@ -30,18 +31,21 @@
sta DAUX1 ; set sector #
stx DAUX2
jsr popa
cmp #16
cmp #NUMDRVS
bcs _inv_dev ; invalid device #
adc #1
sta DUNIT ; unit number (d1,d2,d3,...)
sbc #0
asl a
tax
lda sectsizetab,x
sta DBYTLO ; low byte of bytes to transfer
lda sectsizetab+1,x
sta DBYTHI ; high byte of bytes to transfer
lda #$31 ; D1 (drive_id == 0) has id $31
sta DDEVIC
lda #0
sta DBYTHI ; high byte of bytes to transfer
lda #15
sta DTIMLO ; value got from DOS source
lda #128
sta DBYTLO ; low byte of bytes to transfer
jsr SIOV ; execute