topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 8:04 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: easm - The Win32 Assembler  (Read 6738 times)

Martin_130286

  • Member
  • Joined in 2007
  • **
  • Posts: 12
    • View Profile
    • Invalid Cast
    • Read more about this member.
    • Donate to Member
easm - The Win32 Assembler
« on: April 13, 2007, 10:45 AM »
The Epsilon Assembler (easm) is a Win32 assembler whose main focus is Windows application development. I am developing easm as my final year degree project and I wanted to introduce the project to a wider audience and generate some interest.

The assembler is still in very early stages and currently only supports a small percentage of the overall design. In saying this however, easm is capable of creating some interesting things in its current state. My aim is to develop the project, even after it has served the educational purpose that it was created for, to be a fully functional assembler with little to no limits.

I have released a BETA version of easm on the project website (http://e-asm.org) in the hope that people will test the assembler and  report any potential bugs. Bug reporting is particularly important at this stage as I need some evidence that the application has been tested.

Bugs are reported on the project website and require a login to do so (to avoid abuse of the bug reporting system). If you require a login, just complete the short form (found in the 'Bugs' section of the site) and I'll add the login asap. Any feedback would be greatly appreciated and be a huge help.

The website also contains design documents, explanations of relevant concepts, easm source code samples and the online documentation for the easm syntax (http://e-asm.org/Docs)

The easm syntax is essentially x86 assembler, but with a unique touch which aims to make it more manageable and readable, take the following Hello World example:



   subsystem cui

   section imports

        from msvcr70.dll import printf
        from kernel32.dll import ExitProcess

   section constants

        const NULL = 00h

   section data

        string szOutput = "Hello World\n"

   section code

        call printf (&szOutput)
        call ExitProcess (NULL)



easm makes extensive use of Win32 'imports' in order to import functionality from existing code, residing in dynamic link libraries. It is possible to import pretty much any function from any DLL (given its name) and then invoke the function in easm. This produces a huge library of inherited code, much like other languages have access to.

As a final example, the application below was recently created using easm and shows that easm is capable of the development of a fully functional application (even though it is tedious at this point). The program is a simple HTTP downloader, which saves a remote file to a local file given the fully qualified URL.

[attach=#1][/attach]

http://e-asm.org/samples/http.easm
http://e-asm.org/http.exe

Although easm is intended for the Microsoft Windows platform... there has be some success in running the assembler and applications produced by the assembler under Linux systems with the aid of the Windows Emulator WINE. I have not tried this myself, but I am aware that the early examples in easm run fine when using WINE.

Thanks a lot, Martin.
« Last Edit: April 13, 2007, 01:35 PM by Martin_130286 »

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
Re: easm - The Win32 Assembler
« Reply #1 on: April 13, 2007, 11:50 AM »
Not bad, I got a couple of your examples to compile.
It is pretty low level stuff, I'll have to play with it some more.

Have you tried posting about it at the MASM forum?

Those guys are true hexadecimal mnemonic drivers.  :Thmbsup:

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: easm - The Win32 Assembler
« Reply #2 on: April 13, 2007, 04:57 PM »
I like the ability to do imports that way instead of relying on import libraries. Do you only support PE executable output, or can you produce coff .obj files as well? And, in the case that you only produce PEs, do you support static libraries?

Imho "cui" should be renamed "console", it's more standard and less prone to be confused with "gui".

Do you plan on supporting structures? Otherwise win32 development will be prettttty tedious. And since that's your declared aim, well... yeah. You'd probably also want to support some of the existing includes (or create/convert yourself), having to list constants/structs in each source module is bad.

Keep up the good work though, always interesting to see yet another assembler (and no, I don't mean YASM ;) ).

Oh, and you should step by the http://asmcommunity.net/ forum and make a post about it :)
- carpe noctem

Martin_130286

  • Member
  • Joined in 2007
  • **
  • Posts: 12
    • View Profile
    • Invalid Cast
    • Read more about this member.
    • Donate to Member
Re: easm - The Win32 Assembler
« Reply #3 on: April 14, 2007, 03:17 AM »
Thanks for the feedback f0dder :)

Right now, easm outputs directly to PE, causing problems when you want to create multiple obj's and link them later, I will add other output formats when time permits though. As for imports, right now it's purely dynamic - static of course would be an advantage and something I will consider in later versions.

I do intend to support structures, it's such a pain having to do it manually - that'll be in the next release, but again it's a time issue. I'll more than likely support their declaration in a slightly different way, but I'll write a tool to convert an existing windows.inc to an easm compatible one which can be included as you suggested. It would be fantastic to be able to just write:

   struct WNDCLASSEX wndClass // or something similar.

Thanks for the feedback, I really appreciate it - and I'll make another post at asmcommunity.net, thanks for the link.

Regards, Martin