Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

nwebie qn - outportb

1 view
Skip to first unread message

Wolfgang Kaifler

unread,
Oct 23, 1999, 3:00:00 AM10/23/99
to
I want to put something binary to the printer port, so i found a simle code
but that don't work. I only get the error : "Call to undefined function"
I work with Borland C++ 5.0.
Can anybody help me?
Thanks,
Wolfgang


#include <stdio.h>
#include <dos.h>
#include <conio.h>

int main (void)
{
clrscr();
outportb(0x378, 0xff);
getch();
}


Sergey Mizin

unread,
Oct 27, 1999, 3:00:00 AM10/27/99
to
All is clear from your source: you tried to call 16-bit library function in
32-bit Windows target model. There this function is really absent. There 2 ways
for solving this problem. Your choice depends on your real needs:
1) you make for your own learning-> then you should for such instruction in
Win32 only Assembler directives:
outportb(0x378, 0xff); -> _asm { out 0x378, 0xff},
In this case you need to have Borland 32-TASM - tasm32.exe file in your BC5/BIN
directory, because TASM 32 is standalone tool - not included in BCxxx
2) you really need to print something -> then you should use strictly Win32 API
printer fuction - trust me - you did not to write 32-bit Windows driver good
for limited time.
With best regards, Sergey Mizin, s.v....@chat.ru


Wolfgang Kaifler пишет:

Boba

unread,
Nov 11, 1999, 3:00:00 AM11/11/99
to
Sergey Mizin wrote:
> All is clear from your source: you tried to call 16-bit library function in
> 32-bit Windows target model.
Sergey, could you, please, tell me how you were able to figure out from
Wolfgang's code the target type? Thanx. Boba

Sergey Mizin

unread,
Dec 2, 1999, 3:00:00 AM12/2/99
to
It's very easy: in Win16 API function outportb exists, in Win32 API doesn't exist
- even in BC online help special remark "Portability" is.
Sergey
Boba пишет:
vcard.vcf
0 new messages