
Extremely Active Member
     
Group: Admins
Posts: 2301
Member No.: 160
Joined: 22-June 04

|
those, who are new in assembly, but have already any C skill, may use -S switch to produce assembly file from c(++) code.
then this obvious code: | CODE | #include <windows.h> int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int nCmdShow) { MessageBox(NULL, "Hello World! This is my first win32 program!", "Lesson1", MB_OK); return 0; } |
will be transformed into this: | CODE | .686p ifdef ??version if ??version GT 500H .mmx endif endif model flat ifndef ??version ?debug macro endm endif ?debug S "msgbox.cpp" ?debug T "msgbox.cpp" _TEXT segment dword public use32 'CODE' _TEXT ends _DATA segment dword public use32 'DATA' _DATA ends _BSS segment dword public use32 'BSS' _BSS ends DGROUP group _BSS,_DATA _TEXT segment dword public use32 'CODE' WinMain segment virtual @WinMain proc near ?live16385@0: ; ; WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int nCmdShow) ; push ebp mov ebp,esp ; ; { ; MessageBox(NULL, "Hello World! This is my first win32 program!", ; @1: push 0 push offset s@+45 push offset s@ push 0 call @MessageBoxA ; ; "Lesson1", MB_OK); ; ; return 0; ; xor eax,eax ; ; } ; @3: @2: pop ebp ret 16 @WinMain endp WinMain ends _TEXT ends _DATA segment dword public use32 'DATA' s@ label byte ; s@+0: db "Hello World! This is my first win32 program!",0 ; s@+45: db "Lesson1",0 align 4 _DATA ends _TEXT segment dword public use32 'CODE' _TEXT ends @MessageBoxA equ MessageBoxA extrn MessageBoxA:near ... ?debug D "msgbox.cpp" 14694 15826 end |
Read here how to use bcc from WinAsm Studio.
Attached File ( Number of downloads: 9 )
Login or Register to download
|