#multipass on
; Args
; ~~~~
; Open file manipulation functions.


.Args_ReadAllocatedSize
FNdt(">>> Args_ReadAllocatedSize")
FNdt("  r1 (my handle for file) = %1h8")
;------------------------
; Read the size allocated to the file
;------------------------
; On entry:
;	r1  =	my handle for file
; On exit:
;	r2  =	size allocated to file
;------------------------
	FNfunction("")
	ldr	r14,[r1,#file_mount%]
	ldr	r2,[r1,#i_blocks%]
	ldr	r14,[r14,#s_log_block_size%]
	add	r14, r14, #9		; i_blocks% is number of blocks *2
	mov	r2, r2, LSL r14
FNdt("<<< Args_ReadAllocatedSize")
FNdt("  r2 (size allocated to file) = %2i4")
	FNreturn



.Args_ReadDateStamp
FNdt(">>> Args_ReadDateStamp")
FNdt("  r1 (my handle for file) = %1h8")
;------------------------
; Read the datestamp (load and exec addresses) for the file.
;------------------------
; On entry:
;	r1  =	my handle for file
; On exit:
;	r2  =	load address of file
;	r3  =	exec address of file
;------------------------
	FNfunction("")
	mov	r0,r1
	ldr	r6,[r1,#file_mount%]
	ldr	r1,[r1,#file_type%]
	bl	File_CatalogueInfoFromInode
FNdt("<<< Args_ReadDataStamp")
FNdt("  r2 (load address) = %2h8")
FNdt("  r3 (exec address) = %3h8")
	FNreturn
