Apple2: spare 10 bytes on I/O

This commit is contained in:
Colin Leroy-Mira
2025-10-25 11:23:01 +02:00
committed by Oliver Schmidt
parent 25c1223f02
commit 707e317bb8

View File

@@ -27,17 +27,19 @@ rwcommon:
; Set fd ; Set fd
sta mliparam + MLI::RW::REF_NUM sta mliparam + MLI::RW::REF_NUM
; Set buf ; Set buf and count
lda ptr1 ; buf (ptr1) goes to mliparam + MLI::RW::DATA_BUFFER,
ldx ptr1+1 ; count (ptr2) goes to mliparam + MLI::RW::REQUEST_COUNT
sta mliparam + MLI::RW::DATA_BUFFER ; Make sure both are at expected offset so we can copy them
stx mliparam + MLI::RW::DATA_BUFFER+1 ; in a small loop.
.assert ptr2 = ptr1 + 2, error
.assert MLI::RW::REQUEST_COUNT = MLI::RW::DATA_BUFFER + 2, error
; Set count ldx #$03
lda ptr2 : lda ptr1,x
ldx ptr2+1 sta mliparam + MLI::RW::DATA_BUFFER,x
sta mliparam + MLI::RW::REQUEST_COUNT dex
stx mliparam + MLI::RW::REQUEST_COUNT+1 bpl :-
; Call read or write ; Call read or write
tya tya