W/95, VC 5.0 - Direct Port I/O 
Author Message
 W/95, VC 5.0 - Direct Port I/O

Hello,

I looking for sites or code examples for using inline assembly.  I have
a custom adapter which we've been using in DOS world applications for
some time.  The adapter has port I/O functions and no IRQ functions.  I
want to rewrite the small sections of assembly code to work under Win/95
with the VC++ 5.0 envirnment.

I haven't kept up with the MS VC implementation, Unix is my playground,
so please forgive my ignorance. VC++5.0 has already pointed out that I
need to get a better understanding of the memory model differances
between a DOS and Win/95 application.  May things I used when I wrote
this, long long ago in computer terms, don't apply to this environment,
so help and guidance is appreciated.

 Given the specifices of this device four ports which fall outside of
the normal I/O mapping, I want to do direct port I/O.  This may not be
standard, but the adapter isn't exactly standard.  The routines today
accept a port address and command string which is then passed to the
adapter using inline assembly, written in C/C++7.0. I know that I could
write a VxD to handle the adapter, however, given its single threaded
operation a VxD doesn't make sense to me, maybe some can point out the
error in my thinking.

Examples would be a great help.

Thank you for your time

dim



Mon, 27 Sep 1999 03:00:00 GMT  
 W/95, VC 5.0 - Direct Port I/O

Quote:

>Hello,

>I looking for sites or code examples for using inline assembly.  I have
>a custom adapter which we've been using in DOS world applications for
>some time.  The adapter has port I/O functions and no IRQ functions.  I
>want to rewrite the small sections of assembly code to work under Win/95
>with the VC++ 5.0 envirnment.

The following should work under Win95:
unsigned char inportb(unsigned short port)
{
  unsigned char value;

  _asm {
    mov dx, port
    xor ax,ax
    in al, dx
    mov value,al
    }
   return(value);

Quote:
}

void outportb(unsigned short port, char value)
{
  _asm {
    mov dx, port
    xor ax,ax
    mov al, value
    out dx, al
    }
  return;
Quote:
}



Sat, 02 Oct 1999 03:00:00 GMT  
 W/95, VC 5.0 - Direct Port I/O

Quote:
> >I looking for sites or code examples for using inline assembly.  I have
> >a custom adapter which we've been using in DOS world applications for
> >some time.  The adapter has port I/O functions and no IRQ functions.  I
> >want to rewrite the small sections of assembly code to work under Win/95
> >with the VC++ 5.0 envirnment.

Don't even think about expecting it to work under NT!!

        Phillip Davis



Sun, 03 Oct 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Win98 port from Win 95/VC++ 5.0?

2. Help: How to call Bios Interrupt 13H using VC 5.0 in Window 95

3. How to port VC 5.0 -> VC 4.0

4. MSVC++ 5.0/Direct X 5.0?

5. API/User in domain for 95 OS

6. Problems with MCI-Timer or serial ports in VC 5.0

7. Windows '95 Problem using 2 Com Ports

8. I/O Port Read and Write under 95 and NT

9. Windows 95 comms under BC++ 5.0

10. Write/Read To COM port on WIndows 95/NT

11. Write/Read To COM port on WIndows 95/NT

12. comm port under NT and 95

 

 
Powered by phpBB® Forum Software