Regarding the proposed Binray Literals Deprecation

Walter Bright newshound2 at digitalmars.com
Sat Sep 10 19:53:11 UTC 2022


On 9/10/2022 12:15 PM, Patrick Schluter wrote:
> 8080/8085/Z80 opcodes when expressed in octal are much easier to handle. 

I've never seen 8080/Z80 opcodes expressed in octal. I know that the modregrm 
byte for the x86 is 2,3,3, but I deal with that by using an inline function to 
manipulate it. It never occurred to me to use octal. Interesting.

ubyte modregrm (uint m, uint r, uint rm)
     { return cast(ubyte)((m << 6) | (r << 3) | rm); }

https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/code_x86.d#L508

Of course, bit fields might be better :-)


More information about the Digitalmars-d mailing list