TypeError when running x64 instructions
Howdy,
Using any x64 register will result in the following crash:
irasm.rb:2841:in '+': no implicit conversion of nil into String (TypeError)
from irasm.rb:2841:in 'modrmmodrm_results'
from irasm.rb:2195:in 'modrmmodrm'
from irasm.rb:60:in 'main'
from irasm.rb:4073:in '<main>'
some examples:
- inc byte [any x64 register]
- add byte [any x64 register], al
- add dword [any x64 register], al
This tool was only ever intended to support 32-bit (which I was unclear about in the description, I will update the README soon). I don't have any immediate plans for supporting 64-bit with this tool.
That said, it does generaly support a fallback to nasm for commands that it can't parse (it acts like nasm_shell). I will look into changing the parsing so it doesn't try to interpret 64-bit instructions as an error and just hand them off to nasm instead. You could also use nasm_shell in the meantime until then as well.
So like I said, I don't plan to "support" (by that I mean have redundancy) 64 bit instructions, it just doesn't give freakout errors when you use 64bit instructions. Typically (hopefully) though, for well formed instructions, nasm and objdump will still attempt to do it's thing as the fall back and report the "official" machine code. I wouldn't trust it though, it's just better than an error+exit.
Sample output with new changes (obviously not perfect, but better): irasm > inc byte [rax] FE00 inc BYTE PTR [rax](Provided by Nasm)
irasm > add byte [rax], al 0000 true (Provided by Nasm)
irasm > add dword [rax], al There was an error with your Assembly (or I couldn't parse it)
irasm > xor ebx, ebp 31EB xor ebx,ebp
33DD xor ebx,ebp (The 'Other' ModR/M)
irasm > xor rbx, rbp 4831EB xor rbx,rbp (Provided by Nasm)
irasm >