disasmarm.d now can be a standalone program

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Sep 5 05:31:29 UTC 2024


On 05/09/2024 4:17 PM, Walter Bright wrote:
> I've been using godbolt.org to figure out which #AArch64 instructions 
> are generated for which operations, as I find the instruction 
> descriptions are frequently baffling.
> 
> But I've been reduced to taking the godbolt 8 bit hex instructions and 
> compare them against the 2000 #AArch64 instructions to get a match (yes, 
> the mnemonic helps a lot, but as many mnemonics have multiple encodings, 
> it's back to tedium). It's laborious because the instruction encodings 
> do not line up on byte boundaries, so I have to convert it to binary and 
> then mark out the bit fields by hand (dammit D needs bit fields!)
> 
> I finally realized disasmarm.d can help. I fixed it so one just types in 
> the 8 hex bytes on the command for the instruction, and it will 
> disassemble it and provide the correct URL to the manual page for that 
> instruction.
> 
> disasmarm.d can be compiled with:
> 
> ```
> dmd disasmarm.d -version=StandAlone
> ```
> 
> to make a standalone program and it will do a little disassembling:
> 
> ```
> ./disasmarm fd401bff
> FD 40 1B FF  ldr d31,[sp,#0x30] // 
> https://www.scs.stanford.edu/~zyedidia/arm64/encodingindex.html#ldst_pos
> ```
> 
> It's incomplete as it doesn't yet handle all the encodings, but I work 
> on it as needed.

At this rate we'll have our own objdump before a years end! (Year 
unspecified)


More information about the Digitalmars-d mailing list