2 ; Christian Groessler, Oct-2000
4 ; allocates a new fd in the indirection table
5 ; the fdtable itself is defined here
12 .export fdt_to_fdi,getfd
13 .export fd_table,fd_index
14 .export ___fd_table,___fd_index ; for test(debug purposes only
19 fd_index: ; fd number is index into this table, entry's value specifies the fd_table entry
23 fd_table: ; each entry represents an open iocb
24 .byte 0,0,'E',0 ; system console, app starts with opened iocb #0 for E:
36 ; returns a fd_index entry pointing to the given ft_table entry
37 ; get fd_table entry in A
38 ; return C = 0/1 for OK/error
39 ; return fd_index entry in A if OK
63 ; get a new fd pointing to a ft_table entry
64 ; usage counter of ft_table entry incremented
66 ; return C = 0/1 for OK/error
67 ; returns fd in A if OK
68 ; registers destroyed, tmp1 destroyed
71 sta tmp1 ; save fd_table entry
80 inc fd_table+ft_usa,x ; increment usage counter