- Code: Select all
procedure Test;
begin
//
end;
function Test2 : Integer;
begin
Result := 1;
end;
exports Test, Test2;
Moderators: Sascha Willems, walaber
procedure Test;
begin
//
end;
function Test2 : Integer;
begin
Result := 1;
end;
exports Test, Test2;
function _Fibonacci::_Calculate
enter 14
argument _n ; passed on the stack
reg3 = [_n]
reg1 = 0
if (reg3 != reg1) goto label1
reg0 = 0
goto label0
label1:
reg1 = 1
if (reg3 != reg1) goto label2
reg0 = 1
goto label0
label2:
reg1 = reg3 - 1
push reg1
call _Fibonacci::_Calculate
reg2 = reg0
reg1 = reg3 - 2
push reg1
call _Fibonacci::_Calculate
reg0 = reg2 + reg0
label0:
exit 14
ret 4
?Calculate@@YAHH@Z
push esi
mov esi, DWORD PTR _n$[esp]
cmp esi, 1
jne SHORT $LN1@Calculate
mov eax, esi
pop esi
ret 0
$LN1@Calculate:
lea eax, DWORD PTR [esi-1]
push edi
test eax, eax
jne SHORT $LN16@Calculate
xor edi, edi
jmp SHORT $LN11@Calculate
$LN16@Calculate:
push eax
call ?Calculate@@YAHH@Z ; Calculate
add esp, 4
mov edi, eax
$LN11@Calculate:
lea eax, DWORD PTR [esi-2]
test eax, eax
jne SHORT $LN24@Calculate
mov eax, edi
pop edi
pop esi
ret 0
$LN24@Calculate:
push eax
call ?Calculate@@YAHH@Z ; Calculate
add esp, 4
add eax, edi
pop edi
pop esi
ret 0
function _Fibonacci::_main
enter 1
reg0 = 0
push reg0
call _Fibonacci::_Calculate
reg0 = 1
push reg0
call _Fibonacci::_Calculate
reg0 = 2
push reg0
call _Fibonacci::_Calculate
reg0 = 3
push reg0
call _Fibonacci::_Calculate
reg0 = 4
push reg0
call _Fibonacci::_Calculate
exit 1
ret 0
function _Fibonacci::_Calculate
enter 14
argument _n ; passed on the stack
reg3 = [_n]
reg1 = 0
if (reg3 != reg1) goto label1
reg0 = 0
goto label0
label1:
reg1 = 1
if (reg3 != reg1) goto label2
reg0 = 1
goto label0
label2:
reg1 = reg3 - 1
push reg1
call _Fibonacci::_Calculate
reg2 = reg0
reg1 = reg3 - 2
push reg1
call _Fibonacci::_Calculate
reg0 = reg2 + reg0
label0:
exit 14
ret 4
function _Fibonacci::_Calculate
enter 6
argument _n ; passed on the stack
reg2 = [_n]
reg0 = 0
if (reg2 != reg0) goto label1
reg0 = 0
goto label0
label1:
reg0 = 1
if (reg2 != reg0) goto label2
reg0 = 1
goto label0
label2:
reg0 = reg2 - 1
push reg0
call _Fibonacci::_Calculate
reg1 = reg0
reg0 = reg2 - 2
push reg0
call _Fibonacci::_Calculate
reg0 = reg1 + reg0
label0:
exit 6
ret 4
public static void qsort (int[] a, int left, int right)
{
int i = left, j = right;
int tmp;
int pivot = a[(left + right) / 2];
while (i <= j) {
while (a[i] < pivot)
i++;
while (a[j] > pivot)
j--;
if (i <= j) {
tmp = a[i];
a[i] = a[j];
a[j] = tmp;
i++;
j--;
}
}
if (left < j)
qsort (a, left, j);
if (i < right)
qsort (a, i, right);
}
function _Fibonacci::_qsort
enter 255
argument _a ; passed on the stack frame t1
argument _left ; passed on the stack frame t2
argument _right ; passed on the stack frame t3
reg5 = [_a]
reg2 = [_left]
reg1 = [_right]
reg7 = reg2
reg6 = reg1
reg0 = reg2 + reg1
reg0 = reg0 / 2
reg0 = [reg5 + reg0 * 4]
if (reg2 > reg1) goto label_11
label_1:
reg7 = reg7 - 1
label_3:
reg7 = reg7 + 1
reg4 = [reg5 + reg7 * 4]
if (reg4 < reg0) goto label_3
reg6 = reg6 + 1
label_6:
reg6 = reg6 - 1
reg3 = [reg5 + reg6 * 4]
if (reg3 < reg0) goto label_6
if (reg7 > reg6) goto label_9
[reg5 + reg7 * 4] = reg3
[reg5 + reg6 * 4] = reg4
reg7 = reg7 + 1
reg6 = reg6 - 1
label_9:
if (reg7 <= reg6) goto label_1
label_11:
if (reg2 >= reg6) goto label_12
push reg6
push reg2
push reg5
call _Fibonacci::_qsort
label_12:
if (reg7 >= reg1) goto label_14
push reg1
push reg7
push reg5
call _Fibonacci::_qsort
label_14:
leave 255
ret 12
public class coalescing
{
public static int coalescing (int a, int b)
{
int d = 0;
int e = a;
do {
d = d + b;
e = e - 1;
} while (e>0);
return d;
}
}
?coalescing@@YAHHH@Z PROC ; coalescing, COMDAT
push ebp
mov ebp, esp
mov ecx, DWORD PTR _a$[ebp]
mov edx, DWORD PTR _b$[ebp]
xor eax, eax
$LL3@coalescing:
dec ecx
add eax, edx
test ecx, ecx
jg SHORT $LL3@coalescing
pop ebp
ret 0
function _coalescing::_coalescing
enter 7
argument _a ; passed on the stack frame t1
argument _b ; passed on the stack frame t2
$0 = [_a]
$2 = [_b]
$3 = 0
$1 = 0
label_1:
$3 = $3 + $2
$0 = $0 - 1
if ($0 > $1) goto label_1
leave 7
ret 8
class string
{
string ()
{
}
string (byte[] data)
{
m_data = new init (data);
}
// public interface to native code
native int lenght() const;
// private interface to native code
private native void[] init (byte[] data);
// data is native
private void[] m_data;
}
void* init (VirtualMachinen*const machine, void* const parentClass, int argumentCount, ...);
void* length (VirtualMachinen*const machine, void* const parentClass, int argumentCount, ...)
class myString: public string
{
int lenght() const
{
return super::lenth();
}
}
Forthehorde wrote:I think I will use this for my game instead of Lua.
speps wrote:Forthehorde wrote:I don't understand the goal of Julio as there are loads of alternatives to Lua, including an object oriented spinoff (Squirrel)...
Users browsing this forum: No registered users and 2 guests