Subversion Repositories Kolibri OS

Rev

Rev 1039 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1039 Rev 1053
Line 28... Line 28...
28
	mov	[include_paths],edi
28
	mov	[include_paths],edi
29
	mov	esi,include_variable
29
	mov	esi,include_variable
30
	call	get_environment_variable
30
	call	get_environment_variable
31
	xor	al,al
31
	xor	al,al
32
	stosb
32
	stos	byte [edi]
33
	mov	[memory_start],edi
33
	mov	[memory_start],edi
34
	mov	eax,[additional_memory]
34
	mov	eax,[additional_memory]
35
	mov	[free_additional_memory],eax
35
	mov	[free_additional_memory],eax
36
	mov	eax,[additional_memory_end]
36
	mov	eax,[additional_memory_end]
37
	mov	[labels_list],eax
37
	mov	[labels_list],eax
38
	xor	eax,eax
38
	xor	eax,eax
39
	mov	[display_buffer],eax
39
	mov	[display_buffer],eax
40
	mov	[hash_tree],eax
40
	mov	[hash_tree],eax
41
	mov	[macro_status],al
41
	mov	[macro_status],al
42
 
42
	mov	esi,[input_file]
43
	mov	esi,predefinitions
-
 
44
      process_predefinitions:
-
 
45
	movzx	ecx,byte [esi]
-
 
46
	test	ecx,ecx
-
 
47
	jz	predefinitions_ok
-
 
48
	inc	esi
-
 
49
	lea	eax,[esi+ecx]
-
 
50
	push	eax
-
 
51
	mov	ch,10b
-
 
52
	call	add_preprocessor_symbol
-
 
53
	pop	esi
-
 
54
	mov	edi,[memory_start]
-
 
55
	mov	[edx+8],edi
-
 
56
      convert_predefinition:
-
 
57
	cmp	edi,[memory_end]
-
 
58
	jae	out_of_memory
-
 
59
	lods	byte [esi]
-
 
60
	or	al,al
-
 
61
	jz	predefinition_converted
-
 
62
	cmp	al,20h
-
 
63
	je	convert_predefinition
-
 
64
	mov	ah,al
-
 
65
	mov	ebx,characters
-
 
66
	xlat	byte [ebx]
-
 
67
	or	al,al
-
 
68
	jz	predefinition_separator
-
 
69
	cmp	ah,27h
-
 
70
	je	predefinition_string
-
 
71
	cmp	ah,22h
-
 
72
	je	predefinition_string
-
 
73
	mov	byte [edi],1Ah
-
 
74
	scas	word [edi]
-
 
75
	xchg	al,ah
-
 
76
	stos	byte [edi]
-
 
77
	mov	ebx,characters
-
 
78
	xor	ecx,ecx
-
 
79
      predefinition_symbol:
-
 
80
	lods	byte [esi]
-
 
81
	stos	byte [edi]
-
 
82
	xlat	byte [ebx]
-
 
83
	or	al,al
-
 
84
	loopnzd predefinition_symbol
-
 
85
	neg	ecx
-
 
86
	cmp	ecx,255
-
 
87
	ja	invalid_definition
-
 
88
	mov	ebx,edi
-
 
89
	sub	ebx,ecx
-
 
90
	mov	byte [ebx-2],cl
-
 
91
      found_predefinition_separator:
-
 
92
	dec	edi
-
 
93
	mov	ah,[esi-1]
-
 
94
      predefinition_separator:
-
 
95
	xchg	al,ah
-
 
96
	or	al,al
-
 
97
	jz	predefinition_converted
-
 
98
	cmp	al,20h
-
 
99
	je	convert_line_data
-
 
100
	cmp	al,3Bh
-
 
101
	je	invalid_definition
-
 
102
	cmp	al,5Ch
-
 
103
	je	predefinition_backslash
-
 
104
	stos	byte [edi]
-
 
105
	jmp	convert_predefinition
-
 
106
      predefinition_string:
-
 
107
	mov	al,22h
-
 
108
	stos	byte [edi]
-
 
109
	scas	dword [edi]
-
 
110
	mov	ebx,edi
-
 
111
      copy_predefinition_string:
-
 
112
	lods	byte [esi]
-
 
113
	stos	byte [edi]
-
 
114
	or	al,al
-
 
