Subversion Repositories Kolibri OS

Rev

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

Rev 157 Rev 242
Line 12... Line 12...
12
	mov	[anonymous_reverse],eax
12
	mov	[anonymous_reverse],eax
13
	mov	[anonymous_forward],eax
13
	mov	[anonymous_forward],eax
14
	mov	[hash_tree],eax
14
	mov	[hash_tree],eax
15
	mov	[blocks_stack],eax
15
	mov	[blocks_stack],eax
16
	mov	esi,[memory_start]
16
	mov	[parsed_lines],eax
-
 
17
	mov	esi,[memory_start]
17
	mov	edi,[source_start]
18
	mov	edi,[source_start]
18
      parser_loop:
19
      parser_loop:
19
	mov	[current_line],esi
20
	mov	[current_line],esi
20
	lea	eax,[edi+100h]
21
	lea	eax,[edi+100h]
21
	cmp	eax,[labels_list]
22
	cmp	eax,[labels_list]
Line 25... Line 26...
25
	mov	al,0Fh
26
	mov	al,0Fh
26
	stos	byte [edi]
27
	stos	byte [edi]
27
	mov	eax,esi
28
	mov	eax,esi
28
	stos	dword [edi]
29
	stos	dword [edi]
29
	add	esi,16
30
	inc	[parsed_lines]
-
 
31
	add	esi,16
30
      parse_line:
32
      parse_line:
31
	cmp	byte [esi],1Ah
33
	cmp	byte [esi],1Ah
32
	jne	empty_instruction
34
	jne	empty_instruction
33
	push	edi
35
	push	edi
34
	add	esi,2
36
	add	esi,2
Line 408... Line 410...
408
	mov	al,0Fh
410
	mov	al,0Fh
409
	stos	byte [edi]
411
	stos	byte [edi]
410
	mov	eax,[current_line]
412
	mov	eax,[current_line]
411
	stos	dword [edi]
413
	stos	dword [edi]
412
	mov	eax,1 + (end_directive-assembler) shl 8
414
	inc	[parsed_lines]
-
 
415
	mov	eax,1 + (end_directive-assembler) shl 8
413
	stos	dword [edi]
416
	stos	dword [edi]
414
	mov	eax,1 + (if_directive-assembler) shl 8
417
	mov	eax,1 + (if_directive-assembler) shl 8
415
	stos	dword [edi]
418
	stos	dword [edi]
416
	jmp	parse_next_line
419
	jmp	parse_next_line
417
      skip_parsing_else:
420
      skip_parsing_else:
Line 444... Line 447...
444
	mov	al,0Fh
447
	mov	al,0Fh
445
	stos	byte [edi]
448
	stos	byte [edi]
446
	mov	eax,[current_line]
449
	mov	eax,[current_line]
447
	stos	dword [edi]
450
	stos	dword [edi]
448
      parse_else_if:
451
	inc	[parsed_lines]
-
 
452
      parse_else_if:
449
	mov	eax,1 + (if_directive-assembler) shl 8
453
	mov	eax,1 + (if_directive-assembler) shl 8
450
	stos	dword [edi]
454
	stos	dword [edi]
451
	jmp	parse_if
455
	jmp	parse_if
452
      skip_parsing_pure_else:
456
      skip_parsing_pure_else:
453
	bts	dword [esp],1
457
	bts	dword [esp],1
Line 896... Line 900...
896
	pop	edi esi
900
	pop	edi esi
897
	jmp	expression
901
	jmp	expression
898
      contents_parsed:
902
      contents_parsed:
899
	cmp	[parenthesis_stack],0
903
	cmp	[parenthesis_stack],0
900
	jne	invalid_expression
904
;        jne     invalid_expression
901
	ret
905
	je	contents_ok
-
 
906
	dec	[parenthesis_stack]
-
 
907
	add	esp,8
-
 
908
	jmp	contents_parsed
-
 
909
      contents_ok:
-
 
910
	ret
902
 
911
 
Line 903... Line 912...
903
identify_label:
912
identify_label:
904
	cmp	byte [esi],'.'
913
	cmp	byte [esi],'.'
905
	je	local_label_name
914
	je	local_label_name