Hacker News new | ask | show | jobs
by ArtixFox 1059 days ago
thats cool! Is there any project that does this for other architectures?
4 comments

I created this for x86 many years ago: [link redacted]

It's not an emulator, it allows you to assemble code in C++ at runtime. It breaks down the architecture (as it looked at the time) quite detailed, if you are interested :-)

EDIT to add: the .cbi file is a text file that contains most of the documentation: [link redacted]

thank you!!
Right there with you. I'd love one of these for x86-64 or amdgpu. Assemblers are good things (like the sibling to this) but it's a huge effort to translate the ISA docs to an executable representation.

If you've got that encoding <-> code mapping though, you can turn that into an assembler, an emulator and a compiler backend with a sufficiently determined code generator. Probably a profiler and debugger too. That's a whole set of tooling derived from a single source of truth. In the best case, you persuade the people writing the verilog to provide said information as something like xml. More likely it's an error prone transcription from incomplete pdf files.

aw hell yeah, something like this could be ridiculously useful. Been playing with my own interactive low level language[glorified forth, dont wanna touch C and friends again.] and something like this would make life super easy.
There are Sail models for ARM, RISC-V, x86 and MIPS. I think ARM has its own executable spec too.