diff -ruN T:\FASM-1.67.26\source\IDE\FASMW\ASMEDIT.ASH D:\FASM\SOURCE\IDE\FASMW\ASMEDIT.ASH --- T:\FASM-1.67.26\source\IDE\FASMW\ASMEDIT.ASH Mon Jul 31 16:32:44 2006 +++ D:\FASM\SOURCE\IDE\FASMW\ASMEDIT.ASH Sun Jun 29 21:03:42 2008 @@ -37,6 +37,7 @@ AEM_GETLINELENGTH = WM_USER + 11 AEM_GETLINE = WM_USER + 12 AEM_GETWORDATCARET = WM_USER + 13 +AEM_GETSEL = WM_USER + 14 ; Assembly Editor notifications diff -ruN T:\FASM-1.67.26\source\IDE\FASMW\ASMEDIT.INC D:\FASM\SOURCE\IDE\FASMW\ASMEDIT.INC --- T:\FASM-1.67.26\source\IDE\FASMW\ASMEDIT.INC Tue Dec 18 21:49:02 2007 +++ D:\FASM\SOURCE\IDE\FASMW\ASMEDIT.INC Sun Jun 29 21:09:23 2008 @@ -178,6 +178,8 @@ je aem_setpos cmp eax,AEM_GETPOS je aem_getpos + cmp eax,AEM_GETSEL + je aemgetsel cmp eax,AEM_FINDFIRST je aem_findfirst cmp eax,AEM_FINDNEXT @@ -1464,6 +1466,17 @@ mov eax,[selection_position] inc eax mov [pos.selectionPosition],eax + jmp ignore +aemgetsel: + xor eax,eax + cmp eax,[caret_line_number] + je .noabs + mov eax,[selection_position] + sub eax,[caret_position] + jge .noabs + neg eax + .noabs: + mov [return_value],eax jmp ignore aem_findfirst: mov esi,[lparam] diff -ruN T:\FASM-1.67.26\source\IDE\FASMW\FASMW.ASM D:\FASM\SOURCE\IDE\FASMW\FASMW.ASM --- T:\FASM-1.67.26\source\IDE\FASMW\FASMW.ASM Sat Jan 19 20:45:44 2008 +++ D:\FASM\SOURCE\IDE\FASMW\FASMW.ASM Sun Jun 29 21:27:42 2008 @@ -3,6 +3,13 @@ ; Copyright (c) 1999-2007, Tomasz Grysztar. ; All rights reserved. +; modifications by comrade +; 2008-06-29 +; IRC: #asm, #coders, #win32asm on EFnet +; Web: http://comrade64.cjb.net/ +; http://comrade.ownz.com/ +; http://comrade.win32asm.com/ + format PE GUI 4.0 entry start stack 20000h @@ -12,7 +19,7 @@ include '..\..\version.inc' -IDE_VERSION_STRING equ "0.93.15" +IDE_VERSION_STRING equ "0.93.15.1" struct EDITITEM header TC_ITEMHEADER @@ -48,6 +55,7 @@ section '.data' data readable writeable + _file_caption db '%s - ' _caption db 'flat assembler ',VERSION_STRING,0 _class db 'FASMW_IDE2',0 _asmedit_class db 'ASMEDIT',0 @@ -59,11 +67,13 @@ _memory_error db 'Not enough memory to complete this operation.',0 _loading_error db 'Could not load file %s.',0 _run_object_error db 'Cannot execute object file.',0 + _debug_object_error db 'Cannot debug object file.',0 _saving_question db 'File was modified. Save it now?',0 _not_found db 'Text not found.',0 _replace_prompt db 'Replace this occurence?',0 _untitled db 'Untitled',0 _font_face db 'Courier New',0 + _row_column_sel db 9,'%d,%d (%d)',0 _row_column db 9,'%d,' _value db '%d' _null db 0 @@ -116,6 +126,9 @@ _key_window_maximized db 'Maximized',0 _section_help db 'Help',0 _key_help_path db 'Path',0 + _section_debugger db 'Debugger',0 + _key_debugger db 'debugger',0 + _key_debuggerparams db 'debuggerparams',0 _appearance_settings db 'Font',0 db 'Text color',0 @@ -161,13 +174,14 @@ db 0 preview_selection dd 1,5,1,6 - asm_filter db 'Assembler files',0,'*.ASM;*.INC;*.ASH',0 - db 'All files',0,'*.*',0 + asm_filter db 'Assembly Sources (*.asm;*.s;*.inc;*.ash)',0,'*.asm;*.s;*.inc;*.ash',0 + db 'All Files (*.*)',0,'*.*',0 db 0 - help_filter db 'Help files',0,'*.HLP;*.CHM',0 + help_filter db 'Help Files (*.hlp)',0,'*.hlp',0 db 0 + predefinitions db 0 align 4 @@ -213,6 +227,11 @@ ini_path rb 1000h path_buffer rb 4000h + debugger rb 200h + debuggerparams rb 200h + debuggerdir rb 200h + debugcmdline rb 400h + msg MSG wc WNDCLASS rc RECT @@ -570,6 +589,11 @@ stdcall GetIniInteger,ini_path,_section_window,_key_window_bottom,wp.rcNormalPosition.bottom stdcall GetIniBit,ini_path,_section_window,_key_window_maximized,wp.flags,WPF_RESTORETOMAXIMIZED invoke GetPrivateProfileString,_section_help,_key_help_path,help_path,help_path,1000h,ini_path + invoke GetPrivateProfileString,_section_debugger,_key_debugger,debugger,debugger,200h,ini_path + invoke GetPrivateProfileString,_section_debugger,_key_debuggerparams,debuggerparams,debuggerparams,200h,ini_path + mov byte [debuggerparams+0], '%' + mov byte [debuggerparams+1], 's' + mov byte [debuggerparams+2], ' ' mov [wp.showCmd],SW_HIDE invoke SetWindowPlacement,[hwnd],wp invoke CreateFontIndirect,font @@ -799,6 +823,27 @@ set_asmedit_text: invoke SendMessage,[hwnd_asmedit],WM_SETTEXT,0,dword [esp] call [VirtualFree] + mov eax,[ei.pszpath] + mov ecx,_caption + test eax,eax + jz .nofile + mov ecx,_file_caption + dec eax +@@: inc eax + cmp byte [eax],0 + jnz @B +@@: dec eax + cmp byte [eax],"\" + je @F + cmp byte [eax],":" + je @F + cmp eax,[ei.pszpath] + jne @B + mov ecx,_caption + jmp .nofile +@@: inc eax +.nofile:cinvoke wsprintf,string_buffer,ecx,eax + invoke SetWindowText,[hwnd],string_buffer mov eax,ebx jmp finish load_out_of_memory: @@ -899,6 +944,27 @@ fmselect: mov [ei.header.mask],TCIF_PARAM invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei + mov eax,[ei.pszpath] + mov ecx,_caption + test eax,eax + jz .nofile + mov ecx,_file_caption + dec eax +@@: inc eax + cmp byte [eax],0 + jnz @B +@@: dec eax + cmp byte [eax],"\" + je @F + cmp byte [eax],":" + je @F + cmp eax,[ei.pszpath] + jne @B + mov ecx,_caption + jmp .nofile +@@: inc eax +.nofile:cinvoke wsprintf,string_buffer,ecx,eax + invoke SetWindowText,[hwnd],string_buffer invoke GetWindowLong,[hwnd_asmedit],GWL_STYLE and eax,not WS_VISIBLE invoke SetWindowLong,[hwnd_asmedit],GWL_STYLE,eax @@ -1058,7 +1124,13 @@ cmp [status_update_disabled],0 jne finish invoke SendMessage,[hwnd_asmedit],AEM_GETPOS,aepos,0 - cinvoke wsprintf,string_buffer,_row_column,[aepos.caretLine],[aepos.caretPosition] + invoke SendMessage,[hwnd_asmedit],AEM_GETSEL,0,0 + test eax,eax + mov ecx,_row_column + jz .nosel + mov ecx,_row_column_sel + .nosel: + cinvoke wsprintf,string_buffer,ecx,[aepos.caretLine],[aepos.caretPosition],eax invoke SendMessage,[hwnd_status],SB_SETTEXT,0,string_buffer mov esi,_null invoke SendMessage,[hwnd_asmedit],EM_CANUNDO,0,0 @@ -1119,12 +1191,16 @@ je run cmp eax,IDM_COMPILE je compile + cmp eax,IDM_DEBUG + je debug cmp eax,IDM_ASSIGN je assign cmp eax,IDM_APPEARANCE je appearance cmp eax,IDM_COMPILERSETUP je compiler_setup + cmp eax,IDM_DEBUGGERSETUP + je debugger_setup cmp eax,IDM_SECURESEL je option_securesel cmp eax,IDM_AUTOBRACKETS @@ -1326,7 +1402,6 @@ jmp failed close_modified: mov eax,MB_ICONQUESTION+MB_YESNOCANCEL - or eax,[lparam] invoke MessageBox,[hwnd],_saving_question,[ei.header.pszText],eax cmp eax,IDCANCEL je failed @@ -1469,6 +1544,35 @@ run_object: invoke MessageBox,[hwnd],_run_object_error,_caption,MB_ICONERROR+MB_OK jmp finish + debug: + invoke SendMessage,[hwnd],FM_COMPILE,0,FALSE + test eax,eax + jnz finish + cmp [output_format],4 + jae debug_object + mov [sinfo.cb],sizeof.STARTUPINFO + mov [sinfo.dwFlags],0 + mov esi, debugger + mov edi, debuggerdir + mov ecx, 200h shr 2 + rep movsd + @@: dec edi + cmp edi, debuggerdir + jle @F + cmp byte [edi], '\' + jne @B + @@: mov byte [edi], 0 + mov eax,debugger + mov ecx,path_buffer + mov [param_buffer+0],eax + mov [param_buffer+4],ecx + and [param_buffer+8],0 + invoke wvsprintf,debugcmdline,debuggerparams,param_buffer + invoke CreateProcess,0,debugcmdline,0,0,0,NORMAL_PRIORITY_CLASS,0,debuggerdir,sinfo,pinfo + jmp finish + debug_object: + invoke MessageBox,[hwnd],_debug_object_error,_caption,MB_ICONERROR+MB_OK + jmp finish compile: invoke SendMessage,[hwnd],FM_COMPILE,0,TRUE jmp finish @@ -1488,6 +1592,9 @@ compiler_setup: invoke DialogBoxParam,[hinstance],IDD_COMPILERSETUP,[hwnd],CompilerSetup,0 jmp finish + debugger_setup: + invoke DialogBoxParam,[hinstance],IDD_DEBUGGERSETUP,[hwnd],DebuggerSetup,0 + jmp finish option_securesel: xor [asmedit_style],AES_SECURESEL jmp update @@ -1661,7 +1768,6 @@ invoke SendMessage,[hwnd_tabctrl],TCM_SETCURSEL,[wparam],0 invoke SendMessage,[hwnd],FM_SELECT,[wparam],0 mov eax,MB_ICONQUESTION+MB_YESNOCANCEL - or eax,[lparam] invoke MessageBox,[hwnd],_saving_question,[ei.header.pszText],eax cmp eax,IDCANCEL je finish @@ -1711,6 +1817,8 @@ sete al stdcall WriteIniBit,ini_path,_section_window,_key_window_maximized,eax,1 invoke WritePrivateProfileString,_section_help,_key_help_path,help_path,ini_path + invoke WritePrivateProfileString,_section_debugger,_key_debugger,debugger,ini_path + invoke WritePrivateProfileString,_section_debugger,_key_debuggerparams,debuggerparams,ini_path invoke DestroyWindow,[hwnd] jmp finish wmdestroy: @@ -2709,6 +2817,42 @@ ret endp +proc DebuggerSetup hwnd_dlg,msg,wparam,lparam + push ebx esi edi + cmp [msg],WM_INITDIALOG + je .initdialog + cmp [msg],WM_COMMAND + je .command + cmp [msg],WM_CLOSE + je .close + .notprocessed: + xor eax,eax + jmp .finish + .initdialog: + invoke SetDlgItemText,[hwnd_dlg],ID_DEBUGGER,debugger + invoke SetDlgItemText,[hwnd_dlg],ID_DEBUGGERPARAMS,debuggerparams+3 + jmp .processed + .command: + cmp [wparam],IDCANCEL + je .close + cmp [wparam],IDOK + jne .finish + invoke GetDlgItemText,[hwnd_dlg],ID_DEBUGGER,debugger,200h + invoke GetDlgItemText,[hwnd_dlg],ID_DEBUGGERPARAMS,debuggerparams+3,200h-3 + mov byte [debuggerparams+0], '%' + mov byte [debuggerparams+1], 's' + mov byte [debuggerparams+2], ' ' + invoke EndDialog,[hwnd_dlg],TRUE + jmp finish + .close: + invoke EndDialog,[hwnd_dlg],FALSE + .processed: + mov eax,1 + .finish: + pop edi esi ebx + ret +endp + proc AboutDialog hwnd,msg,wparam,lparam push ebx esi edi cmp [msg],WM_COMMAND @@ -2854,7 +2998,8 @@ TranslateMessage,'TranslateMessage',\ DispatchMessage,'DispatchMessageA',\ PostMessage,'PostMessageA',\ - PostQuitMessage,'PostQuitMessage' + PostQuitMessage,'PostQuitMessage',\ + SetWindowText,'SetWindowTextA' import gdi,\ SetBkColor,'SetBkColor',\ @@ -2916,6 +3061,7 @@ IDD_ERRORSUMMARY,LANG_ENGLISH+SUBLANG_DEFAULT,error_summary_dialog,\ IDD_APPEARANCE,LANG_ENGLISH+SUBLANG_DEFAULT,appearance_dialog,\ IDD_COMPILERSETUP,LANG_ENGLISH+SUBLANG_DEFAULT,compiler_setup_dialog,\ + IDD_DEBUGGERSETUP,LANG_ENGLISH+SUBLANG_DEFAULT,debugger_setup_dialog,\ IDD_ABOUT,LANG_ENGLISH+SUBLANG_DEFAULT,about_dialog resource group_icons,\ @@ -2941,7 +3087,8 @@ IDD_ERRORSUMMARY = 306 IDD_APPEARANCE = 307 IDD_COMPILERSETUP = 308 - IDD_ABOUT = 309 + IDD_DEBUGGERSETUP = 309 + IDD_ABOUT = 310 IDI_MAIN = 401 IDB_ASSIGN = 501 @@ -2962,15 +3109,21 @@ IDM_DELETE = 1205 IDM_SELECTALL = 1206 IDM_VERTICAL = 1207 + IDM_BOOKMARK_TOGGLE= 1208 + IDM_BOOKMARK_NEXT = 1209 + IDM_BOOKMARK_PREV = 1210 + IDM_BOOKMARK_CLEAR = 1211 IDM_POSITION = 1301 IDM_FIND = 1302 IDM_FINDNEXT = 1303 IDM_REPLACE = 1304 IDM_RUN = 1401 IDM_COMPILE = 1402 + IDM_DEBUG = 1403 IDM_ASSIGN = 1409 IDM_APPEARANCE = 1501 IDM_COMPILERSETUP = 1502 + IDM_DEBUGGERSETUP = 1503 IDM_SECURESEL = 1505 IDM_AUTOBRACKETS = 1506 IDM_AUTOINDENT = 1507 @@ -3003,6 +3156,8 @@ ID_MESSAGE = 2402 ID_PROGRESS = 2801 ID_PREVIEW = 2901 + ID_DEBUGGER = 3000 + ID_DEBUGGERPARAMS= 3001 _ equ ,09h, @@ -3012,6 +3167,7 @@ menuitem '&Open...' _ 'Ctrl+O',IDM_OPEN menuitem '&Save' _ 'Ctrl+S',IDM_SAVE menuitem 'Save &as...',IDM_SAVEAS + menuitem '&Close' _ 'Ctrl+W',IDM_CLOSE menuseparator menuitem 'E&xit' _ 'Alt+X',IDM_EXIT,MFR_END menuitem '&Edit',0,MFR_POPUP @@ -3033,10 +3189,12 @@ menuitem '&Replace...' _ 'Ctrl+H',IDM_REPLACE,MFR_END menuitem '&Run',0,MFR_POPUP menuitem '&Run' _ 'F9',IDM_RUN - menuitem '&Compile' _ 'Ctrl+F9',IDM_COMPILE,MFR_END + menuitem '&Compile' _ 'Ctrl+F9',IDM_COMPILE + menuitem '&Debug' _ 'F8',IDM_DEBUG,MFR_END menuitem '&Options',0,MFR_POPUP menuitem '&Appearance...',IDM_APPEARANCE menuitem '&Compiler setup...',IDM_COMPILERSETUP + menuitem '&Debugger...',IDM_DEBUGGERSETUP menuseparator menuitem '&Secure selection',IDM_SECURESEL menuitem 'Automatic &brackets',IDM_AUTOBRACKETS @@ -3071,6 +3229,8 @@ FVIRTKEY+FNOINVERT+FCONTROL,'G',IDM_POSITION,\ FVIRTKEY+FNOINVERT+FCONTROL,'F',IDM_FIND,\ FVIRTKEY+FNOINVERT+FCONTROL,'H',IDM_REPLACE,\ + FVIRTKEY+FNOINVERT+FCONTROL,'W',IDM_CLOSE,\ + FVIRTKEY+FNOINVERT+FCONTROL,VK_F4,IDM_CLOSE,\ FVIRTKEY+FNOINVERT+FCONTROL,VK_TAB,IDM_NEXT,\ FVIRTKEY+FNOINVERT+FCONTROL+FSHIFT,VK_TAB,IDM_PREVIOUS,\ FVIRTKEY+FNOINVERT,VK_F1,IDM_KEYWORD,\ @@ -3085,8 +3245,8 @@ FVIRTKEY+FNOINVERT+FCONTROL,VK_F7,IDM_REPLACE,\ FVIRTKEY+FNOINVERT,VK_F9,IDM_RUN,\ FVIRTKEY+FNOINVERT+FCONTROL,VK_F9,IDM_COMPILE,\ + FVIRTKEY+FNOINVERT,VK_F8,IDM_DEBUG,\ FVIRTKEY+FNOINVERT+FSHIFT,VK_F9,IDM_ASSIGN,\ - FVIRTKEY+FNOINVERT,VK_ESCAPE,IDM_CLOSE,\ FVIRTKEY+FNOINVERT+FALT,'X',IDM_EXIT,\ FVIRTKEY+FNOINVERT+FALT,'1',IDM_SELECTFILE+1,\ FVIRTKEY+FNOINVERT+FALT,'2',IDM_SELECTFILE+2,\ @@ -3172,6 +3332,15 @@ dialogitem 'COMBOBOX','',ID_PRIORITY,38,24,54,96,WS_VISIBLE+WS_TABSTOP+CBS_DROPDOWNLIST+WS_VSCROLL dialogitem 'BUTTON','OK',IDOK,100,6,42,14,WS_VISIBLE+WS_TABSTOP+BS_DEFPUSHBUTTON dialogitem 'BUTTON','C&ancel',IDCANCEL,100,22,42,14,WS_VISIBLE+WS_TABSTOP+BS_PUSHBUTTON + enddialog + + dialog debugger_setup_dialog,'Debugger Setup',54,28,186,44,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME + dialogitem 'STATIC','&Debugger:',-1,4,8,40,8,WS_VISIBLE+SS_RIGHT + dialogitem 'EDIT','',ID_DEBUGGER,48,6,82,12,WS_VISIBLE+WS_BORDER+WS_TABSTOP+ES_AUTOHSCROLL + dialogitem 'STATIC','&Parameters:',-1,4,26,40,8,WS_VISIBLE+SS_RIGHT + dialogitem 'EDIT','',ID_DEBUGGERPARAMS,48,24,82,12,WS_VISIBLE+WS_BORDER+WS_TABSTOP+ES_AUTOHSCROLL + dialogitem 'BUTTON','OK',IDOK,138,6,42,14,WS_VISIBLE+WS_TABSTOP+BS_DEFPUSHBUTTON + dialogitem 'BUTTON','C&ancel',IDCANCEL,138,22,42,14,WS_VISIBLE+WS_TABSTOP+BS_PUSHBUTTON enddialog dialog about_dialog,'About',40,40,172,60,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME