How to map a subroutine to a particular address in rom?

D

Dinesh P

Hello ,
I am writing a interrupt service routine for a vectored
interrupt(vectored address 0x0056). Now I want to load this subroutine to
start from the address(0x0056).

Please help me out

Regards,
Dinesh
 
G

Gordon Burditt

I am writing a interrupt service routine for a vectored
interrupt(vectored address 0x0056). Now I want to load this subroutine to
start from the address(0x0056).

This is off-topic for comp.lang.c. I suggest looking at the manuals
that came with your linker. Oh, yes, you didn't say what compiler
that was or what CPU is involved.

Are you sure you want that? Isn't the *VECTOR* at location 0x0056,
and you want the subroutine to be a bit longer than the size of a
vector?

A common thing to do on PCs is to have an initialization routine
which will "hook" vectors by setting the vector to the address of
a given function, and possibly save the old vector in case the new
routine wants to call the old one. Of course, this doesn't work
if everything is in ROM.

Sometimes it's worth going to assembly language, which may allow
you to define data located at an absolute address.
 
J

Jack Klein

Hello ,
I am writing a interrupt service routine for a vectored
interrupt(vectored address 0x0056). Now I want to load this subroutine to
start from the address(0x0056).

The concepts of interrupt service routines, vectored addresses, or ROM
do not exist in the C language, which is 100% hardware independent.

The place to ask this question is But do not
dare post it there without supplying a lot more information, at the
very least:

1. The microprocessor or microcontroller.

2. The development tools (compiler, assembler, linker, etc.), both
the brand and version.

3. Any other pertinent information about your development
environment.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top