Author Topic: ML64 A form of prototype who verify the number of arguments  (Read 1393 times)

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Code: [Select]
include master_ml64.inc
includelib msvcrt.lib

HINSTANCE typedef QWORD
.const
;a macro as prototype ?
MessageBox MACRO hWnd:REQ,lpText:REQ,lpCaption:REQ,uType:REQ
  IFDEF __UNICODE__
MessageBoxW PROTO
invoke MessageBoxW, hWnd,lpText,lpCaption,uType
  ELSE
MessageBoxA PROTO
invoke MessageBoxA,hWnd,lpText,lpCaption,uType
  ENDIF
EXITM<> ;better look ()
ENDM

.data
salut db  "salut",0
titre db "titre",0
;-------------------
.LISTALL
.code
WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,lpCmdLine:XMASM,nShowCmd:DWORD
MessageBox ( NULL,addr salut,addr titre,MB_OK)
ret
WinMain endp
end
« Last Edit: May 02, 2021, 03:09:48 AM by TouEnMasm »
Fa is a musical note to play with CL

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8491
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: ML64 A form of prototype who verify the number of arguments
« Reply #1 on: May 03, 2021, 08:18:13 PM »
Yves,

Its an old idea, I think Erol (Vortex) designed it about 10 years ago. It works but to make a comprehensive set, you would have to write a macro for every API and that would end up finished for Windows 3000.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: ML64 A form of prototype who verify the number of arguments
« Reply #2 on: May 03, 2021, 08:56:36 PM »
to make a comprehensive set, you would have to write a macro for every API

Not a big deal, these macros could be generated. The resulting file would have about 3MB. I'm not sure whether I would like it, though :cool:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8491
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: ML64 A form of prototype who verify the number of arguments
« Reply #3 on: May 03, 2021, 09:05:57 PM »
The other problem is you would have to have 2 of them so you could handle the function form as well as the statement form.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: ML64 A form of prototype who verify the number of arguments
« Reply #4 on: May 03, 2021, 09:28:41 PM »
The other problem is you would have to have 2 of them so you could handle the function form as well as the statement form.

The function form is enough. You can use void if you don't need the return value.

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: ML64 A form of prototype who verify the number of arguments
« Reply #5 on: May 03, 2021, 10:19:15 PM »

30 000 macros to write isn't a problem for me
It can be made with the extraxted list of protototypes from the windows sdk.
Have a look on this list (With the names of header) who as no duplicate or a  very few number.
The name of headers is a better choice than the name of lib because msdn refer to header more than lib.
The zip is a 7Z,because 7Z is not accepted.
Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: ML64 A form of prototype who verify the number of arguments
« Reply #6 on: May 03, 2021, 10:28:49 PM »
Some look a bit unfamiliar, Yves, but overall you've done an excellent job :thumbsup:

Code: [Select]
ChainesEgales PROTO  chaine1:DWORD ,chaine2 :DWORD,mode:DWORD
chercherChaine PROTO Debut:DWORD,Contenant:DWORD,Chercher:DWORD,Methode:DWORD
ChercherMotBornes PROTO Debut:DWORD,AdrPerdu:DWORD,AdrChercher:DWORD,Methode:DWORD,\
CmpChainLen PROTO pchain1:DWORD,  pchain2:DWORD,  methode:DWORD,longueur:DWORD
TraduireGuide PROTO  pguid:DWORD, adrNom:DWORD
LettreAvantLettreApresmot PROTO adrmot:DWORD,  adrphrase:DWORD ,position:DWORD
DateTimeToString PROTO pdt:PTR DATETIME, pszDateTime:PTR BYTE
GetLocalDateTime PROTO pdt:PTR DATETIME
FormatLocalDateTime PROTO  pchainReponse:DWORD
LongZtexte PROTO  Debut:DWORD
Limites PROTO  value:DWORD
MaitreTexte PROTO  Hfenetre:DWORD,FichierAnalyse:DWORD,Infotextascii:DWORD,\
Mid PROTO  adrtitre:DWORD,decale:DWORD,longueur:DWORD
ScrutationFichierTexte PROTO InfoT:DWORD
CompteurLignes PROTO  pmem:DWORD,taille:DWORD

HSE

  • Member
  • *****
  • Posts: 1741
  • <AMD>< 7-32>
Re: ML64 A form of prototype who verify the number of arguments
« Reply #7 on: May 03, 2021, 11:19:12 PM »
30 000 macros to write isn't a problem for me
It can be made with the extraxted list of protototypes from the windows sdk.

Nidud maked that some years ago in AsmC.

It's very interesting for C translation, because syntax is exactly that of C  :thumbsup:.

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: ML64 A form of prototype who verify the number of arguments
« Reply #8 on: May 03, 2021, 11:24:44 PM »
It's very interesting for C translation, because syntax is exactly that of C  :thumbsup:.

But it breaks old code and makes you dependent on new includes. I also like the option to search a fat source for invoke.

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: ML64 A form of prototype who verify the number of arguments
« Reply #9 on: May 03, 2021, 11:42:04 PM »
Quote
Some look a bit unfamiliar, Yves, but overall you've done an excellent job
Those who lok unfamiliar are of of my personnal library,I will not include them in the pack.
Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: ML64 A form of prototype who verify the number of arguments
« Reply #10 on: May 03, 2021, 11:43:43 PM »
Just joking, Yves :thup:

Vortex

  • Member
  • *****
  • Posts: 2583
Re: ML64 A form of prototype who verify the number of arguments
« Reply #11 on: May 03, 2021, 11:47:06 PM »
Hi HSE,

Quote
It's very interesting for C translation, because syntax is exactly that of C

Kindly, could you expain why there are very few people who translated the whole MS SDK header files to assembly?

HSE

  • Member
  • *****
  • Posts: 1741
  • <AMD>< 7-32>
Re: ML64 A form of prototype who verify the number of arguments
« Reply #12 on: May 03, 2021, 11:59:52 PM »
But it breaks old code and
I don't think so.

makes you dependent on new includes.
I don't pay attention if it's in includes or AsmC build that when read includes. Anyway, for compatibility reasons almost never used.
« Last Edit: May 04, 2021, 08:03:09 AM by HSE »

HSE

  • Member
  • *****
  • Posts: 1741
  • <AMD>< 7-32>
Re: ML64 A form of prototype who verify the number of arguments
« Reply #13 on: May 04, 2021, 12:05:38 AM »
Kindly, could you expain why there are very few people who translated the whole MS SDK header files to assembly?

Sorry, C translation is "C source code translation"

Header files translation is "madness" ? :biggrin:

Vortex

  • Member
  • *****
  • Posts: 2583
Re: ML64 A form of prototype who verify the number of arguments
« Reply #14 on: May 04, 2021, 12:23:41 AM »
Hi HSE,

Quote
Header files translation is "madness" ?

No worries. Exactly, that's the problem : The C\C++ header file set is very complicated. Translating them to asm is a very big job.