473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

about the #pragma

Hi, guys,

I am confused with the preprocessor instruction #pragma.

What does the #pragma mean?
and what does this mean as follow?

====================
#pragma intterupt Timer
====================

any reply is appreciated.

Jun 8 '06 #1
8 7849
"rw******@gmail.com" wrote:

Hi, guys,

I am confused with the preprocessor instruction #pragma.

What does the #pragma mean?
and what does this mean as follow?

====================
#pragma intterupt Timer
====================

[...]

Pragmas are, by definition, implementation defined. They basically
say "hey, compiler, do something special here". What that "something"
is is entirely up to the compiler.

As to what your particular pragma does, you would have to check the
documentation for the particular compiler that was used to compile
the code.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Jun 8 '06 #2
"rw******@gmail.com" <rw******@gmail.com> writes:
Hi, guys,

I am confused with the preprocessor instruction #pragma.

What does the #pragma mean?
and what does this mean as follow?

====================
#pragma intterupt Timer
====================

any reply is appreciated.


You posted the same article twice. Google seems to encourage this for
some reason.

A #pragma directive "causes the implementation to behave in an
implementation-defined manner" (except for a few of the form
"#pragma STDC ..."that are defined by C99). You'll have to consult
the documentation for your compiler to find out what "#pragma interrupt"
means.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 8 '06 #3
Keith Thompson <ks***@mib.org> wrote:
"rw******@gmail.com" <rw******@gmail.com> writes:
What does the #pragma mean?
and what does this mean as follow?
====================
#pragma intterupt Timer
====================


A #pragma directive "causes the implementation to behave in an
implementation-defined manner" (except for a few of the form
"#pragma STDC ..."that are defined by C99). You'll have to consult
the documentation for your compiler to find out what "#pragma interrupt"
means.


A function called as an ISR (interrupt service routine) may be called
at any time, in the middle of the execution of other functions.
To ensure that the original interrupted code can continue executing,
in most cases the interrupt pragma modifies the entry/exit code the
compiler will generate for a function, making it save (and restore on
exit) additional information about the processor state. It could save
more registers, floating point processor state, temporarily disable
interrupts, etc.
The details will change from system to system. As Keith wrote, only
the documentation for your compiler/environment will provide you with
more information.
Jun 8 '06 #4
rw******@gmail.com wrote:
Hi, guys,

I am confused with the preprocessor instruction #pragma.

What does the #pragma mean?
and what does this mean as follow?

====================
#pragma intterupt Timer
====================

any reply is appreciated.

Except for a few pragmas defined in the 1999 standard, almost anything
used with the #pragma directive is platform-specific and questions
should be directed to a newsgroup dedicated to that platform. I don't
know what compiler you are using, but a newsgroup for it is the place
to ask.

Brian
Jun 8 '06 #5
thank you all very much,
after read these, I have got the main idea of what the #pragma means.

thanks a lot!

Rwen.

Jun 9 '06 #6
rw******@gmail.com <rw******@gmail.com> wrote:
thank you all very much,
after read these, I have got the main idea of what the #pragma means.


Please quote some context when replying.

Thank you.

--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
Jun 9 '06 #7
Keith Thompson wrote:
"rw******@gmail.com" <rw******@gmail.com> writes:
Hi, guys,

I am confused with the preprocessor instruction #pragma.

What does the #pragma mean?
and what does this mean as follow?

====================
#pragma intterupt Timer
====================

any reply is appreciated.


You posted the same article twice. Google seems to encourage this for some reason.


Well, my posts to this group are currently over 400 and I've yet to
make a double/multiple post. AFAICS, it's not Google's fault, rather
it's the poster. Though currently I use an ADSL connection, I've used a
56K dial-up modem for many years. Often, it's so slow, that you might
get tempted to press the 'reply' button twice, thinking the site has
stalled.

Of course, there're also people who post multiple times, simply to get
a rise out the group. They may come from a web forum background, which
are much more lax on posting discipline.

Jun 10 '06 #8
santosh wrote:
Keith Thompson wrote:

You posted the same article twice. Google seems to encourage this
for some reason.


Well, my posts to this group are currently over 400 and I've yet to
make a double/multiple post. AFAICS, it's not Google's fault, rather
it's the poster.


This is not true, it's just that you've been lucky not to encounter the
problem. Sometimes Google will report that there was an error and the
message couldn't be sent, but in fact it has. It happens. It happened
to me when I used Google last year.

Brian
--
If televison's a babysitter, the Internet is a drunk librarian who
won't shut up.
-- Dorothy Gambrell (http://catandgirl.com)
Jun 10 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Shri | last post by:
Can anybody tell me where i can find a detailed document on #pragma .... --shri
18
by: Peter Smithson | last post by:
Hi, I've read this page - http://devrsrc1.external.hp.com/STK/impacts/i634.html but don't understand it. Here's the text - "Non-standard usage of setjmp() and longjmp() could result in...
1
by: Gustavo L. Fabro | last post by:
Greetings! Going directly to the point: myclass.h: //-------------------------------------- #pragma managed //Forward declaration
0
by: 42601551 | last post by:
in Jeff Partch's thread http://groups.google.com/group/microsoft.public.vc.language/browse_thread/thread/b9468ebbf7927da8/a901653d04ad774a%23a901653d04ad774a?sa=X&oi=groupsr&start=1&num=3 says a...
15
by: muttaa | last post by:
Hello all, I'm a beginner in C...May i like to know the difference between a #pragma and a #define.... Also,yet i'm unclear what a pragma is all about as i can find topics on it only in...
4
by: mpaine | last post by:
I just converted lots of ASP to ASP.NET (using ASP2ASPX) and noticed a drop in rendering speed. For example, one ASP page takes 0.0313s to be generated while the ASP.NET version takes 0.4842s. ...
26
by: Rick | last post by:
I'm told that "#pragma once" has made it into the ISO standard for either C or C++. I can't find any reference to that anywhere. If it's true, do any of you have a reference I can use? ...
2
by: aleemakhtar1 | last post by:
wat is use of pragma directive in embedded sys ??
0
debasisdas
by: debasisdas | last post by:
PRAGMA:-Signifies that the statement is a pragma (compiler directive). Pragmas are processed at compile time, not at run time. They pass information to the compiler. A pragma is an instruction to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.