There are 34 different versions of the MOV mnemonic. All of them use different kinds and sizes of operands.
There are 8 general purpose registers.
The MOV mnemonic takes two operands, so there are about 8*34*2 = 544 combinations.
You might think I'm forgetting the immediate values: that will decrease the amount of possibilities. Yes, but I'm not mentioning the abilities to do [eax], [eax+2] and [4*eax+ebx] either.
Anyway, I've seen people trying to convert assembly to machine code before, but they all wrote a different function for every single combination.
Not really handy, I'd say...
Right now this assembler supports the following functions:
A hell load of Jump functions (JA, JAE, etc)
You could probably understand that I haven't had the time yet to test them all...
This is an example code. It should work... I hope (It works on my 32 bit computer. I don't see why it wouldn't work on a 64 bit system)
$Code = ASMInstruction("MOV","eax",10) & _ ; Move '10' to EAX
ASMInstruction("ADD","eax",1) & _ ; Add '1' to EAX
ASMInstruction("INC","eax") & _ ; Increase EAX (same as ADD(EAX,1) but faster)
ASMInstruction("XOR","ebx","ebx") & _ ; Shortcut for making EBX zero(0)
ASMInstruction("MOV","bl",2) & _ ; Move '2' to BL
ASMInstruction("ADD","eax","ebx") & _ ; Add EBX to EAX
ASMInstruction("RET") ; Return EAX
$hCode = ASMCompile($Code)
$iRetVal = ASMExecute($hCode)
You need to download both attachments, and have to put them in the same directory.
IA-32 Instruction Set.txt