# include
# include
# include
# include
# include
void main()
{
clrscr();
union REGS regs;
int ans;
char arr[1000];
outp(0x3f2,0x1c); //Motor On
delay(200);
outp(0x3f5,0x0f); //Command Code
delay(200);
outp(0x3f5,0x00); //Command Code
delay(200);
outp(0x3f5,0x0b); //Cylinder no.
delay(200);
outp(0x3f5,0x08); //Sense Interrupt Command
delay(200);
ans=inp(0x3f5); //Reading ST0 in data register
// cout<
delay(100);
ans=inp(0x3f5); //pcn
cout<
outportb(0x12,0); /*initialization of DMA Mode*/
outportb(0x11,10); /*supplying Mode Byte*/
clrscr();
int ar=FP_OFF(arr);
int ar1=FP_SEG(arr);
printf(" %x",ar1);
regs.h.ch = (ar1)&(0x0f00);
printf(" %x",(regs.h.ch));
regs.x.ax = regs.h.ah+ar;
(regs.h.ch)++;
printf(" %x",regs.x.ax);
int z = (regs.x.ax) & (0x0f00);
cout<<""<getch();
outportb(0x04,regs.h.al);
outportb(0x04,regs.h.ah);
outportb(0x81,regs.h.ch);
outportb(0x05,1);
// dma end
outp(0x3f2,0x0c); //Motor off
return;
}
Program to make initialization of DMA Mode Through C
Labels:
Hardware leavel C Programming
Subscribe to:
Post Comments (Atom)
If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE
More Useful Topics... |
|
History Of C..
In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
My 1st Program...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}
Next Step...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");
printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");
}
No comments:
Post a Comment