I have the following code written in C:
void Insw(unsigned int port, unsigned int *buf, int count)
{
_ES = FP_SEG(buf); /* Segment of buf */
_DI = FP_OFF(buf); /* Offset of buf */
_CX = count; /* Number to read */
_DX = port; /* Port */
asm REP INSW;
}
I want to implement a similar function in PowerBasic (for Windows Version 7)
where the buffer can be located anywhere in memory. The purpose is for our
ADC board in which we have a very large FIFO that I want to read out into a
user specified memory buffer (perhaps up to 16Kwords at a time).
Do you have any example code or suggest how this could be done in PowerBasic.
Thanks!
Mike Ihm
------------------
Apex Embedded Systems
www.apexembedded.net
void Insw(unsigned int port, unsigned int *buf, int count)
{
_ES = FP_SEG(buf); /* Segment of buf */
_DI = FP_OFF(buf); /* Offset of buf */
_CX = count; /* Number to read */
_DX = port; /* Port */
asm REP INSW;
}
I want to implement a similar function in PowerBasic (for Windows Version 7)
where the buffer can be located anywhere in memory. The purpose is for our
ADC board in which we have a very large FIFO that I want to read out into a
user specified memory buffer (perhaps up to 16Kwords at a time).
Do you have any example code or suggest how this could be done in PowerBasic.
Thanks!
Mike Ihm
------------------
Apex Embedded Systems
www.apexembedded.net
Comment