tyilo / asm_repl

A REPL for assembly
100 stars 9 forks source link

Trying to load an XMM register hangs #1

Closed shepmaster closed 9 years ago

shepmaster commented 9 years ago

I tried to run this, but it just hangs. :crying_cat_face:

mov xmm0, 0x0123456789abcdef
tyilo commented 9 years ago

You can't move an immediate value to an xmm0 register in x86 assembly. You would have to do something like:

mov rax, 0x0123456789abcdef
movq xmm0, rax

The reason that you don't get an error and it just hangs is that I was using radare's own x86 assembler, which basically doesn't have any error handling. I have switched to using nasm.

Anyways I probably would like to add a command to show and write to floating point registers

tyilo commented 9 years ago

I have tried to implement the command I talked about.

Usage:

> .show fpr-hex
fpr-hex toggled on
> .regs

 xmm0: 00000000000000000000000000000000
...
> .set xmm0 fedcba98765432100123456789abcdef
> .regs

 xmm0: FEDCBA98765432100123456789ABCDEF
 ...

Does this do what you want?

shepmaster commented 9 years ago

It certainly seems to, thanks!

tyilo commented 9 years ago

Cool!