Interview with Privalov the author of FASM — Архив WASM.RU

Все статьи

Interview with Privalov the author of FASM — Архив WASM.RU

- Why did you decided to code your own assembler?

I was writing my own operating system back in 1998 and I needed a good tool for this. These days Turbo Assembler was my favourite, but still lacked some features I needed - I hated to hardcode instructions with DB directives. So I have started my own assembler project and I also made it OS-independent, so I could easily port it into my own OS and do all the development from there. I have also written a portable editor with syntax highlighting for the same purpose, it was called "flat editor", I still have its sources somewhere.

Later I have lost the interest in continuing that OS, and unfortunately I have even lost the sources for the last version (with working ports of flat assembler and flat editor). But I still had the DOS version of flat assembler on backups, and in 2000 I've decided to release it in the internet, just because I though someone might find it useful for OS development. And when I found out there was more interest in it than I initially thought, I started improving it and adapting it for other purposes also - finally it became quite an universal tool.

- How many time you had been coding first version of FASM?

First of all, please note that it was the second time I was writing an assembler. The first one I have written in 1998 without any clue how to write any compiler or assembler. But I gained this way the experience that allowed me to begin in 1999 the flat assembler project in a planned way and finish the first working version quite fast. I have started this project at March 23rd and the first version with complete 386 instruction set implemented and capable of recompiling itself was ready in the beginning of May. So it all took me about one month.

- FASM is very convenient but for all that is absolutely free. Don't you regret having to give it to everybody for free?

I don't think it would get very popular if it was commercial product, especially are there are much fewer assembly language programmers than used to be, and so I doubt it would give me any serious profit. Though I was considering making a 64-bit version of fasm as a commercial product, if only there was enough interest in it. I must confess that I lack the motivation to work on the 64-bit fasm for free.
(Lately Privalov decided against turning 64-bit version of fasm commercial way.)

- Will high-level constructions (built-in PROC, .IF/.WHILE etc.) be added into FASM?

I always wanted to keep the fasm's syntax very simple and based on just few powerful directives that would allow implementing any other features as an custom "upper layer" for assembly language, like macroinstruction packages. And though fasm's directives might still not powerful enough to implement some very sophisticated HLL-like constructions, they seem to be generally more than enough to implement any customization that is still somewhat related to assembly language. And when someone really needs more, I might suggest using some compiler with fasm as a back-end.

- Will instruction optimisation, both formal (f.e. replacing lea with mov, replacing opcodes with shorter ones) and non-formal (f.e. instruction regrouping, cutting unnecessary code), be added into FASM?

No, even those formal optimisations are too controversial to put them into the assembler in my opinion. However, you can make an optimising macros for most of them.

- FASM Macrolanguage is non-trivial and different from MASM/TASM. Are you planning to add compatability mode?

Well, they are still a bit similar to those from TASM's ideal mode, as when I was desiging fasm, I was programming in TASM's ideal all the time. All the elementar macro features all very similar, the only difference is that in fasm you use braces to enclose the macro contents. But even this may be changed with the fasm's "fix" directive.

And the more advanced macro features I had to design considering already existing fasm's internals, and that's why they become what they are. I actually never thought of adding any "compatibility mode".

- Will 64-bit mode be added to FASM?

It's in development, but currently a bit sustained, as I'm working on many other things at the same time. Also, as I said above, I'm considering that I will continue its development only as a commercial project.

- Is architecture of FASM allow to adapt it to other processors (f.e. GameBoy :) )?

Yes, I was trying to make fasm's architecture in a way that would allow such adaptations easy (that would be cross-assembling anyway, since fasm itself is written with x86 mnemonics), but if you would like instructions of syntax much different from the Intel's one, you would have to make quite large changes to parser module, which is the one responsible for separating and recognizing all the syntactic parts of each source line.

- Are you planning to add support of other OSes to FASM?

Yes, fasm should be able to run on any system based on the IA32-compatible processor. I have recently made a version that is compiled to object code linking to the standard C library that should be linkable to working executable on any operating system that has such C library.

Also I was planning to make some version for OS/2, since there were some people requesting it, but I simply never had this system and I don't have enough knowledge about it to make such port.

