I always use as from binutils for that. E.g:
$ echo -e "MOV DWORD PTR [RSP+4], 0x12345678" | as -o /dev/null -64 -al -msyntax=intel -mnaked-reg
GAS LISTING page 1
1 0000 C7442404 MOV DWORD PTR [RSP+4],0x12345678
1 78563412
$ echo -e "push eax" | as -o /dev/null -32 -al -msyntax=intel -mnaked-reg
GAS LISTING page 1
1 0000 50 push eax