I just realized that the reason 0x hex literals are so verbose is that C incorrectly bet on octal. 40 years later we’re still paying the price :(
-
-
Replying to @pcwalton
what else would one do? Making `0123` hex would be just as bad!
2 replies 0 retweets 2 likes -
-
Replying to @pcwalton
I dunno - 0x123 makes it obvious it's hex. Plus, allows for `0xa`
1 reply 0 retweets 1 like -
Replying to @strega_nil @pcwalton
(which would then probably have to be `0Ah`?) it's also more obviously generalizable, i.e., `0b1010`, which I think is super useful
2 replies 0 retweets 2 likes -
Replying to @strega_nil
0ah, right. That’s the notation that assemblers used before C existed :)
2 replies 0 retweets 5 likes -
Replying to @pcwalton
that's MASM/TASM, which I think was after C? not sure what older Intel assemblers used MOS and Motorola typically used $
1 reply 0 retweets 1 like -
Replying to @rygorous
Yeah, I just guessed that it went back to the very first assembler. Definitely could be wrong.
1 reply 0 retweets 0 likes -
(Very first assembler for the 8086, that is)
1 reply 0 retweets 0 likes
Google brought up some old Intel 8008 assembly. Looks like the 00h notation existed back then: https://github.com/feilipu/LLL-Floating-Point/blob/master/80_lllf.asm#L60 …
-
-
I think they're pretty much common for intel processors? but not a ton of others.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.