OK, I have added this to my todo list. Thanks.
Augmented assignment
A community discussion post from the original code:zIRON forum.
Replies
Seems that it also not so hard to do:
dword a, b, d;
a = b + d;
a = b - d;
a = b | d;
a = b ^ d;
a = b & d;
a = b >> d;
a = b << d;
a = b * d;
a = b / d;
Can be translated as:
eax = b; eax += d; a = eax; // uses eax
eax = b; eax -= d; a = eax; // uses eax
eax = b; eax |= d; a = eax; // uses eax
eax = b; eax ^= d; a = eax; // uses eax
eax = b; eax &= d; a = eax; // uses eax
eax = b; ecx = d; eax >> cl; a = eax; // uses eax, ecx
eax = b; ecx = d; eax << cl; a = eax; // uses eax, ecx
eax = b; mul d; a = eax; // uses eax
eax = b; edx = 0; div d; a = eax; // uses eax, edx
And yet about
eax and edx changing without the programmer understanding this
Programmer should know that in this case(dividing of dword) after such instructions as 'div' and 'idiv' the remainder stores in 'edx'. And of course 'edx' will changes :)
And 'mul' may also corruptes 'edx'. Also flags are corrupted(even if you do just eax += ebx). But you do not save flags.
My point that such things should be documented. But our documentation still not have needed explanation about it.
Can You add the ability to use?
program RAW_IMAGE 'test';
#set bits 32;
al = CF;
al = PF;
al = ZF;
al = SF;
al = OF;
Currently
Instruction usage is not supported!
Hmm this I wonder if would better added as macros.
maybe something like...
inline function getCF() {
setc al
$return al;
}
al = getCF();
then you can easily use dl = getCF();
which will translate to
setc al
mov dl, al
what do you think?
Is it too hard to implement?
al = CF;
Cause this is more shorter than GetCF().
And just by analogy: if we want to set dl to al we write "al = dl" but not "al = Getdl()"
setc does not work with al etc, so it means you would physically need to write:
al = CF;
dl = al;
vs
dl = getCF();
But i will consider to inbuild this to automate dl = CF; etc.
Sorry for very very very late response, but exactly is it you want al = cf to do?