News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

ML64 A form of prototype who verify the number of arguments

Started by TouEnMasm, May 01, 2021, 03:54:13 PM

Previous topic - Next topic

TouEnMasm


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
Fa is a musical note to play with CL

hutch--

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.

jj2007

Quote from: hutch-- on May 03, 2021, 08:18:13 PMto 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--

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.

jj2007

Quote from: hutch-- 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.

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

TouEnMasm


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

Some look a bit unfamiliar, Yves, but overall you've done an excellent job :thumbsup:

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

Quote from: TouEnMasm 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.

Nidud maked that some years ago in AsmC.

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

jj2007

Quote from: HSE on May 03, 2021, 11:19:12 PMIt'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

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


Vortex

Hi HSE,

QuoteIt'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

Quote from: jj2007 on May 03, 2021, 11:24:44 PM
But it breaks old code and
I don't think so.

Quote from: jj2007 on May 03, 2021, 11:24:44 PM
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.
Equations in Assembly: SmplMath

HSE

Quote from: Vortex on May 03, 2021, 11:47:06 PM
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:
Equations in Assembly: SmplMath

Vortex

Hi HSE,

QuoteHeader 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.