flat assembler
Message board for the users of flat assembler.
Index
> Windows > Conversion of Masm to Fasm |
Author |
|
shoorick 20 Sep 2005, 05:32
try this:
mov ofn.lStructSize,SIZEOF ofn > mov [ofn.lStructSize],sizeof.OPENFILENAME mov ofn.lpstrFilter, szFilter > mov [ofn.lpstrFilter], szFilter ... if size of ofn is unknown to compiler (you create it with other way) it is possible do this: mov [ofn + OPENFILENAME.lpstrFilter], szFilter |
|||
20 Sep 2005, 05:32 |
|
shism2 20 Sep 2005, 20:53
Sigh none of them worked
|
|||
20 Sep 2005, 20:53 |
|
shism2 20 Sep 2005, 23:02
C:\Documents and Settings\Owner\Desktop\crap\fasmexp\flatpe.asm [21]:
mov [ofn.lStructSize], sizeof.OPENFILENAME error: undefined symbol. Maybe im missing an include file or something? |
|||
20 Sep 2005, 23:02 |
|
Vasilev Vjacheslav 21 Sep 2005, 03:47
some parts of code are stripped, because i can't understand what you do
Code: format pe gui 4.0 entry start ;======================================================================= include '%fasminc%\win32a.inc' ;======================================================================= IDC_CLOSE = 1002 IDC_BACKUP = 2001 IDC_CHOOSEFILE = 1001 IDC_TARGETFILE = 1000 IDD_MAINDLG = 100 IDI_ICON = 9000 ;----------------------------------------------------------------------- section '.idata' data readable writeable backup1 db "Backup.exe",0 szFilter db "ExE files",0,"*.exe",0,"All files",0,"*.*",0,0 section '.udata' readable writeable gIst dd ? gWnd dd ? cFname rb MAX_PATH ofn OPENFILENAME section '.flat' code readable writeable executable start: invoke GetModuleHandle,0 mov [gIst],eax invoke DialogBoxParam,eax,IDD_MAINDLG,0,DlgProc,0 THEEND: invoke ExitProcess,0 proc DlgProc uses ebx esi edi, hDlg, uMsg, wParam, lParam movzx eax,word [wMsg] cmp ax,WM_COMMAND jz .wmcommand cmp ax,WM_CLOSE jz .wmclose cmp ax,WM_INITDIALOG jnz .not_processed ;.wminitdlg: invoke LoadIcon,[gIst],IDI_ICON invoke SendMessage,[hDlg],WM_SETICON,TRUE,eax mov eax,[hDlg] mov [gWnd],eax jmp .processed .wmcommand: cmp [wParam],BN_CLICKED shl 16 + IDC_CLOSE ; <- resource id (control) jz .wmclose cmp [wParam],BN_CLICKED shl 16 + IDC_CHOOSEFILE ; <- resource id (control) jnz .processed mov [ofn.lStructSize],sizeof.OPENFILENAME mov [ofn.lpstrFilter],szFilter push [hDlg] pop [ofn.hwndOwner] mov [ofn.lpstrFile],cFname mov [ofn.nMaxFile],MAX_PATH ;mov [ofn.lpstrInitialDir],szCurDir ; <- not defined mov [ofn.Flags],OFN_FILEMUSTEXIST+OFN_PATHMUSTEXIST+OFN_LONGNAMES+OFN_HIDEREADONLY invoke GetOpenFileName,ofn test eax,eax jz @F invoke SetDlgItemText,[hDlg],IDC_TARGETFILE,cFname @@: jmp .processed .wmclose: invoke EndDialog,[hDlg],NULL .processed: xor eax,eax inc eax jmp .finish .not_processed: xor eax,eax .finish: ret endp section '.idata' import data readable writeable library kernel32,'kernel32.dll',\ user32,'user32.dll' include '%fasminc%\apia\kernel32.inc' include '%fasminc%\apia\user32.inc' section '.rsrc' resource from 'rsrc1.res' data readable ; eof _________________ [not enough memory] |
|||
21 Sep 2005, 03:47 |
|
shism2 21 Sep 2005, 05:17
I got i reinstalled fasm include files and now i get this
C:\Documents and Settings\Owner\Desktop\crap\fasmexp\flatpe.asm [20]: cFname db MAX_PATH dup (0) error: undefined symbol. Last edited by shism2 on 21 Sep 2005, 05:22; edited 1 time in total |
|||
21 Sep 2005, 05:17 |
|
shoorick 21 Sep 2005, 05:21
example
_________________ UNICODE forever! |
|||||||||||
21 Sep 2005, 05:21 |
|
shism2 21 Sep 2005, 05:31
Where can I get shlwapi.inc?
|
|||
21 Sep 2005, 05:31 |
|
shoorick 21 Sep 2005, 05:40
oh, sorry it's my template through it off - it is not needed here there are a lot of dll->inc around a forum to make such things
|
|||
21 Sep 2005, 05:40 |
|
shoorick 21 Sep 2005, 05:45
Quote:
- is not defined in fasm includes - define it by yourself (=260) |
|||
21 Sep 2005, 05:45 |
|
shoorick 21 Sep 2005, 05:56
here same but in pure fasm and without shlwapi.inc
_________________ UNICODE forever! |
|||||||||||
21 Sep 2005, 05:56 |
|
shism2 21 Sep 2005, 06:12
wow thanks alot..Your very helpful and my new TEACHER
|
|||
21 Sep 2005, 06:12 |
|
mrpink 30 Sep 2005, 06:50
Wouldn' t if be good to have a masm --> fasm source translator?
Or more generally a source to source translator that takes as input source code from one assembler and outputs the source code for another assembler? |
|||
30 Sep 2005, 06:50 |
|
shoorick 30 Sep 2005, 07:06
there is a masm.inc to support masm syntaxis. it is not too easy in real to make a good converter, and i prefer to use matching compiler to the ready source.
|
|||
30 Sep 2005, 07:06 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.