Author Topic: asmc-2.32  (Read 685 times)

nidud

  • Member
  • *****
  • Posts: 2046
    • https://github.com/nidud/asmc
asmc-2.32
« on: November 12, 2020, 12:40:24 AM »
Added a new release: asmc-2.32

Some small changes added to inline functions with regards to anonymous arguments.
- In a regular function anonymous parameters will be numeric from _1 to _n.
- The hidden *this parameter will only be used in a class definition.
- Named parameters will be used if provided in the PROTO definition.

tprintf proto format:abs, args:vararg {
    ifidn typeid(format),<ptr_word>
        wprintf(format, args)
    else
        printf(format, args)
    endif
    }

A .STATIC directive is added to .CLASS:

.template Rect

    left    int_t ?
    top     int_t ?
    right   int_t ?
    bottom  int_t ?

    .static Rect x:abs, :abs, :abs, :abs {

        mov this.left,   x
        mov this.top,    _2
        mov this.right,  _3
        mov this.bottom, _4
        }
    .ends
« Last Edit: February 16, 2021, 12:11:18 AM by nidud »

jay101ok

  • Regular Member
  • *
  • Posts: 2
Re: asmc-2.32
« Reply #1 on: December 20, 2020, 05:36:12 PM »
Hi, Nidud

I'm learning your AsmC 2.32. I got a problem. That is in "...\source\test\dllimport".
I've compiled Extern.asm to Exteren.dll. (asmc -pe -Fo Extern.dll Extern.asm)
And compoiled test.asm to test.exe. (asmc -pe -cui test.asm)
Then I executed test.exe, but it appeared MessageBox wtih Erricon "The procedure entry point DllProc could not be located in the dynamic link library extern."

I uses DllBrowser program to check Extern.dll. It shows as follow:
============================================
Export Table

   Name:   Extern.dll
   Characteristics:   00000000
   Time Date Stamp:   5fdeaf39
   Version:   0.00
   Base:   00000001
   Number of Functions:   00000001
   Number of Names:   00000001

Ordinal   Entry Point   Name
0000   00001000   _DllProc
                 
========================================

What's wrong with me. Can you fix it. Thanks for your help.

By the way, do you have any guide to learen about your resources writing.(Dialogs, Accelators, Versions...etc)
Sorry my poor english.

My OS is WinXP pro sp3(x86,zh-tw), Intel i5 with 8G ram.   
         
Regards

nidud

  • Member
  • *****
  • Posts: 2046
    • https://github.com/nidud/asmc
Re: asmc-2.32
« Reply #2 on: December 21, 2020, 05:59:05 AM »
This worked in Windows 7 as originally tested but also fails in Windows 10. It seems the DLL made by Asmc fails to load any externals.

Using LINKW does however work in Windows 10.
makefile
Code: [Select]
test.exe:
    asmc64 -pe $*.asm
    asmc64 -nolib extern.asm
    linkw Format windows pe dll Library msvcrt File extern
    $@
    pause

jay101ok

  • Regular Member
  • *
  • Posts: 2
Re: asmc-2.32
« Reply #3 on: December 24, 2020, 10:35:22 PM »
Hi, Nidud

"asmc -nolib extern.asm" and "linkw Format windows pe dll Library msvcrt File extern" didn't work too.

I tried anthoer way to compile and link.
"asmc /c /coff /Cp extern.asm" and uses MS linker "link msvcrt.lib /DLL /SUBSYSTEM:WINDOWS /def:extern.def extern.obj".
It works fine.

I uses DllBrowser program to check Extern.dll. It shows as follow:
============================================
Export Table

   Name:   Extern.dll
   Characteristics:   00000000
   Time Date Stamp:   5fe2f47a
   Version:   0.00
   Base:   00000001
   Number of Functions:   00000001
   Number of Names:   00000001

Ordinal   Entry Point    Name
0000         00001000    DllProc

       
Import Table

MSVCRT.dll
Ordinal   Function Name   

04b9         printf
====================================== 

The difference between your linker(linkw) and MS linker is:
Your linker makes _DllProc(with underscore)
MS linker makes DllProc(without underscore)
Maybe that is the point. Thanks for your help.

Regards


TimoVJL

  • Member
  • ****
  • Posts: 671
Re: asmc-2.32
« Reply #4 on: December 24, 2020, 11:09:42 PM »

The difference between your linker(linkw) and MS linker is:
Your linker makes _DllProc(with underscore)
MS linker makes DllProc(without underscore)
Maybe that is the point. Thanks for your help.

Regards
_DllProc is a decorated CDECL function and DllProc is a non decorated EXPORT function.
Non decorated EXPORT functions are for dynamic loading and needs definitios.
May the source be with you

nidud

  • Member
  • *****
  • Posts: 2046
    • https://github.com/nidud/asmc
Re: asmc-2.32
« Reply #5 on: December 25, 2020, 01:43:40 AM »
"asmc -nolib extern.asm" and "linkw Format windows pe dll Library msvcrt File extern" didn't work too.

Note that the sample was made for Win64 so it wont work in Win32 (I didn't notice but you did mention WinXP (x86) in your post).

Quote
I tried anthoer way to compile and link.
"asmc /c /coff /Cp extern.asm" and uses MS linker "link msvcrt.lib /DLL /SUBSYSTEM:WINDOWS /def:extern.def extern.obj".
It works fine.

:thumbsup:

jj2007

  • Member
  • *****
  • Posts: 11157
  • Assembler is fun ;-)
    • MasmBasic
Re: asmc-2.32
« Reply #6 on: December 25, 2020, 06:39:58 AM »

nidud

  • Member
  • *****
  • Posts: 2046
    • https://github.com/nidud/asmc
Re: asmc-2.32
« Reply #7 on: February 16, 2021, 12:10:14 AM »
Added a new release: asmc-2.32

404

I make new releases from time to time which are basically a copy of the current state of development. It provides a break for new features and changes to existing ones, but as for the release it self it tend to be followed by a few more updates to correct the unintentional consequences of adding changes.

It's possible to get a specific versions from git by browsing the history if needed as all changes are preserved and the ZIP files are also available in the forked versions.

TimoVJL

  • Member
  • ****
  • Posts: 671
Re: asmc-2.32
« Reply #8 on: February 16, 2021, 12:31:16 AM »
Thanks to ninud, asmc is a project, that provide to me benefits of assembly in big project.
It have a good RTL.
In scandinavia are good programmers who do good job and don't keep noise and don't mock others.
May the source be with you