Sorry for the delayed reply, the U.S. tax deadline has caught up with me, so I spent the last two evenings doing my taxes. (Yuck!)
Anyway... On 4/8/19 6:18 PM, Richard Henderson wrote: > On 4/8/19 8:27 AM, Jan Bobek wrote: >> 2. Note the '-std=c99' switch in the command-line above; without it, >> GCC defines the symbol 'i386' to 1 and the preprocessor magic for >> including arch-specific headers in risu.h breaks. Does anyone have >> an idea how to fix this in a more robust way? > > Adding -U$(ARCH) to the command line is probably as good a fix as any. I didn't know about -U, nice! >> 3. gas (the GNU assembler) chokes on the syntax of test_i386.s; that's >> why I'm using nasm as the assembler above. Is that intentional? I >> haven't found the nasm dependency mentioned anywhere. > > I think rewriting to not require nasm is better. Agreed. >> Also, nasm will happily emit the UD1 opcode (0F B9) with no >> operands (see test_i386.s). That's a bit surprising to me, since >> Intel's Software Developer's Manual says UD1 has two operands; I'd >> expect at least a follow-up ModR/M byte. gas refuses to assemble >> UD1 with no operands, and gdb's disassembler gets confused when I >> load up the nasm's binary into risu. Is there something obvious >> that I'm missing? > > You are not missing anything -- ud1 should require a modrm byte. > > My suggestion is to use only UD1 as the "break" insn, with the different OP_* > codes encoded into the modrm byte. I had to laugh when I read this; this is *exactly* what I had in mind, but then I found out there was no ModR/M byte. >> P.S. This is my first time using git send-email, so please bear with >> me if something goes wrong and/or let me know how I can improve >> my future submissions. Thank you! > > You've done well with git send-email. ;-) Thanks a lot! :) -Jan
signature.asc
Description: OpenPGP digital signature