flat assembler
Message board for the users of flat assembler.

Index > Main > PROC/ENDP with FASM

Author
Thread Post new topic Reply to topic
clros



Joined: 18 Dec 2009
Posts: 6
clros
Hi to everybody.
As it is possible to use the TASM directive PROC/ENDP for create procedures with FASM?
Post 18 Dec 2009, 18:50
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
FASM has PROC and ENDP as macros. They are located in "macros/proc32.inc" in the include directory. They're also included when you include any of the windows includes.
Post 18 Dec 2009, 19:20
View user's profile Send private message Reply with quote
clros



Joined: 18 Dec 2009
Posts: 6
clros
Thanks!
Post 18 Dec 2009, 19:28
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
clros wrote:
Hi to everybody.
As it is possible to use the TASM directive PROC/ENDP for create procedures with FASM?


There is no PROC support in compiler core, but there are MACRO's, PROC32 and PROC64 in the "official" includes, about PROC16 see http://board.flatassembler.net/topic.php?t=10825
Post 19 Dec 2009, 01:26
View user's profile Send private message Reply with quote
clros



Joined: 18 Dec 2009
Posts: 6
clros
DOS386 wrote:
clros wrote:
Hi to everybody.
As it is possible to use the TASM directive PROC/ENDP for create procedures with FASM?


There is no PROC support in compiler core, but there are MACRO's, PROC32 and PROC64 in the "official" includes, about PROC16 see http://board.flatassembler.net/topic.php?t=10825


I am using the 'proc' and 'endp' keywords for now in 16 bit code (use16) under windows apparently without problems. It is correct way?

But... in Linux version of fasm I don't have the 'proc32.inc' include file...why?
Post 19 Dec 2009, 08:10
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17280
Location: In your JS exploiting you and your system
revolution
Under DOS you would want 16bit code.

Under Windows you would want 32bit code.

Under Linux you don't have the stdcall standard in the OS so the proc/endp are not so useful. But you can use them if you want to inside your own apps.
Post 19 Dec 2009, 08:12
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
clros wrote:
I am using the 'proc' and 'endp' keywords for now in 16 bit code (use16) under windows apparently without problems. It is correct way?


You should use format PE and 32-bit code then, not things like format MZ or org 100h Idea
Post 19 Dec 2009, 12:59
View user's profile Send private message Reply with quote
clros



Joined: 18 Dec 2009
Posts: 6
clros
DOS386 wrote:
clros wrote:
I am using the 'proc' and 'endp' keywords for now in 16 bit code (use16) under windows apparently without problems. It is correct way?


You should use format PE and 32-bit code then, not things like format MZ or org 100h Idea


I would want only to create some applications that don't have a particular format. For this motive I use the command prompt under windows (or the terminal under linux) for running my programs.

In this case I can't use the procedure?
Post 19 Dec 2009, 14:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17280
Location: In your JS exploiting you and your system
revolution
Windows command prompt is 32bit. The OS interface uses stdcall and ccall, so proc/endp can be useful.

Linux command prompt is 32bit. But the OS interface is not stdcall or ccall, so proc/endp are not as useful.

But regardless, you can use the proc/endp at your convenience. You don't have to use them but they can help to make things more readable and easier to type. Essentially, it is up to you whether you use them or not.


Last edited by revolution on 19 Dec 2009, 14:32; edited 1 time in total
Post 19 Dec 2009, 14:10
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
clros wrote:
want only to create some applications that don't have a particular format.


Only DOS COM or OS Construction Wink

Quote:
For this motive I use the command prompt under windows


PE is a MUST

Quote:
(or the terminal under linux) for running my programs.


So you need ELF or whatever, I don't have Linux, but I doubt it will accept "no format" Shocked
Post 19 Dec 2009, 14:16
View user's profile Send private message Reply with quote
clros



Joined: 18 Dec 2009
Posts: 6
clros
DOS386 wrote:
clros wrote:
want only to create some applications that don't have a particular format.


Only DOS COM or OS Construction Wink


DOS .com Wink

Quote:
So you need ELF or whatever, I don't have Linux, but I doubt it will accept "no format" Shocked


I also have some doubt...
Post 19 Dec 2009, 15:55
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
clros wrote:
DOS .com Wink


You are asking for trouble Evil or Very Mad
Post 20 Dec 2009, 07:40
View user's profile Send private message Reply with quote
clros



Joined: 18 Dec 2009
Posts: 6
clros
DOS386 wrote:
clros wrote:
DOS .com Wink


You are asking for trouble Evil or Very Mad


Why? Sad
Post 20 Dec 2009, 11:24
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
Because .com under Windows is not encouraged. It's not even supported directly in 64-bit Windows.

If you want to use .com you should use DOS instead.
Post 20 Dec 2009, 17:26
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.