Discussion:
cdecl to stdcall
(too old to reply)
muta...@gmail.com
2023-05-12 13:24:52 UTC
Permalink
I would like to create a library that allows people with
compilers that only do cdecl (ie subc) to call Windows
functions.

So I created some assembler "glue".

I can get a link, but it doesn't actually create the directory,
and then it crashes.

I have tried various combinations.

Any ideas?

.386p
.model flat

.code


extrn ***@8:dword
public _CreateDirectoryA
_CreateDirectoryA:
push 8[esp]
push 8[esp]
push [***@8]
ret
ret


Thanks. Paul.
muta...@gmail.com
2023-05-12 13:41:04 UTC
Permalink
Don't worry - got it.

; support routines
; written by Paul Edwards
; released to the public domain

.386p
.model flat

.code


extrn ***@8:ptr
public _CreateDirectoryA
_CreateDirectoryA:
push 8[esp]
push 8[esp]
call ***@8
ret
ret


end
muta...@gmail.com
2023-05-12 19:15:34 UTC
Permalink
Not sure if I've mentioned before, but there's a genuine
public domain partly masm-compatible assembler called
as86. And while masm accepted that previous code, as86
requires this variation that masm also supports.

And now SubC can use Windows functions! :-)

BFN. Paul.



.386p
.model flat

.code


extrn ***@8:ptr
public _CreateDirectoryA
_CreateDirectoryA:
push 8[esp]
push 8[esp]
call [***@8]
ret
ret


end

Loading...