In the beginning was binary, and the binary was good. A bit was a bit and you knew exactly what it was and *where* it was. 00000010 was clean and clear and when ANDing and/or ORing you could see exactly what was going to happen. But binary is long-winded. Too many ones and zeroes for the common man or woman to deal with. So they invented things like octal and hexadecimal (in addition to using the venerable decimal notation). And every Tom Dick and Harry came up with their own wonderful way of *expressing* all these numbers. Here are some of the ACTUAL ways I have seen numbers expressed in Assemblers and Compilers over the years. And just for jollies I will use the exact same *value* of 204 for ALL of them: 11001100 Straight binary, but are you *really* sure?? 11001100[2] I *think* that means Base Two. 11001100B Yep, it's binary (As an after-thought...) 11001100b Lazy finger version for folks who can't use shift key. B'11001100' Tells you it's Binary right up front! b'11001100' Lazy finger up front version 314[8] 11001100 binary in Octal. 011 001 100 314O Gee, is that a zero (0) at the end, or an "O"? 314o Huh? Whatz dat?? OH! it's an itty bitty "O"! 314Q Well, it's not a zero, but what the #$%* does Q stand for? 314q Aaaargh! I (q)uit! What is that stupid little q doing there? Q'314' I still don't get where that Q comes from. Looks like an "O" q'314' And you thought the Big Q looked funny! 204 The straight decimal value in common decimal notation. (But it MIGHT be something else.... what's your default?) 0204 Allowable, but not often used by normal folks. Still ambiguous. 204. *Someone* thought the decimal point made a spiffy radix indicator. .204 An IDIOT came up with *this* one! 204[10] Explicit subscript/radix form, but confusing to many. (Looks like the tenth member of an array to *me*) 204[D] A slight improvement if you know what the D stands for. 204[d] For those too lazy to hold down the shift key. D'204' Prefix notation. The quote signs freaked out *some* people. d'204' Lazy version of the same thing. 0cc Wow! Hexadecimal for 11001100 . Note how 0 and O look alike... 0cC Mixed version 0Cc The poor compilers had to expect all kinds of trash... 0CC And it twern't too easy for the Assembler, either! 0CCH It's either Hex or a number in some radix >= 18 0cch Sound of a cat expelling a very small hairball. 0ccH Hairballs of varying sizes and shapes... 0cCh 0Cch 0cCH 0CcH 0CCh 0CCH X-rated versions! 0xcc Hairballs expelled with additional sneeze. 0xcC 0xCc 0xCC 0Xcc Bigger sneeze... 0XcC 0XCc 0XCC Humongous Hairball and Gigantic Sneeze. cc$ and those all-time favorites (for you money hungry types) cC$ Cc$ CC$ 0cc$ 0cC$ 0Cc$ 0CC$ $cc $cC $Cc $CC $0cc They have tried every possible variation known to man. $0cC $0Cc $0CC And I'm SURE I must have missed a couple of variants in there somewhere. Don't you just LOVE it when there are so many ways to express something??? I have my own pet theory as to how some of these variants were originally produced. Take the $CC form, for example. I always thought that was SO intuitive. Somebody was smokin' something stronger than tobacco when they came up with THAT one. "Hey, man, gimme a toke on that weed, huh! (puff puff puff) Oh, wow, loookit all the pretty colors. (puff puff puff). Wow, lookit all the slithery shapes. (puff puff puff). What? Yeah, yeah, yeh, back to work. Work! WORK? Hmmm, now what was it that I was workin' on??? Oh yeah. Radishes...rashidishes... no, no, *radixes*. Yeah, that's it. Raxidishies. Gotta come up with a symbol for the HEXADOOCIMAL raxidishi." "H? Heck no! Too easy to remember. X? no No NO! People will figure it out. Must be more convoluted. E? Better... but it's already been used for that stinkin' exxxponenshul thingie. Where's my dictionary when I really need it? Oh, cool. look at that. Before the letter "A" they have all the pretty symbols. Now, of all these pretty, colorful, slithery symbols, which one is the most commonly used and therefore the most brain-busting symbol to use in our compiler? (puff puff puff)." "Why the DOLLAR SIGN, of course!!! And look, while I'm at it, I will just suggest to everyone that they also use the dollar sign as the terminator for strings. Heh heH hEH HEh HEH! Then those fools won't be able to compose strings that contain dollar signs. *That* will serve those capitalists right! How dare they ask people for money for their products! Everything should be free!! Which reminds me, I have to remember to ask my boss for a raise... OK, yeah, use the dollar sign! That will teach those fools to bother *me* while **I'm** smoking!!! Good job!" "Now where did I put that joint? And what is that strange *burning* smell, and why do I feel like my T shirt is on fire? Wow, look at all the cool looking pretty, slithery flames. Urk!" And the rest is history. Fr. Tom McGahee -----Original Message----- From: Harold Hallikainen To: PICLIST@MITVMA.MIT.EDU Date: Thursday, February 03, 2000 10:35 AM Subject: Re: 8 bit hex?! >On Thu, 3 Feb 2000 15:49:24 +0100 Johnny Lindholm > writes: >> Hi, >> I'm into my second week of PIC-programming, until now I've mostly >> done >> 68000 assembler. (This is on pure "hobby level" though!) >> Well, reading through code to snap up some tips and trix I've just >> come >> across the: >> ... >> MOVELW 0CCH >> MOVWF Variable >> ... >> What exactly is this? With the 16F84 as target the registers are >> only 8 >> bit wide. I interpret the last "H" to be a "hex"- indicator and i >> assume >> the hex code is "CC" but then why the first "0"??? >> > > I believe the leading 0 indicates to the assembler that this is a >literal number, not a label. I generally use 0xCC to indicate this is a >hex number, d'34' for decimal, and b'10101010' for binary. > >Harold > >________________________________________________________________ >YOU'RE PAYING TOO MUCH FOR THE INTERNET! >Juno now offers FREE Internet Access! >Try it today - there's no risk! For your FREE software, visit: >http://dl.www.juno.com/get/tagj. >