get_mark, get_eof

This commit is contained in:
Kelvin Sherlock 2015-08-17 10:48:27 -04:00
parent db355e6055
commit cf591b2d73
7 changed files with 199 additions and 6 deletions

View File

@ -1,7 +1,7 @@
SOURCES = main.aii volume.aii get_file_info.aii \
open.aii get_dir_entry.aii close.aii \
open.aii get_dir_entry.aii get_mark.aii get_eof.aii close.aii \
id_disk.aii stubs.aii tables.aii device.aii params.aii data.aii
OBJECTS=$(SOURCES:.aii=.o)

View File

@ -260,4 +260,5 @@
rts
@ok
mend
mend

75
get_eof.aii Normal file
View File

@ -0,0 +1,75 @@
string asis
include 'gsos.equ'
include 'minix.equ'
include 'fst.equ'
include 'fst.macros'
include 'M16.Debug'
include 'records.equ'
import do_eof
import do_ignore
import init_fcr
get_eof procname export
with dp, fst_parms
jsr init_fcr
lda disk_inode.mode
and #S_IFMT
cmp #S_IFREG
beq ok
cmp #S_IFLNK ; ehh
beq ok
lda #bad_store_type
sec
rtl
ok
lda <call_class
beq class0
class1
lda [param_blk_ptr] ; pcount
dec a
asl a ; x 2
asl a ; x 4
tax
dispatch get_eof_dcb_1
lda tool_error
cmp #0
rtl
class0
ldx #get_eof_dcb_0_size-4
dispatch get_eof_dcb_0
lda tool_error
cmp #0
rtl
get_eof_dcb_0
with EOFRec
dc.w eofRefNum, do_ignore
dc.w eofPosition, do_eof
get_eof_dcb_0_size equ *-get_eof_dcb_0
endwith
get_eof_dcb_1
with EOFRecGS
;dc.w pCount, do_ignore
dc.w refNum, do_ignore
dc.w eof, do_eof
endwith
endp
end

85
get_mark.aii Normal file
View File

@ -0,0 +1,85 @@
string asis
include 'gsos.equ'
include 'minix.equ'
include 'fst.equ'
include 'fst.macros'
include 'M16.Debug'
include 'records.equ'
import do_eof
import do_ignore
import init_fcr
get_mark procname export
with dp, fst_parms
jsr init_fcr
lda disk_inode.mode
and #S_IFMT
cmp #S_IFREG
beq ok
cmp #S_IFLNK ; ehh
beq ok
lda #bad_store_type
sec
rtl
ok
; copy fcr.mark to disk_inode.size to re-use eof code.
ldy #fcr.mark
lda [my_fcr],y
sta disk_inode.size
iny
iny
lda [my_fcr],y
sta disk_inode.size+2
lda <call_class
beq class0
class1
lda [param_blk_ptr] ; pcount
dec a
asl a ; x 2
asl a ; x 4
tax
dispatch get_mark_dcb_1
lda tool_error
cmp #0
rtl
class0
ldx #get_mark_dcb_0_size-4
dispatch get_mark_dcb_0
lda tool_error
cmp #0
rtl
get_mark_dcb_0
with MarkRec
dc.w markRefNum, do_ignore
dc.w position, do_eof
get_mark_dcb_0_size equ *-get_mark_dcb_0
endwith
get_mark_dcb_1
with PositionRecGS
;dc.w pCount, do_ignore
dc.w refNum, do_ignore
dc.w position, do_eof
endwith
endp
end

View File

@ -168,3 +168,37 @@ freeBlocks DS.B 4
fileSysID DS.B 2
sizeof equ *
end_struct
JudgeNameRecGS begin_struct
pCount ds.w 1
fileSysID ds.w 1
nameType ds.w 1
syntax ds.l 1
maxLen ds.w 1
name ds.l 1
nameFlags ds.w 1
end_struct
PositionRecGS begin_struct
pCount DS.W 1
refNum DS.W 1
position DS.L 1
end_struct
MarkRec begin_struct
markRefNum DS.B 2
position DS.B 4
end_struct
EOFRecGS begin_struct
pCount DS.W 1
refNum DS.W 1
eof DS.L 1
end_struct
EOFRec begin_struct
eofRefNum DS.B 2
eofPosition DS.B 4
end_struct

View File

@ -11,8 +11,6 @@ stubs proc
export flush
export format
export get_dev_num
export get_eof
export get_mark
export judge_name
export read
export set_eof

View File

@ -14,7 +14,7 @@ max_pcount
dc.w 4 ; ($04) Change Path
dc.w 13 ; ($05) Set File Info
dc.w 13 ; ($06) Get File Info
dc.w 0 ; ($07)
dc.w 6 ; ($07) Judge Name
dc.w 7 ; ($08) Volume
dc.w 0 ; ($09) Set Prefix
dc.w 0 ; ($0A) Get Prefix
@ -68,7 +68,7 @@ min_pcount
dc.w 2 ; ($04) Change Path
dc.w 2 ; ($05) Set File Info
dc.w 2 ; ($06) Get File Info
dc.w 0 ; ($07)
dc.w 3 ; ($07) Judge Name
dc.w 2 ; ($08) Volume
dc.w 0 ; ($09) Set Prefix
dc.w 0 ; ($0A) Get Prefix