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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/16/02 18:23
Read: times


 
#27357 - RE: What is ugly and what not in assembly?
Nic,

I agree with most of what has already been said. I believe you have to compose your source with the assumption someone else will be tasked to perform follow on work.

code in lower case, expresive labels (and i don't mind24 character names if they tell something useful i.e. DAC_output_buffer_index).

Andy is correct about the Tabs vs. Spaces (and there impact upon editors) but i like the space efficiency of Tabs so i use them and am willing to "set tabs" as most decent editors allow.

With 8051 assembly i use Upper Case for SFR's and Hex encoding (i.e. "mov PCON,#080H")

I comment like crazy generating that "book" that was previously indicated as tedious for some. If find it has saved my life when i have had to revisit 10 year old code.

I use "banner" comments above routines to explain the goal in plain english (if you "strip" these banner comments into another file you have a great start on a "theory of ops" doc).

I use the comments on the right to explain the platform "mechanics" of what is happening. I dislike comments that repeat what an opcode already says i.e.

mov a,#0A0H ; move to the accumulator the hex value 0A0H
.

Also i generate a lot of "white space" to partition related and un-related code.

I prefer to avoid source files that combine unrelated functions and use "lib" and "inc" files so that individual source files contain the data, constants, sub-routines and top-level processing associated with each major architectural sub-division of overall processing.

regards,
p


List of 32 messages in thread
TopicAuthorDate
What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembl            01/01/70 00:00      
RE: What is ugly and what not in assembl            01/01/70 00:00      
RE: What is ugly and what not in assembl            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
Useage of nops            01/01/70 00:00      
RE: Useage of nops            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
Nic, sorry you don't like my            01/01/70 00:00      
RE: Nic, sorry you don't like my            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
What Nic didn't say            01/01/70 00:00      
RE: What Nic didn't say            01/01/70 00:00      
RE: Nic, sorry you don't like my            01/01/70 00:00      
RE: What is ugly and what not in assembly?            01/01/70 00:00      
RE: What is ugly and what not in assembl            01/01/70 00:00      
Apology gladly accepted            01/01/70 00:00      
RE: Apology gladly accepted            01/01/70 00:00      
RE: What Nic didn't say, keith            01/01/70 00:00      
RE: What is ugly and what not in assembl            01/01/70 00:00      
RE: John Deans            01/01/70 00:00      
RE: What is ugly and what not in assembl            01/01/70 00:00      
RE: Erik            01/01/70 00:00      
RE: Ijaz            01/01/70 00:00      

Back to Subject List