+ if (!ifx && bstr)
+ {
+ symbol *tlbl = newiTempLabel (NULL);
+
+ loadRegFromConst (hc08_reg_a, zero);
+ emitcode ("brclr", "#%d,%s,%05d$",
+ bstr, aopAdrStr (derefaop, 0, FALSE),
+ (tlbl->key + 100));
+ if (SPEC_USIGN (etype))
+ rmwWithReg ("inc", hc08_reg_a);
+ else
+ rmwWithReg ("dec", hc08_reg_a);
+ emitLabel (tlbl);
+ storeRegToAop (hc08_reg_a, AOP (result), offset);
+ hc08_freeReg (hc08_reg_a);
+ offset++;
+ goto finish;
+ }
+ else if (ifx)
+ {
+ symbol *tlbl = newiTempLabel (NULL);
+ symbol *jlbl;
+ char * inst;
+
+ if (IC_TRUE (ifx))
+ {
+ jlbl = IC_TRUE (ifx);
+ inst = "brclr";
+ }
+ else
+ {
+ jlbl = IC_FALSE (ifx);
+ inst = "brset";
+ }
+ emitcode (inst, "#%d,%s,%05d$",
+ bstr, aopAdrStr (derefaop, 0, FALSE),
+ (tlbl->key + 100));
+ emitBranch ("jmp", jlbl);
+ emitLabel (tlbl);
+ ifx->generated = 1;
+ offset++;
+ goto finish;
+ }
+ }
+
+ /* If the bitfield length is less than a byte */
+ if (blen < 8)
+ {
+ loadRegFromAop (hc08_reg_a, derefaop, 0);
+ if (!ifx)
+ {
+ AccRsh (bstr, FALSE);
+ emitcode ("and", "#0x%02x", ((unsigned char) -1) >> (8 - blen));
+ hc08_dirtyReg (hc08_reg_a, FALSE);
+ if (!SPEC_USIGN (etype))
+ {
+ /* signed bitfield */
+ symbol *tlbl = newiTempLabel (NULL);
+
+ emitcode ("bit", "#0x%02x", 1<<(blen - 1));
+ emitcode ("beq", "%05d$", tlbl->key + 100);
+ emitcode ("ora", "#0x%02x", (unsigned char) (0xff << blen));
+ emitLabel (tlbl);
+ }
+ storeRegToAop (hc08_reg_a, AOP (result), offset);
+ }
+ else
+ {
+ emitcode ("and", "#0x%02x",
+ (((unsigned char) -1) >> (8 - blen)) << bstr);
+ hc08_dirtyReg (hc08_reg_a, FALSE);
+ }
+ offset++;
+ goto finish;
+ }
+
+ /* Bit field did not fit in a byte. Copy all
+ but the partial byte at the end. */
+ for (rlen=blen;rlen>=8;rlen-=8)
+ {
+ loadRegFromAop (hc08_reg_a, derefaop, size-offset-1);
+ if (!ifx)
+ storeRegToAop (hc08_reg_a, AOP (result), offset);
+ else
+ emitcode ("tsta", "");