Page 1 of 1

Variable size declrations being ignored

PostPosted: Wed May 13, 2015 3:14 pm
by Timbo
Its in me to always produce the smallest code I can, so I regularly check the asm for bloat

So I modified some code from doing a mod on a UIntriguer to count to 10 to a simple inc routine

Dim _100hZTick as byte

if OnTick <> nothing then
IF _100hZTick = 10 THEN
_100hZTick = 0
RaiseEvent OnTick() ' raise event
end if
end if

But looking at the asm I see

SimCapture 1.PNG
SimCapture 1.PNG (12.65 KiB) Viewed 21272 times


My byte assignment of the variable has been ignored and turned into a Dword

Is this the case for every variable I declare?

thanks

Re: Variable size declrations being ignored

PostPosted: Wed May 13, 2015 3:27 pm
by Timbo
OK It seems I have managed screwed up.

I saved and compiled files but when checking the time stamps it seems I was looking at the wrong version of the file to check the ASM

Looking now and it is indeed producing very compact byte based code.


So 3 balls up in one day. I need to test more and post less....

Re: Variable size declrations being ignored

PostPosted: Wed May 13, 2015 7:22 pm
by Jerry Messina
I need to test more and post less....


So far today you're doing pretty good. At the rate you're going perhaps you should post MORE, and that way maybe you'll get answers even faster!