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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/12/04 16:14
Read: times


 
#72425 - RE: (OT-ish) Why learn assembler ?
Responding to: ???'s previous message
I think, its not OT since efficient programming was also a very important point on programming the 8051.


My opinion:

I disagree, there is no need to know assembler for efficient programming.

For efficient programming you must only know two points:

1.
Every instruction need time to be executed !

2.
Every instruction need different time do be executed !


E.g. x /= 2 was about 10,000 times faster as x /= 2.11 on the 8051 (without floating point unit).

Maybe assembler was the only easy way to be familiar with this two rules.

But not the assembler skills are important, only to get the knowledge, which instructions are costly and which can be done very fast.

Then the only task for efficient programming was to focus to fast instructions and avoid costly instructions.


The other important point for efficient programming was the conception and planning phase.

A poor programmer starts immediately from the scratch to edit the source code and produce always unmaintenable and big and slow code.

But with a good planning you have already solved 60% or more of the whole programming work.


Also you must watch, that you see all the programming work from the human view.
So only such things must be fast, which are currently on the focus of the user.
E.g. a heating control unit must only react immediately on a key press or emergency event.
Means a keypress must be immediately displayed to give the user a feedback (immediately from the users view = 0.2 ... max 0.5sec).
All other tasks (e.g firing the oven) can be done in the background many times later.

But also the reverse case must be watched.
Measure and display something no faster as min 0.2 ... 0.5sec to give the human a chance to read it out, since fast changing numbers flicker but can not be read. So faster execution waste only CPU speed, which may be missed on other tasks.


So the main point of the planning phase was to sort all tasks by its needed speed and then implement it in this way (interrupts, main loop or background).


Peter


List of 11 messages in thread
TopicAuthorDate
(OT-ish) Why learn assembler ?            01/01/70 00:00      
   RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
      RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
   RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
   RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
      RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
         RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
         RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
      RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
   RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      
      RE: (OT-ish) Why learn assembler ?            01/01/70 00:00      

Back to Subject List