Home
Forum
Screenshots
Downloads
Link To Us
Programming Tools
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
Home
Forum
Assembly Programming
Newbies
Problem running "Hello World" assembler program, Compiled as 32-bit Console application
Track this topic
|
Email this topic
|
Print this topic
xfactor973
New Member
Group: Members
Posts: 1
Member No.: 524
Joined: 12-September 04
I'm trying to get my "Hello World" program to run.
It compiles ok into an .EXE, but when i run it from the console, nothing happens.
CODE
comment * «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
Build this example with
>> Console Assemble & Link <<
; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« *
.486
.model flat, stdcall
option casemap :none ; case sensitive
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
include c:\masm32\include\windows.inc
include c:\masm32\include\masm32.inc
include c:\masm32\include\kernel32.inc
include c:\masm32\macros\macros.asm
includelib c:\masm32\lib\masm32.lib
includelib c:\masm32\lib\kernel32.lib
.code
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
print "Hello world"
exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
Is this correct?
I've never tried assembly before, and I come from a strong java background, so this is all very new to me.
Thanks.
n7yap
Active Member
Group: Members
Posts: 51
Member No.: 87
Joined: 10-June 04
The MASM32 print macro requires the
address
of a zero-terminated string like this:
CODE
print SADD("Hello World")
SADD is a macro that returns the address of the string.
If you're just starting out with MASM32, try writing your program without macros. You will learn more that way.
CODE
.DATA
szHello BYTE "Hello world", 0
.CODE
start:
invoke StdOut, ADDR szHello
invoke ExitProcess, 0
end start
shoorick
Extremely Active Member
Group: Admins
Posts: 2301
Member No.: 160
Joined: 22-June 04
No, of course not!
Try this instead:
CODE
.DATA
hello db "Hello World",0
.CODE
invoke MessageBox,0,ADDR hello,0,0
invoke ExitProcess,0
If you never used assembler before, first take a look at the examples, or create a project from the WinASm studio templates and play with it...
All languages have their specifications...
Good luck!
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
«
Next Oldest
|
Newbies
|
Next Newest
»
Close Topic Options
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
Forum Home
Search
Help
Announcements & Forum Rules
- Announcements, Forum Rules & Guidelines
WinAsm Studio
- General Discussions
- Suggestions/Bug Reports
- WinAsm Studio FAQ
- Multilingual User Interface
- Add-Ins
HiEditor
- General Discussions
- Suggestions/Bug Reports
Assembly Programming
- Main
- Newbies
- Projects - Source Code
- Custom Controls
- Snippets
Computer Science
- C/C++
- Internet
- Hardware & PC maintenance
General
- Online Degrees - Distance Learning
- The Heap
- Russian
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
Enter your search terms
Submit search form
Web
winasm.net