edx = -100500 as int32;
if (SomeFunction() < edx){}
Because SomeFunction will return eax, it will use the current cast of EAX as the primary cast operator.
edx = -100500 as int32;
if (SomeFunction() < edx) {
//should check correctly..
}
// or
edx = -100500;
eax = SomeFunction() as int32;
if (eax < edx) {
//should check correctly..
}
The alternative is that it uses the second operator as a decider for signed/unsigned.
I am planning in a future update to have types specified for functions, but I am not sure how I want to do this yet, I was planning a big update in the near future to have "managed" functions, which will work like high level languages (auto generated assembly) - but this will be after getting everything working perfectly.
SomeFunction may also call some other function in some place.
If we cannot be sure then need to write each time the type of
register. As said above, easy way this is -- to have different operators.
But already implemented other way: uses the status of the first operand.
Then is not such a clear situation.
edx = -100500;
eax = SomeFunction() as int32;
if (eax < edx) {
//should check correctly..
}
// let this function somewhere far away
// and we do not want to check it every time
function SomeFunction() {
if (eax < ecx){
}
}
Useful information, did not know before about this.
But anyway, what if it is inline function?
Also i think that signed|unsigned important also here:
eax = al;
eax = ah;
eax = ax;
And let's count how many we have registers? And in 64bit :) It make programming a bit harder because it means that we need always keep in mind type of register or we need always write type of register(i.e. [type]<reg>).
you mean to keep the casting as global throughout the whole source lifetime?
emm..i think no :)
Maybe not so clear for me and should be documented:
inline function SomeInlineFunction() {
// what kind of type eax here?
// some code
eax as dword;
// some code
}
eax as int32;
SomeInlineFunction();
// what kind of type eax here?