#Include #Include

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
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();
}
}

#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 */
char SC, ASCII, Status;
for(i=0;i<7;i++){
result = inportb(port);
asm{
mov ah,00
int 16h
mov ASCII,al
mov SC,ah
mov ah,02
int 16h
mov Status,al
}
printf("\n%x %c %x\n", SC, ASCII, Status);
}
getch();
}

You might also like