Computing.Net > Forums > Programming > Using far pointers in Borland C++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Using far pointers in Borland C++

Reply to Message Icon

Name: Sonia
Date: December 2, 2002 at 05:43:31 Pacific
OS: Win 2000
CPU/Ram: P4
Comment:

Hi! I've got this snippet of code that I'm using on a Borland C++ V5 compiler. But I get the error : E2141 Declaration syntax error. Help please!
********************************************
static unsigned char far *servicevec = MK_FP(ROMBIOSIDSEG, (ROMBIOSIDOFF + offsetof(rombiosid, jmp2PublicServices))) ;
asm {
mov bx,word ptr parmptr[0] mov cx,word ptr parmptr[2] call dword ptr [servicevec]
cld
}
return (((((pfuncshdr far *)parmptr) -> errorCode) != E_PUBSRVCERRNONE) ? -1 : 0);
********************************************




Sponsored Link
Ads by Google

Response Number 1
Name: Jeff J
Date: December 2, 2002 at 19:48:42 Pacific
Reply:

That's 16-bit C code and assembler, and you're using a 32-bit compiler. I you are just asking about the far pointer declarations, just delete the "far" words. With 32-bit pointers, near and far are not used. I cannot guarantee the rest will work, though.


0

Response Number 2
Name: Sonia
Date: December 3, 2002 at 02:44:21 Pacific
Reply:

Thanks a lot for your help! I removed the "far" words but still get an error with this MK_FP macro. I know MK_FP builds a far pointer value from a segment and an offset. But now that I don't require to build this far pointer, how do I implement it directly??

This is what I get after compilation!

Warning: Call to function 'MK_FP' with no prototype in funciton pubservicecall

Warning: Nonportable pointer conversion in function pubservicecall

Turbo Incremental Link 5.00 blah blah
Error: Unresolved external 'MK_FP' referenced from test.obj.



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Using far pointers in Borland C++

how to use Dos commands in Borlad C www.computing.net/answers/programming/how-to-use-dos-commands-in-borlad-c/4175.html

making project in Borland C++ www.computing.net/answers/programming/making-project-in-borland-c/10494.html

.exe in Borland C 5 without cc3250. www.computing.net/answers/programming/exe-in-borland-c-5-without-cc3250/6623.html