AddCodeLine ("\tinc\t%s", lbuf);
AddCodeLine ("\tlda\t%s", lbuf);
} else {
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tclc");
AddCodeLine ("\tadc\t%s", lbuf);
AddCodeLine ("\tsta\t%s", lbuf);
if (val == 1) {
label = GetLabel ();
AddCodeLine ("\tinc\t%s", lbuf);
- AddCodeLine ("\tbne\tL%04X", label);
+ AddCodeLine ("\tbne\tL%04X", (int)label);
AddCodeLine ("\tinc\t%s+1", lbuf);
g_defloclabel (label);
- AddCodeLine ("\tlda\t%s", lbuf); /* Hmmm... */
+ AddCodeLine ("\tlda\t%s", lbuf); /* Hmmm... */
AddCodeLine ("\tldx\t%s+1", lbuf);
} else {
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tclc");
AddCodeLine ("\tadc\t%s", lbuf);
AddCodeLine ("\tsta\t%s", lbuf);
if (val < 0x100) {
label = GetLabel ();
- AddCodeLine ("\tbcc\tL%04X", label);
+ AddCodeLine ("\tbcc\tL%04X", (int)label);
AddCodeLine ("\tinc\t%s+1", lbuf);
g_defloclabel (label);
AddCodeLine ("\tldx\t%s+1", lbuf);
} else {
- AddCodeLine ("\tlda\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tadc\t%s+1", lbuf);
AddCodeLine ("\tsta\t%s+1", lbuf);
AddCodeLine ("\ttax");
if (val == 1) {
AddCodeLine ("\tjsr\tladdeq1");
} else {
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tjsr\tladdeqa");
}
} else {
AddCodeLine ("\tldx\t#$00");
if (flags & CF_CONST) {
AddCodeLine ("\tclc");
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tadc\t(sp,x)");
AddCodeLine ("\tsta\t(sp,x)");
} else {
AddCodeLine ("\tldx\t#$00");
if (flags & CF_CONST) {
AddCodeLine ("\tclc");
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tadc\t(sp),y");
AddCodeLine ("\tsta\t(sp),y");
} else {
AddCodeLine ("\tstx\tptr1+1");
if (offs == 0) {
AddCodeLine ("\tldx\t#$00");
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tclc");
AddCodeLine ("\tadc\t(ptr1,x)");
AddCodeLine ("\tsta\t(ptr1,x)");
} else {
AddCodeLine ("\tldy\t#$%02X", offs);
AddCodeLine ("\tldx\t#$00");
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tclc");
AddCodeLine ("\tadc\t(ptr1),y");
AddCodeLine ("\tsta\t(ptr1),y");
AddCodeLine ("\tsta\tptr1");
AddCodeLine ("\tstx\tptr1+1");
AddCodeLine ("\tldy\t#$%02X", offs);
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tclc");
AddCodeLine ("\tadc\t(ptr1),y");
AddCodeLine ("\tsta\t(ptr1),y");
AddCodeLine ("\tpha");
AddCodeLine ("\tiny");
- AddCodeLine ("\tlda\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tadc\t(ptr1),y");
AddCodeLine ("\tsta\t(ptr1),y");
AddCodeLine ("\ttax");
} else {
AddCodeLine ("\tsec");
AddCodeLine ("\tlda\t%s", lbuf);
- AddCodeLine ("\tsbc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (int)(val & 0xFF));
AddCodeLine ("\tsta\t%s", lbuf);
}
} else {
AddCodeLine ("\tsec");
if (flags & CF_CONST) {
AddCodeLine ("\tlda\t%s", lbuf);
- AddCodeLine ("\tsbc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)val);
AddCodeLine ("\tsta\t%s", lbuf);
if (val < 0x100) {
label = GetLabel ();
- AddCodeLine ("\tbcs\tL%04X", label);
+ AddCodeLine ("\tbcs\tL%04X", (unsigned)label);
AddCodeLine ("\tdec\t%s+1", lbuf);
g_defloclabel (label);
AddCodeLine ("\tldx\t%s+1", lbuf);
} else {
AddCodeLine ("\tlda\t%s+1", lbuf);
- AddCodeLine ("\tsbc\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tsta\t%s+1", lbuf);
AddCodeLine ("\ttax");
AddCodeLine ("\tlda\t%s", lbuf);
if (val == 1) {
AddCodeLine ("\tjsr\tlsubeq1");
} else {
- AddCodeLine ("\tlda\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tlda\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tlsubeqa");
}
} else {
AddCodeLine ("\tsec");
if (flags & CF_CONST) {
AddCodeLine ("\tlda\t(sp),y");
- AddCodeLine ("\tsbc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)val);
} else {
AddCodeLine ("\tsta\ttmp1");
AddCodeLine ("\tlda\t(sp),y");
AddCodeLine ("\tldx\t#$00");
AddCodeLine ("\tlda\t(ptr1,x)");
AddCodeLine ("\tsec");
- AddCodeLine ("\tsbc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)val);
AddCodeLine ("\tsta\t(ptr1,x)");
} else {
AddCodeLine ("\tldy\t#$%02X", offs);
AddCodeLine ("\tldx\t#$00");
AddCodeLine ("\tlda\t(ptr1),y");
AddCodeLine ("\tsec");
- AddCodeLine ("\tsbc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)val);
AddCodeLine ("\tsta\t(ptr1),y");
}
break;
AddCodeLine ("\tldy\t#$%02X", offs);
AddCodeLine ("\tlda\t(ptr1),y");
AddCodeLine ("\tsec");
- AddCodeLine ("\tsbc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)val);
AddCodeLine ("\tsta\t(ptr1),y");
AddCodeLine ("\tpha");
AddCodeLine ("\tiny");
AddCodeLine ("\tlda\t(ptr1),y");
- AddCodeLine ("\tsbc\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tsta\t(ptr1),y");
AddCodeLine ("\ttax");
AddCodeLine ("\tpla");
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
break;
}
/* FALLTHROUGH */
case CF_INT:
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tbne\t*+4");
- AddCodeLine ("\tcpx\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tcpx\t#$%02X", (unsigned char)(val >> 8));
break;
case CF_LONG:
case CF_CHAR:
case CF_INT:
- AddCodeLine ("\t.word\t$%04X, L%04X", val & 0xFFFF, label & 0xFFFF);
+ AddCodeLine ("\t.word\t$%04X, L%04X",
+ (unsigned)(val & 0xFFFF),
+ (unsigned)(label & 0xFFFF));
break;
case CF_LONG:
- AddCodeLine ("\t.dword\t$%08X", val);
+ AddCodeLine ("\t.dword\t$%08lX", val);
AddCodeLine ("\t.word\tL%04X", label & 0xFFFF);
break;
}
/* If the right hand side is const, the lhs is not on stack but still
- * in the primary register.
+ * in the primary register.
*/
if (flags & CF_CONST) {
case CF_CHAR:
if (flags & CF_FORCECHAR) {
if ((val & 0xFF) != 0xFF) {
- AddCodeLine ("\tora\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tora\t#$%02X", (unsigned char)val);
}
return;
}
case CF_INT:
if (val <= 0xFF) {
- AddCodeLine ("\tora\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tora\t#$%02X", (unsigned char)val);
return;
}
break;
case CF_LONG:
if (val <= 0xFF) {
- AddCodeLine ("\tora\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tora\t#$%02X", (unsigned char)val);
return;
}
break;
case CF_CHAR:
if (flags & CF_FORCECHAR) {
if ((val & 0xFF) != 0) {
- AddCodeLine ("\teor\t#$%02X", val & 0xFF);
+ AddCodeLine ("\teor\t#$%02X", (unsigned char)val);
}
return;
}
case CF_INT:
if (val <= 0xFF) {
if (val != 0) {
- AddCodeLine ("\teor\t#$%02X", val);
+ AddCodeLine ("\teor\t#$%02X", (unsigned char)val);
}
return;
} else if ((val & 0xFF) == 0) {
AddCodeLine ("\tpha");
AddCodeLine ("\ttxa");
- AddCodeLine ("\teor\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\teor\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\ttax");
AddCodeLine ("\tpla");
return;
case CF_LONG:
if (val <= 0xFF) {
if (val != 0) {
- AddCodeLine ("\teor\t#$%02X", val & 0xFF);
+ AddCodeLine ("\teor\t#$%02X", (unsigned char)val);
}
return;
}
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tand\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tand\t#$%02X", (unsigned char)val);
return;
}
/* FALLTHROUGH */
if (val == 0) {
ldaconst (0);
} else if (val != 0xFF) {
- AddCodeLine ("\tand\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tand\t#$%02X", (unsigned char)val);
}
} else if ((val & 0xFF00) == 0xFF00) {
- AddCodeLine ("\tand\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tand\t#$%02X", (unsigned char)val);
} else if ((val & 0x00FF) == 0x0000) {
AddCodeLine ("\ttxa");
- AddCodeLine ("\tand\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tand\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\ttax");
ldaconst (0);
} else {
AddCodeLine ("\ttay");
AddCodeLine ("\ttxa");
- AddCodeLine ("\tand\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tand\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\ttax");
AddCodeLine ("\ttya");
if ((val & 0x00FF) != 0x00FF) {
- AddCodeLine ("\tand\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tand\t#$%02X", (unsigned char)val);
}
}
}
AddCodeLine ("\tstx\tsreg+1");
AddCodeLine ("\tstx\tsreg");
if ((val & 0xFF) != 0xFF) {
- AddCodeLine ("\tand\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tand\t#$%02X", (unsigned char)val);
}
return;
} else if (val == 0xFF00) {
}
} else {
AddCodeLine ("\tclc");
- AddCodeLine ("\tadc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tadc\t#$%02X", (unsigned char)val);
}
break;
}
} else if (FavourSize) {
/* Use jsr calls */
if (val <= 8) {
- AddCodeLine ("\tjsr\tincax%u", val);
+ AddCodeLine ("\tjsr\tincax%lu", val);
} else if (val <= 255) {
ldyconst (val);
AddCodeLine ("\tjsr\tincaxy");
}
} else {
AddCodeLine ("\tsec");
- AddCodeLine ("\tsbc\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tsbc\t#$%02X", (unsigned char)val);
}
break;
}
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tbooleq");
return;
}
/* FALLTHROUGH */
case CF_INT:
- AddCodeLine ("\tcpx\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tcpx\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tbne\t*+4");
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tbooleq");
return;
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tboolne");
return;
}
/* FALLTHROUGH */
case CF_INT:
- AddCodeLine ("\tcpx\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tcpx\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tbne\t*+4");
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tboolne");
return;
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
if (flags & CF_UNSIGNED) {
AddCodeLine ("\tjsr\tboolult");
} else {
}
/* Direct code only for unsigned data types */
if (flags & CF_UNSIGNED) {
- AddCodeLine ("\tcpx\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tcpx\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tbne\t*+4");
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tboolult");
return;
}
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
if (flags & CF_UNSIGNED) {
AddCodeLine ("\tjsr\tboolule");
} else {
case CF_INT:
if (flags & CF_UNSIGNED) {
- AddCodeLine ("\tcpx\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tcpx\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tbne\t*+4");
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tboolule");
return;
}
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
if (flags & CF_UNSIGNED) {
/* If we have a compare > 0, we will replace it by
* != 0 here, since both are identical but the latter
AddCodeLine ("\tora\ttmp1");
AddCodeLine ("\tjsr\tboolne");
} else {
- AddCodeLine ("\tcpx\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tcpx\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tbne\t*+4");
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tboolugt");
}
return;
case CF_CHAR:
if (flags & CF_FORCECHAR) {
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
if (flags & CF_UNSIGNED) {
AddCodeLine ("\tjsr\tbooluge");
} else {
case CF_INT:
if (flags & CF_UNSIGNED) {
- AddCodeLine ("\tcpx\t#$%02X", (val >> 8) & 0xFF);
+ AddCodeLine ("\tcpx\t#$%02X", (unsigned char)(val >> 8));
AddCodeLine ("\tbne\t*+4");
- AddCodeLine ("\tcmp\t#$%02X", val & 0xFF);
+ AddCodeLine ("\tcmp\t#$%02X", (unsigned char)val);
AddCodeLine ("\tjsr\tbooluge");
return;
}
/*****************************************************************************/
-/* Allocating static storage */
+/* Allocating static storage */
/*****************************************************************************/