Subversion Repositories Kolibri OS

Rev

Rev 7839 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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