- CLRC;
- while(size--) {
- char *l = aopGet(AOP(IC_LEFT(ic)),offset);
- if (samer) {
- emitcode("clr","r0");
- emitcode("sbc","r0,%s",l);
- aopPut(AOP(IC_RESULT(ic)),"r0",offset++);
- } else {
- char *s;
- emitcode("clr","%s",s=aopGet(AOP(IC_RESULT(ic)),offset++));
- emitcode("sbc","%s,%s",s,l);
- }
+ if (size == 1) {
+ if (samer) {
+ emitcode("neg","%s",aopGet(AOP(IC_LEFT(ic)),0));
+ } else {
+ aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),0),0);
+ emitcode("neg","%s",aopGet(AOP(IC_RESULT(ic)),0));
+ }
+ } else {
+ offset = size - 1;
+ while(size--) {
+ char *l = aopGet(AOP(IC_LEFT(ic)),offset);
+ if (!samer) {
+ aopPut(AOP(IC_RESULT(ic)),l,offset);
+ l = aopGet(AOP(IC_RESULT(ic)),offset);
+ }
+ if (offset) emitcode("com","%s",l);
+ else emitcode("neg","%s",l);
+ offset--;
+ }
+ size = AOP_SIZE(IC_LEFT(ic)) -1;
+ offset = 1 ;
+ while (size--) {
+ emitcode("sbci","%s,lo8(-1)",aopGet(AOP(IC_RESULT(ic)),offset++));
+ }