I was playing around with Fasm a bit and I can't figure out how to include files as resources. The file I want to include is this manifest for the WinXP styles. Has anyone figured it out.

So far I can understand how to set up the resource directory and the necessary labels, but simply including the whole file at the label doesn't work.

The only real example I have to go on is a bitmap MACRO included. In that macro immediatly following the label are two dwords, one pointing to the data (I believe) the other containing its size. I tried this but that didn't solve the problem.

Another strange thing with the bitmap example is that the first 14 bytes are not included.

Does anyone have any ideas, Thanks.
Posted on 2002-04-05 07:04:15 by Eóin
Maybe you can add this lines directly to .rc file works with masm's rc compiler but didnt worked with tasms rc compiler.


1 24 DISCARDABLE
BEGIN
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="program.exe"/>
<description>My XP Program</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
END
Posted on 2002-04-05 08:03:53 by LaptoniC
My problem isn't actually the file itself, Fasm has the necessary built in functionality to do this easily. However that alone doesn't work so there must be some header needed also.

Clearly the rc compiler must do that for you.
Posted on 2002-04-05 11:20:14 by Eóin
The following macro should work:


macro fileres label,fname
{ local data,size
label dd rva data,size,0,0
data = $
file fname
size = $ - data
align 4 }
Posted on 2002-04-06 10:46:56 by Tomasz Grysztar
Thank you very much Privalov, that worked perfectly.

By the way I love your assembler. You've done an incredible job with it. Thank you again.
Posted on 2002-04-06 18:13:38 by Eóin
Yup.. it's an excellent assembler.. Can't wait for the next version which should implement new features that will make me forget NASM once for all :) (thanks again, Privalov).
Posted on 2002-04-07 04:36:32 by Maverick
fasm 1.33 has just been released, but I'm afraid you'll have to wait longer for the "partial case-sensitivity" you asked for. It needs some more architectural changes, and it will be hard to do it if I wish to minimize slow-down of compilation time. But I'm working on it ;)
Posted on 2002-04-07 09:09:18 by Tomasz Grysztar
Will FASM make app's for Window XP and all under?
Posted on 2002-04-07 10:07:39 by cmax
cmax, I've had no difficulty making apps in/for Win98, 2k & XP. So I presume it works for other versions of windows also.

Privalov, As it stands I can only see two things missing from Fasm.

1) Support for lib files. This may not be possible and I can live without it, its just that it would be nice to have.

2) MACRO string concatenation. Perhaps this is supported and I just haven't figured it out. But I would like to be able to pass an arguement and have the macro generate code with that as part of a string.

For example, something equlivante to this Masm Macro

WM_CASE macro reg,msgs
&nbsp irp msg,<msgs>
&nbsp &nbsp cmp reg,WM_&msg
&nbsp &nbsp je j&msg
&nbsp endm
endm


Which would generate code like the following
WM_CASE eax,<CREATE,COMMAND>
=>

cmp eax,WM_CREATE
je jCREATE
cmp eax,WM_COMMAND
je jCOMMAND

Of this is a very specific example. Something equlivant to the catstr directive would be more useful

name CATSTR [] ...]]

Concatenates text items. Each text item can be a literal string, a constant preceded by a %, or the string returned by a macro function.

Just some thoughts, its still a great assembler though. :cool:
Posted on 2002-04-07 11:09:15 by Eóin

fasm 1.33 has just been released, but I'm afraid you'll have to wait longer for the "partial case-sensitivity" you asked for. It needs some more architectural changes, and it will be hard to do it if I wish to minimize slow-down of compilation time. But I'm working on it ;)

Although I appreciate FAsm's assembling speed, for me (and maybe others) it is not important, since I (and maybe others) work on a small module at once, and assemble it into my own executable format.

So what I would appreciate, if I don't ask too much, is that feature available preferably as a command line option. This way there would be just one FAsm version, it would default to the way most people use it, but would still make me (and hopefully others) 100% happy.

I found another major limitation that would make impossible for me to use FAsm: I need reloc info, for my own executable format. So I'd need another output format, binary, which also saves in another file a list of DWORDs representing which offsets must be relocated, in that binary file. You may implement this as an additional command line option, maybe.

Also, I'd like in FAsm some /? style option to see command line options in the EXE itself, and not only in the manual.

Keep up the great work. :)
Posted on 2002-04-08 07:33:55 by Maverick
I'll try to add some of these features in 1.34. I've already finished the support for # operator, which will allow concatenations (the j#msg with msg defined to CREATE will be preprocessed to jCREATE). And I'm working on case-insensitive instructions and
registers now.
Posted on 2002-04-15 15:47:54 by Tomasz Grysztar
Are their any good tutorials around for FASM? I remember, that one of out board members wanted to translate Iczelions tutorials to FASM?! :confused:
Posted on 2002-04-15 15:56:56 by bazik

I'll try to add some of these features in 1.34. I've already finished the support for # operator, which will allow concatenations (the j#msg with msg defined to CREATE will be preprocessed to jCREATE). And I'm working on case-insensitive instructions and
registers now.
Hi Privalov.. thank you. I hope 1.34 has the option to save the reloc table, so I can start to use it.

Thanks again anyway.
Posted on 2002-04-15 17:00:33 by Maverick
Great news Privalov. Just one question, if msg is a number, not text, will it still work.

For example if msg = 19 the would j#msg produce j19.
Posted on 2002-04-16 04:10:23 by Eóin
Yes, it works exactly that way.
Posted on 2002-04-16 07:30:58 by Tomasz Grysztar
Brilliant, this is incredable. Any idea when 1.34 will be available for download.
Posted on 2002-04-16 08:44:54 by Eóin
The 1.34 is now available to download on the all three mirrors:
http://fasm.metro-nt.pl/
http://privalov.host.sk/
http://omega.im.uj.edu.pl/~grysztar/

Maverick: The mnemonics are finally case-insensitive, but there is still no relocs stuff you asked for, I've some other important things to program now, but I'll come back to it, I hope in the near future. But you should be satisfied even with these features that alredy followed your suggestions.

bAZiK: I've been planning writing some good tutorials for about four months, but I still had not enough time to even start them. But when all the basic stuff for assembler is finished (I mean also some header converter, import generator and resource compiled), I'll finally make some incredibly good tutorials. ;)

E?in: The concatenations are made in preprocessor, so the assembler constants and expression will be calculated after the
concatenations, for example:


msg equ 17
jmp j#msg

after the preprocessing will become:


jmp j17

But this one:


msg = 17
jmp j#msg

will become:


msg = 17
jmp jmsg
Posted on 2002-04-19 11:52:55 by Tomasz Grysztar
bAZiK,
That was I, last summer. I ended up writing an article for AJP 9 and then got a job. What would you look for in a tutorial?

Privalov,
I have a feature request (maybe optionally allowed). Could you have reversed data types. Sometimes I need a word or dword with the MSB first. Maybe a ds (data string) type where I could type:
HexString    ds 0x11F1578A0932


This would also allow for 3 byte strings ( and save on a lot of comma spaces for db)


BTW, when I reassembled the MBR of a HD, I noticed that FAsm used different opcodes than the original MBR for the same insturction. I guess theres more than one way to skin a cloned cat.
Posted on 2002-04-25 03:19:49 by eet_1024