WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
 
Forum
 

Hello World in WinAsm please

Vad
Quote Post


New Member
*

Group: Members
Posts: 1
Member No.: 63836
Joined: 16-November 14


Sponsored Links
Gentelmens ,
I want to ask you to wirte a correct hello world programm in winasm ide.
I do thank you in advance.

P:s: i have tried following but there were errors at executing it.

section .text
global _start ;must be declared for linker (ld)
_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel

mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel

section .data
msg db 'Hello, world!', 0xa ;our dear string
len equ $ - msg ;length of our dear string
PMEmail Poster
Top
b0mb
Quote Post


New Member
*

Group: Members
Posts: 1
Member No.: 63844
Joined: 17-November 14


Hi Vad,

I'm not sure if you have pasted the correct source code into here, since -to me- it looks like it uses linux syscalls... since board name is winasm, not linasm, i suggest you to search some more for examples.

Regards.

P.s.: heres my example hello world:

.486
.model flat, stdcall
option casemap:none

include windows.inc
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib

.data
cCaption db "Caption",0
cText db "Hello World",0
retval dd ?

.code
start:
invoke MessageBox, NULL, addr cText, addr cCaption, MB_OK
mov retval, eax
invoke ExitProcess, 0
end start

---
edit: last invoke of exitprocess used wrong return value, thanks for pointing this bug out to ragdog!
PMEmail Poster
Top
ragdog
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 891
Member No.: 5019
Joined: 13-May 07


CODE

mov retval, eax
invoke ExitProcess, retval


??

invoke ExitProcess, 0

greets,
PMUsers Website
Top
2 User(s) are reading this topic (2 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