funniest
April 7th, 2002, 05:59 PM
I'm trying to import an old program to VC++, this program has some functions to deal with RS232 and ports. The program has a function called init8250, and this is a piece of code from it:
chan = 0;
unsigned far *prs232_base = ( unsigned far * )0x400000L;
register unsigned port;
port50[ chan ] = port = *( prs232_base + chan );
...
outpfunc( port + MCR50, 0 ); /* MCR50 = 5*/
When I run it, I got the "Exception Privileged.." error, which I know it's about the access permision for com port on Win2K.. So, I'm using an additional tool to permit the port access, and I still got that error.
When I display the "port" variable above, it is: 9460301 (I think this number is too big and it generates the error).
So, can someone please tell me why this old piece of code is like that and what should I change it to work for the new compilers like VC++.
Thanks in advance.
chan = 0;
unsigned far *prs232_base = ( unsigned far * )0x400000L;
register unsigned port;
port50[ chan ] = port = *( prs232_base + chan );
...
outpfunc( port + MCR50, 0 ); /* MCR50 = 5*/
When I run it, I got the "Exception Privileged.." error, which I know it's about the access permision for com port on Win2K.. So, I'm using an additional tool to permit the port access, and I still got that error.
When I display the "port" variable above, it is: 9460301 (I think this number is too big and it generates the error).
So, can someone please tell me why this old piece of code is like that and what should I change it to work for the new compilers like VC++.
Thanks in advance.