Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Assignment of TH and TL by Single Chip Microcomputer
Assignment of TH and TL by Single Chip Microcomputer
it's the same, the first type is 65536-1 = 55536, and 55536 is converted into hexadecimal, that is, D8F, TH=XD8 is the upper 8 bits, and TL=xF is the lower 8 bits.

the second th =-1/256; TL =-1%256; Equivalent to: TH= 65536-1/256;/256; TL =65536-1%56; After that operation, TH = 55536/256; TL =55536%256; .

55536/256 is equivalent to the upper 8 bits, that is, XD8;; 55536%256 is equivalent to the lower 8 bits, which is XF.

So it's just that the way of assignment is different, but the result is the same!