lab2 ok
This commit is contained in:
parent
a0dacc4b9e
commit
274d517426
BIN
2020301918-李懋良-试点班第2个报告.docx
Normal file
BIN
2020301918-李懋良-试点班第2个报告.docx
Normal file
Binary file not shown.
12
loader.asm
12
loader.asm
@ -222,23 +222,23 @@ FuncFindFile:
|
|||||||
mov word [RootDirSectorNow], SectorNoOfRootDirectory
|
mov word [RootDirSectorNow], SectorNoOfRootDirectory
|
||||||
mov word [LeftRootDirSectors], RootDirSectors
|
mov word [LeftRootDirSectors], RootDirSectors
|
||||||
.FindLoaderInRootDir:
|
.FindLoaderInRootDir:
|
||||||
mov ax, [RootDirSectorNow]; ax <- 现在正在搜索的扇区号
|
mov ax, [RootDirSectorNow] ; ax <- 现在正在搜索的扇区号
|
||||||
mov bx, OffsetOfSectorBuf ; es:bx = BaseOfSectorBuf:OffsetOfSectorBuf
|
mov bx, OffsetOfSectorBuf ; es:bx = BaseOfSectorBuf:OffsetOfSectorBuf
|
||||||
mov cx, 1
|
mov cx, 1
|
||||||
call ReadSector
|
call ReadSector
|
||||||
|
|
||||||
mov si, [bp + 4] ; ds:si -> "LOADER BIN"
|
mov si, [bp + 4] ; ds:si
|
||||||
mov di, OffsetOfSectorBuf ; es:di -> BaseOfSectorBuf:400h = BaseOfSectorBuf*10h+400h
|
mov di, OffsetOfSectorBuf ; es:di -> BaseOfSectorBuf:400h = BaseOfSectorBuf*10h+400h
|
||||||
mov dx, 10h ; 32(目录项大小) * 16(dx) = 512(BPB_BytsPerSec)
|
mov dx, 10h ; 32(目录项大小) * 16(dx) = 512(BPB_BytsPerSec)
|
||||||
|
|
||||||
.CompareFilename:
|
.CompareFilename:
|
||||||
call StringCmp
|
call StringCmp
|
||||||
cmp ax, 1
|
cmp ax, 1
|
||||||
jz .LoaderFound ; ax == 1 -> 比对成了
|
jz .LoaderFound ; ax == 1 -> 比对成了
|
||||||
dec dx
|
dec dx
|
||||||
cmp dx, 0
|
cmp dx, 0
|
||||||
jz .GotoNextRootDirSector ; 该扇区的所有目录项都探索完了,去探索下一个扇区
|
jz .GotoNextRootDirSector ; 该扇区的所有目录项都探索完了,去探索下一个扇区
|
||||||
add di, 20h ; 32 -> 目录项大小
|
add di, 20h ; 32 -> 目录项大小
|
||||||
jmp .CompareFilename
|
jmp .CompareFilename
|
||||||
|
|
||||||
.GotoNextRootDirSector:
|
.GotoNextRootDirSector:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user