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.

Assembly language Or C language, which 1 is best.

Status
Not open for further replies.

zafir

Member level 1
Joined
Jan 15, 2010
Messages
34
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Location
Paksitan
Activity points
1,576
I want to know that one should learn Assembly language 4 programming 8051 microcontroller or C language.Which 1 is preferable and y it is? Many people said that Assembly is tough but it make a rigid concept about actual programming + Architecture of controller but on the other hand other people said that C language is well suited, faster and easy language 4 programming microcontroller.I am currently learning Assembly language (4 programming 8051) and finding it too much difficult as comparable to C language.Please post any stuff regarding Assembly language fundamentals.thanx.
Regards,
zafir
 

Hi,
I think it's better to learn a high level language as it's easy and it will help you when you switch micrcontrollers. I learnt BASIC as I didn't like C and use mikroBASIC for PIC and AVR (I don't do 8051).
Say, after learning 8051, you want to switch to AVR or PIC, then, if you had learnt assembly, you have to relearn the architecture and language and everything, but if you learnt C or BASIC, you can use your existing language skills and just emphasize on learning the new features/peripherals.
You might want to check out mikroBASIC for 8051 or if you want, mikroC for 8051.
www.mikroe.com
Hope this helps.
Tahmid.
 
So if I learn High level language like mikrobasic or mikroC(I Interface 20x4 LCD using parallel port using code written in C) then it would possible that i could easily switch to other microcontrollers as well or not.Please also tell me that which compiler is used for generating hex file of code written in mikroBasic.(No idea about mikroBasic only work on GW-BASIC in beginner class).Thanx.
Regards,
Zafir
 

Yea, using high level language will make switching to other microcontroller lot easier.

mikroBasic has in built compiler that will generate .hex file which you burn into your chip.
 

Well it actually depends I would say C i s a good all round language to know, but assembler has its uses, you can do more nitty gritty timing specific things with assembler, and you code is usually faster. Because most compilers *correct me if i am wrong* turn C into assembler then in machine code

J
 

Because the OP is directing this question to about using 8051, I would strongly suggest to learn it first using assembly language because its hardware architecture is
suited to making small assembly language programs easy.
luv the bit test instructions :D

It is basically an OLD architecture, first designed, what 30+years ago? but a good one.
C programming on it can indirectly hide the way the architecture is used and hide its
limitation in order to code in C type constructs.

The overall advantage of high level like C programming is in understanding and maintaining the code after it was first written when the amount of code is large and
complex,
I don't think assembly can ever compete on this level (otherwise we would all be coding in assembler still : )

More modern designed microcontrollers are designed to be more friendly to high level language support.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top