Re: numbers written in ascii... looking for all common (and some uncommon) forms....
From: Bx.C (invalid-email-address_at_invalid.shiragajin)
Date: 02/25/04
- Next message: Bx.C: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Previous message: The Half A Wannabee: "Even brute force was better then Delphi !"
- In reply to: Beth: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Next in thread: Beth: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Reply: Beth: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 24 Feb 2004 20:24:38 -0600
(big snips)
> Allowing 8 and 9 into an octal constants, though, is asking for
> confusion, isn't it? Seems about as "sensible" as Intel's infamous
> "real-mode addressing", allowing something like this to have a
> non-normalised form where more than one constant can actually be
> different but numerically the same: 018 and 020, both being 16
> decimal...
ack!! is 019 = 021? or is both 018 and 019 = 020 ?
well.. (on a side note) ...we all know that halloween IS christmas
OCTal/OCTober 31 = DECimal/DECember 25... i still find that coincidence very
strange...
> I confess to have never even known about this before (perhaps I did
> read it once - I have looked through this book a few times but usually
> as "reference" rather than "cover to cover" - so I might have seen it
> before but totally forgot about it five minutes later, if I did ;),
> let alone used it...until you tipped me off and I checked it up in my
> C book just now...as I say, I'm not in any way a "fan" of octal so I
> didn't miss not knowing that this existed (although, all hell would
> have broken loose - without me understanding why - if I'd used the
> "leading zero" stuff that I actually do use in ASM coding and hex
> costants in C...but, thankfully, I never do that with decimal
> constants (I think of those like "human numbers" so leading zeroes
> just don't seem right ;) or I'd have landed myself in trouble with C
> syntax unintentionally and it would have taken them all to be octal!
> E.g. I like to write "mov ah, 4Ch" or "mov ax, 0013h" or "move ax,
> 00001234h" _with_ the leading zeroes so that the intended size of the
> constant is clear as crystal from reading the source...it's also just
> great for aligning your source code too; If you have a whole bunch of
> dword-sized data in an array then I like to align it all into neat
> "columns" and "rows" for reading...it's just a whole lot easier on the
> eyes and tidy than comma and digits thrown arbitrarily into a big mess
> of numbers somewhere ;)...
>
> Beth :)
>
i do much the same... except i throw in an extra leading zero...
4Ch = 04Ch
0013h = 00013h
00001234h = 000001234h
reason being, is that if it begins w/ A-F, you have to put a leading zero
anyway (or some other non-alpha) character, or the assembler will decide
that it's an identifier.... so to line up everything, i always have a
4-character text string for bytes (0xxh), 6 character text string for words
(0xxxxh), and 10 character text string for dwords(0xxxxxxxxh)...
now if it's not being placed into an assembly language file... but rather
it's a hex value that's being displayed to the screen (usually in such
instances, hex is implied anyway) then i'll just drop my usual leading 0 and
the trailing h
- Next message: Bx.C: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Previous message: The Half A Wannabee: "Even brute force was better then Delphi !"
- In reply to: Beth: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Next in thread: Beth: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Reply: Beth: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|