| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Watcom16 v9.5/MASM6 PDD? |
TT> Anyway, does anyone have a sample 16-bit PDD that compiles with Watcom's
TT> 16-bit C/C++ version 9.5 compiler and MASM 6.0? Just a skeleton would
TT> be great.
From one of the customers using the D.U.D.E......
Subject: Watcom C/C++ 9.5 for DD
I just wanted to follow up on using the Watcom C/C++ 9.5 compiler
to write OS/2 device drivers. I have got it working with both the
sample code from 'Writing OS/2 Device Drivers in C' and with
the DHCALLS.LIB (?) library from the DDK (v1.0) and thought I'd
pass this information back should anyone else ask.
1) Instead of _acrtused, the Watcom C runtime library looks for
cstart_. This should be declared as public in the .asm file.
2) Watcom provides a special pragma, cdecl, for specifying the
calling convention used by MSC. They also provide a _Cdecl
keyword, as in 'word _Cdecl main(...);'. The runtime library
always wants to look for the main() function, however, and
it looks for main_ (per Watcom calling conventions) instead of
_main (MSC) at link time. I defined a special pragma which
follows the MS calling convention but used the Watcom naming
convention :
#pragma aux MSC_Compat "*_"
parm caller []
value struct float struct routine [ax]
modify [ax bx cx dx es]
which can be used to define main thusly :
#pragma aux (MSC_Compat) main;
3) The compiler flag -Zu must be used for SS!=DS, etc. I believe this
is equilavent to the MS -Aw flag.
Anyways, I just wanted to pass this along if anyone else should ask
about the Watcom compiler. It does seem to produce better code
than the MS package, and is much better supported i.e. they still
support it!
--- Maximus/2 2.01
* Origin: Beer bellies = great waist. (905)858-8488 (1:259/414)SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 413 430 SEEN-BY: 711/807 808 809 934 942 712/353 623 713/888 800/1 @PATH: 259/414 400 99 98 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.