473,434 Members | 1,430 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,434 software developers and data experts.

#pragma directive

#pragma CODE_SEG NON_BANKED
unsigned char read8bSRAMlinear(unsigned long addr)
{
static unsigned char storedPage;
static unsigned char calcPage;
static unsigned int offset;
static unsigned char data;
calcPage = (unsigned char) (addr / 0x4000); // 0x4000 = page
size
offset = ((addr % 0x4000) + 0x8000);

storedPage = PPAGE;
PPAGE = calcPage;
data = *((unsigned char *)(offset));
PPAGE = storedPage;
return data;
}

void write8bSRAMlinear(unsigned long addr,unsigned char data)
{
static unsigned char storedPage;
static unsigned char calcPage;
static unsigned int offset;

calcPage = (unsigned char) (addr / 0x4000); // 0x4000 = page
size
offset = ((addr % 0x4000) + 0x8000);

storedPage = PPAGE;
PPAGE = calcPage;
*((unsigned char *)(offset)) = data;
PPAGE = storedPage;
}
//------------------------------------------------------------------------------
#pragma CODE_SEG DEFAULT // place to default paged memory
void writemain(void)
{
unsigned long address;
unsigned char data;

//--- NORMAL EXPANDED WIDE ---------------
//PEAR = PEAR_RDWE_MASK | PEAR_LSTRE_MASK; // enable R/W & LSTRB
signal on port E (see S12MEBIV3.pdf)
//MODE |= (MODE_MODA_MASK+MODE_MODB_MASK+MODE_EMK_MASK); //
switch to Expanded Narrow mode emulate port K

//DDRS = 0xFF; // output port
//DDRM = 0xFF; // output port

data = 0;
for(;;)
{
// linear writting to external memory
for(address=0;address<MAX_ADDRESS;address++)
{
write8bSRAMlinear(address, data); // write data to
external RAM
}
// linear reading from external memory
for(address=0;address<MAX_ADDRESS;address++)
{
PTM = read8bSRAMlinear(address); // read data from
external RAM and put them to the port M
}
}

}
//------------------------------------------------------------------------------
can someone explain the working of this #pragma whther it substitutes
or is like a function how does it work?
Using metrowerkscode warrior
Risha
Nov 14 '05 #1
2 10825
Pragmas are compiler specific. Read the documentation.
There is *NO* other
way to know what that means.
jacob
Nov 14 '05 #2
jacob navia <ja***@jacob.remcomp.fr> writes:
Pragmas are compiler specific. Read the documentation.
There is *NO* other
way to know what that means.


There are a few language-defined pragmas in C99, but yes, most pragmas
are implementation-defined.

--
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.
Nov 14 '05 #3

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

Similar topics

1
by: Jacob Jensen | last post by:
Hi I have a problem creating C++ code that is multiplatform compilable. My problem is using the "#pragma once" directive which can be used by microsoft Visual Studio pre-compiler but which gives...
6
by: Shri | last post by:
Can anybody tell me where i can find a detailed document on #pragma .... --shri
6
by: Stefan Slapeta | last post by:
The following linker directive #pragma comment (linker, "/delayload:xy.dll") which was valid in VC 6 produces just a warning in VC 7.1 (though the directive is ok, IMO). Is this fixed in...
11
by: ramu | last post by:
HI, Can anyone tell me about pragma? And can u give an example of how to use it?
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...
8
by: rwen2012 | last post by:
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...
8
by: Steve Richter | last post by:
Is there an ANSI C or GNU C equivalent to the #pragma cancel_handler provided in IBM's ILE C compiler? ...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.