FASM - checking for "rolled up" window

git-svn-id: svn://kolibrios.org@2059 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2011-08-18 15:20:00 +00:00
parent 8e1566eec3
commit 9934173476
3 changed files with 433 additions and 450 deletions

View File

@ -1,8 +1,6 @@
@fasm.exe -m 16384 ..\..\..\develop\libraries\box_lib\trunk\box_lib.asm box_lib.obj
@kpack box_lib.obj
@erase lang.inc @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm fasm.asm fasm @fasm -m 16384 fasm.asm fasm
@erase lang.inc @erase lang.inc
@kpack fasm @kpack fasm
@pause @pause

View File

@ -1,8 +1,6 @@
@fasm.exe -m 16384 ..\..\..\develop\libraries\box_lib\trunk\box_lib.asm box_lib.obj
@kpack box_lib.obj
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm fasm.asm fasm @fasm -m 16384 fasm.asm fasm
@erase lang.inc @erase lang.inc
@kpack fasm @kpack fasm
@pause @pause

View File

@ -4,6 +4,7 @@
;; Copyright (c) 1999-2006, Tomasz Grysztar ;; ;; Copyright (c) 1999-2006, Tomasz Grysztar ;;
;; All rights reserved. ;; ;; All rights reserved. ;;
;; ;; ;; ;;
;; KolibriOS port by KolibriOS Team ;;
;; Menuet port by VT ;; ;; Menuet port by VT ;;
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -19,18 +20,17 @@ APP_MEMORY = 0x00800000
;; Menuet header ;; Menuet header
appname equ "flat assembler " appname equ "flat assembler "
;---------------------------------------------------------------------
use32 use32
org 0x0
org 0x0 db 'MENUET01' ; 8 byte id
db 'MENUET01' ; 8 byte id dd 0x01 ; header version
dd 0x01 ; header version dd START ; program start
dd START ; program start dd program_end ; program image size
dd program_end ; program image size dd stacktop ; required amount of memory
dd stacktop ; required amount of memory dd stacktop ; stack
dd stacktop ; stack dd params,cur_dir_path ; parameters,icon
dd params,cur_dir_path ; parameters,icon ;---------------------------------------------------------------------
include 'lang.inc' include 'lang.inc'
include '../../../macros.inc' include '../../../macros.inc'
purge add,sub ; macros.inc does incorrect substitution purge add,sub ; macros.inc does incorrect substitution
@ -40,10 +40,8 @@ include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/libraries/box_lib/load_lib.mac' include '../../../develop/libraries/box_lib/load_lib.mac'
@use_library @use_library
center fix true center fix true
;---------------------------------------------------------------------
START: ; Start of execution START: ; Start of execution
mov edi, fileinfos mov edi, fileinfos
mov ecx, (fileinfos_end-fileinfos)/4 mov ecx, (fileinfos_end-fileinfos)/4
@ -55,364 +53,360 @@ START: ; Start of execution
pop ebx pop ebx
mcall mcall
cmp [params],0 cmp [params],0
jz start_1 jz start_1
mov ecx,10 mov ecx,10
mov eax,' ' mov eax,' '
mov edi,infile mov edi,infile
push ecx push ecx
cld cld
rep stosd rep stosd
mov ecx,[esp] mov ecx,[esp]
mov edi,outfile mov edi,outfile
rep stosd rep stosd
pop ecx pop ecx
mov edi,path mov edi,path
rep stosd rep stosd
mov esi,params mov esi,params
; DEBUGF "params: %s\n",esi ; DEBUGF "params: %s\n",esi
mov edi,infile mov edi,infile
call mov_param_str call mov_param_str
; mov edi,infile ; mov edi,infile
; DEBUGF " input: %s\n",edi ; DEBUGF " input: %s\n",edi
mov edi,outfile mov edi,outfile
call mov_param_str call mov_param_str
; mov edi,outfile ; mov edi,outfile
; DEBUGF "output: %s\n",edi ; DEBUGF "output: %s\n",edi
mov edi,path mov edi,path
call mov_param_str call mov_param_str
; mov edi,path ; mov edi,path
; DEBUGF " path: %s\n",edi ; DEBUGF " path: %s\n",edi
dec esi dec esi
cmp [esi], dword ',run' cmp [esi], dword ',run'
jne @f jne @f
mov [_run_outfile],1 mov [_run_outfile],1
@@: @@:
mov [_mode],CONSOLE_MODE
mov [_mode],CONSOLE_MODE jmp start
jmp start ;---------------------------------------------------------------------
start_1: start_1:
;sys_ ;sys_
load_libraries l_libs_start,load_lib_end load_libraries l_libs_start,load_lib_end
cmp eax,-1 cmp eax,-1
jne @f jne @f
mcall -1 ;exit if not open box_lib.obj mcall -1 ;exit if not open box_lib.obj
@@: @@:
mcall 40,0x27 ;¬ áª  á¨á⥬­ëå ᮡë⨩ mcall 40,0x27 ;¬ áª  á¨á⥬­ëå ᮡë⨩
;---------------------------------------------------------------------
get_sys_colors 1,0 get_sys_colors 1,0
edit_boxes_set_sys_color edit1,editboxes_end,sc edit_boxes_set_sys_color edit1,editboxes_end,sc
check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc
;---------------------------------------------------------------------
; OpenDialog initialisation ; OpenDialog initialisation
push dword OpenDialog_data push dword OpenDialog_data
call dword [OpenDialog_Init] call dword [OpenDialog_Init]
;---------------------------------------------------------------------
red: ; Redraw red: ; Redraw
call draw_window call draw_window
still: still:
push 10 ; Wait here for event push 10 ; Wait here for event
pop eax pop eax
mcall mcall
cmp al,6 cmp al,6
je call_mouse je call_mouse
dec eax dec eax
je red ; Redraw request je red ; Redraw request
dec eax dec eax
jne button ; Button in buffer jne button ; Button in buffer
key: ; Key key: ; Key
mov al,2 ; Read it and ignore mov al,2 ; Read it and ignore
mcall mcall
push dword edit1 push dword edit1
call [edit_box_key] call [edit_box_key]
push dword edit2 push dword edit2
call [edit_box_key] call [edit_box_key]
push dword edit3 push dword edit3
call [edit_box_key] call [edit_box_key]
jmp still
jmp still ;---------------------------------------------------------------------
call_mouse: call_mouse:
call mouse call mouse
jmp still jmp still
;---------------------------------------------------------------------
button: ; Button in Window button: ; Button in Window
mov al,17
mov al,17 mcall
mcall
cmp ah,1
cmp ah,1 jne noclose
jne noclose or eax,-1
or eax,-1 mcall
mcall ;---------------------------------------------------------------------
noclose: noclose:
cmp ah,5 ;press button for OpenDialog cmp ah,5 ;press button for OpenDialog
jne @f jne @f
call fun_opn_dlg call fun_opn_dlg
@@: @@:
cmp ah,2 ; Start compiling cmp ah,2 ; Start compiling
je start je start
cmp ah,3 ; Start compiled file cmp ah,3 ; Start compiled file
jnz norunout jnz norunout
mov edx,outfile mov edx,outfile
call make_fullpaths call make_fullpaths
mcall 70,file_info_start mcall 70,file_info_start
; xor ecx,ecx ; xor ecx,ecx
jmp still jmp still
norunout: ;---------------------------------------------------------------------
cmp ah,4 norunout:
jnz norundebug cmp ah,4
jnz norundebug
mov edx,outfile
call make_fullpaths mov edx,outfile
mcall 70,file_info_debug call make_fullpaths
jmp still mcall 70,file_info_debug
jmp still
norundebug: ;---------------------------------------------------------------------
norundebug:
jmp still jmp still
;---------------------------------------------------------------------
mouse: mouse:
push dword edit1 push dword edit1
call [edit_box_mouse] call [edit_box_mouse]
push dword edit2 push dword edit2
call [edit_box_mouse] call [edit_box_mouse]
push dword edit3 push dword edit3
call [edit_box_mouse] call [edit_box_mouse]
push dword ch1_dbg push dword ch1_dbg
call [check_box_mouse] call [check_box_mouse]
ret ret
;---------------------------------------------------------------------
draw_window: draw_window:
pusha pusha
mcall 12,1 ; Start of draw
;get_sys_colors 1,0
xor eax,eax
mov ebx,100*65536+280
mov ecx,90*65536+260
mov edx,[sc.work]
or edx,0x33000000
mov edi,title ; Draw Window Label Text
mcall
mcall 12,1 ; Start of draw mcall 9,PROCESSINFO,-1
;get_sys_colors 1,0 mov eax,[PROCESSINFO+70] ;status of window
test eax,100b
jne .end
xor eax,eax cmp dword[pinfo.box.width],230 ; ïðîâåðÿåì øèðèíó îêíà
mov ebx,100*65536+280 jge @f
mov ecx,90*65536+260 mov dword[pinfo.box.width],230 ; åñëè îêíî î÷åíü óçêîå, óâåëè÷èâàåì øèðèíó äëÿ èçáåæàíèÿ ãëþêîâ
mov edx,[sc.work] @@:
or edx,0x33000000 mpack ecx,1,1
mov edi,title ; Draw Window Label Text mov ebx,[pinfo.box.width]
mcall sub ebx,10
mov eax,8
mov edx,0x4000000B
mpack ebx,[pinfo.box.width],MAGIC1
msub ebx,MAGIC1+10+1,0
mpack ecx,0, (14*3+16)/3-1
madd ecx,1,0
mcall ,,,0x00000002,[sc.work_button]
madd ecx, (14*3+16)/3+1,0
mcall ,,,0x00000003
madd ecx, (14*3+16)/3+1,0
mcall ,,,4
;button for OpenDialog [..]
mov ebx, 5*65536+47
mov ecx, 33*65536+14
mcall ,,,5
mcall 9,PROCESSINFO,-1 mpack ebx,6,0 ; Draw Window Text
add ebx,1+ 14/2-3
mov ecx,[sc.work_text]
mov edx,text
mov esi,text.line_size
mov eax,4
mcall ;InFile
cmp dword[pinfo.box.width],230 ; ïðîâåðÿåì øèðèíó îêíà add ebx, 16 ;14
jge @f add edx,text.line_size
mov dword[pinfo.box.width],230 ; åñëè îêíî î÷åíü óçêîå, óâåëè÷èâàåì øèðèíó äëÿ èçáåæàíèÿ ãëþêîâ mcall ;OutFile
@@:
mpack ecx,1,1 mov ecx,[sc.work_button_text]
mov ebx,[pinfo.box.width] add ebx, 16 ;14
sub ebx,10 add edx,text.line_size
mcall ;Path
mov eax,8 mov ebx,[pinfo.box.width]
mov edx,0x4000000B sub ebx,MAGIC1+10+1-9
mpack ebx,[pinfo.box.width],MAGIC1 shl ebx,16
msub ebx,MAGIC1+10+1,0 add ebx,1+( (14*3+16)/3-1)/2-3
mpack ecx,0, (14*3+16)/3-1 mcall ,,[sc.work_button_text],s_compile,7
madd ecx,1,0 add ebx,(14*3+16)/3+1
mcall ,,,0x00000002,[sc.work_button] mcall ,,,s_run
madd ecx, (14*3+16)/3+1,0 add ebx,(14*3+16)/3+1
mcall ,,,0x00000003 mcall ,,,s_debug
madd ecx, (14*3+16)/3+1,0
mcall ,,,4 mpack ebx,MAGIC1+6,0
add ebx,1+ 14/2-3+ 14*0
;button for OpenDialog [..] mov esi,[pinfo.box.width]
mov ebx, 5*65536+47 sub esi,MAGIC1*2+5*2+6+3
mov ecx, 33*65536+14 mov eax,esi
mcall ,,,5 mov cl,6
div cl
mpack ebx,6,0 ; Draw Window Text cmp al,MAX_PATH
add ebx,1+ 14/2-3 jbe @f
mov ecx,[sc.work_text] mov al,MAX_PATH
mov edx,text @@:
mov esi,text.line_size movzx esi,al
mov eax,4
mcall ;InFile
add ebx, 16 ;14
add edx,text.line_size
mcall ;OutFile
mov ecx,[sc.work_button_text]
add ebx, 16 ;14
add edx,text.line_size
mcall ;Path
mov ebx,[pinfo.box.width]
sub ebx,MAGIC1+10+1-9
shl ebx,16
add ebx,1+( (14*3+16)/3-1)/2-3
mcall ,,[sc.work_button_text],s_compile,7
add ebx,(14*3+16)/3+1
mcall ,,,s_run
add ebx,(14*3+16)/3+1
mcall ,,,s_debug
mpack ebx,MAGIC1+6,0
add ebx,1+ 14/2-3+ 14*0
mov esi,[pinfo.box.width]
sub esi,MAGIC1*2+5*2+6+3
mov eax,esi
mov cl,6
div cl
cmp al,MAX_PATH
jbe @f
mov al,MAX_PATH
@@: movzx esi,al
call draw_messages
mov eax,dword[pinfo.box.width]
sub eax,127
mov dword[edit1.width],eax ; óñòàíàâëèâàåì øèðèíó òåêñòîâûõ ïîëåé
mov dword[edit2.width],eax
mov dword[edit3.width],eax
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword edit3
call [edit_box_draw]
push dword ch1_dbg
call [check_box_draw]
mcall 12,2 ; End of Draw
popa
ret
call draw_messages
mov eax,dword[pinfo.box.width]
sub eax,127
mov dword[edit1.width],eax ; óñòàíàâëèâàåì øèðèíó òåêñòîâûõ ïîëåé
mov dword[edit2.width],eax
mov dword[edit3.width],eax
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword edit3
call [edit_box_draw]
push dword ch1_dbg
call [check_box_draw]
.end:
mcall 12,2 ; End of Draw
popa
ret
;---------------------------------------------------------------------
bottom_right dd ? bottom_right dd ?
align 4 align 4
fun_opn_dlg: ;äã­ªæ¨ï ¤«ï ¢ë§®¢  OpenFile ¤¨ «®£  fun_opn_dlg: ;äã­ªæ¨ï ¤«ï ¢ë§®¢  OpenFile ¤¨ «®£ 
pushad pushad
copy_path open_dialog_name,communication_area_default_path,library_path,0 copy_path open_dialog_name,communication_area_default_path,library_path,0
mov [OpenDialog_data.type],0 mov [OpenDialog_data.type],0
xor al,al xor al,al
mov edi,dword[edit3.text] mov edi,dword[edit3.text]
mov ecx,dword[edit3.max] mov ecx,dword[edit3.max]
cld cld
repne scasb repne scasb
cmp byte[edi-2],'/' cmp byte[edi-2],'/'
jne @f jne @f
mov byte[edi-2],0 ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®« mov byte[edi-2],0 ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®«
@@: @@:
push dword OpenDialog_data
call dword [OpenDialog_Start]
cmp [OpenDialog_data.status],2
je @f
push dword OpenDialog_data xor al,al
call dword [OpenDialog_Start] mov edi,dword[edit3.text]
cmp [OpenDialog_data.status],2 mov ebx,edi ;copy text pointer
je @f mov ecx,dword[edit3.max]
xor al,al cld
mov edi,dword[edit3.text] repne scasb
mov ebx,edi ;copy text pointer cmp byte[edi-2],'/'
mov ecx,dword[edit3.max] jne .no_slash
cld
repne scasb dec edi ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®«
cmp byte[edi-2],'/' .no_slash:
jne .no_slash mov byte[edi-1],'/' ;áâ ¢¨¬ ¢ ª®­æ¥ ¯ã⨠᫥è
dec edi ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®« mov byte[edi],0 ;®â१ ¥¬ ¨¬ï ­ ©¤¥­­®£® ä ©« 
.no_slash: sub edi,ebx ;edi = strlen(edit3.text)
mov byte[edi-1],'/' ;áâ ¢¨¬ ¢ ª®­æ¥ ¯ã⨠᫥è mov [edit3.size],edi
mov byte[edi],0 ;®â१ ¥¬ ¨¬ï ­ ©¤¥­­®£® ä ©«  mov [edit3.pos],edi
sub edi,ebx ;edi = strlen(edit3.text)
mov [edit3.size],edi
mov [edit3.pos],edi
push dword [OpenDialog_data.filename_area] push dword [OpenDialog_data.filename_area]
push dword edit1 push dword edit1
call dword [edit_box_set_text] call dword [edit_box_set_text]
push dword [OpenDialog_data.filename_area] push dword [OpenDialog_data.filename_area]
push dword edit2 push dword edit2
call dword [edit_box_set_text] call dword [edit_box_set_text]
mov esi,[edit2.text] mov esi,[edit2.text]
xor eax,eax xor eax,eax
cld cld
.cycle: .cycle:
lodsb lodsb
test eax,eax test eax,eax
jnz .cycle jnz .cycle
sub esi,4
cmp esi,[edit2.text]
jle .short_fn
mov byte[esi],0
sub dword [edit2.size],4
sub dword [edit2.pos],4
.short_fn:
push dword edit1 sub esi,4
call dword [edit_box_draw] cmp esi,[edit2.text]
push dword edit2 jle .short_fn
call dword [edit_box_draw]
push dword edit3 mov byte[esi],0
call dword [edit_box_draw] sub dword [edit2.size],4
@@: sub dword [edit2.pos],4
.short_fn:
push dword edit1
call dword [edit_box_draw]
push dword edit2
call dword [edit_box_draw]
push dword edit3
call dword [edit_box_draw]
@@:
popad popad
ret ret
;---------------------------------------------------------------------
draw_messages: draw_messages:
mov eax,13 ; clear work area mov eax,13 ; clear work area
mpack ebx,7-2,[pinfo.box.width] mpack ebx,7-2,[pinfo.box.width]
sub ebx,5*2+7*2-1-2*2 sub ebx,5*2+7*2-1-2*2
mpack ecx,0,[pinfo.box.height] mpack ecx,0,[pinfo.box.height]
madd ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25) madd ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25)
mov word[bottom_right+2],bx mov word[bottom_right+2],bx
mov word[bottom_right],cx mov word[bottom_right],cx
msub [bottom_right],7,11 msub [bottom_right],7,11
add [bottom_right],7 shl 16 + 53 add [bottom_right],7 shl 16 + 53
mov edx,[sc.work] mov edx,[sc.work]
mcall mcall
_cy = 0 _cy = 0
_sy = 2 _sy = 2
_cx = 4 _cx = 4
_sx = 6 _sx = 6
push ebx ecx push ebx ecx
mpack ebx,4,5 mpack ebx,4,5
add bx,[esp+_cx] add bx,[esp+_cx]
mov ecx,[esp+_sy-2] mov ecx,[esp+_sy-2]
mov cx,[esp+_sy] mov cx,[esp+_sy]
msub ecx,1,1 msub ecx,1,1
mcall 38,,,[sc.work_graph] mcall 38,,,[sc.work_graph]
mov si,[esp+_cy] mov si,[esp+_cy]
add cx,si add cx,si
shl esi,16 shl esi,16
add ecx,esi add ecx,esi
madd ecx,1,1 madd ecx,1,1
mcall mcall
mpack ebx,4,4 mpack ebx,4,4
mov esi,[esp+_sy-2] mov esi,[esp+_sy-2]
mov si,cx mov si,cx
mov ecx,esi mov ecx,esi
mcall mcall
mov si,[esp+_cx] mov si,[esp+_cx]
add bx,si add bx,si
shl esi,16 shl esi,16
add ebx,esi add ebx,esi
madd ebx,1,1 madd ebx,1,1
mcall mcall
pop ecx ebx pop ecx ebx
ret ret
;---------------------------------------------------------------------
; DATA ; DATA
;---------------------------------------------------------------------
if lang eq ru if lang eq ru
text: text:
db ' ‚å” ©«:' db ' ‚å” ©«:'
@ -461,40 +455,39 @@ end if
system_dir1 db '/sys/lib/' system_dir1 db '/sys/lib/'
lib1_name db 'proc_lib.obj',0 lib1_name db 'proc_lib.obj',0
;---------------------------------------------------------------------
align 4 align 4
import_box_lib: import_box_lib:
edit_box_draw dd aEdit_box_draw edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse edit_box_mouse dd aEdit_box_mouse
edit_box_set_text dd aEdit_box_set_text edit_box_set_text dd aEdit_box_set_text
;version_ed dd aVersion_ed ;version_ed dd aVersion_ed
check_box_draw dd aCheck_box_draw check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse check_box_mouse dd aCheck_box_mouse
;version_ch dd aVersion_ch ;version_ch dd aVersion_ch
dd 0,0 dd 0,0
aEdit_box_draw db 'edit_box',0 aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0 aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0 aEdit_box_mouse db 'edit_box_mouse',0
aEdit_box_set_text db 'edit_box_set_text',0 aEdit_box_set_text db 'edit_box_set_text',0
;aVersion_ed db 'version_ed',0 ;aVersion_ed db 'version_ed',0
aCheck_box_draw db 'check_box_draw',0
aCheck_box_mouse db 'check_box_mouse',0
;aVersion_ch db 'version_ch',0
aCheck_box_draw db 'check_box_draw',0
aCheck_box_mouse db 'check_box_mouse',0
;aVersion_ch db 'version_ch',0
;---------------------------------------------------------------------
align 4 align 4
import_proc_lib: import_proc_lib:
OpenDialog_Init dd aOpenDialog_Init OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start OpenDialog_Start dd aOpenDialog_Start
dd 0,0 dd 0,0
aOpenDialog_Init db 'OpenDialog_init',0 aOpenDialog_Init db 'OpenDialog_init',0
aOpenDialog_Start db 'OpenDialog_start',0 aOpenDialog_Start db 'OpenDialog_start',0
;---------------------------------------------------------------------
;library structures ;library structures
l_libs_start: l_libs_start:
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 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
@ -506,7 +499,6 @@ edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1),
edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6 edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6
editboxes_end: editboxes_end:
ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr) ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr)
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
OpenDialog_data: OpenDialog_data:
@ -544,9 +536,9 @@ dd Filter.end - Filter
db 'ASM',0 db 'ASM',0
.end: .end:
db 0 db 0
;---------------------------------------------------------------------
mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox
;---------------------------------------------------------------------
infile db 'example.asm' infile db 'example.asm'
times MAX_PATH-$+infile db 0 times MAX_PATH-$+infile db 0
outfile db 'example' outfile db 'example'
@ -555,97 +547,92 @@ path db '/rd/1//' ;OpenDialog
times MAX_PATH-$+path db 0 times MAX_PATH-$+path db 0
path_end: path_end:
lf db 13,10,0 lf db 13,10,0
;---------------------------------------------------------------------
mov_param_str: mov_param_str:
cld cld
@@: @@:
lodsb lodsb
cmp al,',' cmp al,','
je @f je @f
stosb stosb
test al,al test al,al
jnz @b jnz @b
@@: @@:
xor al,al xor al,al
stosb stosb
ret ret
;---------------------------------------------------------------------
start: start:
cmp [_mode],NORMAL_MODE cmp [_mode],NORMAL_MODE
jne @f jne @f
call draw_messages call draw_messages
mov [textxy],7 shl 16 + 70 mov [textxy],7 shl 16 + 70
@@: @@:
mov esi,_logo mov esi,_logo
call display_string call display_string
; ;---------------------------------------------------------------------
; Fasm native code ; Fasm native code
; ;---------------------------------------------------------------------
mov [input_file],infile
mov [input_file],infile mov [output_file],outfile
mov [output_file],outfile
call init_memory
call init_memory
call make_timestamp
call make_timestamp mov [start_time],eax
mov [start_time],eax
call preprocessor
call preprocessor call parser
call parser call assembler
call assembler bt dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
bt dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0 jae @f ;jz @f
jae @f ;jz @f call symbol_dump
call symbol_dump
@@: @@:
call formatter call formatter
call display_user_messages call display_user_messages
movzx eax,[current_pass] movzx eax,[current_pass]
inc eax inc eax
call display_number call display_number
mov esi,_passes_suffix mov esi,_passes_suffix
call display_string call display_string
call make_timestamp call make_timestamp
sub eax,[start_time] sub eax,[start_time]
xor edx,edx xor edx,edx
mov ebx,100 mov ebx,100
div ebx div ebx
or eax,eax or eax,eax
jz display_bytes_count jz display_bytes_count
xor edx,edx xor edx,edx
mov ebx,10 mov ebx,10
div ebx div ebx
push edx push edx
call display_number call display_number
mov dl,'.' mov dl,'.'
call display_character call display_character
pop eax pop eax
call display_number call display_number
mov esi,_seconds_suffix mov esi,_seconds_suffix
call display_string call display_string
display_bytes_count: display_bytes_count:
mov eax,[written_size] mov eax,[written_size]
call display_number call display_number
mov esi,_bytes_suffix mov esi,_bytes_suffix
call display_string call display_string
xor al,al xor al,al
cmp [_run_outfile],0 cmp [_run_outfile],0
je @f je @f
mov edx,outfile mov edx,outfile
call make_fullpaths call make_fullpaths
mov eax,70 mov eax,70
mov ebx,file_info_start mov ebx,file_info_start
xor ecx,ecx xor ecx,ecx
mcall mcall
@@: @@:
jmp exit_program jmp exit_program
;---------------------------------------------------------------------
include 'system.inc' include 'system.inc'
include 'version.inc' include 'version.inc'
include 'errors.inc' include 'errors.inc'
@ -658,7 +645,7 @@ include 'x86_64.inc'
include 'tables.inc' include 'tables.inc'
include 'symbdump.inc' include 'symbdump.inc'
include 'messages.inc' include 'messages.inc'
;---------------------------------------------------------------------
title db appname,VERSION_STRING,0 title db appname,VERSION_STRING,0
_logo db 'flat assembler version ',VERSION_STRING,13,10,0 _logo db 'flat assembler version ',VERSION_STRING,13,10,0