>Yes. To prevent that, I went one step further and wrote a simple >preprocessor (a Perl script, see below) that allows me to "declare" >the banked symbols. Whenever an instruction makes a reference to >such a symbol, this preprocessor inserts Olin's macro call ahead of it. > >Even this isn't foolproof -- for example, if you reference one of >those symbols immediately after a skip instruction and the macro >inserts something there. The problem that I have had is as follows: - ; unknown banked state dbankif bank_x_register ; operations using bank_x_registers label: dbankif bank_x_register ; more operations using bank_x_registers dbankif bank_y_register ; operations using bank_y_registers bne label ; more operations The problem arises because the dbankif immediately after the label generates no code because bank_x is already selected using the macro before the label. the next dbankif then changes the bank selected, some operations happen, then branch back to the label. The easiest fix I found was to change the dbankif after the label to a dbank so the macro inserted code irrespective of the previous bank. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist