Regarding the proposed Binray Literals Deprecation

Patrick Schluter Patrick.Schluter at bbox.fr
Sat Sep 10 19:15:06 UTC 2022


On Saturday, 10 September 2022 at 02:31:05 UTC, Walter Bright 
wrote:
> On 9/9/2022 4:53 PM, Adam D Ruppe wrote:
>> The nice thing is D lets you group the bits withunderscores.
>
> Yes, that is a great feature I copied from Ada, where it had 
> lain forgotten. Now everyone is adding it!
>
>> So you might do like 0b11_111_101_001 which makes it a lot 
>> easier to manage and you can group something like a flags 
>> register the same way it appears in the documentation.
>
> I haven't seen CPUs that were documented in octal since the 
> PDP-11, even though it didn't quite work with 16 bits. It was a 
> holdover from the 36 bit PDP-10. 8 and 16 bit processors ever 
> since used hex.

8080/8085/Z80 opcodes when expressed in octal are much easier to 
handle. Emulators is a niche domain but a lot of CPU and 
peripheral registers have quite often octal fields. Of course, 
hex is often enough to handle them.



More information about the Digitalmars-d mailing list