Implement file open
This commit is contained in:
parent
f702006582
commit
fbab632616
@ -1,9 +1,15 @@
|
|||||||
; FCB layout
|
; FCB layout
|
||||||
; 1 byte drive (0=default, 1=A:, 2=B:, ...)
|
|
||||||
; 8.3 filename
|
|
||||||
; 8.3 filename for rename
|
|
||||||
|
|
||||||
FCBSIZ equ 30
|
struc FCB
|
||||||
|
|
||||||
|
FCBDRV resb 1 ; BYTE drive (0=default, 1=A:, 2=B:, ...)
|
||||||
|
FCBFN resb 11 ; 11 BYTES filename
|
||||||
|
FCBCLUS resw 1 ; DWORD current cluster
|
||||||
|
FCBRN resb 1 ; BYTE record in cluster
|
||||||
|
|
||||||
|
endstruc
|
||||||
|
|
||||||
|
FCBSIZ equ FCB_size
|
||||||
|
|
||||||
section .data
|
section .data
|
||||||
|
|
||||||
@ -136,11 +142,13 @@ fndnxt mov bp, sp
|
|||||||
; copy over drive byte
|
; copy over drive byte
|
||||||
movsb
|
movsb
|
||||||
; copy filename
|
; copy filename
|
||||||
|
push ds
|
||||||
mov ax, cs
|
mov ax, cs
|
||||||
mov ds, ax
|
mov ds, ax
|
||||||
mov si, bx
|
mov si, bx
|
||||||
mov cx, 11
|
mov cx, 11
|
||||||
rep movsb
|
rep movsb
|
||||||
|
pop ds
|
||||||
; done!
|
; done!
|
||||||
xor ax, ax
|
xor ax, ax
|
||||||
ret
|
ret
|
||||||
@ -149,5 +157,12 @@ fndnxt mov bp, sp
|
|||||||
.ret: sbb al, al
|
.ret: sbb al, al
|
||||||
ret
|
ret
|
||||||
|
|
||||||
open:
|
open call fndfst
|
||||||
ret
|
test al, al
|
||||||
|
jnz .ret
|
||||||
|
; read start cluster
|
||||||
|
mov ax, [cs:bx+26]
|
||||||
|
mov [ds:bx+FCBCLUS], ax
|
||||||
|
; reset record number
|
||||||
|
mov byte [ds:bx+FCBRN], 0
|
||||||
|
.ret ret
|
||||||
|
Loading…
Reference in New Issue
Block a user