Subversion Repositories Kolibri OS

Rev

Rev 255 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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