3 ms·
> A library that can generate opcodes without exposing all the fiddly mod/rm stuff is probably just as good as the preprocessor tool. I'm skeptical that such a
by haberman 14y ago
> A library that can generate opcodes without exposing all the fiddly mod/rm stuff is probably just as good as the preprocessor tool.
I'm skeptical that such a library could have a very simple or clean interface -- the "mov" instruction alone has almost 40 variants, all encoded in different ways -- but if you ever create such a thing I promise to check it out and give it a fair opinion. :)
- tptacek 14y agoMost of the x64 instruction set shares a common set of addressing mode variants all encoded the same way. I've done this from C (messily) and from Ruby (very cleanly) and while the x64 ISA is definitely a pain to work with directly, it's not so painful that I think it defies the abstractions C provides natively. :)