All pastes #10360 Raw Edit

Stuff

public text v1 · immutable
#10360 ·published 2005-04-26 11:58 UTC
rendered paste body
void SpeedCommand(signed short val) {
	unsigned char b1,b2;
	b1 = val & 0x00FF;
	b2 = val >> 8;
	printf("data: %x\n",val);
	printf("byte1: %x  byte2: %x\n",b1,b2);
}

Called like this:

    short test = 0x4080;
    SpeedCommand(test);

Gives this:

data: 4080
byte1: 80  byte2: 40

Shouldnt it be the other way around?