Keygen_Dr. Posted April 24, 2009 Posted April 24, 2009 (edited) What's wrong with this ASM code... I'm using, Negatory Assembly Studio...Error;Generating Code...Linking...Link failed .486 ; creating 32bit code .model flat, stdcall ; 32 bit memory mode option casemap : none ;;*********************************************************************************************************;******************************************** INCLUDES ***************************************************;********************************************************************************************************* include windows.inc include gdi32.inc include user32.inc include kernel32.inc include Comctl32.inc include comdlg32.inc include shell32.inc include oleaut32.inc;*********************************************************************************************************;******************************************** INCLUDELIBS ************************************************;********************************************************************************************************* includelib gdi32.lib includelib user32.lib includelib kernel32.lib includelib Comctl32.lib includelib comdlg32.lib includelib shell32.lib includelib oleaut32.lib;*********************************************************************************************************;******************************************** FUNC MACRO *************************************************;********************************************************************************************************* FUNC MACRO parameters:VARARG invoke parameters EXITM <eax> ENDM include dialogs.inc dlgproc PROTO :DWORD,:DWORD,:DWORD,:DWORD;*********************************************************************************************************;******************************************** DATA? ******************************************************;********************************************************************************************************* .data? hInstance dd ?;*********************************************************************************************************;******************************************** DATA? ******************************************************;********************************************************************************************************* .data MsgBoxText db "Really? :(",0 MsgBoxCaption db "This project is not working...",0;********************************************************************************************************;******************************************** CONST ******************************************************;********************************************************************************************************* .const NULL equ 0;*********************************************************************************************************;******************************************** CODE *******************************************************;********************************************************************************************************* .codestart: mov hInstance, FUNC(GetModuleHandle,NULL) invoke MessageBoxA, NULL, ADDR MsgBoxText, ADDR MsgBoxCaption, 0 call main invoke ExitProcess, eax;---------------------------;---------- main -----------;--------------------------- main proc Dialog "Dialog Project", \ ;caption "MS Sans Serif",10, \ ;font, pointsize WS_OVERLAPPED or \ ;styles for WS_SYSMENU or DS_CENTER, \ ;window 2, \ ;number of controls ---: button + text 50,50,150,80, \ ;x y co-ordinates 1024 ;memory buffer size DlgButton "Close",WS_TABSTOP,48,40,50,15,IDCANCEL DlgStatic "Dialog Project",SS_CENTER,2,20,140,9,100 CallModalDialog hInstance,0,dlgproc,NULL ret main endp;---------------------------;---------- dlgproc --------;--------------------------- dlgproc proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD .if uMsg == WM_INITDIALOG invoke SendMessage,hWin,WM_SETICON,1 FUNC(LoadIcon,NULL,IDI_ASTERISK) .elseif uMsg == WM_COMMAND .if wParam == IDCANCEL jmp quit_dialog .endif .elseif uMsg == WM_CLOSE quit_dialog: invoke EndDialog,hWin,0 .endif xor eax,eax ret dlgproc endp end start Edited April 25, 2009 by Keygen_Dr.
ghandi Posted April 25, 2009 Posted April 25, 2009 Dialog "Dialog Project", \ ;caption"MS Sans Serif",10, \ ;font, pointsizeWS_OVERLAPPED or \ ;styles forWS_SYSMENU or DS_CENTER, \ ;window2, \ ;number of controls ---: button + text50,50,150,80, \ ;x y co-ordinates1024 ;memory buffer sizeNot sure if your assembler will be the same (i mean, this is MASM code after all, can't see it being any different). but the comments in this part are making the line too long, if you want the comments, either use Tab (rather than Space) to separate the comments from the code, or remove the comments from the lines for the dialog and have another copy of the entire dialog template commented out either above or below it. Another way to avoid problems it to have it all on a single line:Dialog "Dialog Project","MS Sans Serif",10,WS_OVERLAPPED or WS_SYSMENU or DS_CENTER,2,50,50,150,80,1024Also:invoke SendMessage,hWin,WM_SETICON,1 FUNC(LoadIcon,NULL,IDI_ASTERISK)needs a comma after the "1" to make it a single line, otherwise the assembler thinks it is two separate lines, i've also placed it on a single line: invoke SendMessage,hWin,WM_SETICON,1,FUNC(LoadIcon,NULL,IDI_ASTERISK)Compiled fine now. I'd also recommend using an IDE which displays the actual error messages from ML.exe/Link.exe, that way you can track down what is wrong and how you can fix it. (IE: Google searching error code/message, rather than only having a message saying that it coudnt assemble/link your code.)HR,Ghandi
Keygen_Dr. Posted April 25, 2009 Author Posted April 25, 2009 Wow, it worked, ghandi! Thanks for answering quickly. It gave me a headache hehe ...
alaphate Posted April 25, 2009 Posted April 25, 2009 (edited) Yep, I got same error: "line too long". Edited April 25, 2009 by alaphate
diablo2oo2 Posted April 25, 2009 Posted April 25, 2009 (edited) normally the compiler should show in which line is an error. and not just "...failed" Edited April 25, 2009 by diablo2oo2
Keygen_Dr. Posted April 25, 2009 Author Posted April 25, 2009 (edited) normally the compiler should show in which line is an error. and not just "...failed" I'm using this compiler.Assembly Studio!. I think it's really old, that's why it can't say anything about the error. And it really sucks. But i found some video tutorials with that program. I'm afraid to switch it to another one. Cuz i'm really a newbie at coding in assembly. But maybe you can tell me a good compiler that can say where is the error. It would be really nice... But as i said before, i'm really newbie, i learned somethings from this software, if there will be so many differents in writing the codes. It would be really bad. gihandi said that use and IDE, but i don't know how to Edited April 25, 2009 by Keygen_Dr.
by:70 Posted April 26, 2009 Posted April 26, 2009 (edited) Error: ;******************************************************************************* ************************** I'm using? RadASM http://www.radasm.com/resed/ Edited April 26, 2009 by by:70
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now