flat assembler
Message board for the users of flat assembler.
Index
> Main > Requested Feature |
Author |
|
fly 16 May 2005, 06:10
in fasm there exist a directive called 'file', i never tried it, but i read about in the fasm programmers manual, page 11
|
|||
16 May 2005, 06:10 |
|
Tomasz Grysztar 16 May 2005, 06:14
Please, read the fasm's FAQ.
|
|||
16 May 2005, 06:14 |
|
THEWizardGenius 17 May 2005, 14:12
Quote:
The very first thing in the FAQ list is "Does flat assembler have some directive like incbin?" and the answer is yes: the directive is called 'file.' See section 1.2.2 of the manual (Data definitions). The Manual mentions the 'file' directive, but it isn't very clear on the syntax. I would guess the directive is like this: file 'filename.ext'[: offset[, length]] where "filename.ext" is the name of the binary file you wish to read from, "offset" is the offset (in bytes) into the file where you wish to begin reading (if you do not specify this option, the beginning of the file is assumed), and "length" is the number of bytes to read from the file (if not specified, the file is read from offset or beginning of file all the way to the end of the file). I have never used the directive and unfortunately the manual and FAQ do not tell much about it, but I assume this is how it should be written. I assume that offset and length are zero-based; however, Privalov, you may wish to mmake this clear in the manual, as I have never actually seen a statement in the manual that says "all numbers are zero-based unless specified otherwise", although when in doubt I assume they are. |
|||
17 May 2005, 14:12 |
|
Tomasz Grysztar 17 May 2005, 14:16
What do you mean by "zero-based" when you speak about length? As for the offset, all offsets in assembly are zero-based anyway.
And the syntax using your convention should be written this way: file 'path'[:offset][,length] you can specify both offset without length and length without offset. I will add some examples to documentation to clear it out. |
|||
17 May 2005, 14:16 |
|
THEWizardGenius 22 May 2005, 21:59
Thanks. I wasn't sure because as I say, it isn't very well documented. This is not assembly, so it's not safe to assume that it is zero-based since all offsets in assembly are zero-based: it's an extra FASM-specific thing. You may wish to add 'incbin' as an alias for 'file', since some people are used to incbin instead of 'file'. You know, it would be nice if it were possible to have aliases for certain directives that are FASM-specific so people could customize FASM.
|
|||
22 May 2005, 21:59 |
|
Tomasz Grysztar 22 May 2005, 22:05
As manuals recommend, you should do any customizations like that with EQU directive (and FIX in case of aliases for preprocessor's constructions). Implementing aliases internally would extend unnecessarily the amount of reserved words and I'd prefer to avoid it.
Quote: This is not assembly, so it's not safe to assume that it is zero-based since all offsets in assembly are zero-based: it's an extra FASM-specific thing. Well, it is one of the directives processed by assembler, the ones that control the process of assembling, and they also are a part of an assembly language (even though this language varies between different assemblers). You may even define the instruction mnemonics as a special case of such directives, like: "mov" directive tells assembler to generate and put at current position the opcode of transfer instruction with the specified operands. And in the assembly languages in general the offset for the first field of any structure - in memory or in file - is zero. That's why you have guessed correctly that in case of "file" directive it's also this way. |
|||
22 May 2005, 22:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.