Path: chuka.playstation.co.uk!news From: "Scott Ward" Newsgroups: scee.yaroze.freetalk.english Subject: Re: The Passmore Tutorial Date: Thu, 29 Jul 1999 02:31:49 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 56 Message-ID: <7noavi$oub23@chuka.playstation.co.uk> References: <379CE1FC.D1528C7C@which.net> <7njp7i$i4m33@chuka.playstation.co.uk> <7nl2q3$oub1@chuka.playstation.co.uk> <7no2dr$oub20@chuka.playstation.co.uk> NNTP-Posting-Host: p20-lorikeet-gui.tch.virgin.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Thanks to James and Alex for clearing that up. Ah, I see the light. I always thought programmers just used hex to make their programs look more complicated, I now understand why it's used in binary. I'm still looking for someone to explain what the '(LSB)' and'(MSB)' bits mean in the FILE FORMATS doc. section on TIM data bytes. If anyone could let me know it would set my mind at ease. It's really bugging me now, god damn it. ;o) Cheers gents, Scott Alex Herbert wrote in message news:7no2dr$oub20@chuka.playstation.co.uk... > Hi Scott, > > Scott Ward wrote in message > news:7nl2q3$oub1@chuka.playstation.co.uk... > > > > Also, why are hex numbers shown as 0x01, 0x04, 0x09, etc. instead of just > > 0x1, 0x4, 0x9 and for that matter, why use hex at all? > > Wouldn't ((tim1.pmode>>3) & 1) be the same as ((tim1.pmode>>3) & 0x01)? > > > > Cheers, > > > > Scott Ward > > > > The reason for hex is that it's binary friendly. Each hex digit represents > 4-bits, so it often more convenient when you're thinking in binary. It also > shows that the programmer was thinking binary (logic) instead of decimal > (numerical), and can make code easier to understand. > > In the original post, the & operator was used with a hex value. This make's > sense as & is a binary operator. & (AND) is useful for clearing selective > bits to 0. | (OR), on the other hand, is useful for setting selective bits > to 1. > > Hex numbers are usually expressed as pairs of digits as each pair makes a > byte. > > > Herbs > >