Reputation: 293
How to simply get a code of exactly one assembly instruction?
For example for "mov eax 0x14". I want to get it in linux terminal preferably with gcc or gdm.
Upvotes: 1
Views: 2007
Reputation: 521
rasm2 from the radare2 package fits this purpose nicely:
$ rasm2 'nop'
90
$ rasm2 -d '90'
nop
http://radare.org/y/?p=examples&f=rasm
Upvotes: 2
Reputation: 58822
$ echo "mov eax, 0x14" | as -o /dev/null -al -msyntax=intel -mnaked-reg
GAS LISTING page 1
1 0000 B8140000 mov eax,0x14
1 00
Upvotes: 6