Subversion Repositories Kolibri OS

Rev

Rev 255 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
255 heavyiron 1
;-----------------------------------------------------------
2
;-----------load heading of file in memory------------------
3
;-----------------------------------------------------------
4
 
5
load_heading_of_file:
6
 
7
         mov [where_load_file],ebx
8
         mov [full_file_path],eax
9
 
10
         mov esi,[full_file_path]
11
         mov edi,filepath
12
         mov ecx,256
13
         rep movsd
14
 
15
         xor eax,eax
16
         mov ecx,[where_load_file]
17
         mov edx,filepath
18
 
19
         mov [file_information],eax
20
         mov [file_information+4],eax
21
         mov [file_information+8],eax
22
         mov [file_information+12],dword 512
23
         mov [file_information+16],ecx
24
         mov [file_information+20],al
25
         mov [file_information+21],edx
26
 
27
         mov eax,70
28
         mov ebx,file_information
485 heavyiron 29
         mcall
255 heavyiron 30
 
31
         ret
32
;-----------------------------------------------------------
33
;--------load file in memory--------------------------------
34
;-----------------------------------------------------------
35
load_file:
36
         mov [where_load_file],ebx
37
         mov [full_file_path],eax
38
 
39
         mov esi,[full_file_path]
40
         mov edi,filepath
41
         mov ecx,256
42
         rep movsd
43
 
44
         xor eax,eax
45
         mov ebx,bufer_for_info
46
         mov ecx,filepath
47
 
48
         mov [file_information],dword 5
49
         mov [file_information+4],eax
50
         mov [file_information+8],eax
51
         mov [file_information+12],eax
52
         mov [file_information+16],ebx
53
         mov [file_information+20],al
54
         mov [file_information+21],ecx
55
 
56
         mov eax,70
57
	 mov ebx,file_information
485 heavyiron 58
         mcall
255 heavyiron 59
 
60
         test eax,eax
61
         jnz error_load_file
62
 
63
         xor eax,eax
64
         mov ebx,[bufer_for_info+32]
65
         mov ecx,[where_load_file]
66
         mov edx,filepath
67
 
68
         mov [file_information],eax
69
         mov [file_information+4],eax
70
         mov [file_information+8],eax
71
         mov [file_information+12],ebx
72
         mov [file_information+16],ecx
73
         mov [file_information+20],al
74
         mov [file_information+21],edx
75
 
76
         mov eax,70
77
         mov ebx,file_information
485 heavyiron 78
         mcall
255 heavyiron 79
 
80
         error_load_file:
81
 
82
	 ret
83
;-----------------------------------------------------------
84
;---------------save in file from memory--------------------
85
;-----------------------------------------------------------
86
save_file:
87
         mov [size_to_save],ecx
88
         mov [pointer_to_data],ebx
89
         mov [full_file_path],eax
90
 
91
         mov esi,[full_file_path]
92
         mov edi,filepath
93
         mov ecx,256
94
         rep movsd
95
 
96
         xor eax,eax
97
         mov ebx,[size_to_save]
98
         mov ecx,[pointer_to_data]
99
         mov edx,filepath
100
 
101
         mov [file_information],dword 2
102
         mov [file_information+4],eax
103
         mov [file_information+8],eax
104
         mov [file_information+12],ebx
105
         mov [file_information+16],ecx
106
         mov [file_information+20],al
107
         mov [file_information+21],edx
108
 
109
         mov eax,70
110
         mov ebx,file_information
485 heavyiron 111
         mcall
255 heavyiron 112
 
113
	 ret
114
 
115
;----------------------------------------------------------
116
;-------------file information structure-------------------
117
;----------------------------------------------------------
118
 
119
file_information:
120
 
121
  dd 5
122
  dd 0
123
  dd 0
124
  dd 0
125
  dd bufer_for_info
126
  dd 0
127
  dd filepath
128
 
129
filepath rb 1040
130
 
131
bufer_for_info  rd 10
132
full_file_path  dd 0
133
where_load_file dd 0
134
size_to_save    dd 0
135
pointer_to_data dd 0