Author Topic: Fusion  (Read 2994 times)

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1082
  • ObjAsm Developer
    • ObjAsm
Fusion
« on: November 20, 2018, 06:52:22 PM »
Hello
Recently, I've been working on the translation of the Windows header files, a project started a few years ago by Japheth and which I've continued in the last months. Since the headers are independent of the bitness and I had more and more problems keeping ObjAsm32 and ObjAsm64 in sync, I was thinking about merging them into a single project.

The complexity of the backend will become higher, but at high level, like switching from ANSI to UNICODE, it should go seamlessly.
I can think about a project section of shared code and macros and 2 dedicated sections for 32 and 64 bits.  :idea:

The idea behind is use put as much as possible in the shared section to reduce the synchonization work. To achieve this, the 32 bit GPRs should be written that way to fit to the proper bitness. For example, using a macro, xax will become eax for 32 bit and rax for 64 bit. This will work for the vast majority of the cases. If not, a code path or a dedicated file will be necessary.

I know about other projects, like DualInc, that went this way too. But before I start mixing everything together, I would know what problems you had doing so.  ;)

Thanks, Biterider

jj2007

  • Member
  • *****
  • Posts: 13946
  • Assembly is fun ;-)
    • MasmBasic
Re: Fusion
« Reply #1 on: November 20, 2018, 07:07:11 PM »
This is similar to what I did for 64-bit assembly with RichMasm: A set of macros that can be used for 32- and 64-bit code alike with a single switch (OPT_64 0/1). Instead of calling registers xax or similar, I use this:

if @64
  SIZE_P equ <QWORD>            ; int and long are 32-bit, pointer is 64-bit
else
  SIZE_P equ <DWORD>            ; int, long, and pointer are 32-bit
  rax equ eax                   ; rrr
  rcx equ ecx
  rdx equ edx
  rsi equ esi
  rdi equ edi
  rbx equ ebx
  rbp equ ebp
  rsp equ esp
endif


SIZE_P works like a charm and is intuitive IMHO. My 2cts ;)

HSE

  • Member
  • *****
  • Posts: 2498
  • AMD 7-32 / i3 10-64
Re: Fusion
« Reply #2 on: November 20, 2018, 11:25:58 PM »
Hi Biterider!!

   ObjAsm32 is a very mature tool now, and it will be usefull for long time (32 bit PC also will be here some more time) without heavy modifications (if any).

   If ObjAsm64 become dual that could be very interesting, even if that result totally incompatible with ObjAsm32  :t


   
     

   
Equations in Assembly: SmplMath