Message-ID: <35ED2E1C.769A6BCE@hrz.uni-bielefeld.de> Date: Wed, 02 Sep 1998 13:38:05 +0200 From: oliver kuhlmann MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Need help for asm Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: dhcp6-239.uni-bielefeld.de Lines: 45 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, I assembled a little board with an 8bit-ADC. The ADC runs at 200KHz by its own oscillator. When valid data appear on its output a flag goes high for about 2 µS, then the ADC starts a new conversion. To get the data by LPT1 I wrote some code like following. Unfortunately it runs too slow on my 486DX40, to get the data on a rate of 200KHz. Perhaps asm code will be fast enough. But how to code the loop and its code inside by asm? Olli ... #define LPT1 0x3BC #define MAXSAMPLES 1000000 char *sample; void main (void) { sample = new char [1000000]; disable(); / disable all int outport(LPT1 +2, 0x20); / tristates D0-D7 LPT1 / unfortunately the loop is to slow for (int i = 0; i < MAXSAMPLES; i++) { while (! (inportb (LPT1 + 1) & 0x80)); / wait until S7 on LPT1 (busy) goes up *sample[ i ] = inportb (LPT1); / get valid data while ( inportb (LPT1 +1) & 0x80); / wait until S7 goes down (new AD-conversion) } enable(); }