News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Proto typing with JWASM

Started by Gunther, November 19, 2021, 06:15:58 PM

Previous topic - Next topic

Gunther

I'm currently working on an embedded DOS system. The processor is an 80386 without FPU. My floating point emulation is not finished yet, but essential parts are already working.
One challenge is that everything should run in 32 bit protected mode. I use JWASM for DOS and Japhet's rock solid HX DOS Extender. This is working very well so far.

I've a near procedure with the following stack layout:

[ebp+8]  = parameter1
[ebp+12] = parameter2


I call the procedure in that way:

push    parameter2
push    parameter1
call    procedure


I think that should also work with invoke, but it needs some proto typing. Has anyone ever done this with JWASM for DOS? Any help is appreciated. Thanks in advance.
You have to know the facts before you can distort them.

_japheth

>Has anyone ever done this with JWASM for DOS?

Yes - there's no special requirement for DOS.

However, you need to know who's to "clean" the stack AFTER the call:


xxx proto c :dword, :dword  ; the caller is supposed to clean
xxx proto stdcall :dword, :dword ; the proc itself has to do it - sam as in win32

Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

Gunther

Thanks for your help, Andreas. Can you please give a small example (function definition, prototyping, calling) - let's say STDCALL? In the folder Samples I did not find a DOS example for that.
Thank you very much.

You have to know the facts before you can distort them.