flat assembler
Message board for the users of flat assembler.

Index > Windows > win32ax.inc fails to assemble, but ok with win32a.inc, why?

Author
Thread Post new topic Reply to topic
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 18 Aug 2004, 06:27
i guess i havent get the information about win32a.inc, win32ax.inc and win32axp.inc correctly.

the code below can be assembled without problem
-----------------------------------------------
Code:
format PE console 4.0
entry exit

include '%fasminc%\win32a.inc' ; notice: win32a.inc is used here

section '.code' code readable executable
  exit:
           invoke ExitProcess, 0

section '.idata' import data readable writeable
      library kernel32, 'kernel32.dll'
  
    import  kernel32, \
                        ExitProcess, 'ExitProcess'
    

+---------------+
| MS-DOS prompt |
+---------------+
G:\learn\fasm>fasm e1.asm
flat assembler version 1.54
2 passes, 1536 bytes.

#####################################################

this code will generate error if i try to assemble it
-----------------------------------------------------
Code:
format PE console 4.0
entry exit

include '%fasminc%\win32ax.inc'    ; fail with win32ax.inc and win32axp.inc

section '.code' code readable executable
     exit:
           invoke ExitProcess, 0

section '.idata' import data readable writeable
      library kernel32, 'kernel32.dll'
  
    import  kernel32, \
                        ExitProcess, 'ExitProcess'
    

+---------------+
| MS-DOS prompt |
+---------------+
G:\learn\fasm>fasm e1.asm
flat assembler version 1.54
D:\ASM\fasmw154\INCLUDE\win32ax.inc [4]:
format PE GUI 4.0
error: unexpected instruction.


will fail also if i change it to '%fasminc%\win32axp.inc'
please guide me on how do i know when i should use win32a.inc or win32ax.inc
or win32axp.inc :?

win32ax == win32 ANSI Extend ; i suppose
so, how come the extended version fail?

sincerely,
vbVeryBeginner d(^-^)b
http://sulaiman.thefreebizhost.com
Post 18 Aug 2004, 06:27
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 18 Aug 2004, 06:58
Using win32ax.inc, you should not specify format and entry point.... Try this:
Code:
include '%fasminc%\win32ax.inc

.code

  exit:
    invoke ExitProcess,0

.end exit    
Post 18 Aug 2004, 06:58
View user's profile Send private message Visit poster's website Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 18 Aug 2004, 10:16
yup, the win32ax.inc does specifies the format to PE GUI 4.0
so to specifies it one more time will cause that error (i suppose)

but does this imply, if i want to use the CONSOLE API, i should choose the win32a.inc?

em... could somebody let me know, what are the "overhead" of using the win32ax.inc? if there is one.

sincerely,
vbVeryBeginner d(^-^)b
http://sulaiman.thefreebizhost.com
Post 18 Aug 2004, 10:16
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 18 Aug 2004, 12:56
There is no overhead on the executable.
With win32ax.inc only the syntax is slightly different (more high level style) and is for building GUI applications.
With win32axp.inc the assembly time increases a little because of API parameter count checking.
Post 18 Aug 2004, 12:56
View user's profile Send private message Yahoo Messenger Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 18 Aug 2004, 14:12
ic, thanks tommy & pelaillo Smile
Quote:

from : pelaillo
With win32ax.inc only the syntax is slightly different (more high level style) and is for building GUI applications.


please confirm, does it means, using win32ax.inc is better, coz one can switches between the styles (high level style or PURE style), unlike using win32a.inc where one is subjected to code all in the PURE RAW style. and he got to do lot of dirty works if he changes his mind latter to use the high level style.

sincerely,
vbVeryBeginner d(.~.)b
http://sulaiman.thefreebizhost.com


Quote:

from: Tommy
Using win32ax.inc, you should not specify format and entry point....


em. does this implies that the default entry or starting point for those executable which assembled under win32ax.inc is the ".code" section?
Post 18 Aug 2004, 14:12
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 18 Aug 2004, 14:15
No.... the label u use after ".end"... For instance ".end start" => "entry start" Wink
Post 18 Aug 2004, 14:15
View user's profile Send private message Visit poster's website Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 18 Aug 2004, 14:19
ic ic, thanks very much tommy... ya help a lot :p,
Post 18 Aug 2004, 14:19
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 18 Aug 2004, 16:59
You could include the HLL constructs macros whenever you need to use them.
I find it more flexible the win32a.inc, but you don't need to do dirty tricks on passing between one or another. If you mix styles probably you get a less readable source that however got compiled but is less maintainable.
The best thing is that you choose the style you find more comfortable and stick to it for all across the source.
Post 18 Aug 2004, 16:59
View user's profile Send private message Yahoo Messenger Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 18 Aug 2004, 17:07
i guess i will go with the win32a.inc style ... Smile thanks

~ this thread is SOLVED. vbVeryBeginner says thanks to those who reply Smile
Post 18 Aug 2004, 17:07
View user's profile Send private message Visit poster's website 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-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.