115
	jz	invalid_definition
-
 
116
	cmp	al,ah
-
 
117
	jne	copy_predefinition_string
-
 
118
	lods	byte [esi]
-
 
119
	cmp	al,ah
-
 
120
	je	copy_predefinition_string
-
 
121
	dec	esi
-
 
122
	dec	edi
-
 
123
	mov	eax,edi
-
 
124
	sub	eax,ebx
-
 
125
	mov	[ebx-4],eax
-
 
126
	jmp	convert_predefinition
-
 
127
      predefinition_backslash:
-
 
128
	mov	byte [edi],0
-
 
129
	lods	byte [esi]
-
 
130
	or	al,al
-
 
131
	jz	invalid_definition
-
 
132
	cmp	al,20h
-
 
133
	je	invalid_definition
-
 
134
	cmp	al,3Bh
-
 
135
	je	invalid_definition
-
 
136
	mov	al,1Ah
-
 
137
	stos	byte [edi]
-
 
138
	mov	ecx,edi
-
 
139
	mov	ax,5C01h
-
 
140
	stos	word [edi]
-
 
141
	dec	esi
-
 
142
      group_predefinition_backslashes:
-
 
143
	lods	byte [esi]
-
 
144
	cmp	al,5Ch
-
 
145
	jne	predefinition_backslashed_symbol
-
 
146
	stos	byte [edi]
-
 
147
	inc	byte [ecx]
-
 
148
	jmp	group_predefinition_backslashes
-
 
149
      predefinition_backslashed_symbol:
-
 
150
	cmp	al,20h
-
 
151
	je	invalid_definition
-
 
152
	cmp	al,22h
-
 
153
	je	invalid_definition
-
 
154
	cmp	al,27h
-
 
155
	je	invalid_definition
-
 
156
	cmp	al,3Bh
-
 
157
	je	invalid_definition
-
 
158
	mov	ah,al
-
 
159
	mov	ebx,characters
-
 
160
	xlat	byte [ebx]
-
 
161
	or	al,al
-
 
162
	jz	predefinition_backslashed_symbol_character
-
 
163
	mov	al,ah
-
 
164
      convert_predefinition_backslashed_symbol:
-
 
165
	stos	byte [edi]
-
 
166
	xlat	byte [ebx]
-
 
167
	or	al,al
-
 
168
	jz	found_predefinition_separator
-
 
169
	inc	byte [ecx]
-
 
170
	jz	invalid_definition
-
 
171
	lods	byte [esi]
-
 
172
	jmp	convert_predefinition_backslashed_symbol
-
 
173
      predefinition_backslashed_symbol_character:
-
 
174
	mov	al,ah
-
 
175
	stos	byte [edi]
-
 
176
	inc	byte [ecx]
-
 
177
	jmp	convert_predefinition
-
 
178
      predefinition_converted:
-
 
179
	mov	[memory_start],edi
-
 
180
	sub	edi,[edx+8]
-
 
181
	mov	[edx+12],edi
-
 
182
	jmp	process_predefinitions
-
 
183
      predefinitions_ok:
-
 
184
 
-
 
185
	mov	esi,[input_file]
-
 
186
	mov	edx,esi
43
	mov	edx,esi
187
	call	open
44
	call	open
188
	jc	main_file_not_found
45
	jc	main_file_not_found
189
	mov	edi,[memory_start]
46
	mov	edi,[memory_start]
190
	call	preprocess_file
47
	call	preprocess_file
Line 1670... Line 1527...
1670
	jnz	invalid_value
1527
	jnz	invalid_value
1671
	cmp	dword [edi+4],0
1528
	cmp	dword [edi+4],0
1672
	jne	value_out_of_range
1529
	jne	value_out_of_range
1673
	mov	eax,[edi]
1530
	mov	eax,[edi]
1674
 
1531
	cmp	eax,80000000h
1675
	cmp	eax,80000000h
-
 
1676
	jae	value_out_of_range
1532
	jae	value_out_of_range
1677
	push	[free_additional_memory]
1533
	push	[free_additional_memory]
1678
	push	[macro_symbols]
1534
	push	[macro_symbols]
1679
	mov	[macro_symbols],0
1535
	mov	[macro_symbols],0
1680
	push	[counter_limit]
1536
	push	[counter_limit]