add: shift = 16 - p->mem[memtype].bankaddrbits; bank = bank << shift;  fprintf(stderr, "bank address=%u\n", bank);
context: int avr_write_bank(int fd, AVRPART * p, int memtype,                    unsigned short bank){  unsigned char cmd[4];  unsigned char res[4];  LED_ON(fd, pgm->pinno[PIN_LED_PGM]);  LED_OFF(fd, pgm->pinno[PIN_LED_ERR]);  cmd[0] = 0x4c;  cmd[1] = bank >> 8;     /* high order bits of address */  cmd[2] = bank & 0x0ff;  /* low order bits of address  */  cmd[3] = 0;             /* these bits are ignored     */  avr_cmd(fd, cmd, res);  /*   * since we don't know what voltage the target AVR is powered by, be   * conservative and delay the max amount the spec says to wait    */  usleep(p->mem[memtype].max_write_delay);  LED_OFF(fd, pgm->pinno[PIN_LED_PGM]);  return 0;}