Rev 2093 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2093 | Rev 2105 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; flat assembler source ;; |
3 | ;; flat assembler source ;; |
4 | ;; Copyright (c) 1999-2006, Tomasz Grysztar ;; |
4 | ;; Copyright (c) 1999-2006, Tomasz Grysztar ;; |
5 | ;; All rights reserved. ;; |
5 | ;; All rights reserved. ;; |
6 | ;; ;; |
6 | ;; ;; |
7 | ;; KolibriOS port by KolibriOS Team ;; |
7 | ;; KolibriOS port by KolibriOS Team ;; |
8 | ;; Menuet port by VT ;; |
8 | ;; Menuet port by VT ;; |
9 | ;; ;; |
9 | ;; ;; |
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
11 | 11 | ||
12 | NORMAL_MODE = 8 |
12 | NORMAL_MODE = 8 |
13 | CONSOLE_MODE = 32 |
13 | CONSOLE_MODE = 32 |
14 | 14 | ||
15 | MAGIC1 = 6*(text.line_size-1)+14 |
15 | MAGIC1 = 6*(text.line_size-1)+14 |
16 | MAX_PATH = 100 |
16 | MAX_PATH = 100 |
17 | 17 | ||
18 | APP_MEMORY = 0x00800000 |
18 | APP_MEMORY = 0x00800000 |
19 | 19 | ||
20 | ;; Menuet header |
20 | ;; Menuet header |
21 | 21 | ||
22 | appname equ "flat assembler " |
22 | appname equ "flat assembler " |
23 | ;--------------------------------------------------------------------- |
23 | ;--------------------------------------------------------------------- |
24 | use32 |
24 | use32 |
25 | org 0x0 |
25 | org 0x0 |
26 | db 'MENUET01' ; 8 byte id |
26 | db 'MENUET01' ; 8 byte id |
27 | dd 0x01 ; header version |
27 | dd 0x01 ; header version |
28 | dd START ; program start |
28 | dd START ; program start |
29 | dd program_end ; program image size |
29 | dd program_end ; program image size |
30 | dd stacktop ; required amount of memory |
30 | dd stacktop ; required amount of memory |
31 | dd stacktop ; stack |
31 | dd stacktop ; stack |
32 | dd params,cur_dir_path ; parameters,icon |
32 | dd params,cur_dir_path ; parameters,icon |
33 | ;--------------------------------------------------------------------- |
33 | ;--------------------------------------------------------------------- |
34 | include 'lang.inc' |
34 | include 'lang.inc' |
35 | include '../../../macros.inc' |
35 | include '../../../macros.inc' |
36 | purge add,sub ; macros.inc does incorrect substitution |
36 | purge add,sub ; macros.inc does incorrect substitution |
37 | include 'fasm.inc' |
37 | include 'fasm.inc' |
38 | 38 | ||
39 | include '../../../develop/libraries/box_lib/trunk/box_lib.mac' |
39 | include '../../../develop/libraries/box_lib/trunk/box_lib.mac' |
40 | include '../../../develop/libraries/box_lib/load_lib.mac' |
40 | include '../../../develop/libraries/box_lib/load_lib.mac' |
41 | @use_library |
41 | @use_library |
42 | 42 | ||
43 | center fix true |
43 | center fix true |
44 | ;--------------------------------------------------------------------- |
44 | ;--------------------------------------------------------------------- |
45 | START: ; Start of execution |
45 | START: ; Start of execution |
46 | mov edi, fileinfos |
46 | mov edi, fileinfos |
47 | mov ecx, (fileinfos_end-fileinfos)/4 |
47 | mov ecx, (fileinfos_end-fileinfos)/4 |
48 | or eax, -1 |
48 | or eax, -1 |
49 | rep stosd |
49 | rep stosd |
50 | push 68 |
50 | push 68 |
51 | pop eax |
51 | pop eax |
52 | push 11 |
52 | push 11 |
53 | pop ebx |
53 | pop ebx |
54 | mcall |
54 | mcall |
55 | 55 | ||
56 | cmp [params],0 |
56 | cmp [params],0 |
57 | jz start_1 |
57 | jz start_1 |
58 | 58 | ||
59 | mov ecx,10 |
59 | mov ecx,10 |
60 | mov eax,' ' |
60 | mov eax,' ' |
61 | mov edi,infile |
61 | mov edi,infile |
62 | push ecx |
62 | push ecx |
63 | cld |
63 | cld |
64 | rep stosd |
64 | rep stosd |
65 | mov ecx,[esp] |
65 | mov ecx,[esp] |
66 | mov edi,outfile |
66 | mov edi,outfile |
67 | rep stosd |
67 | rep stosd |
68 | pop ecx |
68 | pop ecx |
69 | mov edi,path |
69 | mov edi,path |
70 | rep stosd |
70 | rep stosd |
71 | 71 | ||
72 | mov esi,params |
72 | mov esi,params |
73 | ; DEBUGF "params: %s\n",esi |
73 | ; DEBUGF "params: %s\n",esi |
74 | mov edi,infile |
74 | mov edi,infile |
75 | call mov_param_str |
75 | call mov_param_str |
76 | ; mov edi,infile |
76 | ; mov edi,infile |
77 | ; DEBUGF " input: %s\n",edi |
77 | ; DEBUGF " input: %s\n",edi |
78 | mov edi,outfile |
78 | mov edi,outfile |
79 | call mov_param_str |
79 | call mov_param_str |
80 | ; mov edi,outfile |
80 | ; mov edi,outfile |
81 | ; DEBUGF "output: %s\n",edi |
81 | ; DEBUGF "output: %s\n",edi |
82 | mov edi,path |
82 | mov edi,path |
83 | call mov_param_str |
83 | call mov_param_str |
84 | ; mov edi,path |
84 | ; mov edi,path |
85 | ; DEBUGF " path: %s\n",edi |
85 | ; DEBUGF " path: %s\n",edi |
86 | dec esi |
86 | dec esi |
87 | cmp [esi], dword ',run' |
87 | cmp [esi], dword ',run' |
88 | jne @f |
88 | jne @f |
89 | mov [_run_outfile],1 |
89 | mov [_run_outfile],1 |
90 | @@: |
90 | @@: |
91 | mov [_mode],CONSOLE_MODE |
91 | mov [_mode],CONSOLE_MODE |
92 | jmp start |
92 | jmp start |
93 | ;--------------------------------------------------------------------- |
93 | ;--------------------------------------------------------------------- |
94 | start_1: |
94 | start_1: |
95 | ;sys_ |
95 | ;sys_ |
96 | load_libraries l_libs_start,load_lib_end |
96 | load_libraries l_libs_start,load_lib_end |
97 | 97 | ||
98 | cmp eax,-1 |
98 | cmp eax,-1 |
99 | jne @f |
99 | jne @f |
100 | mcall -1 ;exit if not open box_lib.obj |
100 | mcall -1 ;exit if not open box_lib.obj |
101 | @@: |
101 | @@: |
102 | mcall 40,0x27 ;¬ ᪠á¨á⥬ëå ᮡë⨩ |
102 | mcall 40,0x27 ;¬ ᪠á¨á⥬ëå ᮡë⨩ |
103 | ;--------------------------------------------------------------------- |
103 | ;--------------------------------------------------------------------- |
104 | get_sys_colors 1,0 |
104 | get_sys_colors 1,0 |
105 | edit_boxes_set_sys_color edit1,editboxes_end,sc |
105 | edit_boxes_set_sys_color edit1,editboxes_end,sc |
106 | check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc |
106 | check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc |
107 | ;--------------------------------------------------------------------- |
107 | ;--------------------------------------------------------------------- |
108 | ; OpenDialog initialisation |
108 | ; OpenDialog initialisation |
109 | push dword OpenDialog_data |
109 | push dword OpenDialog_data |
110 | call dword [OpenDialog_Init] |
110 | call dword [OpenDialog_Init] |
111 | ;--------------------------------------------------------------------- |
111 | ;--------------------------------------------------------------------- |
112 | red: ; Redraw |
112 | red: ; Redraw |
113 | call draw_window |
113 | call draw_window |
114 | 114 | ||
115 | still: |
115 | still: |
116 | push 10 ; Wait here for event |
116 | mcall 10 ; Wait here for event |
117 | pop eax |
- | |
118 | mcall |
- | |
119 | cmp al,6 |
117 | cmp al,6 |
120 | je call_mouse |
118 | je call_mouse |
121 | dec eax |
119 | dec eax |
122 | je red ; Redraw request |
120 | je red ; Redraw request |
123 | dec eax |
121 | dec eax |
124 | jne button ; Button in buffer |
122 | jne button ; Button in buffer |
125 | key: ; Key |
123 | key: ; Key |
126 | mov al,2 ; Read it and ignore |
124 | mcall 2 ; Read it and ignore |
127 | mcall |
- | |
128 | 125 | ||
129 | push dword edit1 |
126 | push dword edit1 |
130 | call [edit_box_key] |
127 | call [edit_box_key] |
131 | push dword edit2 |
128 | push dword edit2 |
132 | call [edit_box_key] |
129 | call [edit_box_key] |
133 | push dword edit3 |
130 | push dword edit3 |
134 | call [edit_box_key] |
131 | call [edit_box_key] |
135 | jmp still |
132 | jmp still |
136 | ;--------------------------------------------------------------------- |
133 | ;--------------------------------------------------------------------- |
137 | call_mouse: |
134 | call_mouse: |
138 | call mouse |
135 | call mouse |
139 | jmp still |
136 | jmp still |
140 | ;--------------------------------------------------------------------- |
137 | ;--------------------------------------------------------------------- |
141 | button: ; Button in Window |
138 | button: ; Button in Window |
142 | mov al,17 |
- | |
143 | mcall |
139 | mcall 17 |
144 | - | ||
145 | cmp ah,1 |
140 | cmp ah,1 |
146 | jne noclose |
141 | jne noclose |
147 | or eax,-1 |
142 | or eax,-1 |
148 | mcall |
143 | mcall |
149 | ;--------------------------------------------------------------------- |
144 | ;--------------------------------------------------------------------- |
150 | noclose: |
145 | noclose: |
151 | cmp ah,5 ;press button for OpenDialog |
146 | cmp ah,5 ;press button for OpenDialog |
152 | jne @f |
147 | jne @f |
153 | call fun_opn_dlg |
148 | call fun_opn_dlg |
154 | @@: |
149 | @@: |
155 | cmp ah,2 ; Start compiling |
150 | cmp ah,2 ; Start compiling |
156 | je start |
151 | je start |
157 | cmp ah,3 ; Start compiled file |
152 | cmp ah,3 ; Start compiled file |
158 | jnz norunout |
153 | jnz norunout |
159 | 154 | ||
160 | mov edx,outfile |
155 | mov edx,outfile |
161 | call make_fullpaths |
156 | call make_fullpaths |
162 | mcall 70,file_info_start |
157 | mcall 70,file_info_start |
163 | ; xor ecx,ecx |
158 | ; xor ecx,ecx |
164 | jmp still |
159 | jmp still |
165 | ;--------------------------------------------------------------------- |
160 | ;--------------------------------------------------------------------- |
166 | norunout: |
161 | norunout: |
167 | cmp ah,4 |
162 | cmp ah,4 |
168 | jnz norundebug |
163 | jnz norundebug |
169 | 164 | ||
170 | mov edx,outfile |
165 | mov edx,outfile |
171 | call make_fullpaths |
166 | call make_fullpaths |
172 | mcall 70,file_info_debug |
167 | mcall 70,file_info_debug |
173 | jmp still |
168 | jmp still |
174 | ;--------------------------------------------------------------------- |
169 | ;--------------------------------------------------------------------- |
175 | norundebug: |
170 | norundebug: |
176 | jmp still |
171 | jmp still |
177 | ;--------------------------------------------------------------------- |
172 | ;--------------------------------------------------------------------- |
178 | mouse: |
173 | mouse: |
179 | push dword edit1 |
174 | push dword edit1 |
180 | call [edit_box_mouse] |
175 | call [edit_box_mouse] |
181 | push dword edit2 |
176 | push dword edit2 |
182 | call [edit_box_mouse] |
177 | call [edit_box_mouse] |
183 | push dword edit3 |
178 | push dword edit3 |
184 | call [edit_box_mouse] |
179 | call [edit_box_mouse] |
185 | push dword ch1_dbg |
180 | push dword ch1_dbg |
186 | call [check_box_mouse] |
181 | call [check_box_mouse] |
187 | ret |
182 | ret |
188 | ;--------------------------------------------------------------------- |
183 | ;--------------------------------------------------------------------- |
189 | draw_window: |
184 | draw_window: |
190 | pusha |
185 | pusha |
191 | mcall 12,1 ; Start of draw |
186 | mcall 12,1 ; Start of draw |
192 | ;get_sys_colors 1,0 |
187 | ;get_sys_colors 1,0 |
193 | xor eax,eax |
188 | |
194 | mov ebx,100*65536+280 |
- | |
195 | mov ecx,90*65536+260 |
- | |
196 | mov edx,[sc.work] |
189 | mov edx,[sc.work] |
197 | or edx,0x33000000 |
190 | or edx,0x33000000 |
- | 191 | xor eax,eax |
|
- | 192 | xor esi,esi |
|
198 | mov edi,fullpath_open ;title ; Draw Window Label Text |
193 | mcall ,<100,280>,<90,260>,,,title ; Draw Window Label Text |
199 | mcall |
- | |
200 | 194 | ||
201 | mcall 9,PROCESSINFO,-1 |
195 | mcall 9,PROCESSINFO,-1 |
202 | 196 | ||
203 | mov eax,[PROCESSINFO+70] ;status of window |
197 | mov eax,[PROCESSINFO+70] ;status of window |
204 | test eax,100b |
198 | test eax,100b |
205 | jne .end |
199 | jne .end |
206 | 200 | ||
207 | cmp dword[pinfo.box.width],230 ; ïðîâåðÿåì øèðèíó îêíà |
201 | cmp dword[pinfo.box.width],230 ; ïðîâåðÿåì øèðèíó îêíà |
208 | jge @f |
202 | jge @f |
209 | mov dword[pinfo.box.width],230 ; åñëè îêíî î÷åíü óçêîå, óâåëè÷èâàåì øèðèíó äëÿ èçáåæàíèÿ ãëþêîâ |
203 | mov dword[pinfo.box.width],230 ; åñëè îêíî î÷åíü óçêîå, óâåëè÷èâàåì øèðèíó äëÿ èçáåæàíèÿ ãëþêîâ |
210 | @@: |
204 | @@: |
211 | mpack ecx,1,1 |
205 | mpack ecx,1,1 |
212 | mov ebx,[pinfo.box.width] |
206 | mov ebx,[pinfo.box.width] |
213 | sub ebx,10 |
207 | sub ebx,10 |
214 | mov eax,8 |
208 | mov eax,8 |
215 | mov edx,0x4000000B |
209 | mov edx,0x4000000B |
216 | mpack ebx,[pinfo.box.width],MAGIC1 |
210 | mpack ebx,[pinfo.box.width],MAGIC1 |
217 | msub ebx,MAGIC1+10+1,0 |
211 | msub ebx,MAGIC1+10+1,0 |
218 | mpack ecx,0, (14*3+16)/3-1 |
212 | mpack ecx,0, (14*3+16)/3-1 |
219 | madd ecx,1,0 |
213 | madd ecx,1,0 |
220 | mcall ,,,0x00000002,[sc.work_button] |
214 | mcall ,,,0x00000002,[sc.work_button] |
221 | madd ecx, (14*3+16)/3+1,0 |
215 | madd ecx, (14*3+16)/3+1,0 |
222 | mcall ,,,0x00000003 |
216 | mcall ,,,0x00000003 |
223 | madd ecx, (14*3+16)/3+1,0 |
217 | madd ecx, (14*3+16)/3+1,0 |
224 | mcall ,,,4 |
218 | mcall ,,,4 |
225 | ;button for OpenDialog [..] |
219 | ;button for OpenDialog [..] |
226 | mov ebx, 5*65536+47 |
220 | mov ebx, 5*65536+47 |
227 | mov ecx, 33*65536+14 |
221 | mov ecx, 33*65536+14 |
228 | mcall ,,,5 |
222 | mcall ,,,5 |
229 | 223 | ||
230 | mpack ebx,6,0 ; Draw Window Text |
224 | mpack ebx,6,0 ; Draw Window Text |
231 | add ebx,1+ 14/2-3 |
225 | add ebx,1+ 14/2-3 |
232 | mov ecx,[sc.work_text] |
- | |
233 | mov edx,text |
- | |
234 | mov esi,text.line_size |
226 | mcall 4,,[sc.work_text],text,text.line_size ;InFile |
235 | mov eax,4 |
- | |
236 | mcall ;InFile |
- | |
237 | 227 | ||
238 | add ebx, 16 ;14 |
228 | add ebx, 16 ;14 |
239 | add edx,text.line_size |
229 | add edx,text.line_size |
240 | mcall ;OutFile |
230 | mcall ;OutFile |
241 | 231 | ||
242 | mov ecx,[sc.work_button_text] |
232 | mov ecx,[sc.work_button_text] |
243 | add ebx, 16 ;14 |
233 | add ebx, 16 ;14 |
244 | add edx,text.line_size |
234 | add edx,text.line_size |
245 | mcall ;Path |
235 | mcall ;Path |
246 | 236 | ||
247 | mov ebx,[pinfo.box.width] |
237 | mov ebx,[pinfo.box.width] |
248 | sub ebx,MAGIC1+10+1-9 |
238 | sub ebx,MAGIC1+10+1-9 |
249 | shl ebx,16 |
239 | shl ebx,16 |
250 | add ebx,1+( (14*3+16)/3-1)/2-3 |
240 | add ebx,1+( (14*3+16)/3-1)/2-3 |
251 | mcall ,,[sc.work_button_text],s_compile,7 |
241 | mcall ,,[sc.work_button_text],s_compile,7 |
252 | add ebx,(14*3+16)/3+1 |
242 | add ebx,(14*3+16)/3+1 |
253 | mcall ,,,s_run |
243 | mcall ,,,s_run |
254 | add ebx,(14*3+16)/3+1 |
244 | add ebx,(14*3+16)/3+1 |
255 | mcall ,,,s_debug |
245 | mcall ,,,s_debug |
256 | 246 | ||
257 | mpack ebx,MAGIC1+6,0 |
247 | mpack ebx,MAGIC1+6,0 |
258 | add ebx,1+ 14/2-3+ 14*0 |
248 | add ebx,1+ 14/2-3+ 14*0 |
259 | mov esi,[pinfo.box.width] |
249 | mov esi,[pinfo.box.width] |
260 | sub esi,MAGIC1*2+5*2+6+3 |
250 | sub esi,MAGIC1*2+5*2+6+3 |
261 | mov eax,esi |
251 | mov eax,esi |
262 | mov cl,6 |
252 | mov cl,6 |
263 | div cl |
253 | div cl |
264 | cmp al,MAX_PATH |
254 | cmp al,MAX_PATH |
265 | jbe @f |
255 | jbe @f |
266 | mov al,MAX_PATH |
256 | mov al,MAX_PATH |
267 | @@: |
257 | @@: |
268 | movzx esi,al |
258 | movzx esi,al |
269 | 259 | ||
270 | call draw_messages |
260 | call draw_messages |
271 | 261 | ||
272 | mov eax,dword [pinfo.box.width] |
262 | mov eax,dword [pinfo.box.width] |
273 | sub eax,127 |
263 | sub eax,127 |
274 | mov dword[edit1.width],eax ; óñòàíàâëèâàåì øèðèíó òåêñòîâûõ ïîëåé |
264 | mov dword[edit1.width],eax ; óñòàíàâëèâàåì øèðèíó òåêñòîâûõ ïîëåé |
275 | mov dword[edit2.width],eax |
265 | mov dword[edit2.width],eax |
276 | mov dword[edit3.width],eax |
266 | mov dword[edit3.width],eax |
277 | 267 | ||
278 | push dword edit1 |
268 | push dword edit1 |
279 | call [edit_box_draw] |
269 | call [edit_box_draw] |
280 | push dword edit2 |
270 | push dword edit2 |
281 | call [edit_box_draw] |
271 | call [edit_box_draw] |
282 | push dword edit3 |
272 | push dword edit3 |
283 | call [edit_box_draw] |
273 | call [edit_box_draw] |
284 | push dword ch1_dbg |
274 | push dword ch1_dbg |
285 | call [check_box_draw] |
275 | call [check_box_draw] |
286 | .end: |
276 | .end: |
287 | mcall 12,2 ; End of Draw |
277 | mcall 12,2 ; End of Draw |
288 | popa |
278 | popa |
289 | ret |
279 | ret |
290 | ;--------------------------------------------------------------------- |
280 | ;--------------------------------------------------------------------- |
291 | bottom_right dd ? |
281 | bottom_right dd ? |
292 | 282 | ||
293 | align 4 |
283 | align 4 |
294 | fun_opn_dlg: ;äãªæ¨ï ¤«ï ¢ë§®¢ OpenFile ¤¨ «®£ |
284 | fun_opn_dlg: ;äãªæ¨ï ¤«ï ¢ë§®¢ OpenFile ¤¨ «®£ |
295 | pushad |
285 | pushad |
296 | copy_path open_dialog_name,communication_area_default_path,library_path,0 |
286 | copy_path open_dialog_name,communication_area_default_path,library_path,0 |
297 | mov [OpenDialog_data.type],0 |
287 | mov [OpenDialog_data.type],0 |
298 | 288 | ||
299 | xor al,al |
289 | xor al,al |
300 | mov edi,dword [edit3.text] |
290 | mov edi,dword [edit3.text] |
301 | mov ecx,dword [edit3.max] |
291 | mov ecx,dword [edit3.max] |
302 | cld |
292 | cld |
303 | repne scasb |
293 | repne scasb |
304 | cmp byte[edi-2],'/' |
294 | cmp byte[edi-2],'/' |
305 | jne @f |
295 | jne @f |
306 | mov byte[edi-2],0 ;¥á«¨ ¢ ª®æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à 稢 ¥¬ 1 ᨬ¢®« |
296 | mov byte[edi-2],0 ;¥á«¨ ¢ ª®æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à 稢 ¥¬ 1 ᨬ¢®« |
307 | @@: |
297 | @@: |
308 | push dword OpenDialog_data |
298 | push dword OpenDialog_data |
309 | call dword [OpenDialog_Start] |
299 | call dword [OpenDialog_Start] |
310 | cmp [OpenDialog_data.status],2 |
300 | cmp [OpenDialog_data.status],2 |
311 | je @f |
301 | je @f |
312 | 302 | ||
313 | xor al,al |
303 | xor al,al |
314 | mov edi,dword [edit3.text] |
304 | mov edi,dword [edit3.text] |
315 | mov ebx,edi ;copy text pointer |
305 | mov ebx,edi ;copy text pointer |
316 | mov ecx,dword [edit3.max] |
306 | mov ecx,dword [edit3.max] |
317 | cld |
307 | cld |
318 | repne scasb |
308 | repne scasb |
319 | cmp byte[edi-2],'/' |
309 | cmp byte[edi-2],'/' |
320 | jne .no_slash |
310 | jne .no_slash |
321 | 311 | ||
322 | dec edi ;¥á«¨ ¢ ª®æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à 稢 ¥¬ 1 ᨬ¢®« |
312 | dec edi ;¥á«¨ ¢ ª®æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à 稢 ¥¬ 1 ᨬ¢®« |
323 | .no_slash: |
313 | .no_slash: |
324 | mov byte[edi-1],'/' ;áâ ¢¨¬ ¢ ª®æ¥ ¯ã⨠᫥è |
314 | mov byte[edi-1],'/' ;áâ ¢¨¬ ¢ ª®æ¥ ¯ã⨠᫥è |
325 | mov byte[edi],0 ;®â१ ¥¬ ¨¬ï ©¤¥®£® ä ©« |
315 | mov byte[edi],0 ;®â१ ¥¬ ¨¬ï ©¤¥®£® ä ©« |
326 | sub edi,ebx ;edi = strlen(edit3.text) |
316 | sub edi,ebx ;edi = strlen(edit3.text) |
327 | mov [edit3.size],edi |
317 | mov [edit3.size],edi |
328 | mov [edit3.pos],edi |
318 | mov [edit3.pos],edi |
329 | 319 | ||
330 | push dword [OpenDialog_data.filename_area] |
320 | push dword [OpenDialog_data.filename_area] |
331 | push dword edit1 |
321 | push dword edit1 |
332 | call dword [edit_box_set_text] |
322 | call dword [edit_box_set_text] |
333 | 323 | ||
334 | push dword [OpenDialog_data.filename_area] |
324 | push dword [OpenDialog_data.filename_area] |
335 | push dword edit2 |
325 | push dword edit2 |
336 | call dword [edit_box_set_text] |
326 | call dword [edit_box_set_text] |
337 | 327 | ||
338 | mov esi,[edit2.text] |
328 | mov esi,[edit2.text] |
339 | xor eax,eax |
329 | xor eax,eax |
340 | cld |
330 | cld |
341 | .cycle: |
331 | .cycle: |
342 | lodsb |
332 | lodsb |
343 | test eax,eax |
333 | test eax,eax |
344 | jnz .cycle |
334 | jnz .cycle |
345 | 335 | ||
346 | sub esi,5 |
336 | sub esi,5 |
347 | cmp esi,[edit2.text] |
337 | cmp esi,[edit2.text] |
348 | jle .short_fn |
338 | jle .short_fn |
349 | 339 | ||
350 | mov byte[esi],0 |
340 | mov byte[esi],0 |
351 | sub dword [edit2.size],4 |
341 | sub dword [edit2.size],4 |
352 | sub dword [edit2.pos],4 |
342 | sub dword [edit2.pos],4 |
353 | 343 | ||
354 | .short_fn: |
344 | .short_fn: |
355 | push dword edit1 |
345 | push dword edit1 |
356 | call dword [edit_box_draw] |
346 | call dword [edit_box_draw] |
357 | push dword edit2 |
347 | push dword edit2 |
358 | call dword [edit_box_draw] |
348 | call dword [edit_box_draw] |
359 | push dword edit3 |
349 | push dword edit3 |
360 | call dword [edit_box_draw] |
350 | call dword [edit_box_draw] |
361 | @@: |
351 | @@: |
362 | popad |
352 | popad |
363 | ret |
353 | ret |
364 | ;--------------------------------------------------------------------- |
354 | ;--------------------------------------------------------------------- |
365 | draw_messages: |
355 | draw_messages: |
366 | mov eax,13 ; clear work area |
- | |
367 | mpack ebx,7-2,[pinfo.box.width] |
356 | mpack ebx,7-2,[pinfo.box.width] |
368 | sub ebx,5*2+7*2-1-2*2 |
357 | sub ebx,5*2+7*2-1-2*2 |
369 | mpack ecx,0,[pinfo.box.height] |
358 | mpack ecx,0,[pinfo.box.height] |
370 | madd ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25) |
359 | madd ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25) |
371 | mov word[bottom_right+2],bx |
360 | mov word[bottom_right+2],bx |
372 | mov word[bottom_right],cx |
361 | mov word[bottom_right],cx |
373 | msub [bottom_right],7,11 |
362 | msub [bottom_right],7,11 |
374 | add [bottom_right],7 shl 16 + 53 |
363 | add [bottom_right],7 shl 16 + 53 |
375 | mov edx,[sc.work] |
364 | mcall 13,,,[sc.work] ; clear work area |
376 | mcall |
- | |
377 | _cy = 0 |
365 | _cy = 0 |
378 | _sy = 2 |
366 | _sy = 2 |
379 | _cx = 4 |
367 | _cx = 4 |
380 | _sx = 6 |
368 | _sx = 6 |
381 | push ebx ecx |
369 | push ebx ecx |
382 | mpack ebx,4,5 |
370 | mpack ebx,4,5 |
383 | add bx,[esp+_cx] |
371 | add bx,[esp+_cx] |
384 | mov ecx,[esp+_sy-2] |
372 | mov ecx,[esp+_sy-2] |
385 | mov cx,[esp+_sy] |
373 | mov cx,[esp+_sy] |
386 | msub ecx,1,1 |
374 | msub ecx,1,1 |
387 | mcall 38,,,[sc.work_graph] |
375 | mcall 38,,,[sc.work_graph] |
388 | mov si,[esp+_cy] |
376 | mov si,[esp+_cy] |
389 | add cx,si |
377 | add cx,si |
390 | shl esi,16 |
378 | shl esi,16 |
391 | add ecx,esi |
379 | add ecx,esi |
392 | madd ecx,1,1 |
380 | madd ecx,1,1 |
393 | mcall |
381 | mcall |
394 | mpack ebx,4,4 |
382 | mpack ebx,4,4 |
395 | mov esi,[esp+_sy-2] |
383 | mov esi,[esp+_sy-2] |
396 | mov si,cx |
384 | mov si,cx |
397 | mov ecx,esi |
385 | mov ecx,esi |
398 | mcall |
386 | mcall |
399 | mov si,[esp+_cx] |
387 | mov si,[esp+_cx] |
400 | add bx,si |
388 | add bx,si |
401 | shl esi,16 |
389 | shl esi,16 |
402 | add ebx,esi |
390 | add ebx,esi |
403 | madd ebx,1,1 |
391 | madd ebx,1,1 |
404 | mcall |
392 | mcall |
405 | pop ecx ebx |
393 | pop ecx ebx |
406 | ret |
394 | ret |
407 | ;--------------------------------------------------------------------- |
395 | ;--------------------------------------------------------------------- |
408 | ; DATA |
396 | ; DATA |
409 | ;--------------------------------------------------------------------- |
397 | ;--------------------------------------------------------------------- |
410 | if lang eq ru |
398 | if lang eq ru |
411 | text: |
399 | text: |
412 | db ' å ©«:' |
400 | db ' å ©«:' |
413 | .line_size = $-text |
401 | .line_size = $-text |
414 | db 'ëå ©«:' |
402 | db 'ëå ©«:' |
415 | db ' ãâì:' |
403 | db ' ãâì:' |
416 | ;db 'x' |
404 | ;db 'x' |
417 | 405 | ||
418 | s_compile db '®¬¯¨«.' |
406 | s_compile db '®¬¯¨«.' |
419 | s_run db ' ã᪠' |
407 | s_run db ' ã᪠' |
420 | s_debug db 'â« ¤ª ' |
408 | s_debug db 'â« ¤ª ' |
421 | s_dbgdescr db '®§¤ ¢ âì ®â« ¤®çãî ¨ä®à¬ æ¨î',0 |
409 | s_dbgdescr db '®§¤ ¢ âì ®â« ¤®çãî ¨ä®à¬ æ¨î',0 |
422 | s_dbgdescr_end: |
410 | s_dbgdescr_end: |
423 | 411 | ||
424 | err_message_found_lib0 db '¥ ©¤¥ ¡¨¡«¨®â¥ª box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ®¬ ®ª¥, ¥á«¨ ¡¨¡«¨®â¥ª ¥ ¡ã¤¥â ©¤¥ |
412 | err_message_found_lib0 db '¥ ©¤¥ ¡¨¡«¨®â¥ª box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ®¬ ®ª¥, ¥á«¨ ¡¨¡«¨®â¥ª ¥ ¡ã¤¥â ©¤¥ |
425 | err_message_import0 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0 |
413 | err_message_import0 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0 |
426 | err_message_found_lib1 db '¥ ©¤¥ ¡¨¡«¨®â¥ª proc_lib.obj',0 |
414 | err_message_found_lib1 db '¥ ©¤¥ ¡¨¡«¨®â¥ª proc_lib.obj',0 |
427 | err_message_import1 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',0 |
415 | err_message_import1 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',0 |
428 | head_f_i: |
416 | head_f_i: |
429 | head_f_l db '¨á⥬ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨ |
417 | head_f_l db '¨á⥬ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨ |
430 | else |
418 | else |
431 | text: |
419 | text: |
432 | db ' InFile:' |
420 | db ' InFile:' |
433 | .line_size = $-text |
421 | .line_size = $-text |
434 | db 'OutFile:' |
422 | db 'OutFile:' |
435 | db ' Path:' |
423 | db ' Path:' |
436 | ;db 'x' |
424 | ;db 'x' |
437 | 425 | ||
438 | s_compile db 'COMPILE' |
426 | s_compile db 'COMPILE' |
439 | s_run db ' RUN ' |
427 | s_run db ' RUN ' |
440 | s_debug db ' DEBUG ' |
428 | s_debug db ' DEBUG ' |
441 | s_dbgdescr db 'Generate debug information',0 |
429 | s_dbgdescr db 'Generate debug information',0 |
442 | s_dbgdescr_end: |
430 | s_dbgdescr_end: |
443 | 431 | ||
444 | err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0 |
432 | err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0 |
445 | err_message_import0 db 'Error on load import library box_lib.obj',0 |
433 | err_message_import0 db 'Error on load import library box_lib.obj',0 |
446 | err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0 |
434 | err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0 |
447 | err_message_import1 db 'Error on load import library proc_lib.obj',0 |
435 | err_message_import1 db 'Error on load import library proc_lib.obj',0 |
448 | 436 | ||
449 | head_f_i: |
437 | head_f_i: |
450 | head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨ |
438 | head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª , ¯à¨ ¢®§¨ª®¢¥¨¨ ®è¨¡ª¨ |
451 | end if |
439 | end if |
452 | 440 | ||
453 | system_dir0 db '/sys/lib/' |
441 | system_dir0 db '/sys/lib/' |
454 | lib0_name db 'box_lib.obj',0 |
442 | lib0_name db 'box_lib.obj',0 |
455 | 443 | ||
456 | system_dir1 db '/sys/lib/' |
444 | system_dir1 db '/sys/lib/' |
457 | lib1_name db 'proc_lib.obj',0 |
445 | lib1_name db 'proc_lib.obj',0 |
458 | ;--------------------------------------------------------------------- |
446 | ;--------------------------------------------------------------------- |
459 | align 4 |
447 | align 4 |
460 | import_box_lib: |
448 | import_box_lib: |
461 | edit_box_draw dd aEdit_box_draw |
449 | edit_box_draw dd aEdit_box_draw |
462 | edit_box_key dd aEdit_box_key |
450 | edit_box_key dd aEdit_box_key |
463 | edit_box_mouse dd aEdit_box_mouse |
451 | edit_box_mouse dd aEdit_box_mouse |
464 | edit_box_set_text dd aEdit_box_set_text |
452 | edit_box_set_text dd aEdit_box_set_text |
465 | ;version_ed dd aVersion_ed |
453 | ;version_ed dd aVersion_ed |
466 | 454 | ||
467 | check_box_draw dd aCheck_box_draw |
455 | check_box_draw dd aCheck_box_draw |
468 | check_box_mouse dd aCheck_box_mouse |
456 | check_box_mouse dd aCheck_box_mouse |
469 | ;version_ch dd aVersion_ch |
457 | ;version_ch dd aVersion_ch |
470 | 458 | ||
471 | dd 0,0 |
459 | dd 0,0 |
472 | 460 | ||
473 | aEdit_box_draw db 'edit_box',0 |
461 | aEdit_box_draw db 'edit_box',0 |
474 | aEdit_box_key db 'edit_box_key',0 |
462 | aEdit_box_key db 'edit_box_key',0 |
475 | aEdit_box_mouse db 'edit_box_mouse',0 |
463 | aEdit_box_mouse db 'edit_box_mouse',0 |
476 | aEdit_box_set_text db 'edit_box_set_text',0 |
464 | aEdit_box_set_text db 'edit_box_set_text',0 |
477 | ;aVersion_ed db 'version_ed',0 |
465 | ;aVersion_ed db 'version_ed',0 |
478 | 466 | ||
479 | aCheck_box_draw db 'check_box_draw',0 |
467 | aCheck_box_draw db 'check_box_draw',0 |
480 | aCheck_box_mouse db 'check_box_mouse',0 |
468 | aCheck_box_mouse db 'check_box_mouse',0 |
481 | ;aVersion_ch db 'version_ch',0 |
469 | ;aVersion_ch db 'version_ch',0 |
482 | ;--------------------------------------------------------------------- |
470 | ;--------------------------------------------------------------------- |
483 | align 4 |
471 | align 4 |
484 | import_proc_lib: |
472 | import_proc_lib: |
485 | OpenDialog_Init dd aOpenDialog_Init |
473 | OpenDialog_Init dd aOpenDialog_Init |
486 | OpenDialog_Start dd aOpenDialog_Start |
474 | OpenDialog_Start dd aOpenDialog_Start |
487 | dd 0,0 |
475 | dd 0,0 |
488 | aOpenDialog_Init db 'OpenDialog_init',0 |
476 | aOpenDialog_Init db 'OpenDialog_init',0 |
489 | aOpenDialog_Start db 'OpenDialog_start',0 |
477 | aOpenDialog_Start db 'OpenDialog_start',0 |
490 | ;--------------------------------------------------------------------- |
478 | ;--------------------------------------------------------------------- |
491 | ;library structures |
479 | ;library structures |
492 | l_libs_start: |
480 | l_libs_start: |
493 | lib0 l_libs lib0_name, cur_dir_path, library_path, system_dir0, err_message_found_lib0, head_f_l, import_box_lib, err_message_import0, head_f_i |
481 | lib0 l_libs lib0_name, cur_dir_path, library_path, system_dir0, err_message_found_lib0, head_f_l, import_box_lib, err_message_import0, head_f_i |
494 | lib1 l_libs lib1_name, cur_dir_path, library_path, system_dir1, err_message_found_lib1, head_f_l, import_proc_lib,err_message_import1, head_f_i |
482 | lib1 l_libs lib1_name, cur_dir_path, library_path, system_dir1, err_message_found_lib1, head_f_l, import_proc_lib,err_message_import1, head_f_i |
495 | load_lib_end: |
483 | load_lib_end: |
496 | 484 | ||
497 | edit1 edit_box 153, 56, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (outfile-infile-1), infile, mouse_dd, 0, 11,11 |
485 | edit1 edit_box 153, 56, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (outfile-infile-1), infile, mouse_dd, 0, 11,11 |
498 | edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1), outfile, mouse_dd, 0, 7,7 |
486 | edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1), outfile, mouse_dd, 0, 7,7 |
499 | edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6 |
487 | edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6 |
500 | editboxes_end: |
488 | editboxes_end: |
501 | ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr) |
489 | ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr) |
502 | ;--------------------------------------------------------------------- |
490 | ;--------------------------------------------------------------------- |
503 | align 4 |
491 | align 4 |
504 | OpenDialog_data: |
492 | OpenDialog_data: |
505 | .type dd 0 |
493 | .type dd 0 |
506 | .procinfo dd pinfo ;+4 |
494 | .procinfo dd pinfo ;+4 |
507 | .com_area_name dd communication_area_name ;+8 |
495 | .com_area_name dd communication_area_name ;+8 |
508 | .com_area dd 0 ;+12 |
496 | .com_area dd 0 ;+12 |
509 | .opendir_path dd path ;+16 |
497 | .opendir_path dd path ;+16 |
510 | .dir_default_path dd default_dir ;+20 |
498 | .dir_default_path dd default_dir ;+20 |
511 | .start_path dd library_path ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢ |
499 | .start_path dd library_path ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢ |
512 | .draw_window dd draw_window ;+28 |
500 | .draw_window dd draw_window ;+28 |
513 | .status dd 0 ;+32 |
501 | .status dd 0 ;+32 |
514 | .openfile_path dd path ;+36 ¯ãâì ª ®âªàë¢ ¥¬®¬ã ä ©«ã |
502 | .openfile_path dd path ;+36 ¯ãâì ª ®âªàë¢ ¥¬®¬ã ä ©«ã |
515 | .filename_area dd filename_area ;+40 |
503 | .filename_area dd filename_area ;+40 |
516 | .filter_area dd Filter |
504 | .filter_area dd Filter |
517 | .x: |
505 | .x: |
518 | .x_size dw 420 ;+48 ; Window X size |
506 | .x_size dw 420 ;+48 ; Window X size |
519 | .x_start dw 10 ;+50 ; Window X position |
507 | .x_start dw 10 ;+50 ; Window X position |
520 | .y: |
508 | .y: |
521 | .y_size dw 320 ;+52 ; Window y size |
509 | .y_size dw 320 ;+52 ; Window y size |
522 | .y_start dw 10 ;+54 ; Window Y position |
510 | .y_start dw 10 ;+54 ; Window Y position |
523 | 511 | ||
524 | default_dir db '/rd/1',0 ;¤¨à¥ªâ®à¨ï ¯® 㬮«ç ¨î |
512 | default_dir db '/rd/1',0 ;¤¨à¥ªâ®à¨ï ¯® 㬮«ç ¨î |
525 | 513 | ||
526 | communication_area_name: |
514 | communication_area_name: |
527 | db 'FFFFFFFF_open_dialog',0 |
515 | db 'FFFFFFFF_open_dialog',0 |
528 | open_dialog_name: |
516 | open_dialog_name: |
529 | db 'opendial',0 |
517 | db 'opendial',0 |
530 | communication_area_default_path: |
518 | communication_area_default_path: |
531 | db '/rd/1/File managers/',0 |
519 | db '/rd/1/File managers/',0 |
532 | 520 | ||
533 | Filter: |
521 | Filter: |
534 | dd Filter.end - Filter |
522 | dd Filter.end - Filter |
535 | .1: |
523 | .1: |
536 | db 'ASM',0 |
524 | db 'ASM',0 |
537 | .end: |
525 | .end: |
538 | db 0 |
526 | db 0 |
539 | ;--------------------------------------------------------------------- |
527 | ;--------------------------------------------------------------------- |
540 | mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox |
528 | mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox |
541 | ;--------------------------------------------------------------------- |
529 | ;--------------------------------------------------------------------- |
542 | infile db 'example.asm' |
530 | infile db 'example.asm' |
543 | times MAX_PATH-$+infile db 0 |
531 | times MAX_PATH-$+infile db 0 |
544 | outfile db 'example' |
532 | outfile db 'example' |
545 | times MAX_PATH-$+outfile db 0 |
533 | times MAX_PATH-$+outfile db 0 |
546 | path db '/rd/1//' ;OpenDialog ¯à¨ § ¯ã᪥ ã¡¨à ¥â ¯®á«¥¤¨© á«¥è, ® ¤¨ «®£ ¬®¦¥â ¨á¯®«ì§®¢ âìáï ¥ ¢á¥£¤ , ¯®â®¬ã á«¥è 2 |
534 | path db '/rd/1//' ;OpenDialog ¯à¨ § ¯ã᪥ ã¡¨à ¥â ¯®á«¥¤¨© á«¥è, ® ¤¨ «®£ ¬®¦¥â ¨á¯®«ì§®¢ âìáï ¥ ¢á¥£¤ , ¯®â®¬ã á«¥è 2 |
547 | times MAX_PATH-$+path db 0 |
535 | times MAX_PATH-$+path db 0 |
548 | path_end: |
536 | path_end: |
549 | lf db 13,10,0 |
537 | lf db 13,10,0 |
550 | ;--------------------------------------------------------------------- |
538 | ;--------------------------------------------------------------------- |
551 | mov_param_str: |
539 | mov_param_str: |
552 | cld |
540 | cld |
553 | @@: |
541 | @@: |
554 | lodsb |
542 | lodsb |
555 | cmp al,',' |
543 | cmp al,',' |
556 | je @f |
544 | je @f |
557 | stosb |
545 | stosb |
558 | test al,al |
546 | test al,al |
559 | jnz @b |
547 | jnz @b |
560 | @@: |
548 | @@: |
561 | xor al,al |
549 | xor al,al |
562 | stosb |
550 | stosb |
563 | ret |
551 | ret |
564 | ;--------------------------------------------------------------------- |
552 | ;--------------------------------------------------------------------- |
565 | start: |
553 | start: |
566 | cmp [_mode],NORMAL_MODE |
554 | cmp [_mode],NORMAL_MODE |
567 | jne @f |
555 | jne @f |
568 | call draw_messages |
556 | call draw_messages |
569 | mov [textxy],7 shl 16 + 70 |
557 | mov [textxy],7 shl 16 + 70 |
570 | @@: |
558 | @@: |
571 | mov esi,_logo |
559 | mov esi,_logo |
572 | call display_string |
560 | call display_string |
573 | 561 | ||
574 | ;--------------------------------------------------------------------- |
562 | ;--------------------------------------------------------------------- |
575 | ; Fasm native code |
563 | ; Fasm native code |
576 | ;--------------------------------------------------------------------- |
564 | ;--------------------------------------------------------------------- |
577 | mov [input_file],infile |
565 | mov [input_file],infile |
578 | mov [output_file],outfile |
566 | mov [output_file],outfile |
579 | 567 | ||
580 | call init_memory |
568 | call init_memory |
581 | 569 | ||
582 | call make_timestamp |
570 | call make_timestamp |
583 | mov [start_time],eax |
571 | mov [start_time],eax |
584 | 572 | ||
585 | call preprocessor |
573 | call preprocessor |
586 | call parser |
574 | call parser |
587 | call assembler |
575 | call assembler |
588 | bt dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0 |
576 | bt dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0 |
589 | jae @f ;jz @f |
577 | jae @f ;jz @f |
590 | call symbol_dump |
578 | call symbol_dump |
591 | @@: |
579 | @@: |
592 | call formatter |
580 | call formatter |
593 | 581 | ||
594 | call display_user_messages |
582 | call display_user_messages |
595 | movzx eax,[current_pass] |
583 | movzx eax,[current_pass] |
596 | inc eax |
584 | inc eax |
597 | call display_number |
585 | call display_number |
598 | mov esi,_passes_suffix |
586 | mov esi,_passes_suffix |
599 | call display_string |
587 | call display_string |
600 | call make_timestamp |
588 | call make_timestamp |
601 | sub eax,[start_time] |
589 | sub eax,[start_time] |
602 | xor edx,edx |
590 | xor edx,edx |
603 | mov ebx,100 |
591 | mov ebx,100 |
604 | div ebx |
592 | div ebx |
605 | or eax,eax |
593 | or eax,eax |
606 | jz display_bytes_count |
594 | jz display_bytes_count |
607 | xor edx,edx |
595 | xor edx,edx |
608 | mov ebx,10 |
596 | mov ebx,10 |
609 | div ebx |
597 | div ebx |
610 | push edx |
598 | push edx |
611 | call display_number |
599 | call display_number |
612 | mov dl,'.' |
600 | mov dl,'.' |
613 | call display_character |
601 | call display_character |
614 | pop eax |
602 | pop eax |
615 | call display_number |
603 | call display_number |
616 | mov esi,_seconds_suffix |
604 | mov esi,_seconds_suffix |
617 | call display_string |
605 | call display_string |
618 | display_bytes_count: |
606 | display_bytes_count: |
619 | mov eax,[written_size] |
607 | mov eax,[written_size] |
620 | call display_number |
608 | call display_number |
621 | mov esi,_bytes_suffix |
609 | mov esi,_bytes_suffix |
622 | call display_string |
610 | call display_string |
623 | xor al,al |
611 | xor al,al |
624 | 612 | ||
625 | cmp [_run_outfile],0 |
613 | cmp [_run_outfile],0 |
626 | je @f |
614 | je @f |
627 | mov edx,outfile |
615 | mov edx,outfile |
628 | call make_fullpaths |
616 | call make_fullpaths |
629 | xor ecx,ecx |
617 | xor ecx,ecx |
630 | mcall 70,file_info_start |
618 | mcall 70,file_info_start |
631 | @@: |
619 | @@: |
632 | jmp exit_program |
620 | jmp exit_program |
633 | ;--------------------------------------------------------------------- |
621 | ;--------------------------------------------------------------------- |
634 | include 'system.inc' |
622 | include 'system.inc' |
635 | include 'version.inc' |
623 | include 'version.inc' |
636 | include 'errors.inc' |
624 | include 'errors.inc' |
637 | include 'expressi.inc' |
625 | include 'expressi.inc' |
638 | include 'preproce.inc' |
626 | include 'preproce.inc' |
639 | include 'parser.inc' |
627 | include 'parser.inc' |
640 | include 'assemble.inc' |
628 | include 'assemble.inc' |
641 | include 'formats.inc' |
629 | include 'formats.inc' |
642 | include 'x86_64.inc' |
630 | include 'x86_64.inc' |
643 | include 'tables.inc' |
631 | include 'tables.inc' |
644 | include 'symbdump.inc' |
632 | include 'symbdump.inc' |
645 | include 'messages.inc' |
633 | include 'messages.inc' |
646 | ;--------------------------------------------------------------------- |
634 | ;--------------------------------------------------------------------- |
647 | title db appname,VERSION_STRING,0 |
635 | title db appname,VERSION_STRING,0 |
648 | 636 | ||
649 | _logo db 'flat assembler version ',VERSION_STRING,13,10,0 |
637 | _logo db 'flat assembler version ',VERSION_STRING,13,10,0 |
650 | 638 | ||
651 | _passes_suffix db ' passes, ',0 |
639 | _passes_suffix db ' passes, ',0 |
652 | _seconds_suffix db ' seconds, ',0 |
640 | _seconds_suffix db ' seconds, ',0 |
653 | _bytes_suffix db ' bytes.',13,10,0 |
641 | _bytes_suffix db ' bytes.',13,10,0 |
654 | 642 | ||
655 | _include db 'INCLUDE',0 |
643 | _include db 'INCLUDE',0 |
656 | 644 | ||
657 | _counter db 4,'0000' |
645 | _counter db 4,'0000' |
658 | 646 | ||
659 | _mode dd NORMAL_MODE |
647 | _mode dd NORMAL_MODE |
660 | _run_outfile dd 0 |
648 | _run_outfile dd 0 |
661 | ;bGenerateDebugInfo db 0 |
649 | ;bGenerateDebugInfo db 0 |
662 | 650 | ||
663 | sub_table: |
651 | sub_table: |
664 | times $41 db $00 |
652 | times $41 db $00 |
665 | times $1A db $20 |
653 | times $1A db $20 |
666 | times $25 db $00 |
654 | times $25 db $00 |
667 | times $10 db $20 |
655 | times $10 db $20 |
668 | times $30 db $00 |
656 | times $30 db $00 |
669 | times $10 db $50 |
657 | times $10 db $50 |
670 | times $04 db $00,$01 |
658 | times $04 db $00,$01 |
671 | times $08 db $00 |
659 | times $08 db $00 |
672 | 660 | ||
673 | ;include_debug_strings |
661 | ;include_debug_strings |
674 | program_end: |
662 | program_end: |
675 | ; params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/', |
663 | ; params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/', |
676 | params rb 4096 |
664 | params rb 4096 |
677 | cur_dir_path rb 4096 |
665 | cur_dir_path rb 4096 |
678 | library_path rb 4096 |
666 | library_path rb 4096 |
679 | filename_area rb 256 |
667 | filename_area rb 256 |
680 | 668 | ||
681 | align 4 |
669 | align 4 |
682 | 670 | ||
683 | include 'variable.inc' |
671 | include 'variable.inc' |
684 | 672 | ||
685 | program_base dd ? |
673 | program_base dd ? |
686 | buffer_address dd ? |
674 | buffer_address dd ? |
687 | memory_setting dd ? |
675 | memory_setting dd ? |
688 | start_time dd ? |
676 | start_time dd ? |
689 | memblock dd ? |
677 | memblock dd ? |
690 | 678 | ||
691 | predefinitions rb 1000h |
679 | predefinitions rb 1000h |
692 | 680 | ||
693 | dbgfilename rb MAX_PATH+4 |
681 | dbgfilename rb MAX_PATH+4 |
694 | 682 | ||
695 | sc system_colors |
683 | sc system_colors |
696 | max_handles = 8 |
684 | max_handles = 8 |
697 | fileinfos rb (4+20+MAX_PATH)*max_handles |
685 | fileinfos rb (4+20+MAX_PATH)*max_handles |
698 | fileinfos_end: |
686 | fileinfos_end: |
699 | pinfo process_information |
687 | pinfo process_information |
700 | 688 | ||
701 | align 1000h |
689 | align 1000h |
702 | rb 1000h |
690 | rb 1000h |
703 | stacktop: |
691 | stacktop:90,260>100,280> |