writing a interrupt program in 89c51

Thread Starter

Abby

Joined Jan 20, 2008
2
i want to write a program to handle an external interrupt at int0

for tht i must write a program a location 0013h

how can i do this

i using keil for programming
 

saha

Joined Jun 1, 2006
53
Hi,

check this file a simple program copy and paste in keil save as .asm file add file to project . You should get it.

regards,
saha
 

Attachments

Papabravo

Joined Feb 24, 2006
21,225
You should look in the compiler documentation for an "interrupt" keyword. This keyword will allow you to select which vector to use and more importantly tell the compiler to use an RETI instruction to return rather than the usual retrurn instruction.

This is one of those "extensions" to the C language whose implementation is definitely non-standard. Whadya gonna do! -- Eh? Fageddaboudit!
 

jvjtech

Joined Jan 26, 2008
23
It has been a while since I worked with Keil tools. I took a look at the example suggested by Nanovate and see the "interrupt 0" qualifier on the ISR. I assume that the file REGS52.h maps this ISR to location 0013h as mentioned by Abby. A good source of reference information is the sample code available on the Keil and Atmel websites but one has to be aware of tool (compiler/assembler) specific twists. Regards.
 
Top