ok, i got step closer to this now:
Here is what happened. I downgraded to vs2003 did not work, always seems to generate 32-bit by VS.
So i downloaded and installed Turbo C4 version. Configured everything including all system variables.
But damn stdio.h include issue got in the way. Basically it can not find it. Since I am not using VS, it will not seek the stdio.h in the VS include location. Configured couple of system variables including LIB, CLASSPATH and PATH to point to Turbo C's include / lib location still not work.
Screw it, I said, I commented out the "include stdio.h" and anything that uses STDIO from the code from time being (so the c file is nothing useful but file with assignment to some variables :t) and tried to generated executable.
Now everything just same but use masm to generate asm obj file, but for C, used tcc compiler and tlink from the turbo C.
As you can see below that persistent, annoying error regarding 4c error is gone:
However it still complained about 32-bit code in the assembly which i am looking at it now.
C:\GIT\MINIX.DEV\EXP>nmake asmc
Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
c:\masm32\bin\ml /c /Fl /Zi /Zd asmfile.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: asmfile.asm
tcc /c cfile.c
Turbo C++ Version 3.00 Copyright (c) 1992 Borland International
cfile.c:
Warning cfile.c 19: Function should return a value in function main
Warning cfile.c 19: 'b' is assigned a value that is never used in function main
Warning cfile.c 19: 'a' is assigned a value that is never used in function main
Available memory 4165820
tlink.exe asmfile.obj cfile.obj,,,,,
Turbo Link Version 5.0 Copyright (c) 1992 Borland International
Fatal: 32-bit record encountered in module ASMFILE.ASM
NMAKE : fatal error U1077: 'tlink.exe' : return code '0x2'
Stop.
C:\GIT\MINIX.DEV\EXP>
C:\GIT\MINIX.DEV\EXP>dir *.obj
Volume in drive C has no label.
Volume Serial Number is FC76-C34F
Directory of C:\git\minix.dev\exp
11/09/2015 05:52 PM 2,083 asmfile.obj
11/09/2015 05:52 PM 236 CFILE.OBJ
2 File(s) 2,319 bytes
0 Dir(s) 43,573,825,536 bytes free
When comparing the asm and C object files both starts with the 80 not 4c that tells something is hopeful
C:
80 09 20 07 63 66 69 6c 65 2e 63 dc 88 1f 20 20 20 1b 54 43 38 36 20 42 6f 72 6c 61 6e 64 20 54
asm:
80 0d 20 0b 61 73 6d 66 69 6c 65 2e 61 73 6d 18 96 20 20 20 04 44 41 54 41 03 53 54 41 04 43 4f