core: implement VariableExpression and use it to improve flags handling ; arch_x86: use VariableExpression to update flags