Skip to content

Commit 7f0ddd4

Browse files
committed
Fix forgotten SetTarget call in LBA read/write/verify/seek
As the memory used to implement these calls is already completely used on the 2840 BIOS, adding "call SetTarget" requires to save three bytes, that's why the code had to be shuffled (to eliminate one short JMP) and another byte by using LODSW to transfer data from [SI] to AX.
1 parent c4659f1 commit 7f0ddd4

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

274x-211.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ VersionOfs = 18D8h
1515

1616
PATCH_VERSION MACRO
1717
;db "Release"
18-
db "EDD 1.0"
18+
db "EDD 1.1"
1919
ENDM
2020

2121
INCLUDE aic7770.asm

284x-101.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ VersionOfs = 40A4h
1313

1414
PATCH_VERSION MACRO
1515
;db "/2842VL BIOS v1.01 "
16-
db " BIOS v1.01/EDD 1.0"
16+
db " BIOS v1.01/EDD 1.1"
1717
ENDM
1818

1919
INCLUDE aic7770.asm

284x-200.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ VersionOfs = 4068h
1313

1414
PATCH_VERSION MACRO
1515
;db "/2842VL BIOS v1.01 "
16-
db " BIOS v2.0/EDD 1.0 "
16+
db " BIOS v2.0/EDD 1.1 "
1717
ENDM
1818

1919
INCLUDE aic7770.asm

aic7770.asm

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,19 @@ go_on:
203203
jmp I13FinishWithAH
204204

205205
org MyInt15Ofs
206+
I13E_seek:
207+
test byte ptr [bp+BIOSFlags], BF_IgnoreSeek ; TEST always clears CF
208+
jnz return_ok
209+
mov cx, 082Bh
210+
jmp I13E_common
211+
I13E_read:
212+
mov cx, 0028h
213+
jmp I13E_common_stc
214+
I13E_write:
215+
mov cx, 002Ah
216+
jmp I13E_common_stc
217+
I13E_verify:
218+
mov cx, 082Fh
206219
I13E_common_stc:
207220
stc
208221
I13E_common:
@@ -218,17 +231,19 @@ I13E_common:
218231
add ax, ax
219232
mov word ptr [bp+TransferLenLow + 1], ax ; transfer length
220233
; set LBA (bswapping it)
221-
mov ax, es:[si+8]
234+
add si, 8
235+
lods [WORD PTR es:si] ; offset 8, si=+10
222236
xchg ah, al
223237
mov word ptr [bp+CDBdata + 4], ax
224-
mov ax, es:[si+10]
238+
lods [WORD PTR es:si] ; offset 10, si=+12
225239
xchg ah, al
226240
mov word ptr [bp+CDBdata + 2], ax
227241
test [bp+VDSFlags], IsNoData
228242
jnz no_data
229-
les bx, es:[si+4]
243+
les bx, es:[si-12+4] ; offset 4, correct for si change
230244
call SetDataAddress
231245
no_data:
246+
call SetTarget
232247
call ExecuteCommand
233248
cmp ah, 1 ; unsupported command
234249
jne usual_case
@@ -241,21 +256,6 @@ usual_case:
241256
jmp I13FinishWithAH
242257

243258

244-
I13E_read:
245-
mov cx, 0028h
246-
jmp I13E_common_stc
247-
I13E_write:
248-
mov cx, 002Ah
249-
jmp I13E_common_stc
250-
I13E_verify:
251-
mov cx, 082Fh
252-
jmp I13E_common_stc
253-
I13E_seek:
254-
test byte ptr [bp+BIOSFlags], BF_IgnoreSeek ; TEST always clears CF
255-
jnz return_ok
256-
mov cx, 082Bh
257-
jmp I13E_common
258-
259259
org VersionOfs
260260
PATCH_VERSION
261261

0 commit comments

Comments
 (0)