Regarding the proposed Binray Literals Deprecation
Patrick Schluter
Patrick.Schluter at bbox.fr
Sun Sep 11 13:01:44 UTC 2022
On Saturday, 10 September 2022 at 19:53:11 UTC, Walter Bright
wrote:
> 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 :-)
Here a short article explaining the idea (it even works up to
AMD64).
https://dercuano.github.io/notes/8080-opcode-map.html#addtoc_2
More information about the Digitalmars-d
mailing list