K=FCbek Tony wrote: >Hi, > >Dan Michaels wrote: > >>This example doesn't really help Peter Schulz's case very much.=20 > >No, it was meant as an general statement concerning the use of GOTO's >in C or asm ( thread started out as c-only but has since grown ). > I know, but as you say, the thread has drifted and drifted and=20 drifted. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >>First, the code is written in assembler, and not C, and secondly,=20 >>"most" assembler code that I have seen looks like a spaghetti chef=20 >>wrote it anyway.=20 >> > >This does not need to be the case, there are no excuses for writing >poorly written/documented code in C, Pascal, asm or whatever. >Ofcource asm, as it is 'lower' level, IS harder to understand/follow >particulary to thoose who do not practice it regulary. And >have you ever amused yourself by looking at the generated output from >an PIC c-compiler :-). >The mentioned example is ( except it's fairly well documented ) as >far as one could take this 'technique' i.e. at one extreme. > You are correct - you can write spaghetti/garbage code any number of ways. Unfortunately, it is much easier to do if you relie on GOTOs and jumps a lot. The smaller PICs with 2 stack levels beg for this type of coding - I would never use one of these, myself, if I could avoid it.=20 Luckily, the 2nd gen PICs have 8 stack levels, so you can use=20 a lot more subroutine calls, and produce much better structured=20 code.=20 Personally, I try to make the "overall structure" of my assembler=20 programs look "exactly" like they would look if I were coding in=20 C or other HLL. The difference is mainly in the syntax, not in the structure. At least this is what I try to do. It is not=20 always the most efficient code, however. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>If Peter took this sort of thing to his QA types, they would make=20 >>him go back and re-take CS101 - Pascal For Non-Programmers. >> >May I ask what is CS101 ( sorry I'm not native english so sometimes >need time to catch up :) ) ComputerStudy101 ? ( and yes I know it's some >kind of joke ) > Yes, a joke. "Computer Science 101", used in this manner, is=20 generally meant to be taken as the "lowest-level" computer=20 course, given to totally naiive people. Like going back to=20 First Grade or Kindergarten [US terms].=20 best regards, - dan michaels -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu