WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

BCC - produce assembly file from C/C++ code, those, who are new in assembly, but have already any C skill, may use -S switch to produce assembly file from C/C++ code.

shoorick
Quote Post


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

PMEmail PosterUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google