01.11.2015, 09:41
its*
A function doesn't iterate through its parameters; they are pushed onto the stack in reverse order.
PUSH c
PUSH b
PUSH a
The frame now looks like this:
12+8 - c
12+4 - b
12+0 - a
12 - arg count
8 - return addr
4 - ??
0 - return pos
If you look at the assembly output, you will see why it makes sense to do it that way.
They're not concurrent (that would be crazy!). You can also do if/and/or/else without an if-statement.
A function doesn't iterate through its parameters; they are pushed onto the stack in reverse order.
PUSH c
PUSH b
PUSH a
The frame now looks like this:
12+8 - c
12+4 - b
12+0 - a
12 - arg count
8 - return addr
4 - ??
0 - return pos
If you look at the assembly output, you will see why it makes sense to do it that way.
Quote:
Today I learned that you can have concurrent operations using the comma operator.
Код:
new i, j; j = 0; i = (j++, j+=1, j+=1, j *= 2, j /= 10, j += 15, j * 2); |
pawn Код:
a && (a = 0) || (b = 1)
// translation:
if (a) {
a = 0;
} else {
b = 1;
}
a && (a = 0, b) && (b = 0, c) && (c = 0, d) && (d = 0)
// translation:
if (a) {
a = 0;
if (b) {
b = 0;
if (c) {
c = 0;
if (d) {
d = 0;
}
}
}
}