flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
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. |
|||
![]() |
|
gandalf
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? |
|||
![]() |
|
revolution
gandalf wrote:
|
|||
![]() |
|
gandalf
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. |
|||
![]() |
|
vid
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. |
|||
![]() |
|
rugxulo
Wait, doesn't NASM / YASM support multi-section binary??
And as for making COFF into flat binary, can't GNU BinUtils OBJCOPY do that?? |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.