![]() |
| | #1 |
| Registered User Join Date: Jun 2007
Posts: 9
| HELP: assembly & C linking woes.... Linker Warning: DOSSEG directive ignored in module asm.asm Linker Error: Undefined symbol _ASMClsV in module main.c Linker Error: Undefined symbol VADDR in module asm.asm In my asm.asm file I've got: DOSSEG .MODEL huge .386 .DATA EXTRN vaddr : word; .CODE PUBLIC ASMClsV ASMClsV PROC Near ;bla bla ASMClsV EndP In main.c I've got: extern void ASMClsV(); Am trying to link using Borland C++ 4.5 since my source files are all 16-bit. I successfully linked the same asm.asm file with a 16-bit pascal object using Turbo Pascal 7.0. Why can't I link using Borland C++ 4.5 to a 16-bit C file? Also, I used Microsoft Macro Assembler 5. Should I use Turbo Assembler? |
| andrewwan1980 is offline | |
| | #2 |
| Registered User Join Date: Jun 2007
Posts: 9
| Excellent! I managed to get the C & assembly files recognise each others variables & functions. Thanks to Scorpions4ever for telling me about C mangles variable & function names by prefixing an underscore in front. Now I get a different problem: Linker Error: Fixup overflow at _TEXT:0002, target = vaddr in module asm.asm ... It appears there's a linker error line for each of my variables surrounded by [ ], eg. ASMClsV PROC Near mov es, [vaddr] ; bla bla ASMClsV EndP What does this Fixup overflow mean? |
| andrewwan1980 is offline | |
| | #3 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,665
| |
| Salem is offline | |
| | #4 |
| Registered User Join Date: Jun 2007
Posts: 9
| I read the cool document about Fixup Overflow at http://vmlinux.org/~jakov/community....com/15961.html but still unsuccessful. I fixed this problem myself by moving the variables from the C file to assembly file. C file: extern unsigned short vaddr; //Pascal word type extern long AsmY; //Pascal integer type extern void *ScrOfsPtr; //Pascal pointer type Assembly file: .DATA PUBLIC vaddr, AsmY, ScrOfsPtr vaddr label word AsmY label word ScrOfsPtr label dword Now I don't know why I need the label before word/dword. What does that mean? And is that correct corresponding to the C & Pascal types? |
| andrewwan1980 is offline | |
| | #5 |
| Registered User Join Date: Oct 2001
Posts: 2,936
| >And is that correct corresponding to the C & Pascal types? >AsmY label word This one should probably be a dword: Code: AsmY label dword
__________________ http://www.freechess.org |
| swoopy is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| linking to assembly | xixpsychoxix | C Programming | 21 | 07-16-2008 03:51 PM |
| Linking C++ and Assembly | Warlax | C++ Programming | 6 | 10-19-2007 04:33 PM |
| True ASM vs. Fake ASM ???? | DavidP | A Brief History of Cprogramming.com | 7 | 04-02-2003 04:28 AM |
| Linking an assembly routine into a GCC project | huh | C++ Programming | 3 | 11-21-2002 03:14 PM |
| C,C++,Perl,Java | brusli | C Programming | 9 | 12-31-2001 03:35 AM |