flat assembler
Message board for the users of flat assembler.

Index > Windows > New to FASM Questions and more Questions

Author
Thread Post new topic Reply to topic
FireAndIce



Joined: 20 Dec 2007
Posts: 6
FireAndIce 20 Dec 2007, 00:31
hello everyone,

I've been reading tutorials for several of the assemblers out there, and I can now say that I understand the fundamentals and basics well. I fully comprehend hex and binary numbers and all the basic instructions. I've had a fun time learning, but I still have a few questions.

1. Could someone please explain what "format PE GUI 4.0 entry start" does? I searched the forums and found that its needed when you're programming GUI apps, but what exactly does the instruction itself do?

2. Why is the syntax for starting a program and declaring data different? For example, i've seen "section .code" but at other times only ".code". I've seen the same for declaring data. Do you use one in certain cases or how does that work?

3. What do the words "readable writable executable" in the sections do? Sort of a follow up to question #2. I'm confused as to what they actually mean and do.

4. Could someone explain the difference between "proc" and a macro? Is proc just a macro, and if so, why not just use a macro instead of a proc. I know there are some differences between the two and some clarification would help.

I have some more questions, but I think thats enough for now.
Also, I just wanted to say how great its been to read some of the other posts and the helpful responses that this forum community gives. People like vid and locodelAssembly and others have made the learning process much smoother.

P.S. I really liked your tutorial vid. But I was only able to find up to chapter 9 on macros. Do you have anymore and could you post a link? I tried searching through the decard site, but its just full of advertisements. Maybe i'm missing something.

thanks for the help
Post 20 Dec 2007, 00:31
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP 20 Dec 2007, 00:39
format PE console ;Allocates a console for the program when it starts
GUI 4.0 is used when making windows programs, but I have never used it before.

entry --- simply points to the label where to start the program, such as
entry BeginMyProgram which is needed in the file header upon startup

section '.code' and .code compile the same, it creates a section in the file for the data, in this case code. .text is used interchangeably.

section '.code' readable writable executable
if you disassemble a file header you will see this information, just sets what I like to call the 'security' of each section, sending errors when read-only data is written to, ect..

I have never used macros or proc, but I do know that macros are just another way of saying "do this when this is typed". Asksomeone else about that one please lol. proc are just a high-level aspect of fasm to make it a little more user-friendly, again maybe someone next can ellaborate.

Please post as many questions as you have, or just make them into a text file and attach them here, I'm sure many people would like to send you answers to them by the dozens. Have fun learning asm!
Post 20 Dec 2007, 00:39
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 20 Dec 2007, 01:07
1 and 3 - see FASM documentation

2 - ".code" is just a helper macro, that is in "win32ax.inc"

4 - If you use macro 10 times, then it is as if you wrote entire macro body 10 times. If you call procedure 10 times, then it's still just 10 call instructions, and one time body of procedure.
Post 20 Dec 2007, 01:07
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1902
DOS386 20 Dec 2007, 01:12
Quote:
4. Could someone explain the difference between "proc" and a macro? Is proc just a macro, and if so, why not just use a macro instead of a proc. I know there are some differences between the two and some clarification would help.


NO (not proc=macro). But you can keep them both out for the beginning. Macros get expanded when compiling, subroutines no. "proc" IIRC comes from MASM and is in FASM implemented using macros, but results in a sub (I don't use proc).

> what "format PE GUI 4.0 entry start" does?

Check Tomasz's (with PE GUI) and my ( http://board.flatassembler.net/topic.php?t=6735 , without PE GUI) examples.

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 20 Dec 2007, 01:12
View user's profile Send private message Reply with quote
FireAndIce



Joined: 20 Dec 2007
Posts: 6
FireAndIce 20 Dec 2007, 05:30
thanks a lot everyone...it definitely helped clear things out....sometimes(especially when first learning something) the documentation can seem like a bunch of technical jargon. Its always good to have it explained in normal terms.

Vid: Did you read my last question regarding the tutorials. Maybe you or anyone else who knows can help me find the rest Smile
Post 20 Dec 2007, 05:30
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 20 Dec 2007, 08:18
I never really continued that tutorial, but first 9 chapters should be more/less still valid. I don't think I ever will continue them...
Post 20 Dec 2007, 08:18
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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.