You are on page 1of 3

#include <stdio.

h>
#include <dos.h>
#include <conio.h>
#include <iostream.h>
void main(void)
{
unsigned char result;
int port =0x60, i;
/* serial port 1 */
for(i=0;i<5;i++){
result = inportb(port);
printf("%x = 0x%X\n", port, result);
getch();
}
}

#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include <iostream.h>
void main(void)
{ clrscr();
unsigned char result;
int port =0x60, i;
/* serial port 1 */
for(i=0;i<7;i++){
result = inportb(port);
if(result == 0x1E){
printf("\n %x\n0x%X\n A\n", port, result);
}else if(result == 0x30){
printf("\n %x\n0x%X\n B\n", port, result);
}else if(result == 0x2E){
printf("\n %x\n0x%X\n C\n", port, result);
}else if(result == 0x20){
printf("\n %x\n0x%X\n D\n", port, result);
}else if(result == 0x12){
printf("\n %x\n0x%X\n E\n", port, result);
}else if(result == 0x21){
printf("\n %x\n0x%X\n F\n", port, result);
}
getch();
}
}

/* serial port 1 */ char SC.h> #include <conio. ASCII.al } printf("\n%x %c %x\n". for(i=0.#include <stdio. unsigned char result. ASCII.ah mov ah.i<7.h> #include <dos.h> #include <iostream.al mov SC. int port =0x60. Status. Status).h> void main(void) { clrscr().i++){ result = inportb(port).02 int 16h mov Status. asm{ mov ah.00 int 16h mov ASCII. i. } . SC. } getch().