completely wrong. Chebychev (Remez), Padé, and maybe Taylor.
[fmap.git] / x86_64_sse2_x87 / fasm / examples / x86 / include / ext / movbe.inc
blob02d4548f3410008b8bc030686c9ca9caf2656f26
1 ; CPUID Fn0000_0001_ECX[MOVBE] = 1
2 calminstruction movbe? dest*,src*
3         asmcmd  =x86.=parse_operand =@dest,dest
4         asmcmd  =x86.=parse_operand =@src,src
6         local   size
8         check   @dest.size <> 0 &  @src.size <> 0 & @dest.size <> @src.size
9         jyes    operand_sizes_do_not_match
11         compute size, @dest.size or @src.size
12         check   size > 1
13         jno     invalid_operand_size
15     main:
16         check   @dest.type = 'reg' & @src.type = 'mem'
17         jyes    movbe_reg_mem
18         check   @dest.type = 'mem' & @src.type = 'reg'
19         jyes    movbe_mem_reg
21     invalid_combination_of_operands:
22         asmcmd  =err 'invalid combination of operands'
23         exit
25     movbe_reg_mem:
26         asmcmd  =x86.=select_operand_prefix =@src,size
27         asmcmd  =x86.=store_instruction <0Fh,38h,0F0h>,=@src,=@dest.=rm
28         exit
30     movbe_mem_reg:
31         asmcmd  =x86.=select_operand_prefix =@dest,size
32         asmcmd  =x86.=store_instruction <0Fh,38h,0F1h>,=@dest,=@src.=rm
33         exit
35     invalid_operand_size:
36         asmcmd  err 'invalid operand size'
37         compute size, 0
38         jump    main
40     operand_sizes_do_not_match:
41         asmcmd  err 'operand sizes do not match'
42         compute size, 0
43         jump    main
44 end calminstruction