+ pic16_emitpcode(POC_IORFW, pic16_popCopyReg(&pic16_pc_prodh));
+ } // if (blen != 8 || bstr != 0)
+
+ /* write new value back */
+ switch (p_type) {
+ case FPOINTER:
+ case POINTER:
+ if (!fsr0_setup) pic16_loadFSR0( result );
+ pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_indf0));
+ break;
+
+ case GPOINTER:
+ if (AOP(result)->aopu.aop_reg[2]) {
+ // prepare call to __gptrset1, this is actually genGenPointerSet(WREG, result, ?ic?)
+ pic16_emitpcode (POC_MOVWF, pic16_popCopyReg (pic16_stack_postdec/*pic16_pc_postdec1*/));
+ pic16_emitpcode (POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(result),0), pic16_popCopyReg(&pic16_pc_fsr0l)));
+ pic16_emitpcode (POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(result),1), pic16_popCopyReg(&pic16_pc_prodl)));
+ pic16_emitpcode (POC_MOVFW, pic16_popGet(AOP(result),2));
+ pic16_emitpcode (POC_CALL, pic16_popGetWithString ("__gptrput1"));
+ {
+ symbol *sym;
+ sym = newSymbol( "__gptrput1", 0 );
+ strcpy(sym->rname, "__gptrput1");
+ checkAddSym(&externs, sym);
+ }
+ } else {
+ // data pointer (just 2 byte given)
+ if (!fsr0_setup) pic16_loadFSR0( result );
+ pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_indf0));
+ }
+
+ // this should work in all cases (as soon as gptrget/gptrput work on EEPROM and PROGRAM MEMORY)
+ //pic16_emitpcomment ("; =?= genPackBits, GPOINTER access");
+ werror(W_POSSBUG2, __FILE__, __LINE__);
+ break;
+
+ default:
+ assert (0 && "invalid pointer type specified");
+ break;
+ }