Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/24/04 07:03
Read: times


 
#73086 - Why learn assembler part two
Ive been away for a while due to personal stuff but thought I should add my own thoughts about the recent post about why learning assembler is a good thing and C is the spawn of the devil.
While I agree that learning assembler programming is an essencial part using embedded processors I do think that insisting on only using assembler is akin to insisting on only building op-amps and logic gates from descreet components,it can be done but it isnt because its not very good design practice.
C is used because its portable,easy to debug,modify,document,can be easily split over many developers,has many standard libraries etc,etc.
While its very nice to be able to specify exactly what registers are used for a function most of the time it simply isnt required,where a function needs to be time critical in-line assembler can be used.With even a freeware compiler such as sdcc one can specify exactly what level of optimisation is performed on the code,one can specify that a function will pass variables on the stack,in ram,will use internal or external stack space,an interrupt function will use private register space or not,a function can be made reentrant or not,can be forced to save all registers or none etc etc and so on.
Basically writing in C is a 'chain of thought' process and mostly isolates the programmer from the hardware where being too close to the hardware is a bad thing.As ith any design process some level of abstraction is required to produce good system design.
The answer is to not get too preocupied with the details where you don't really need to be.There is another good reason to learn to program is C most companies will ask you what experiance you have with writing code for embedded systems,if you tell them that youve got lots they will be happy but if you tell them that you will only write in assembler they will show you the door.
Jez
P.S
The latest version of SDCC was released eariler this year with many new features,library and bug fixes.

List of 6 messages in thread
TopicAuthorDate
Why learn assembler part two            01/01/70 00:00      
   RE: Why learn assembler part two            01/01/70 00:00      
   RE: Why learn assembler part two            01/01/70 00:00      
   Why we have HLLs            01/01/70 00:00      
      RE: Why we have HLLs            01/01/70 00:00      
      RE: Why we have HLLs            01/01/70 00:00      

Back to Subject List