Hi Everyone

I'm still trying to figure out, how to make functions written in C
to ASM files.
I've gotten some great help from Readiosys,Tank and Fodder.
I feel I'm getting closer, just keep on it, and I'll master this compliler, Oh Well enough talk!
I've sent both file folders the Library folder and ASM folder in
zip file.
I have so far gotten pure C to do math, but I want to be able use
C runtime files,
Fodder said do this

1) make sure libc is linked in.
2) make sure the entrypoint is the libc entrypoint, not yours.

But I really don't know how to do this


:)
Posted on 2002-01-19 09:48:13 by andy981
I figured how to run CLIB runtime functions,
written in C in my ASM code assembled on Masm32 , Yah!


Is what this program writes
I figured it out

You need
.data
EXTERNDEF _acrtused:WORD



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

.386
.model flat,stdcall
option casemap:none
include \masm32\include\A.inc
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\Simple.lib


.data
EXTERNDEF _acrtused:WORD

.code
PUBLIC main
main:

invoke Simple

invoke ExitProcess,0
end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Posted on 2002-01-19 10:51:56 by andy981
EXTERNDEF _acrtused:WORD should be in the Include file not
ASM file or it will crash , well that fixed it for me



EXTERNDEF _acrtused:WORD

Simple proto C
Posted on 2002-01-19 11:19:26 by andy981
Now I can't use Masm32 calls like

invoke StdOut,ADDR var

causes
undefined symbol : StdOut
error

.data
andy db "Andy",0ah,0
.code
PUBLIC main
main:
invoke StdOut,ADDR andy

invoke Simple

invoke ExitProcess,0
end
Posted on 2002-01-19 12:17:12 by andy981

Now I can't use Masm32 calls like

invoke StdOut,ADDR var

causes
undefined symbol : StdOut
error



Forgot Masm32.lib

:stupid:

Anyway thing are looking prettyup, except
for 55k file size, But it'll help me build somestuff and then in time
whittle out the C
If I like,
Next I need to know how to call the API in C
But I have not found much on it, on the web, just a lot of VB stuff

By the way I think it was one of Fodder's earlier replies to someone else that showed me EXTERNDEF _acrtused:WORD

Andy981! :)
Posted on 2002-01-19 13:04:07 by andy981