





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






void sendchar (char ch, int pno) { _DX = pno; _AH = 1; _AL = ch; geninterrupt (0x14); } unsigned int getcomstatus (int pno) { unsigned int temp; _DX = pno; _AH = 03; geninterrupt (0x14); ((char)(&temp)) = _AL; (((char)(&temp)) + 1) = _AH; return temp; }
void main() { while(1) { i = getcomstatus (0); if ((((((char)(&i)) + 1)&0x20) == 0x20) && (kbhit())) { ch1 = getche(); sendchar (ch1, 0); } if (((((char)(&i)) +1) & 0x01) == 0x01) { ch2 = receivechar (0); putch (ch2); } if ((ch1 == 27) || (ch2 ==27)) break; } }
unsigned int far com=(unsigned int far) 0x00400000; void main () { char ch = 0; int i = 1;int j= 1; char ch2='A'; initialize( com); SelfTestOn(com); clrscr(); while (ch!=27) { if (i==80) { j++; i=0; }
if (j==13) j=0;
gotoxy(i,j); ch=getche(); writechar(ch,com); ch2=readchar(com); gotoxy(i,j+14); putch(ch2); i++; } SelfTestOff (com); }
hello how r u? whats new about systems programming?
hello how r u? whats new about systems programming?
unsigned int far com=(unsigned int far) 0x00400000; unsigned char far scr=(unsigned char far) 0xB8000000; int i =0,j=0;char ch;int k; void interrupt (oldint)(); void interrupt newint(); void main () { initialize(com); SelfTestOn(com); oldint = getvect(0x0c); setvect(0x0c,newint); outport((com)+1,1); outport(0x21,inport(0x21)&0xEF); keep(0,1000); }
void interrupt newint() { ch= readchar(com); if (i==80) { j++; i=0; } if (j==13) j=0; k = i2+(j+14)80*2; *(scr+k)=ch; i++; outport(0x20,0x20); }
unsigned char far *scr= (unsigned char far *)0xB8000000;