News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

POH2INC converter

Started by Vortex, April 22, 2012, 06:14:51 PM

Previous topic - Next topic

Vortex

With thanks to Pelle, the new POH2INC command-line tool converts C to assembler include files.

Here is a quick example.

test.h :


extern char * __stdcall SearchNullorCRorQuote(char *str);
extern char * __stdcall SearchQuoteOrNull(char *str);
extern char* __stdcall GetFilePath(char *str,char *str2);
extern void __stdcall szCatStr(char *str,char *str2);
extern char * __stdcall AnalyzeFunc(char *str);
extern int __stdcall NumbOfParams(char *str);
extern int __stdcall szCopy(char *str,char *str1);
extern int __stdcall WriteFileToDisc(char *str,char *str2,int size);
extern char* __stdcall GetFileExtension(char *str);
extern int  __stdcall szCmp(char *str,char *str2);
extern int __cdecl wsp(char *str,char *str1,...);
extern void __stdcall StdOut(char *str);


poh2inc.exe test.h

test.inc :


SearchNullorCRorQuote PROTO STDCALL str:PTR BYTE
SearchQuoteOrNull PROTO STDCALL str:PTR BYTE
GetFilePath PROTO STDCALL str:PTR BYTE, str2:PTR BYTE
szCatStr PROTO STDCALL str:PTR BYTE, str2:PTR BYTE
AnalyzeFunc PROTO STDCALL str:PTR BYTE
NumbOfParams PROTO STDCALL str:PTR BYTE
szCopy PROTO STDCALL str:PTR BYTE, str1:PTR BYTE
WriteFileToDisc PROTO STDCALL str:PTR BYTE, str2:PTR BYTE, size:SDWORD
GetFileExtension PROTO STDCALL str:PTR BYTE
szCmp PROTO STDCALL str:PTR BYTE, str2:PTR BYTE
wsp PROTO CDECL str:PTR BYTE, str1:PTR BYTE, :VARARG
StdOut PROTO STDCALL str:PTR BYTE


dedndave

very cool   :U

although, i have to wonder how it handles some of the hard stuff, like enumerations

Vortex

Hi Dave,

Reading Pelles C help, POH2INC reference [7.00] :

QuotePelles H to INC converter is used for converting C to assembler include files. Note that there is almost never a "perfect" conversion. POH2INC will process each file in isolation, and many files depend on typedefs and macros from other files. Also, many include files hide part of the C syntax in macros making the job for POH2INC much harder.