#define MAX (1000*1000)

if (MAX > 32767)
    position = 0;