summaryrefslogtreecommitdiff
path: root/memdisk/memdisk.asm
diff options
context:
space:
mode:
Diffstat (limited to 'memdisk/memdisk.asm')
-rw-r--r--memdisk/memdisk.asm19
1 files changed, 11 insertions, 8 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm
index fc46e844..1e27e1e9 100644
--- a/memdisk/memdisk.asm
+++ b/memdisk/memdisk.asm
@@ -91,7 +91,9 @@ Pointers: dw Int13Start
dw Int15Start
dw PatchArea
dw TotalSize
+ dw IretPtr
+IretPtr equ Int13Start.iret
Int13Start:
; Swap stack
mov [cs:Stack],esp
@@ -139,7 +141,7 @@ Int13Start:
pop ax
pop bp
lss esp,[cs:Stack]
- iret
+.iret: iret
.our_drive:
; Set up standard entry frame
@@ -464,10 +466,10 @@ edd_setup_regs:
cmp dword [es:si+4],-1
je .linear_address
- movzx esi,word [es:si+4] ; Offset
+ movzx ebx,word [es:si+4] ; Offset
movzx edi,word [es:si+6] ; Segment
shl edi,4
- add esi,edi
+ add ebx,edi
jmp .got_address
.linear_address:
@@ -480,23 +482,24 @@ edd_setup_regs:
; no really better code available
jne .error
- mov esi,[es:si+16]
+ mov ebx,[es:si+16]
.got_address:
cmp dword [es:si+12],0 ; LBA too large?
jne .overrun
movzx ecx, word [es:si+2] ; Sectors to transfer
- mov edi,[es:si+8] ; Starting sector
- mov eax,edi
+ mov esi,[es:si+8] ; Starting sector
+ mov eax,esi
add eax,ecx
jc .overrun
cmp eax,[DiskSize]
ja .overrun
shl ecx,SECTORSIZE_LG2-2 ; Convert to dwords
- shl edi,SECTORSIZE_LG2 ; Convert to an offset
- add edi,[DiskBuf]
+ shl esi,SECTORSIZE_LG2 ; Convert to an offset
+ add esi,[DiskBuf]
+ mov edi,ebx
pop es
ret