473,412 Members | 4,594 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,412 software developers and data experts.

why c is using in embeded systems

hi any one reply why is c powerful language than others and also why we have to go for 'C' only for embeded systems most of the times
Nov 8 '06 #1
3 1762
Banfa
9,065 Expert Mod 8TB
C is used in embedded systems because it provides low level access to the hardware (that is you can access the hardware directly using pointers) which historically other languages have not done. Also as a low level language it's instructions often have direct equivilents in machine language (assembler) making it easy to compile for most platforms.

Also it is a well developed language so writing compilers for new platforms is relatively easy.
Nov 8 '06 #2
horace1
1,510 Expert 1GB
hi any one reply why is c powerful language than others and also why we have to go for 'C' only for embeded systems most of the times
You chose a language to suit the application area and C (and C++) are suited for embedded applications due to
(1) one aim of C was to be able to implement machine independent code for applications which in the past required assembly language, e.g. operating systems such as UNIX
(2) pointers can be used to access memory mapped registers in I/O devices
(3) it has low-level operators similar to those in assembly languages and which can map directly into machine code operations, e.g. ++ -- and the bitwise operators & | ~ << >> etc which enable manipulation of bits (setting, clearing, shifting, etc)
(4) C has been around a long time and compilers are very efficient at optimizing code; often producing better code than many programs written in assembly language.

Assembly languages were not only machine dependent so code could not be ported across platforms but equivalent C code could be written in a much shorter time.

Assembly language still used for time critical area of applications. However, many modern processors are so complex (e.g. ARM 7, TMS320C6711, dsPIC) that they mainly programmed in C or C++
Nov 8 '06 #3
Banfa
9,065 Expert Mod 8TB
Assembly language still used for time critical area of applications. However, many modern processors are so complex (e.g. ARM 7, TMS320C6711, dsPIC) that they mainly programmed in C or C++
Or areas where the code has to be code specific because it requires direct access to the processor registers.

I am think of RTOS where 95% of the code is C but there are often a few routines under-pinning the C code in assembler (in my experience often associated with task switching).
Nov 8 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jens Thiede | last post by:
I want to use python heavily on my embeded linux. What would the best way be to slim down Python. Only keep those modules you would acctually need, and not imparing Python's capabilities? ...
0
by: Natsu Mizutani | last post by:
Hello, I'm trying to wrap a c++ library using MPI inside with boost.python (or SWIG). I managed to find that calling `MPI::Init()` embeded in a c++ funtion would not work. So, I decided to use...
7
by: John Ortt | last post by:
Hi there, I am trying to do a two level embeded query but it is causing Dr Watson errors. The line which is causing the problem is: CFCDeci: (Select sum (FlexChangeDeci) FROM as WHERE (....
3
by: Viorel Ghilas | last post by:
Hi all, I have an assembly, that contain some embeded resources, How can I add in runtime, data to my embeded resources. is it posible with best regard Viorel Ghilas
5
by: Gerald | last post by:
Recently, my program need to be run in embeded enviroment, and I cann't use standard library. But I need to use arctan(x), so I implement it like the following: inline double pow(double x,...
1
by: MORALBAROMETER | last post by:
Hi all, I want to update MULTIPLE elements of an HTML page using Ajax. for this reason i my response is an xml document. I want to use XSL at the client side to update these elements. How can i...
0
by: Yiyu | last post by:
Hi, I am a newbie here. Here what I want to do and I wonder if it's easy to be achieved using Windows Presentation Foundation: I am going to teach a college course and I want to do real time...
2
by: dhirajgaherwar | last post by:
Hi everybody, Can anyone tell how to call a standard "Find and Replace dialog box" while my application (embeded word aplication) is at run time. Is there any embeded somewhere ?? or do i have to...
0
by: Pitaridis Aristotelis | last post by:
I know how to extract an embeded resource from a file but does anyone how to import an embeded resource to a file?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.