Subversion Repositories Kolibri OS

Rev

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

Rev 1189 Rev 2287
Line 1... Line 1...
1
; flat assembler core
1
; flat assembler core
2
; Copyright (c) 1999-2009, Tomasz Grysztar.
2
; Copyright (c) 1999-2011, Tomasz Grysztar.
3
; All rights reserved.
3
; All rights reserved.
Line 4... Line 4...
4
 
4
 
5
preprocessor:
5
preprocessor:
6
	mov	edi,characters
6
	mov	edi,characters
Line 94... Line 94...
94
	call	convert_line
94
	call	convert_line
95
	call	preprocess_line
95
	call	preprocess_line
96
	pop	edx ebx
96
	pop	edx ebx
97
      next_line:
97
      next_line:
98
	cmp	byte [esi-1],1Ah
98
	cmp	byte [esi-1],0
-
 
99
	je	file_end
-
 
100
	cmp	byte [esi-1],1Ah
99
	jne	preprocess_source
101
	jne	preprocess_source
100
      file_end:
102
      file_end:
101
	pop	[memory_end]
103
	pop	[memory_end]
102
	clc
104
	clc
103
	ret
105
	ret
Line 217... Line 219...
217
	cmp	al,9
219
	cmp	al,9
218
	je	concatenate_lines
220
	je	concatenate_lines
219
	cmp	al,1Ah
221
	cmp	al,1Ah
220
	je	unexpected_end_of_file
222
	je	unexpected_end_of_file
221
	cmp	al,0Ah
223
	or	al,al
-
 
224
	jz	unexpected_end_of_file
-
 
225
	cmp	al,0Ah
222
	je	concatenate_lf
226
	je	concatenate_lf
223
	cmp	al,0Dh
227
	cmp	al,0Dh
224
	je	concatenate_cr
228
	je	concatenate_cr
225
	cmp	al,3Bh
229
	cmp	al,3Bh
226
	je	find_concatenated_line
230
	je	find_concatenated_line
Line 239... Line 243...
239
	jmp	group_backslashes
243
	jmp	group_backslashes
240
      backslashed_symbol:
244
      backslashed_symbol:
241
	cmp	al,1Ah
245
	cmp	al,1Ah
242
	je	unexpected_end_of_file
246
	je	unexpected_end_of_file
243
	cmp	al,0Ah
247
	or	al,al
-
 
248
	jz	unexpected_end_of_file
-
 
249
	cmp	al,0Ah
244
	je	extra_characters_on_line
250
	je	extra_characters_on_line
245
	cmp	al,0Dh
251
	cmp	al,0Dh
246
	je	extra_characters_on_line
252
	je	extra_characters_on_line
247
	cmp	al,20h
253
	cmp	al,20h
248
	je	extra_characters_on_line
254
	je	extra_characters_on_line
Line 281... Line 287...
281
	cmp	al,9
287
	cmp	al,9
282
	je	concatenate_lines
288
	je	concatenate_lines
283
	cmp	al,1Ah
289
	cmp	al,1Ah
284
	je	unexpected_end_of_file
290
	je	unexpected_end_of_file
285
	cmp	al,0Ah
291
	or	al,al
-
 
292
	jz	unexpected_end_of_file
-
 
293
	cmp	al,0Ah
286
	je	concatenate_lf
294
	je	concatenate_lf
287
	cmp	al,0Dh
295
	cmp	al,0Dh
288
	je	concatenate_cr
296
	je	concatenate_cr
289
	cmp	al,3Bh
297
	cmp	al,3Bh
290
	jne	extra_characters_on_line
298
	jne	extra_characters_on_line
Line 1592... Line 1600...
1592
	mov	al,')'
1600
	mov	al,')'
1593
	stosb
1601
	stosb
1594
	push	esi
1602
	push	esi
1595
	mov	esi,[esp+4]
1603
	mov	esi,[esp+4]
1596
	call	calculate_expression
1604
	mov	[value_size],8
-
 
1605
	call	calculate_expression
1597
	mov	eax,[edi]
1606
	mov	eax,[edi]
1598
	mov	ecx,[edi+4]
1607
	mov	ecx,[edi+4]
1599
	pop	esi edi
1608
	pop	esi edi
1600
	cdq
1609
	cdq
1601
	cmp	edx,ecx
1610
	cmp	edx,ecx
Line 1885... Line 1894...
1885
	cmp	[counter_limit],eax
1894
	cmp	[counter_limit],eax
1886
	je	process_macro_line
1895
	je	process_macro_line
1887
	inc	[counter]
1896
	inc	[counter]
1888
      process_macro_line:
1897
      process_macro_line:
1889
	mov	[current_line],edi
1898
	lods	byte [esi]
-
 
1899
	or	al,al
-
 
1900
	jz	process_next_line
-
 
1901
	cmp	al,'}'
-
 
1902
	je	macro_block_processed
-
 
1903
	dec	esi
-
 
1904
	mov	[current_line],edi
1890
	lea	eax,[edi+10h]
1905
	lea	eax,[edi+10h]
1891
	cmp	eax,[memory_end]
1906
	cmp	eax,[memory_end]
1892
	jae	out_of_memory
1907
	jae	out_of_memory
1893
	mov	eax,[esp+4]
1908
	mov	eax,[esp+4]
1894
	or	eax,eax
1909
	or	eax,eax