Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C/C++ versus Assembly for programming microprocessor systems

Status
Not open for further replies.

Obi

Newbie level 4
Joined
Oct 26, 2006
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Russia, Ivanovo
Activity points
1,338
Hi, friends! what is better for programming microprocessor systems? С++ or assembler? Or may be somthing else? :?:
:idea: I suppose C/C++ with some asm insets?

Added after 3 minutes:

And one more question. What does EC++ stand for? (it is in the caption of subforum).... Curiosity is incurable... :D
 

Re: C/C++ vs assembler

Dear,
Sre assembler is better. It generates the minimum size as the program is optimized where C generates redndancy in code.
 

Re: C/C++ vs assembler

Hi,

You better use C, its the industry standard. Read the following:

"A device’s assembly language is tied to the device and the way the device works. They are hard to master, and become obsolete for you the moment you change microcontroller families. They are specific purpose languages that work only on specific Microcontrollers. On the other hand, C is ageneral-purpose programming language that can work on any microprocessor that has a C compiler written for it. C abstracts the concepts of what a microcontroller does and provides a text based logical and readable way to get microcontroller to do what microcontroller do. Once you learn C, you can move easily between microcontroller families, write software much faster, and create code that is much easier to understand and maintain."

Quoted From: C Programming for Microcontrollers


As you were saying C + Some Assembler :)


Regards
 

Re: C/C++ vs assembler

Hi, I already program 25 years. I would say. It is not better. Assembly is best for small devices with code size upto 4K, you can still maintain this code in a propper way. If you go for bigger projects more complexity and bigger embedded devices use C not C++.

Assembly is about 5 to 10 times smaller than C, that is if you master assembly. I wrote AES 128 encryption in 340 bytes including the permutation table of 256 bytes. in C this would be 2.5 K in best case.

If your project is for low cost mass market you can implement it best in assembly since it one time hard work but than your done and make the best price. if your project is small (< 1K devices) best to use C even for simple things. its faster.

C++ is not an option, to much memory and RAM is needed, nice for PC's but not embedded systems.

regards,

Paul.
 

Re: C/C++ vs assembler

Obi said:
what is better for programming microprocessor systems? С++ or assembler?
Answer: It depends!

  • Assembler is better if you need maximum performance, smallest code size or optimal resource usage.
  • C/C++ is better for faster development, complex software projects and software that must be maintained over long periods of time.
 

C/C++ vs assembler

i agree with lambtron

i write in c the last 3 years.

also if you use a lot of mcu like atmel, pic, motorola etc
you must use C beacuse it is difficult to switch every time for one mcu to another.

:p
 

Re: C/C++ vs assembler

hi all,
here in india also i saw experienced people prefer assembly, but for me c is the best, i am programming for past three years and previously i was in j2ee domain. so after coming at embeded system assembly was horrible for me.

actually assembly is good but it took lots of time to develop program using assembly. also you get char, int, long in c, and also ther multiplication, but in assembly you have to hard code them.


for me c is the best. its really hardware friendly and programmer friendly.



real life example:: my current project is ad7730 based weigh machine with at89c52. using c i developed it (program part) withen three weeks. but i sure if i wrote it in assembly it will definitely took more than three months for me



arnab/vu2bpw
 

Re: C/C++ vs assembler

Thank you all... Now it's clear. And what about other languges? For example, Pascal. :D Are they used?
 

C/C++ vs assembler

I agree with lambtron and xxtigerxx
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top