Two things: 1. To init curdb just: curdb set 3 2. Your expression for newdb should probably be: (addr >> 8) & 15 becuase the PIC18 has 16 256-byte data banks Bob Ammerman RAm Systems ----- Original Message ----- From: "Carlos Ojea" To: Sent: Friday, July 19, 2002 8:36 AM Subject: DBANKIF macro for pic18 > Hello: > > I am trying to modify Olin's macro DBANKIF for use with a pic18. > I wrote this macro (simplified) : > > > > dbankif18 macro adr > local newbank > newbank set (((adr) >> 11) & 3) ;find 0-N desired bank number > > if currdb != newbank > movlb newbank ;select new special function registers bank > currdb set newbank > endif > exitm > > > > I know 'currdb' is an assembly time variable. > How could I init that variable? > > > PD: Sorry Olin, I am a newbye writing macros... > > -- > 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