Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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?
 

kelvin_foru

Newbie level 4
Joined
Jul 19, 2007
Messages
5
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Activity points
1,303
For precious and full control of a microcontroller you should use low level language thats assembly language.
 

firmware

Member level 4
Joined
Apr 10, 2007
Messages
69
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,288
Activity points
1,599
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.
 

abbas1707

Full Member level 4
Joined
May 3, 2007
Messages
216
Helped
20
Reputation
40
Reaction score
8
Trophy points
1,298
Activity points
2,371
high level language >> easy to work with
low level language>>needed where accuracy is must
 

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
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
 

ece9710

Newbie level 6
Joined
May 17, 2007
Messages
14
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,360
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...
 

foxabilo

Member level 3
Joined
Jul 16, 2007
Messages
67
Helped
13
Reputation
26
Reaction score
1
Trophy points
1,288
Location
Derby, England
Activity points
1,886
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
 

vinseth

Member level 2
Joined
Jul 6, 2007
Messages
42
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,463
Low level language can be difficult to program,but helps you understand the hardware deeply. Actually you will be programming using registers.
 

btbass

Advanced Member level 5
Joined
Jul 20, 2001
Messages
1,897
Helped
438
Reputation
880
Reaction score
287
Trophy points
1,363
Location
Oberon
Activity points
12,861
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.
 

hassan1980

Full Member level 4
Joined
Jan 14, 2005
Messages
204
Helped
9
Reputation
18
Reaction score
6
Trophy points
1,298
Activity points
1,348
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.
 

neoaspilet11

Full Member level 5
Joined
Sep 29, 2005
Messages
277
Helped
29
Reputation
56
Reaction score
8
Trophy points
1,298
Location
Cebu, Philippines
Activity points
4,048
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.
 

kmr

Newbie level 3
Joined
Feb 23, 2007
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
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.
 

nguyennam

Advanced Member level 1
Joined
Sep 6, 2006
Messages
440
Helped
43
Reputation
86
Reaction score
14
Trophy points
1,298
Activity points
4,069
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
 

neoaspilet11

Full Member level 5
Joined
Sep 29, 2005
Messages
277
Helped
29
Reputation
56
Reaction score
8
Trophy points
1,298
Location
Cebu, Philippines
Activity points
4,048
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top