This was very helpful (especially the nested loops)! The "cblock" usage is clever, too. In correspondance with my other "re:" post, could I do this?: cblock 0x20 ; stuff in bank 0 endc cblock 0xA0 ; stuff in bank 1 endc cblock 0x110 ; stuff in bank 2 blahdeblahblahbloo endc cblock 0x190 ; stuff in bank 3 endc ..then refer, for example, to "blahdeblahblahbloo" (after of course setting the RC0/1 flags correctly) directly in code? I.e.: bsf STATUS, RP0 bcr STATUS, RP1 movfw blahdeblahblahbloo ..? Thanks, Kieren ----- Original Message ----- From: "Brendan Moran" To: Sent: Thursday, July 18, 2002 5:40 PM Subject: Re: [PIC]: I got the basic ASM blues > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I haven't used banksel much, and I don't intend to. The reason that > I don't use banksel is that while macros can be useful, what they do > most often, if you don't write them yourself, is confuse you. I have > found that I have a hard time using other people's code; unless it > has very well defined entry and exit points, I have to figure out how > it operates to be able to use it, and it's usually faster to write my > own than to use someone else's in that kind of situation. > > On top of all that, I highly recommend writing many of your own > macros, so that you have a better understanding of how the processor > actually works. > > The code that I would use for the same task is: > > #include P16F877.inc > #define constA 0 ;const A and B define the delay between > flashes, where 0 is the longest delay, and 1 is the shortest. > #define constB 0 > cblock H'20' > endc > > org 0 > clrf PCLATH > goto main > nop > nop > nop > > main: bsf STATUS,RP0 > movlw H'06' > movwf ADCON > movlw H'3F' > movwf TRISA > bcf STATUS,RP0 > > cblock > temp1 > temp2 > endc > > loop: movlw 1 > xorwf PORTA,f > movlw constA > movwf temp1 > > del1: decfsz temp1,f > goto loop > > movlw constB > movwf temp2 > del2 decfsz temp2,f > goto del1 > goto del2 > > END > > - --Brendan > > -----BEGIN PGP SIGNATURE----- > Version: PGPfreeware 6.5.8 for non-commercial use > > iQA/AwUBPTbveAVk8xtQuK+BEQLHzgCdGJ4YERafbuTvWQK0UHVjQ4I4OYgAoPOV > vxx4D7R0cnpPLB7rNLQ6ODo3 > =6jql > -----END PGP SIGNATURE----- > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.