My apologies Jerry, your code does indeed provide complete single line branching. :o) So is it possible to add a macro set that turns CJAE x,#31,blah into if(x>=31) goto blah ?? -Roman Jerry Merrill wrote: > > One of us missed something here: > > > if(x>=31) goto blah == CJAE x,#31,blah > and > if(x==7) goto womble == CJE x,#7,womble > > 'A SINGLE bullet-proof line' in each case > > I agree that 'if (x==7) goto...' is more readable (especially for all of us > old C guys) than CJE.... but all of the loading, testing, > branch/not-branching is contained in that single line. > > At 11:47 AM 6/29/01, you wrote: > >Jerry Merrill wrote: > > > > > > > > > > >One thing I do miss is some of the branching tests, > > > >which can be a pain with the PIC asm and can cost time > > > >and bugs. > > > > > > > >Something like: > > > >if(x>=31) goto blah > > > >else if(x==7) goto womble > > > > > > > >is very fast and safe to code in C but a bit of a pain > > > >to code in PIC asm. > > > This is the point of our CVASM16 assembler. It adds 'higher level' > > > instructions that handle these issues (while maintaining the lower level > > > opcodes). This makes it easy to see and do what you want without having to > > > deal with double negatives and such. > > > > > > You mean like: > > > CJAE x,#31,blah ; Compare, Jump After or Equal > > > CJE x,#7,womble ; Compare, Jump Equal... > > > >Hi Jerry, it's still not quite as instinctive as > >if(x>=31) goto blah > >and with that format you get each line as a self > >contained bug-proof branching system. With the > >low-level nature of PIC processors I often get caught > >having to load a test value somewhere, then compare > >it with somthing else, then branch/not branch which > >again can be another level of confusion. > > > >Although I love getting at the hardware directly > >I still long for one bulletproof line of code > >that does branching. It's the minimum I expect from > >any decent programming language. > >-Roman > > > >-- > >http://www.piclist.com#nomail Going offline? Don't AutoReply us! > >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > Jerry Merrill > > jerrym@tech-tools.com > http://www.tech-tools.com > FAX: (972) 494-5814 VOICE:(972) 272-9392 > TechTools PO Box 462101 Garland, TX 75046-2101 > > Join our PIC discussion list at > http://www.tech-tools.com/picsource.htm > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body