- The most stupid question: is assembler dead? :)

From the fact that this interview is taking place, we can simply tell: it's not. However much has changed since the "gold" assembly language days and I would say it IS dead in some aspects. Ten years ago the opinion about the assembly language you would hear from the average programmer was that it's something like the highest art, requring very deep knowledge and experience, but giving you incredible power. I think it was even a kind of common programmers' dream to gain a high skills in programming with assembler. And today you are most likely to hear something like: "Assembler? Isn't it a waste of time?".

- What do you think about .NET and IL?

The idea of intermediate code is actually very old and though it has many advantages for HLL coders (especially for the languages that need to be "wiser than a programmer", but extremely stable thank to it, in some cases it's very important to give LESS power to the programmer - well, even the classing protected mode mechanisms are an example of such approach). But it should be obvious that such programs will never be able to beat well written native machine code in terms of performance. So it seems to be just a tendention to higer specialization, splitting programming languages into two main areas: one where the stability is most important, and one where the performance and power is most important. Of course assembly programmers are the core of the second one.

- What do you think about open-source projects?

It's good to see the source of program you're using, as you can also use it to make sure there is no any dangerous code inside. And an option to reuse code in your own projects is a very good thing, too - but I think it's a bit too strong in case of GPL, as it forces you to release such a projects open-source under GPL. That's why I prefer much simpler BSD-style license.

- Do you know about demo scene? Have you favourite groups, demos or intros?

I used to know about it in the old days, but now I have lost any contact. As for the favourite demos, my favourite of all the time is the Future Crew's "Second Reality".

- Your opinion about virii scene? Is it really dead and is it good or not? :)

I never had any contact with such scene, in fact I didn't even really realize its existence.

- Your opinion about crack and software research scene?

I should not advocate any reverse engineering, since it is now illegal in many countries, though my opinion is that you should always have right to reverse a program you've got on the computer - you just should have right to know what you're running, in the same way as the right to know what you are eating when you bought some food. But in both cases it has been manipulated to allow concerns keep their secrets hidden (I mean something like the recipe for Coca Cola).

Of course reversing in most cases is used to break the software protection - and, again, you should have right to do it, when you have bought the software, for example just to make the software you own easier to use - it's only copying it to the others that is and should be illegal.

So it was my opinion about legality problems, as for the reverse engineering and cracking itself, I must confess I was doing such things quite frequently for my own use in DOS days, and in my opinion doing it gives you a great experience with assembly language and leads to gaining really high quality skills. Perhaps the best assembly programmers would be found among the crackers.

- What future of programming do you see?

The programming is now splitting into different areas, and I think in future they all will become even more specialized, as there are no really universal programming languages and I doubt there ever will be any.

- Where do you live and why?

I live in Poland, as I'm Polish. Right now in the city of Krakуw, where is my university placed.

- Your favourite dish :).

Oh, this is a hard question. Let's say... some chicken with potatos. :)

- Your favourite books and/or book genres.

I always loved reading, a lot of reading - and I like many different genres, but SF and Fantasy were usually the genres I was reading the most. So also such books would occupy the largest part of my favorites list, though this list is constantly changing. Some of my favourites are: "Little, Big" by John Crowley, "Chronicles of Thomas Covenant" by Stephen R. Donaldson, "Monday begins on Saturday" and "Roadside picnic" by A. and B. Strugatsky, many books of Philip K. Dick and Kurt Vonnegut, etc.

And one of my favourite authors other than SF&F ones is Erich Maria Remarque.

- Do you like computer games?

I used to play a lot some years ago, when the games were still released mainly for DOS. So all my favourite games are the DOS ones, I will just mention "Betrayal at Krondor" and "Privateer" but this is just the top of the iceberg.

- Do you belive in God or other superbeing?

Yes, I am active Roman Catholic.

- Have you ever tried lucid dreaming?

I was doing it very frequently for a years, with sometimes really much amount of control (even changing all the scenery), But then I became a bit bored with it and now it happens much less frequently. And only recently I have realized that this fenomenon has its own name and is even discussed in the internet.

- Do you like anime or not and why?

I cannot simply say that I like it or not, just because I almost don't know it. I never had much contact with it.

2002-2013 (c)