flat assembler
Message board for the users of flat assembler.
Index
> Main > code and data sections |
Author |
|
revolution 28 Feb 2009, 01:38
1) You can use a linker. Put all the various bits of your code into sections, and then use the linker to merge the sections together in the order you specify.
2) Use macros. Enclose each of the sections within a macro definition, and then at the end instantiate the macros in the order that you need. |
|||
28 Feb 2009, 01:38 |
|
gandalf 28 Feb 2009, 10:42
revolution wrote: 1) You can use a linker. Put all the various bits of your code into sections, and then use the linker to merge the sections together in the order you specify. Which free linker would you recommend? |
|||
28 Feb 2009, 10:42 |
|
revolution 28 Feb 2009, 10:45
gandalf wrote:
|
|||
28 Feb 2009, 10:45 |
|
gandalf 28 Feb 2009, 11:07
Quote: I don't use linkers. So I can't recommend any. I leave the question open for others to make suggestions. The problem is that I need binary files (for an OS-like project) and AFAIK fasm doesn't support sections in binary format (how could it?) I would need to make fasm produce a, say, MS COFF file, link it and then convert it into a binary file, or something like that. Developing my own ad-hoc linker would probably be simpler than figuring out how to make all this work out. Wouldn't the use of macros make the error reporting less readable? I think I'll get rid of conditional comp... assembling and create separate code and data asm files: list_c.asm list_d.asm tree_c.asm tree_d.asm BTW, having code and data on different files is even more convenient because you can keep them in two different edit windows and switch between them instantly. |
|||
28 Feb 2009, 11:07 |
|
vid 28 Feb 2009, 13:25
For windows I would suggest MS linker (link.exe + DLLs, available in any compiler package). Then you need to separately compile both files to MS COFF .obj files, and use linker to merge them.
Quote: Wouldn't the use of macros make the error reporting less readable? Yeah, somewhat. But nothing extremely hard. |
|||
28 Feb 2009, 13:25 |
|
rugxulo 09 Mar 2009, 01:36
Wait, doesn't NASM / YASM support multi-section binary??
And as for making COFF into flat binary, can't GNU BinUtils OBJCOPY do that?? |
|||
09 Mar 2009, 01:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.