Add to Favorites    Make Home Page 1290 Online  
 Language Categories  
 Our Services  

Home » C Home » Hardware Interaction Through C Home » Program for implementing all the display functions.

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Program for implementing all the display functions.
Description
Category C » Hardware Interaction Through C
Hits 368803
Code Select and Copy the Code
#include<stdio.h> #include<conio.h> #include<dos.h> #include<process.h> #include<iostream.h> # include<ctype.h> main() { int choice; char cont='y'; int a1q1(),a1q2(),a1q3(),a1q4(),a1q5(),a1q6(),a1q7(),a1q8(),a1q9(),a1q10(); clrscr(); gotoxy(24,3); while(cont=='y') { clrscr(); printf(" ---------------------------------------"); printf(" |1.Get current Display Mode. | "); printf(" |2.Character with chosen attribute. | "); printf(" |3. Scroll the window up. | "); printf(" |4.Scroll the window down. | "); printf(" |5.Read the character & it's attribute| "); printf(" |6.Positioning the Cursor . | "); printf(" |7.Selecting the Video Mode. | "); printf(" |8.Selecting the type of the Cursor. | "); printf(" |9.Reading the Cursor position | "); printf(" |10.Select the page of the text. | "); printf(" |11. Exit. | "); printf(" ---------------------------------------"); printf(" Enter your choice [ ]"); gotoxy(37,16); scanf("%d",&choice); switch(choice) { case 1: a1q1(); break; case 2: a1q2(); break; case 3: a1q3(); break; case 4: a1q4(); break; case 5: a1q5(); break; case 6: a1q6(); break; case 7: a1q7(); break; case 8: a1q8(); break; case 9: a1q9(); break; case 10: a1q10(); break; case 11: exit(0); } gotoxy(3,21); printf(" Do you want to continue[y/n]: [ ]"); gotoxy(32,22); cin>>cont; } getch(); } /****************************************************************************/ a1q1() { clrscr(); union REGS regs; regs.h.ah=0x0f; int86(0x10,®s,®s); int noofcol; int displaymode; int activetextpage; noofcol = regs.h.ah; displaymode = regs.h.al; activetextpage = regs.h.bh; printf(" "); printf(" No. of Columns on Screen - %d ",noofcol); printf(" Display Mode - %d ",displaymode); printf(" The Active Text Page - %d ",activetextpage); return(0); } /****************************************************************************/ a1q2() { clrscr(); union REGS regs; regs.h.ah = 2; regs.h.dh = 0; regs.h.dl = 0; regs.h.bh = 0; int86(0x10,®s,®s); getch(); regs.h.ah = 9; regs.h.bh = 0; regs.h.al = 65; regs.h.dl = 8; regs.h.cl = 2; regs.h.ch = 0; int86(0x10,®s,®s); return(0); } /****************************************************************************/ a1q3() { clrscr(); union REGS regs; regs.h.ah = 6; regs.h.al = 5; regs.h.bh = 8; regs.h.ch = 0; regs.h.cl = 0; regs.h.dh = 50; regs.h.dl = 50; int86(0x10,®s,®s); return(0); } /****************************************************************************/ a1q4() { clrscr(); union REGS regs; regs.h.ah = 7; regs.h.al = 5; regs.h.bh = 8; regs.h.ch = 0; regs.h.cl = 0; regs.h.dh = 50; regs.h.dl = 50; int86(0x10,®s,®s); return(0); } /****************************************************************************/ a1q5() { clrscr(); int x,y; union REGS regs; regs.h.ah = 2; regs.h.dh = 0; regs.h.dl = 0; regs.h.bh = 0; int86(0x10,®s,®s); getch(); regs.h.ah = 8; regs.h.bh = 0; int86(0x10,®s,®s); x = regs.h.al; y = regs.h.ah; clrscr(); printf("Ascii Character is - %d ",x); printf("The attribute of Character is - %d ",y); return(0); } /****************************************************************************/ a1q6() { clrscr(); int x,y; union REGS regs; printf(" Enter the X-position - "); scanf("%d",&x); printf(" Enter the Y-position - "); scanf("%d",&y); regs.h.ah = 2; regs.h.bh = 0; regs.h.dh = y; regs.h.dl = x; int86(0x10,®s,®s); return(0); } /****************************************************************************/ a1q7() { clrscr(); int choice; union REGS regs; printf(" For CGA Mode(0-6)."); printf(" For Mono MOde(1)."); printf(" Select the Mode - "); scanf("%d",&choice); clrscr(); regs.h.ah = 0; /*Set cursor position*/ regs.h.al = choice; int86(0x10,®s,®s); gotoxy(40,12); printf(" HAVE A NICE DAY"); return(0); } /****************************************************************************/ a1q8() { clrscr(); int x,y; union REGS regs; printf(" Enter the starting line of the cursor(0-4) - "); scanf("%d",&x); printf(" Enter the ending line of the cursor - "); scanf("%d",&y); gotoxy(40,12); regs.h.ah = 1; regs.h.ch = x; regs.h.cl = y; int86(0x10,®s,®s); return(0); } /****************************************************************************/ a1q9() { clrscr(); union REGS regs; regs.h.ah = 3; regs.h.bh = 9; regs.h.dh = 8; regs.h.dl = 27; int86(0x10,®s,®s); printf(" The row position of cursor on selected page - %d",regs.h.ch); printf(" The column position of cursor on selected page - %d",regs.h.cl); return(0); } /****************************************************************************/ a1q10() { clrscr(); union REGS regs; regs.h.ah = 5; regs.h.bh = 6; int86(0x10,®s,®s); return(0); } /****************************************************************************/

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi ¦Õ¤ ?¤Ð Ãß??ÝÐÝ
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=99


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review