"Fossies" - the Fresh Open Source Software Archive 
Member "fasm/tools/prepsrc.inc" (21 Feb 2022, 1867 Bytes) of package /linux/misc/fasm-1.73.30.tgz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) fasm source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1
2 preprocessed_source:
3 mov edx,[input_file]
4 call open
5 jc input_not_found
6 mov al,2
7 xor edx,edx
8 call lseek
9 cmp eax,30h
10 jb invalid_input
11 push eax
12 call alloc
13 jc not_enough_memory
14 push eax
15 xor al,al
16 xor edx,edx
17 call lseek
18 mov ecx,[esp+4]
19 mov edx,[esp]
20 call read
21 jc reading_error
22 pop eax ecx
23 cmp dword [eax],1A736166h
24 jne invalid_input
25 mov esi,[eax+32]
26 add esi,eax
27 mov ebp,[eax+36]
28 add ebp,esi
29 mov edi,eax
30 push eax
31 preprocessed_to_text:
32 cmp esi,ebp
33 jae conversion_done
34 add esi,16
35 xor dl,dl
36 convert_preprocessed_line:
37 lodsb
38 cmp al,1Ah
39 je copy_symbol
40 cmp al,22h
41 je copy_symbol
42 cmp al,3Bh
43 je preprocessor_symbols
44 or al,al
45 jz line_converted
46 stosb
47 xor dl,dl
48 jmp convert_preprocessed_line
49 copy_symbol:
50 or dl,dl
51 jz space_ok
52 mov byte [edi],20h
53 inc edi
54 space_ok:
55 cmp al,22h
56 je quoted
57 lodsb
58 movzx ecx,al
59 rep movsb
60 or dl,-1
61 jmp convert_preprocessed_line
62 quoted:
63 mov al,27h
64 stosb
65 lodsd
66 mov ecx,eax
67 jecxz quoted_copied
68 copy_quoted:
69 lodsb
70 stosb
71 cmp al,27h
72 jne quote_ok
73 stosb
74 quote_ok:
75 loop copy_quoted
76 quoted_copied:
77 mov al,27h
78 stosb
79 or dl,-1
80 jmp convert_preprocessed_line
81 preprocessor_symbols:
82 mov al,3Bh
83 stosb
84 jmp copy_symbol
85 line_converted:
86 mov ax,0A0Dh
87 stosw
88 jmp preprocessed_to_text
89 conversion_done:
90 mov edx,[output_file]
91 call create
92 jc writing_error
93 pop edx
94 mov ecx,edi
95 sub ecx,edx
96 call write
97 jc writing_error
98 call close
99 ret
100
101 not_enough_memory:
102 call error
103 db 'not enough memory to load the required data',0
104 input_not_found:
105 call error
106 db 'the input file was not found',0
107 reading_error:
108 call error
109 db 'some error occured while trying to read file',0
110 writing_error:
111 call error
112 db 'some error occured while trying to write file',0
113 invalid_input:
114 call error
115 db 'input file is not a recognized assembly information format',0