c++.dos.32-bits - Linking with external asm
- Gisle Vanem (41/41) Jul 09 2002 I'm having problems linking with external assembly modules. It looks as ...
- Gisle Vanem (3/8) Jul 09 2002 Bummer, I changed this to ".MODEL SMALL,C" and everything works now.
- Walter (4/11) Jul 09 2002 if
I'm having problems linking with external assembly modules. It looks as if external assembly routines are never called despite being called from C. I'm using the latest compiler 8.29.5 and Borland's tasm v.3.2. Here is a minimal 32-bit program that illustrates the problem. C-code:-(test.c)--------------------------------------------------------------------------------------- #include <stdio.h> int main (void) { extern int val; extern void foo (int); val = 10; printf ("val = %d\n", val); foo (11); printf ("val = %d\n", val); return (0); } asm-code---(test1.asm)-------------------------------------------------------------------------- .386 .MODEL FLAT,C .DATA public val val dd 0 .CODE public foo foo: mov eax, [esp+4] mov val, eax ret end bat-file ---(test.bat)----------------------------------------------------------------------------------- tasm /mx test1.asm dmc -g -mx test.c test1.obj x32.lib ------------------------- the printout is: val = 10 val = 10 But I would expect val = 10 val = 11 What is the problem? Gisle V.
Jul 09 2002
"Gisle Vanem" <giva bgnett.no> wrote in message news:...I'm having problems linking with external assembly modules. It looks as if external assembly routines are never called despite being called from C. I'm using the latest compiler 8.29.5 and Borland's tasm v.3.2. .. .MODEL FLAT,CBummer, I changed this to ".MODEL SMALL,C" and everything works now. Gisle V.
Jul 09 2002
"Gisle Vanem" <giva bgnett.no> wrote in message news:ageqv1$2so8$1 digitaldaemon.com..."Gisle Vanem" <giva bgnett.no> wrote in message news:...ifI'm having problems linking with external assembly modules. It looks asThe DOSX memory model has 3 separate segments, and so is not flat.external assembly routines are never called despite being called from C. I'm using the latest compiler 8.29.5 and Borland's tasm v.3.2. .. .MODEL FLAT,CBummer, I changed this to ".MODEL SMALL,C" and everything works now.
Jul 09 2002