But I have not idea what to do with commands that can use negative numbers like
int d = (stack < 127 ? -stack : -127);
emit2 ("add sp, #%d", d);
both !immedbyte and !immedword are replaced with 32-bit long number when parameter is negative:
emit2("add sp, !immedbyte", -15) give us "add sp, #0xFFFFFFF1"
Is this a bug?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Related
Wiki: z80
But I have not idea what to do with commands that can use negative numbers like
int d = (stack < 127 ? -stack : -127);
emit2 ("add sp, #%d", d);
both !immedbyte and !immedword are replaced with 32-bit long number when parameter is negative:
emit2("add sp, !immedbyte", -15) give us "add sp, #0xFFFFFFF1"
Is this a bug?
Implemented for all "#0x" in revision #7917.
Philipp
Keeping it open for the other #-prefixed stuff.
The !immedword substitution was applied in revision #7919. AFAIk there currently is no mechanism like this for negative numbers.
Philipp