[comp.lang.c] LINT won't do your debugging fo

carroll@s.cs.uiuc.edu (07/17/89)

/* Written 10:07 am  Jun 29, 1989 by usenet@cps3xx.UUCP in s.cs.uiuc.edu:comp.lang.c */
/* ---------- "Re: LINT won't do your debugging fo" ---------- */
When implementing some very low level code in C under MSDOS, an if
with a null body provides a very handy slight delay. Example: after
sending the address to the CMOS RAM on an AT, you need a slight pause on
a fast machine to then read or write its contents.
/* End of text from s.cs.uiuc.edu:comp.lang.c */
/* Written  6:07 pm  Jul 16, 1989 by scs@adam.pika.mit.edu in s.cs.uiuc.edu:comp.lang.c */
I think that this is clearly a place where assembler is the way to go. It has
what to me are the key points that say "do it in assembler" :
1. It's low level
2. By its very nature it's machine dependent - the problem relates to CMOS
   ram constraints on an AT. The dependency is not going to get worse by going
   to assembler.
3. Exact control over timing and execution is required. When you say "sometimes
   it gets optimized out", that's a big clue to go to a lower level.
4. There's not a lot of code involved.

C is great, I use it as my primary language, but there are places where it is
not appropriate. C and assembler should be complementary, not antagonistic.

Alan M. Carroll                "Oh goody, the Illudium Q-36 Explosive
carroll@s.cs.uiuc.edu           Space Modulator!"
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll