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.

high-level language or low level language

Status
Not open for further replies.

cai2

Member level 2
Joined
Nov 30, 2006
Messages
50
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,618
which one is preferably?...high-level language or low level language?
 

For precious and full control of a microcontroller you should use low level language thats assembly language.
 

It's up to your application, if you need to do the very
complicate application such as PID conrol or floating point calculating, high level language is more suitable than low level language, however low level language also can do these, but you must take a long time to developing.
 

high level language >> easy to work with
low level language>>needed where accuracy is must
 

Depends on application.
Low level is usefull when you wanna save code space and optimize the speed of processing.
High level language is more readable and configurable and most importantly can be processor independant
 

i think it's a low level language..because it is the basic level,,eventhough high level language is easier but low level language is more readable and more accurate...
 

I am going to go out on a limb here and probably annoy the ASM coders, go with high level every time, the high level languages for micro-controllers such as HighTech and CCS and others perform optimization on the code they produce to (in my opinion) better than or equal to human opimization, also all of these high level packages are designed such that all hardware features are accesable without problem and also come with inline assembers so if you want to do somthing bizzar with a chip you can just "inline" it.

ASM (imho) complety sucks, the code you end up creating is usually only ever readable by you, is almost impossible to update 6 months later because despite their best intentions coders rarely document and comment there own code (unless someone is paying them) fully.

My opinion is biased due to spending most of 1984-1990 stuck with ASM on 8086/68000 cpu's and having found high level languages in 1991 I cannot belive I spent so much time on the smallest things before :D
 

Low level language can be difficult to program,but helps you understand the hardware deeply. Actually you will be programming using registers.
 

That is why C is king for micro programming. It is both a high and a low level language!
With C, you can manipulate the hardware down to the individual bit level, then you can then build on the low level functions to construct very high level abstraction.
 

I think if you have mastering for example hte low language you can do anything yoiu want, on the other hand if you mastering the high language you can do anything you want.
 

Yeah Hi - level programming is more preferrable for portability and code development time perspective. But in my case I developed MCU applciations in both in C and ASM. ASM usually is suitable for applicaitons where limited resources are fully optimized. Typical low resoucres micro where applications just barely fit in into the MCU resources can be worked around using ASM.
 

btbass said:
That is why C is king for micro programming. It is both a high and a low level language!.
I agree that C is a sweet spot for microcontroller programmer. But, I wouldn't call it a high level language. I'd consider it a "medium" level language, or as many people have refered to C, a "high-level assembler" language -- which works just great for micros.
 

Maybe people never stops discussing about Assembly (low level language) or C (high level), which is better?

I myself never hate or complain about any language, or praise for the rest. Each language has its own pros and cons, and depending the specific project, specific programmer, using this or that language is better solution.

I just list out here the pros and cons of these 2 languages, based on my experiences, for your ease of "judging":

Assembly:
Pros:
- First, most of assembler are freely provided and well supported from chip manufacturers. And you must not be worried about these sources. Every new chip will be updated instantly in these softwares.
- Assembly is simple so easy to learn.
- Assembly helps (I write "help", not "always make" because it is still up to the programmer's ability) write better, shorter, more compact (more efficient), faster machine codes. You can experience trimming the code to fit the chips, and you can get funs at that jobs, that you cannot get in C programming. The smaller in memory chips usually mean that cheaper chips.
- Easy to revise, maintain (repeat: based on my experiences).
- You will understand very well the chip hardware. So, you will use the chip in excellent ways, especially when you also are the electronic engineer, not a programmer only.
- For the time being, I have seen only the dissassembler programs, this kind of program helps you convert the hex file (machine code) back into asm file (source code). That in many cases is very useful, for example, in case you have lost the source codes, but still keep the machine codes, or sometimes you can get the hex codes elsewhere but there is no source code provided.

Cons:
- Source codes often very long (in comparison with code written in C).
- Each chip manufacturer provides a different assembler for its chips. Even a slight difference from chip to chip of one manufacturer.
- It is really the tough mission (or even impossible with a individual) if dealing with the big projects/or bigger chips (for example, 16-bit or 32-bit chips) (due to the very long source codes).

C languge:
Pros:
- Programmer needs not to understand well the chip hardware.
- Applying the code for various chips is easier.
- Writing source codes is easier task, and it is shorter in general.

Cons:
- C compilers is usually not free, and expensive. Sometimes maybe cannot affordable for the individual programmer or beginner.
- Cannot use the chip at high efficiency. There is a statistics that a good written machine code written by C maybe upto 150% longer than a good written machine code written by Assembly.
- Some projects where Assembly can solve the problems but C cannot.
- For the time being, I have seen no program that helps convert the hex file back into the C source code.
- Once only using C, you become lazy and do not want to come back to assembly. And it is bad, as in some projects, you may be impossible to get the project done.

Just some of my thoughts.

nguyennam
 

Hello nguyennam very good comparison. I myself experienced also trimming codes in assembly to fit into a MCU.

It must be fun if a program can convert hex file back into C codes. That would probably increase the number of reverse engineered firmwares.

Personally, I worked heavily on assembly cause its free and easy to use.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top