ASDA-B3 MODBUS Communication outportb (PORT+BRDH,0x00); outportb (PORT+LCR,0x06); /* set prorocol = 1AH, = 0AH = 07H = 1BH = 0BH */ for ( I = 0; I 9 while ( !(inportb(PORT+LSR) & 0x20) ); /* wait until THR empty */ outportb (PORT+THR,tdat[I]); /* send data to THR */ } I = 0; while ( !kbhit() ) { if ( inportb(PORT+LSR)&0x01 ) { /* b0==1, data is read */ rdat[I++] = inportb(PORT+RDR); /* read data from RDR */ } } } 9-13