Hi Fernando, Hmmm... Maybe I'm the best person to answer this. >Excuse my ignorance of such basic knowledge, but 3 books and several weeks of >banging my head against my desk have driven me to this. > >I can't figure out how memory is mapped for the PICs (16c84). the data >sheets show bank 0 from 00h to 7Fh and bank 1 from 80h to FFh. I think I've >finally figured out the concept of data banks and register shadowing but >their is a sample program in Predko's book that clears the STATUS flags as >follows: > >movlw 0x0F8 >andwf STATUS > >What does the "h" in the memory maps mean, and where does the final 8 in >0x0F8 fit in to this format. Also, 0x0F8 was never defined previously in the >program. why was this address selected and how can you know what its value >is. "h" in the memory map means hex. A hex number can be defined in the following formats: 0##h - Where "##" is the Hext Number (each Digit '0' to 'F') H'##' 0x0## and in some assemblers: $## For the book, I primarily used the "0x0##" format for hex. For Binary Numbers, you can write them in: B'########' or sometimes %######## Formats. When I AND the STATUS Register with 0x0F8 (which is what these two lines are doing) I am clearing the three least significant bits of the STATUS Register 0x0F8 is B'11111000' and when ANDED with another number, the least significant three bits of the result will be reset (zeros). The purpose of this was to clear the Zero, Half Carry and Carry Flags in the Status Register so changes caused by different instrutions could be easily seen. >Another quick one: If a processor is rated at 4Mhz, why use only a 1Mhz >crystal. Lots of reasons. The basic ones are: 1 MHz uses less power than 4 MHz and radiates less noise. At 1 MHz, the PIC's instruction cycle is 4 usecs long (or 250,000 instruction cycles per second) which is fast enough for most applications. Good luck, myke "I was well aware that the processes of puberty are often fatal to psychic power." - Sir Arthur Conan Doyle