flat assembler
Message board for the users of flat assembler.

Index > Main > Code and data in include file

Author
Thread Post new topic Reply to topic
Jin X



Joined: 06 Mar 2004
Posts: 133
Location: Russia
Jin X 04 Sep 2018, 11:39
Hi! Wink

I'm writting some library in include file for Windows apps.
This include will contain code, data and bss section contents.

In NASM I can wtite:
Code:
[section .data]
MyStr db 'Hello World',0

[section .bss]
MyData resb 100

[section .text]
mov eax,MyStr
mov edx,MyData
ret

__SECT__  ; return to original section    

Then I can include this file almost at any line of main source file (before entry point or after main code).

But if I want to write something like this for fasm I don't see any tools to do this quite easily Sad

I see only these ways:

1. Make 2 of 3 include files like 'MyLib_code.inc', 'MyLib_data.inc', 'MyLib_bss.inc' and include them at different lines of main source code:
Code:
include 'win32axp.inc'

.code
; here my code
include 'MyLib_code.inc'

.data
; here my data
include 'MyLib_data.inc'
include 'MyLib_bss.inc'    


2. Place code, data and bss into macroses and call them in main source code:
Code:
include 'win32axp.inc'
include 'MyLib.inc'

.code
; here my code
MyLib_Code

.data
; here my data
MyLib_Data
MyLib_BSS    

I can't use .data and .code macroses multiple times in fasm Sad

Is there more convenient way to do this in fasm ???
Post 04 Sep 2018, 11:39
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 04 Sep 2018, 11:48
There is a recent thread about the same thing: https://board.flatassembler.net/topic.php?t=20691

And please also check out this one: https://board.flatassembler.net/topic.php?p=202285#202285
Post 04 Sep 2018, 11:48
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.