Hi Janny;janni wrote:Maybe you've found another hole in the new rule application? If yes, then post some code.
Is not easy.
look to this,
Code: Select all
dim var_1_16 as word
dim var_2_8 as byte
dim var_3_8 as byte
dim var_temp as word
main:
'Based on the post of Chris
var_1_16 = %0000110011001100
'simple evaluated expression result as byte
var_2_8 = var_1_16 and %00111111
'it's work to me i only changed the constant to show it
var_3_8 = word((var_1_16 and %0000101111000000) >> 6)
' x
'and the correct is as you wrote the compiler make the converssion
var_3_8 = word(var_1_16 >> 6)
'To the new rule work how the old we can write.
'1-> if the var_1_16 need to hold the value:
var_temp = (var_1_16 and %0000111111000000) >> 6
var_3_8 = var_temp 'and we get the same as old
'2-> if the var_1_16 don't need to hold the value:
var_1_16 = (var_1_16 and %0000111111000000) >> 6
var_3_8 = var_1_16 'and we get the same as old
'maybe another form can be found.
nop
end.