Provided you use a number which is a power of 2 ( such a 1024 = 2^10 ) you can fake integer division with a shift.
Thus ( size Shr 10 ) is the size divided by 1024. And Shr doesn't care if size is positive or negative.
Thus ( size Shr 10 ) is the size divided by 1024. And Shr doesn't care if size is positive or negative.