Home › Forums › C Programming › Using the interrupts in c language
- This topic has 3 replies, 2 voices, and was last updated 20 years ago by
msaqib.
- AuthorPosts
- February 11, 2005 at 2:41 pm #1880
coolsoum
ParticipantUsing interrupts is really fun. The interrupts give the absoulte power to the programer. The bios routine can directly be executed. things like accesing the flopy in low leve and reading sector by sector. Reading the time from bios CMOS.
in order to execute a interrupt and get the result u need to do following steps. first define union REGS inregs,outregs pass the subroutine value through the inregs
invoke an interrupt with the int86 command and get the result in out regsthis is the procedure to run any interrupt subroutine.
- February 12, 2005 at 3:35 am #3130
msaqib
ParticipantCan you Please give some code sample, to do this.
Actually I have never beeen into this area. - February 13, 2005 at 12:15 pm #3131
coolsoum
ParticipantAs i already explained how to use intrepput routine in BIOS now here is example to get the time from the CMOS
12345678910111213141516#include<dos.h><br />#include<stdio.h><br />void main()<br />{<br />int size[10],i=0;<br />union REGS inregs,outregs;<br />inregs.h.ah=0x02;<br />int86(0x1A,&inregs,&outregs);<br />size[0]=outregs.h.ch;<br />size[1]=outregs.h.cl;<br />size[2]=outregs.h.dh;<br />size[3]=outregs.h.dl;<br />printf("n%d",size);<br />for(i=1;i<=3;i++)<br />printf(":%d",size);<br />} - February 15, 2005 at 8:39 am #3132
msaqib
ParticipantThanks for your support.
I have’t tried this code due to some business, After testing this code I will again ask for your support.
Saqib
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.