NefMoto

Technical => Reverse Engineering => Topic started by: elRey on January 22, 2013, 08:37:40 AM



Title: lambda on a 16bit LoHi, 1 = 7FFF or 1 = 8000 ?
Post by: elRey on January 22, 2013, 08:37:40 AM
For lambda on a 16bit LoHi scale, does 1 = 7FFF or 1 = 8000 ?

I know on a 8bit scale 1 = 80 which leads me to believe 1 = 8000 on 16bit.

Thanks,
Rey


Title: Re: lambda on a 16bit LoHi, 1 = 7FFF or 1 = 8000 ?
Post by: phila_dot on January 22, 2013, 08:56:44 AM
1000h

7FFFh is max postive signed word and 8000h is max negative signed word.


Title: Re: lambda on a 16bit LoHi, 1 = 7FFF or 1 = 8000 ?
Post by: slowrider on January 22, 2013, 10:11:02 AM
0000h LoHi => 0
0100h LoHi => 1
0200h LoHi => 2
1000h LoHi => 16


Title: Re: lambda on a 16bit LoHi, 1 = 7FFF or 1 = 8000 ?
Post by: nyet on January 22, 2013, 11:45:48 AM
btw just a nitpick LoHi is immaterial in this discussion if you are expressing hex terms in short words and not bytes.

i.e.

0x1234 = 0x12 0x34 HiLo
0x1234 = 0x34 0x12 LoHi

Both are 0x1234 :)

When expressing values, they're always expressed big endian


Title: Re: lambda on a 16bit LoHi, 1 = 7FFF or 1 = 8000 ?
Post by: nyet on January 22, 2013, 11:48:14 AM
0000h LoHi => 0
0100h LoHi => 1
0200h LoHi => 2
1000h LoHi => 16

More properly:

01h 00h LoHi = 1 = 0001h
02h 00h LoHi = 2 = 0002h
10h 00h LoHi = 16 = 0010h