Soluzione proposta da DJGecchi

.method livellatore(x,y)
.var
.end_var
	ILOAD X
	ILOAD Y
	IFICMPEQ zero //se x==y return 0
	LDCW objref	//altrimenti carico objref: ci sarà sicuramente una chiamata di metodo
	ILOAD X
	ILOAD Y
	ISUB //eseguo x-y
	IFLT incy //se x-y < 0 significa che x < y
	ILOAD X
	BIPUSH 1
	ISUB //x-1
	ILOAD Y
	INVOKEVIRTUAL livellatore
	GOTO end
incy	ILOAD X
	ILOAD Y
	BIPUSH 1
	ISUB //y-1
	INVOKEVIRTUAL livellatore
	GOTO end
	zero:	BIPUSH 0
	IRETURN
end:	BIPUSH 1 //ad una delle due chiamate di metodo...
	IADD //...dev?essere sommato 1
	IRETURN
zero:	BIPUSH 0
	IRETURN

.end_method













