flat assembler
Message board for the users of flat assembler.

Index > Windows > HELLO Example Fails

Author
Thread Post new topic Reply to topic
ryannathans



Joined: 01 Dec 2011
Posts: 3
ryannathans 01 Dec 2011, 10:09
Hi, I'm new, absolutely clueless.

I downloaded the assembler for Windows yesterday.

I looked in examples and the HELLO.exe runs fine, the HELLO.asm doesn't seem to reflect what I see in the message box in HELLO.exe

Curious I tried to run/compile HELLO.asm but it has errors such as .code being invalid.

What am I doing wrong?
Post 01 Dec 2011, 10:09
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 517
Location: Munich
shutdownall 01 Dec 2011, 11:02
What error exactly ?
Maybe post your code using CTRL-A and Copy&Paste to see.
Post 01 Dec 2011, 11:02
View user's profile Send private message Send e-mail Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 02 Dec 2011, 07:55
Assuming you didnt shuffle any files around and the package is not corrupt...

Lets look at the note at the top of hello.asm:

Code:
include 'win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here
    

Now, to build for...

win32ax -- Win32 no unicode
win32wx -- Win32 with unicode
win64ax -- Win64 no unicode
win64wx -- Win64 with unicode

So now my question is, what version of Windoze you have and for what country?

Edit:
The weird thing is that no include file error is present?
This means FASM is finding /include/win32ax.inc which in turn
defines the .code macro and such...

We should checksum de FASM distro!
Post 02 Dec 2011, 07:55
View user's profile Send private message Reply with quote
ryannathans



Joined: 01 Dec 2011
Posts: 3
ryannathans 03 Dec 2011, 03:04
What now?

EDIT: My hello.asm doesn't have that line at the top.

G:\fasm\EXAMPLES\HELLO\HELLO.ASM

Code:
;---ASM Hello World Win32 MessageBox



title db 'Win32', 0
msg db 'Hello World', 0

.code

Main:
push 0            ; uType = MB_OK
push offset title ; LPCSTR lpCaption
push offset msg   ; LPCSTR lpText
push 0            ; hWnd = HWND_DESKTOP
call MessageBoxA
push eax          ; uExitCode = MessageBox(...)
call ExitProcess
END MAIN

    


None of the includes work either.
Windows 7 Pro 64bit
Post 03 Dec 2011, 03:04
View user's profile Send private message Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler 03 Dec 2011, 07:27
What package did you get this from? Doesn't look anything like my hello.asm;



Code:
; example of simplified Windows programming using complex macro features

include 'win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here

.code

  start:
        invoke  MessageBox,HWND_DESKTOP,"Hi! I'm the example program!",invoke GetCommandLine,MB_OK
        invoke  ExitProcess,0

.end start
                                                        

_________________
This is a block of text that can be added to posts you make.
Post 03 Dec 2011, 07:27
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 03 Dec 2011, 12:09
The 'REAL' FASM page: http://flatassembler.net/
Post 03 Dec 2011, 12:09
View user's profile Send private message Reply with quote
ryannathans



Joined: 01 Dec 2011
Posts: 3
ryannathans 03 Dec 2011, 15:40
Lolwut is this.

That's the page I got it from.

I can't understand how it's different.

I went to downloads > windows

same zip too. Same version, same name, different md5.

O well.

Works now. Thanks
Post 03 Dec 2011, 15:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.