ph_.lib -- create small window command line .exe
[page last modified 10/6/2019]

For latest version go to paulhoule.com/ph_ ph_.lib is a tiny C stdlib replacement to produce smaller .exe files. It is intended to support only a little-endian architecture (eg. X86) and the Microsoft Visual C compiler. 32 and 64 bit versions are provided. Only a small subset of the C stdlib is implemented. What is implemented is compatible with MSVC, so a build-time switch to select either ph_ or MSVC stdlib is possible -- a design goal for testing. ph_ fwrite() supports "text" mode output, converting 0xa to 0xd, 0xa. Text mode input is not supported; files must be read in binary mode. Ver 1.x are pretty much "proof of concept" only -- not even command line arguments (argc and argv) are supported. No __chkstk is supplied; for programs making large stack allocations the caller must add the compiler's chkstk.obj to their link list. The target user of ph_.lib is a Windows command line tool. The tool must be compiled using ph_.h and linked against ph_.lib (compiling is necessary since ph_.lib using non-standard structs, defines and calling conventions). A typical scenario is to compile/develop/debug using the MSVC stdlib, then complile/link against ph_.h/ph_.lib for release. The below program will compile to a 2,560 byte executable with ph_.lib via the command "cl /O1 hello.c ph_.lib /link /entry:main" using the 2017 32-bit MSVC 15.4 (ver 19.11.25547) compiler: #include "ph_.h" void main(void) { printf("Hello World\n"); } Built with the MSVC 15.4 static stdlib the executable is 97,280 bytes. Any version of MSVC 6.0 or later should work, 32 or 64 bit. The following files are included: ph_.h C Header file ph_.c C source ph_.asm 32/64-bit X86 asm (rewrite of some ph_.c funcs) ph_.txt This file lib\ph_.lib 32-bit library lib\x64\ph_.lib 64-bit library Change Log ---------- Ver 1.3: Removed ph_ prefix from all names; ph_.h/ph_.lib may no longer be 10/6/19 compiled and linked along with stdlib .h files and stdlib.lib. Added a few dozen funtions. Still no support for argv/argc. Ver 1.2: Added memmove,wmemmove, strcpy, wstrcpy 9/24/19 removed ?memcpy code; ?memcpy now equated to ?memmove Ver 1.1 Added minimal wide char support; another proof-of-concept release. 9/13/19 New: wchar_t, wint_t, wmemcpy, wmemset, wcschr, scslen, _wfopen Ver 1.0: Initial release. Only a handful of functions implemented. 9/1/19 Not really useful; basically a proof-of-concept.


Click here to download  ph_13.zip

Click here to download  ph_12.zip

Click here to download  ph_11.zip

Click here to download  ph_10.zip


Widget is loading comments...

You are visitor 201       Go to Home Page