Subversion Repositories Kolibri OS

Rev

Rev 872 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. ; flat assembler core
  3. ; Copyright (c) 1999-2007, Tomasz Grysztar.
  4. ; All rights reserved.
  5.  
  6. simple_instruction_except64:
  7.         cmp     [code_type],64
  8.         je      illegal_instruction
  9. simple_instruction:
  10.         stos    byte [edi]
  11.         jmp     instruction_assembled
  12. simple_instruction_only64:
  13.         cmp     [code_type],64
  14.         jne     illegal_instruction
  15.         jmp     simple_instruction
  16. simple_instruction_16bit_except64:
  17.         cmp     [code_type],64
  18.         je      illegal_instruction
  19. simple_instruction_16bit:
  20.         cmp     [code_type],16
  21.         jne     size_prefix
  22.         stos    byte [edi]
  23.         jmp     instruction_assembled
  24.       size_prefix:
  25.         mov     ah,al
  26.         mov     al,66h
  27.         stos    word [edi]
  28.         jmp     instruction_assembled
  29. simple_instruction_32bit_except64:
  30.         cmp     [code_type],64
  31.         je      illegal_instruction
  32. simple_instruction_32bit:
  33.         cmp     [code_type],16
  34.         je      size_prefix
  35.         stos    byte [edi]
  36.         jmp     instruction_assembled
  37. simple_instruction_64bit:
  38.         cmp     [code_type],64
  39.         jne     illegal_instruction
  40.         mov     ah,al
  41.         mov     al,48h
  42.         stos    word [edi]
  43.         jmp     instruction_assembled
  44. simple_extended_instruction_64bit:
  45.         cmp     [code_type],64
  46.         jne     illegal_instruction
  47.         mov     al,48h
  48.         stos    byte [edi]
  49. simple_extended_instruction:
  50.         mov     ah,al
  51.         mov     al,0Fh
  52.         stos    word [edi]
  53.         jmp     instruction_assembled
  54. prefix_instruction:
  55.         stos    byte [edi]
  56.         or      [prefixed_instruction],-1
  57.         jmp     continue_line
  58. segment_prefix:
  59.         mov     ah,al
  60.         shr     ah,4
  61.         cmp     ah,6
  62.         jne     illegal_instruction
  63.         and     al,1111b
  64.         mov     [segment_register],al
  65.         call    store_segment_prefix
  66.         or      [prefixed_instruction],-1
  67.         jmp     continue_line
  68. int_instruction:
  69.         lods    byte [esi]
  70.         call    get_size_operator
  71.         cmp     ah,1
  72.         ja      invalid_operand_size
  73.         cmp     al,'('
  74.         jne     invalid_operand
  75.         call    get_byte_value
  76.         mov     ah,al
  77.         mov     al,0CDh
  78.         stos    word [edi]
  79.         jmp     instruction_assembled
  80. iret_instruction:
  81.         cmp     [code_type],64
  82.         jne     simple_instruction
  83.         call    operand_64bit
  84.         jmp     simple_instruction
  85. aa_instruction:
  86.         cmp     [code_type],64
  87.         je      illegal_instruction
  88.         push    eax
  89.         mov     bl,10
  90.         cmp     byte [esi],'('
  91.         jne     aa_store
  92.         inc     esi
  93.         xor     al,al
  94.         xchg    al,[operand_size]
  95.         cmp     al,1
  96.         ja      invalid_operand_size
  97.         call    get_byte_value
  98.         mov     bl,al
  99.       aa_store:
  100.         cmp     [operand_size],0
  101.         jne     invalid_operand
  102.         pop     eax
  103.         mov     ah,bl
  104.         stos    word [edi]
  105.         jmp     instruction_assembled
  106.  
  107. basic_instruction:
  108.         mov     [base_code],al
  109.         lods    byte [esi]
  110.         call    get_size_operator
  111.         cmp     al,10h
  112.         je      basic_reg
  113.         cmp     al,'['
  114.         jne     invalid_operand
  115.       basic_mem:
  116.         call    get_address
  117.         push    edx ebx ecx
  118.         lods    byte [esi]
  119.         cmp     al,','
  120.         jne     invalid_operand
  121.         lods    byte [esi]
  122.         call    get_size_operator
  123.         cmp     al,'('
  124.         je      basic_mem_imm
  125.         cmp     al,10h
  126.         jne     invalid_operand
  127.       basic_mem_reg:
  128.         lods    byte [esi]
  129.         call    convert_register
  130.         mov     [postbyte_register],al
  131.         pop     ecx ebx edx
  132.         mov     al,ah
  133.         cmp     al,1
  134.         je      basic_mem_reg_8bit
  135.         call    operand_autodetect
  136.         inc     [base_code]
  137.       basic_mem_reg_8bit:
  138.         call    store_instruction
  139.         jmp     instruction_assembled
  140.       basic_mem_imm:
  141.         mov     al,[operand_size]
  142.         cmp     al,1
  143.         je      basic_mem_imm_8bit
  144.         cmp     al,2
  145.         je      basic_mem_imm_16bit
  146.         cmp     al,4
  147.         je      basic_mem_imm_32bit
  148.         cmp     al,8
  149.         je      basic_mem_imm_64bit
  150.         or      al,al
  151.         jnz     invalid_operand_size
  152.         cmp     [error_line],0
  153.         jne     basic_mem_imm_8bit
  154.         mov     eax,[current_line]
  155.         mov     [error_line],eax
  156.         mov     [error],operand_size_not_specified
  157.       basic_mem_imm_8bit:
  158.         call    get_byte_value
  159.         mov     byte [value],al
  160.         mov     al,[base_code]
  161.         shr     al,3
  162.         mov     [postbyte_register],al
  163.         pop     ecx ebx edx
  164.         mov     [base_code],80h
  165.         call    store_instruction_with_imm8
  166.         jmp     instruction_assembled
  167.       basic_mem_imm_16bit:
  168.         call    operand_16bit
  169.         call    get_word_value
  170.         mov     word [value],ax
  171.         mov     al,[base_code]
  172.         shr     al,3
  173.         mov     [postbyte_register],al
  174.         pop     ecx ebx edx
  175.         cmp     [value_type],0
  176.         jne     basic_mem_imm_16bit_store
  177.         cmp     [size_declared],0
  178.         jne     basic_mem_imm_16bit_store
  179.         cmp     word [value],80h
  180.         jb      basic_mem_simm_8bit
  181.         cmp     word [value],-80h
  182.         jae     basic_mem_simm_8bit
  183.       basic_mem_imm_16bit_store:
  184.         mov     [base_code],81h
  185.         call    store_instruction_with_imm16
  186.         jmp     instruction_assembled
  187.       basic_mem_simm_8bit:
  188.         mov     [base_code],83h
  189.         call    store_instruction_with_imm8
  190.         jmp     instruction_assembled
  191.       basic_mem_imm_32bit:
  192.         call    operand_32bit
  193.         call    get_dword_value
  194.       basic_mem_imm_32bit_ok:
  195.         mov     dword [value],eax
  196.         mov     al,[base_code]
  197.         shr     al,3
  198.         mov     [postbyte_register],al
  199.         pop     ecx ebx edx
  200.         cmp     [value_type],0
  201.         jne     basic_mem_imm_32bit_store
  202.         cmp     [size_declared],0
  203.         jne     basic_mem_imm_32bit_store
  204.         cmp     dword [value],80h
  205.         jb      basic_mem_simm_8bit
  206.         cmp     dword [value],-80h
  207.         jae     basic_mem_simm_8bit
  208.       basic_mem_imm_32bit_store:
  209.         mov     [base_code],81h
  210.         call    store_instruction_with_imm32
  211.         jmp     instruction_assembled
  212.       basic_mem_imm_64bit:
  213.         cmp     [size_declared],0
  214.         jne     long_immediate_not_encodable
  215.         call    operand_64bit
  216.         call    get_simm32
  217.         cmp     [value_type],4
  218.         jae     long_immediate_not_encodable
  219.         jmp     basic_mem_imm_32bit_ok
  220.       get_simm32:
  221.         call    get_qword_value
  222.         mov     ecx,edx
  223.         cdq
  224.         cmp     ecx,edx
  225.         jne     value_out_of_range
  226.         cmp     [value_type],4
  227.         jne     get_simm32_ok
  228.         mov     [value_type],2
  229.       get_simm32_ok:
  230.         ret
  231.       basic_reg:
  232.         lods    byte [esi]
  233.         call    convert_register
  234.         mov     [postbyte_register],al
  235.         lods    byte [esi]
  236.         cmp     al,','
  237.         jne     invalid_operand
  238.         lods    byte [esi]
  239.         call    get_size_operator
  240.         cmp     al,10h
  241.         je      basic_reg_reg
  242.         cmp     al,'('
  243.         je      basic_reg_imm
  244.         cmp     al,'['
  245.         jne     invalid_operand
  246.       basic_reg_mem:
  247.         call    get_address
  248.         mov     al,[operand_size]
  249.         cmp     al,1
  250.         je      basic_reg_mem_8bit
  251.         call    operand_autodetect
  252.         add     [base_code],3
  253.         call    store_instruction
  254.         jmp     instruction_assembled
  255.       basic_reg_mem_8bit:
  256.         add     [base_code],2
  257.         call    store_instruction
  258.         jmp     instruction_assembled
  259.       basic_reg_reg:
  260.         lods    byte [esi]
  261.         call    convert_register
  262.         mov     bl,[postbyte_register]
  263.         mov     [postbyte_register],al
  264.         mov     al,ah
  265.         cmp     al,1
  266.         je      basic_reg_reg_8bit
  267.         call    operand_autodetect
  268.         inc     [base_code]
  269.       basic_reg_reg_8bit:
  270.         call    store_nomem_instruction
  271.         jmp     instruction_assembled
  272.       basic_reg_imm:
  273.         mov     al,[operand_size]
  274.         cmp     al,1
  275.         je      basic_reg_imm_8bit
  276.         cmp     al,2
  277.         je      basic_reg_imm_16bit
  278.         cmp     al,4
  279.         je      basic_reg_imm_32bit
  280.         cmp     al,8
  281.         je      basic_reg_imm_64bit
  282.         or      al,al
  283.         jnz     invalid_operand_size
  284.         cmp     [error_line],0
  285.         jne     basic_reg_imm_32bit
  286.         mov     eax,[current_line]
  287.         mov     [error_line],eax
  288.         mov     [error],operand_size_not_specified
  289.         jmp     basic_reg_imm_32bit
  290.       basic_reg_imm_8bit:
  291.         call    get_byte_value
  292.         mov     dl,al
  293.         mov     bl,[base_code]
  294.         shr     bl,3
  295.         xchg    bl,[postbyte_register]
  296.         or      bl,bl
  297.         jz      basic_al_imm
  298.         mov     [base_code],80h
  299.         call    store_nomem_instruction
  300.         mov     al,dl
  301.         stos    byte [edi]
  302.         jmp     instruction_assembled
  303.       basic_al_imm:
  304.         mov     al,[base_code]
  305.         add     al,4
  306.         stos    byte [edi]
  307.         mov     al,dl
  308.         stos    byte [edi]
  309.         jmp     instruction_assembled
  310.       basic_reg_imm_16bit:
  311.         call    operand_16bit
  312.         call    get_word_value
  313.         mov     dx,ax
  314.         mov     bl,[base_code]
  315.         shr     bl,3
  316.         xchg    bl,[postbyte_register]
  317.         cmp     [value_type],0
  318.         jne     basic_reg_imm_16bit_store
  319.         cmp     [size_declared],0
  320.         jne     basic_reg_imm_16bit_store
  321.         cmp     dx,80h
  322.         jb      basic_reg_simm_8bit
  323.         cmp     dx,-80h
  324.         jae     basic_reg_simm_8bit
  325.       basic_reg_imm_16bit_store:
  326.         or      bl,bl
  327.         jz      basic_ax_imm
  328.         mov     [base_code],81h
  329.         call    store_nomem_instruction
  330.         mov     ax,dx
  331.         call    mark_relocation
  332.         stos    word [edi]
  333.         jmp     instruction_assembled
  334.       basic_reg_simm_8bit:
  335.         mov     [base_code],83h
  336.         call    store_nomem_instruction
  337.         mov     al,dl
  338.         stos    byte [edi]
  339.         jmp     instruction_assembled
  340.       basic_ax_imm:
  341.         add     [base_code],5
  342.         call    store_instruction_code
  343.         mov     ax,dx
  344.         call    mark_relocation
  345.         stos    word [edi]
  346.         jmp     instruction_assembled
  347.       basic_reg_imm_32bit:
  348.         call    operand_32bit
  349.         call    get_dword_value
  350.       basic_reg_imm_32bit_ok:
  351.         mov     edx,eax
  352.         mov     bl,[base_code]
  353.         shr     bl,3
  354.         xchg    bl,[postbyte_register]
  355.         cmp     [value_type],0
  356.         jne     basic_reg_imm_32bit_store
  357.         cmp     [size_declared],0
  358.         jne     basic_reg_imm_32bit_store
  359.         cmp     edx,80h
  360.         jb      basic_reg_simm_8bit
  361.         cmp     edx,-80h
  362.         jae     basic_reg_simm_8bit
  363.       basic_reg_imm_32bit_store:
  364.         or      bl,bl
  365.         jz      basic_eax_imm
  366.         mov     [base_code],81h
  367.         call    store_nomem_instruction
  368.         mov     eax,edx
  369.         call    mark_relocation
  370.         stos    dword [edi]
  371.         jmp     instruction_assembled
  372.       basic_eax_imm:
  373.         add     [base_code],5
  374.         call    store_instruction_code
  375.         mov     eax,edx
  376.         call    mark_relocation
  377.         stos    dword [edi]
  378.         jmp     instruction_assembled
  379.       basic_reg_imm_64bit:
  380.         cmp     [size_declared],0
  381.         jne     long_immediate_not_encodable
  382.         call    operand_64bit
  383.         call    get_simm32
  384.         cmp     [value_type],4
  385.         jae     long_immediate_not_encodable
  386.         jmp     basic_reg_imm_32bit_ok
  387. single_operand_instruction:
  388.         mov     [base_code],0F6h
  389.         mov     [postbyte_register],al
  390.         lods    byte [esi]
  391.         call    get_size_operator
  392.         cmp     al,10h
  393.         je      single_reg
  394.         cmp     al,'['
  395.         jne     invalid_operand
  396.       single_mem:
  397.         call    get_address
  398.         mov     al,[operand_size]
  399.         cmp     al,1
  400.         je      single_mem_8bit
  401.         jb      single_mem_nosize
  402.         call    operand_autodetect
  403.         inc     [base_code]
  404.         call    store_instruction
  405.         jmp     instruction_assembled
  406.       single_mem_nosize:
  407.         cmp     [error_line],0
  408.         jne     single_mem_8bit
  409.         mov     eax,[current_line]
  410.         mov     [error_line],eax
  411.         mov     [error],operand_size_not_specified
  412.       single_mem_8bit:
  413.         call    store_instruction
  414.         jmp     instruction_assembled
  415.       single_reg:
  416.         lods    byte [esi]
  417.         call    convert_register
  418.         mov     bl,al
  419.         mov     al,ah
  420.         cmp     al,1
  421.         je      single_reg_8bit
  422.         call    operand_autodetect
  423.         inc     [base_code]
  424.       single_reg_8bit:
  425.         call    store_nomem_instruction
  426.         jmp     instruction_assembled
  427. mov_instruction:
  428.         mov     [base_code],88h
  429.         lods    byte [esi]
  430.         call    get_size_operator
  431.         cmp     al,10h
  432.         je      mov_reg
  433.         cmp     al,'['
  434.         jne     invalid_operand
  435.       mov_mem:
  436.         call    get_address
  437.         push    edx ebx ecx
  438.         lods    byte [esi]
  439.         cmp     al,','
  440.         jne     invalid_operand
  441.         lods    byte [esi]
  442.         call    get_size_operator
  443.         cmp     al,'('
  444.         je      mov_mem_imm
  445.         cmp     al,10h
  446.         jne     invalid_operand
  447.       mov_mem_reg:
  448.         lods    byte [esi]
  449.         cmp     al,60h
  450.         jb      mov_mem_general_reg
  451.         cmp     al,70h
  452.         jb      mov_mem_sreg
  453.       mov_mem_general_reg:
  454.         call    convert_register
  455.         mov     [postbyte_register],al
  456.         pop     ecx ebx edx
  457.         cmp     ah,1
  458.         je      mov_mem_reg_8bit
  459.         mov     al,ah
  460.         call    operand_autodetect
  461.         mov     al,[postbyte_register]
  462.         or      al,bl
  463.         or      al,bh
  464.         jz      mov_mem_ax
  465.         inc     [base_code]
  466.         call    store_instruction
  467.         jmp     instruction_assembled
  468.       mov_mem_reg_8bit:
  469.         or      al,bl
  470.         or      al,bh
  471.         jz      mov_mem_al
  472.         call    store_instruction
  473.         jmp     instruction_assembled
  474.       mov_mem_al:
  475.         test    ch,22h
  476.         jnz     mov_mem_address16_al
  477.         test    ch,44h
  478.         jnz     mov_mem_address32_al
  479.         test    ch,88h
  480.         jnz     mov_mem_address64_al
  481.         or      ch,ch
  482.         jnz     invalid_address_size
  483.         cmp     [code_type],64
  484.         je      mov_mem_address64_al
  485.         cmp     [code_type],32
  486.         je      mov_mem_address32_al
  487.         cmp     edx,10000h
  488.         jb      mov_mem_address16_al
  489.       mov_mem_address32_al:
  490.         call    store_segment_prefix_if_necessary
  491.         call    address_32bit_prefix
  492.         mov     [base_code],0A2h
  493.       store_mov_address32:
  494.         call    store_instruction_code
  495.         push    instruction_assembled
  496.         jmp     store_address_32bit_value
  497.       mov_mem_address16_al:
  498.         call    store_segment_prefix_if_necessary
  499.         call    address_16bit_prefix
  500.         mov     [base_code],0A2h
  501.       store_mov_address16:
  502.         cmp     [code_type],64
  503.         je      invalid_address
  504.         call    store_instruction_code
  505.         mov     eax,edx
  506.         stos    word [edi]
  507.         cmp     edx,10000h
  508.         jge     value_out_of_range
  509.         jmp     instruction_assembled
  510.       mov_mem_address64_al:
  511.         call    store_segment_prefix_if_necessary
  512.         mov     [base_code],0A2h
  513.       store_mov_address64:
  514.         call    store_instruction_code
  515.         push    instruction_assembled
  516.         jmp     store_address_64bit_value
  517.       mov_mem_ax:
  518.         test    ch,22h
  519.         jnz     mov_mem_address16_ax
  520.         test    ch,44h
  521.         jnz     mov_mem_address32_ax
  522.         test    ch,88h
  523.         jnz     mov_mem_address64_ax
  524.         or      ch,ch
  525.         jnz     invalid_address_size
  526.         cmp     [code_type],64
  527.         je      mov_mem_address64_ax
  528.         cmp     [code_type],32
  529.         je      mov_mem_address32_ax
  530.         cmp     edx,10000h
  531.         jb      mov_mem_address16_ax
  532.       mov_mem_address32_ax:
  533.         call    store_segment_prefix_if_necessary
  534.         call    address_32bit_prefix
  535.         mov     [base_code],0A3h
  536.         jmp     store_mov_address32
  537.       mov_mem_address16_ax:
  538.         call    store_segment_prefix_if_necessary
  539.         call    address_16bit_prefix
  540.         mov     [base_code],0A3h
  541.         jmp     store_mov_address16
  542.       mov_mem_address64_ax:
  543.         call    store_segment_prefix_if_necessary
  544.         mov     [base_code],0A3h
  545.         jmp     store_mov_address64
  546.       mov_mem_sreg:
  547.         sub     al,61h
  548.         mov     [postbyte_register],al
  549.         pop     ecx ebx edx
  550.         mov     ah,[operand_size]
  551.         or      ah,ah
  552.         jz      mov_mem_sreg_store
  553.         cmp     ah,2
  554.         jne     invalid_operand_size
  555.       mov_mem_sreg_store:
  556.         mov     [base_code],8Ch
  557.         call    store_instruction
  558.         jmp     instruction_assembled
  559.       mov_mem_imm:
  560.         mov     al,[operand_size]
  561.         cmp     al,1
  562.         je      mov_mem_imm_8bit
  563.         cmp     al,2
  564.         je      mov_mem_imm_16bit
  565.         cmp     al,4
  566.         je      mov_mem_imm_32bit
  567.         cmp     al,8
  568.         je      mov_mem_imm_64bit
  569.         or      al,al
  570.         jnz     invalid_operand_size
  571.         cmp     [error_line],0
  572.         jne     mov_mem_imm_32bit
  573.         mov     eax,[current_line]
  574.         mov     [error_line],eax
  575.         mov     [error],operand_size_not_specified
  576.         jmp     mov_mem_imm_32bit
  577.       mov_mem_imm_8bit:
  578.         call    get_byte_value
  579.         mov     byte [value],al
  580.         mov     [postbyte_register],0
  581.         mov     [base_code],0C6h
  582.         pop     ecx ebx edx
  583.         call    store_instruction_with_imm8
  584.         jmp     instruction_assembled
  585.       mov_mem_imm_16bit:
  586.         call    operand_16bit
  587.         call    get_word_value
  588.         mov     word [value],ax
  589.         mov     [postbyte_register],0
  590.         mov     [base_code],0C7h
  591.         pop     ecx ebx edx
  592.         call    store_instruction_with_imm16
  593.         jmp     instruction_assembled
  594.       mov_mem_imm_32bit:
  595.         call    operand_32bit
  596.         call    get_dword_value
  597.       mov_mem_imm_32bit_store:
  598.         mov     dword [value],eax
  599.         mov     [postbyte_register],0
  600.         mov     [base_code],0C7h
  601.         pop     ecx ebx edx
  602.         call    store_instruction_with_imm32
  603.         jmp     instruction_assembled
  604.       mov_mem_imm_64bit:
  605.         cmp     [size_declared],0
  606.         jne     long_immediate_not_encodable
  607.         call    operand_64bit
  608.         call    get_simm32
  609.         cmp     [value_type],4
  610.         jae     long_immediate_not_encodable
  611.         jmp     mov_mem_imm_32bit_store
  612.       mov_reg:
  613.         lods    byte [esi]
  614.         mov     ah,al
  615.         sub     ah,10h
  616.         and     ah,al
  617.         test    ah,0F0h
  618.         jnz     mov_sreg
  619.         call    convert_register
  620.         mov     [postbyte_register],al
  621.         lods    byte [esi]
  622.         cmp     al,','
  623.         jne     invalid_operand
  624.         lods    byte [esi]
  625.         call    get_size_operator
  626.         cmp     al,'['
  627.         je      mov_reg_mem
  628.         cmp     al,'('
  629.         je      mov_reg_imm
  630.         cmp     al,10h
  631.         jne     invalid_operand
  632.       mov_reg_reg:
  633.         lods    byte [esi]
  634.         mov     ah,al
  635.         sub     ah,10h
  636.         and     ah,al
  637.         test    ah,0F0h
  638.         jnz     mov_reg_sreg
  639.         call    convert_register
  640.         mov     bl,[postbyte_register]
  641.         mov     [postbyte_register],al
  642.         mov     al,ah
  643.         cmp     al,1
  644.         je      mov_reg_reg_8bit
  645.         call    operand_autodetect
  646.         inc     [base_code]
  647.       mov_reg_reg_8bit:
  648.         call    store_nomem_instruction
  649.         jmp     instruction_assembled
  650.       mov_reg_sreg:
  651.         mov     bl,[postbyte_register]
  652.         mov     ah,al
  653.         and     al,1111b
  654.         mov     [postbyte_register],al
  655.         shr     ah,4
  656.         cmp     ah,5
  657.         je      mov_reg_creg
  658.         cmp     ah,7
  659.         je      mov_reg_dreg
  660.         ja      mov_reg_treg
  661.         dec     [postbyte_register]
  662.         cmp     [operand_size],8
  663.         je      mov_reg_sreg64
  664.         cmp     [operand_size],4
  665.         je      mov_reg_sreg32
  666.         cmp     [operand_size],2
  667.         jne     invalid_operand_size
  668.         call    operand_16bit
  669.         jmp     mov_reg_sreg_store
  670.       mov_reg_sreg64:
  671.         call    operand_64bit
  672.         jmp     mov_reg_sreg_store
  673.       mov_reg_sreg32:
  674.         call    operand_32bit
  675.       mov_reg_sreg_store:
  676.         mov     [base_code],8Ch
  677.         call    store_nomem_instruction
  678.         jmp     instruction_assembled
  679.       mov_reg_treg:
  680.         cmp     ah,9
  681.         jne     invalid_operand
  682.         mov     [extended_code],24h
  683.         jmp     mov_reg_xrx
  684.       mov_reg_dreg:
  685.         mov     [extended_code],21h
  686.         jmp     mov_reg_xrx
  687.       mov_reg_creg:
  688.         mov     [extended_code],20h
  689.       mov_reg_xrx:
  690.         mov     [base_code],0Fh
  691.         cmp     [code_type],64
  692.         je      mov_reg_xrx_64bit
  693.         cmp     [operand_size],4
  694.         jne     invalid_operand_size
  695.         cmp     [postbyte_register],8
  696.         jne     mov_reg_xrx_store
  697.         cmp     [extended_code],20h
  698.         jne     mov_reg_xrx_store
  699.         mov     al,0F0h
  700.         stos    byte [edi]
  701.         mov     [postbyte_register],0
  702.       mov_reg_xrx_store:
  703.         call    store_nomem_instruction
  704.         jmp     instruction_assembled
  705.       mov_reg_xrx_64bit:
  706.         cmp     [operand_size],8
  707.         jne     invalid_operand_size
  708.         call    store_nomem_instruction
  709.         jmp     instruction_assembled
  710.       mov_reg_mem:
  711.         call    get_address
  712.         mov     al,[operand_size]
  713.         cmp     al,1
  714.         je      mov_reg_mem_8bit
  715.         call    operand_autodetect
  716.         mov     al,[postbyte_register]
  717.         or      al,bl
  718.         or      al,bh
  719.         jz      mov_ax_mem
  720.         add     [base_code],3
  721.         call    store_instruction
  722.         jmp     instruction_assembled
  723.       mov_reg_mem_8bit:
  724.         mov     al,[postbyte_register]
  725.         or      al,bl
  726.         or      al,bh
  727.         jz      mov_al_mem
  728.         add     [base_code],2
  729.         call    store_instruction
  730.         jmp     instruction_assembled
  731.       mov_al_mem:
  732.         test    ch,22h
  733.         jnz     mov_al_mem_address16
  734.         test    ch,44h
  735.         jnz     mov_al_mem_address32
  736.         test    ch,88h
  737.         jnz     mov_al_mem_address64
  738.         or      ch,ch
  739.         jnz     invalid_address_size
  740.         cmp     [code_type],64
  741.         je      mov_al_mem_address64
  742.         cmp     [code_type],32
  743.         je      mov_al_mem_address32
  744.         cmp     edx,10000h
  745.         jb      mov_al_mem_address16
  746.       mov_al_mem_address32:
  747.         call    store_segment_prefix_if_necessary
  748.         call    address_32bit_prefix
  749.         mov     [base_code],0A0h
  750.         jmp     store_mov_address32
  751.       mov_al_mem_address16:
  752.         call    store_segment_prefix_if_necessary
  753.         call    address_16bit_prefix
  754.         mov     [base_code],0A0h
  755.         jmp     store_mov_address16
  756.       mov_al_mem_address64:
  757.         call    store_segment_prefix_if_necessary
  758.         mov     [base_code],0A0h
  759.         jmp     store_mov_address64
  760.       mov_ax_mem:
  761.         test    ch,22h
  762.         jnz     mov_ax_mem_address16
  763.         test    ch,44h
  764.         jnz     mov_ax_mem_address32
  765.         test    ch,88h
  766.         jnz     mov_ax_mem_address64
  767.         or      ch,ch
  768.         jnz     invalid_address_size
  769.         cmp     [code_type],64
  770.         je      mov_ax_mem_address64
  771.         cmp     [code_type],32
  772.         je      mov_ax_mem_address32
  773.         cmp     edx,10000h
  774.         jb      mov_ax_mem_address16
  775.       mov_ax_mem_address32:
  776.         call    store_segment_prefix_if_necessary
  777.         call    address_32bit_prefix
  778.         mov     [base_code],0A1h
  779.         jmp     store_mov_address32
  780.       mov_ax_mem_address16:
  781.         call    store_segment_prefix_if_necessary
  782.         call    address_16bit_prefix
  783.         mov     [base_code],0A1h
  784.         jmp     store_mov_address16
  785.       mov_ax_mem_address64:
  786.         call    store_segment_prefix_if_necessary
  787.         mov     [base_code],0A1h
  788.         jmp     store_mov_address64
  789.       mov_reg_imm:
  790.         mov     al,[operand_size]
  791.         cmp     al,1
  792.         je      mov_reg_imm_8bit
  793.         cmp     al,2
  794.         je      mov_reg_imm_16bit
  795.         cmp     al,4
  796.         je      mov_reg_imm_32bit
  797.         cmp     al,8
  798.         je      mov_reg_imm_64bit
  799.         or      al,al
  800.         jnz     invalid_operand_size
  801.         cmp     [error_line],0
  802.         jne     mov_reg_imm_32bit
  803.         mov     eax,[current_line]
  804.         mov     [error_line],eax
  805.         mov     [error],operand_size_not_specified
  806.         jmp     mov_reg_imm_32bit
  807.       mov_reg_imm_8bit:
  808.         call    get_byte_value
  809.         mov     dl,al
  810.         mov     al,0B0h
  811.         call    store_mov_reg_imm_code
  812.         mov     al,dl
  813.         stos    byte [edi]
  814.         jmp     instruction_assembled
  815.       mov_reg_imm_16bit:
  816.         call    get_word_value
  817.         mov     dx,ax
  818.         call    operand_16bit
  819.         mov     al,0B8h
  820.         call    store_mov_reg_imm_code
  821.         mov     ax,dx
  822.         call    mark_relocation
  823.         stos    word [edi]
  824.         jmp     instruction_assembled
  825.       mov_reg_imm_32bit:
  826.         call    operand_32bit
  827.         call    get_dword_value
  828.         mov     edx,eax
  829.         mov     al,0B8h
  830.         call    store_mov_reg_imm_code
  831.         mov     eax,edx
  832.         call    mark_relocation
  833.         stos    dword [edi]
  834.         jmp     instruction_assembled
  835.       mov_reg_imm_64bit:
  836.         call    operand_64bit
  837.         call    get_qword_value
  838.         mov     ecx,edx
  839.         cmp     [size_declared],0
  840.         jne     mov_reg_imm_64bit_store
  841.         cmp     [value_type],4
  842.         jae     mov_reg_imm_64bit_store
  843.         cdq
  844.         cmp     ecx,edx
  845.         je      mov_reg_64bit_imm_32bit
  846.       mov_reg_imm_64bit_store:
  847.         push    eax ecx
  848.         mov     al,0B8h
  849.         call    store_mov_reg_imm_code
  850.         pop     edx eax
  851.         call    mark_relocation
  852.         stos    dword [edi]
  853.         mov     eax,edx
  854.         stos    dword [edi]
  855.         jmp     instruction_assembled
  856.       store_mov_reg_imm_code:
  857.         mov     ah,[postbyte_register]
  858.         test    ah,1000b
  859.         jz      mov_reg_imm_prefix_ok
  860.         or      [rex_prefix],41h
  861.       mov_reg_imm_prefix_ok:
  862.         and     ah,111b
  863.         add     al,ah
  864.         mov     [base_code],al
  865.         call    store_instruction_code
  866.         ret
  867.       mov_reg_64bit_imm_32bit:
  868.         mov     edx,eax
  869.         mov     bl,[postbyte_register]
  870.         mov     [postbyte_register],0
  871.         mov     [base_code],0C7h
  872.         call    store_nomem_instruction
  873.         mov     eax,edx
  874.         call    mark_relocation
  875.         stos    dword [edi]
  876.         jmp     instruction_assembled
  877.       mov_sreg:
  878.         mov     ah,al
  879.         and     al,1111b
  880.         mov     [postbyte_register],al
  881.         shr     ah,4
  882.         cmp     ah,5
  883.         je      mov_creg
  884.         cmp     ah,7
  885.         je      mov_dreg
  886.         ja      mov_treg
  887.         cmp     al,2
  888.         je      illegal_instruction
  889.         dec     [postbyte_register]
  890.         lods    byte [esi]
  891.         cmp     al,','
  892.         jne     invalid_operand
  893.         lods    byte [esi]
  894.         call    get_size_operator
  895.         cmp     al,'['
  896.         je      mov_sreg_mem
  897.         cmp     al,10h
  898.         jne     invalid_operand
  899.       mov_sreg_reg:
  900.         lods    byte [esi]
  901.         call    convert_register
  902.         or      ah,ah
  903.         jz      mov_sreg_reg_size_ok
  904.         cmp     ah,2
  905.         jne     invalid_operand_size
  906.         mov     bl,al
  907.       mov_sreg_reg_size_ok:
  908.         mov     [base_code],8Eh
  909.         call    store_nomem_instruction
  910.         jmp     instruction_assembled
  911.       mov_sreg_mem:
  912.         call    get_address
  913.         mov     al,[operand_size]
  914.         or      al,al
  915.         jz      mov_sreg_mem_size_ok
  916.         cmp     al,2
  917.         jne     invalid_operand_size
  918.       mov_sreg_mem_size_ok:
  919.         mov     [base_code],8Eh
  920.         call    store_instruction
  921.         jmp     instruction_assembled
  922.       mov_treg:
  923.         cmp     ah,9
  924.         jne     invalid_operand
  925.         mov     [extended_code],26h
  926.         jmp     mov_xrx
  927.       mov_dreg:
  928.         mov     [extended_code],23h
  929.         jmp     mov_xrx
  930.       mov_creg:
  931.         mov     [extended_code],22h
  932.       mov_xrx:
  933.         mov     [base_code],0Fh
  934.         lods    byte [esi]
  935.         cmp     al,','
  936.         jne     invalid_operand
  937.         lods    byte [esi]
  938.         cmp     al,10h
  939.         jne     invalid_operand
  940.         lods    byte [esi]
  941.         call    convert_register
  942.         mov     bl,al
  943.         cmp     [code_type],64
  944.         je      mov_xrx_64bit
  945.         cmp     ah,4
  946.         jne     invalid_operand_size
  947.         cmp     [postbyte_register],8
  948.         jne     mov_xrx_store
  949.         cmp     [extended_code],22h
  950.         jne     mov_xrx_store
  951.         mov     al,0F0h
  952.         stos    byte [edi]
  953.         mov     [postbyte_register],0
  954.       mov_xrx_store:
  955.         call    store_nomem_instruction
  956.         jmp     instruction_assembled
  957.       mov_xrx_64bit:
  958.         cmp     ah,8
  959.         jne     invalid_operand_size
  960.         call    store_nomem_instruction
  961.         jmp     instruction_assembled
  962. cmov_instruction:
  963.         mov     [base_code],0Fh
  964.         mov     [extended_code],al
  965.         lods    byte [esi]
  966.         call    get_size_operator
  967.         cmp     al,10h
  968.         jne     invalid_operand
  969.         lods    byte [esi]
  970.         call    convert_register
  971.         mov     [postbyte_register],al
  972.         lods    byte [esi]
  973.         cmp     al,','
  974.         jne     invalid_operand
  975.         lods    byte [esi]
  976.         call    get_size_operator
  977.         cmp     al,'['
  978.         je      cmov_reg_mem
  979.         cmp     al,10h
  980.         jne     invalid_operand
  981.       cmov_reg_reg:
  982.         lods    byte [esi]
  983.         call    convert_register
  984.         mov     bl,al
  985.         mov     al,ah
  986.         call    operand_autodetect
  987.         call    store_nomem_instruction
  988.         jmp     instruction_assembled
  989.       cmov_reg_mem:
  990.         call    get_address
  991.         mov     al,[operand_size]
  992.         call    operand_autodetect
  993.         call    store_instruction
  994.         jmp     instruction_assembled
  995. test_instruction:
  996.         mov     [base_code],84h
  997.         lods    byte [esi]
  998.         call    get_size_operator
  999.         cmp     al,10h
  1000.         je      test_reg
  1001.         cmp     al,'['
  1002.         jne     invalid_operand
  1003.       test_mem:
  1004.         call    get_address
  1005.         push    edx ebx ecx
  1006.         lods    byte [esi]
  1007.         cmp     al,','
  1008.         jne     invalid_operand
  1009.         lods    byte [esi]
  1010.         call    get_size_operator
  1011.         cmp     al,'('
  1012.         je      test_mem_imm
  1013.         cmp     al,10h
  1014.         jne     invalid_operand
  1015.       test_mem_reg:
  1016.         lods    byte [esi]
  1017.         call    convert_register
  1018.         mov     [postbyte_register],al
  1019.         pop     ecx ebx edx
  1020.         mov     al,ah
  1021.         cmp     al,1
  1022.         je      test_mem_reg_8bit
  1023.         call    operand_autodetect
  1024.         inc     [base_code]
  1025.       test_mem_reg_8bit:
  1026.         call    store_instruction
  1027.         jmp     instruction_assembled
  1028.       test_mem_imm:
  1029.         mov     al,[operand_size]
  1030.         cmp     al,1
  1031.         je      test_mem_imm_8bit
  1032.         cmp     al,2
  1033.         je      test_mem_imm_16bit
  1034.         cmp     al,4
  1035.         je      test_mem_imm_32bit
  1036.         cmp     al,8
  1037.         je      test_mem_imm_64bit
  1038.         or      al,al
  1039.         jnz     invalid_operand_size
  1040.         cmp     [error_line],0
  1041.         jne     test_mem_imm_32bit
  1042.         mov     eax,[current_line]
  1043.         mov     [error_line],eax
  1044.         mov     [error],operand_size_not_specified
  1045.         jmp     test_mem_imm_32bit
  1046.       test_mem_imm_8bit:
  1047.         call    get_byte_value
  1048.         mov     byte [value],al
  1049.         mov     [postbyte_register],0
  1050.         mov     [base_code],0F6h
  1051.         pop     ecx ebx edx
  1052.         call    store_instruction_with_imm8
  1053.         jmp     instruction_assembled
  1054.       test_mem_imm_16bit:
  1055.         call    operand_16bit
  1056.         call    get_word_value
  1057.         mov     word [value],ax
  1058.         mov     [postbyte_register],0
  1059.         mov     [base_code],0F7h
  1060.         pop     ecx ebx edx
  1061.         call    store_instruction_with_imm16
  1062.         jmp     instruction_assembled
  1063.       test_mem_imm_32bit:
  1064.         call    operand_32bit
  1065.         call    get_dword_value
  1066.       test_mem_imm_32bit_store:
  1067.         mov     dword [value],eax
  1068.         mov     [postbyte_register],0
  1069.         mov     [base_code],0F7h
  1070.         pop     ecx ebx edx
  1071.         call    store_instruction_with_imm32
  1072.         jmp     instruction_assembled
  1073.       test_mem_imm_64bit:
  1074.         cmp     [size_declared],0
  1075.         jne     long_immediate_not_encodable
  1076.         call    operand_64bit
  1077.         call    get_simm32
  1078.         cmp     [value_type],4
  1079.         jae     long_immediate_not_encodable
  1080.         jmp     test_mem_imm_32bit_store
  1081.       test_reg:
  1082.         lods    byte [esi]
  1083.         call    convert_register
  1084.         mov     [postbyte_register],al
  1085.         lods    byte [esi]
  1086.         cmp     al,','
  1087.         jne     invalid_operand
  1088.         lods    byte [esi]
  1089.         call    get_size_operator
  1090.         cmp     al,'['
  1091.         je      test_reg_mem
  1092.         cmp     al,'('
  1093.         je      test_reg_imm
  1094.         cmp     al,10h
  1095.         jne     invalid_operand
  1096.       test_reg_reg:
  1097.         lods    byte [esi]
  1098.         call    convert_register
  1099.         mov     bl,[postbyte_register]
  1100.         mov     [postbyte_register],al
  1101.         mov     al,ah
  1102.         cmp     al,1
  1103.         je      test_reg_reg_8bit
  1104.         call    operand_autodetect
  1105.         inc     [base_code]
  1106.       test_reg_reg_8bit:
  1107.         call    store_nomem_instruction
  1108.         jmp     instruction_assembled
  1109.       test_reg_imm:
  1110.         mov     al,[operand_size]
  1111.         cmp     al,1
  1112.         je      test_reg_imm_8bit
  1113.         cmp     al,2
  1114.         je      test_reg_imm_16bit
  1115.         cmp     al,4
  1116.         je      test_reg_imm_32bit
  1117.         cmp     al,8
  1118.         je      test_reg_imm_64bit
  1119.         jmp     invalid_operand_size
  1120.       test_reg_imm_8bit:
  1121.         call    get_byte_value
  1122.         mov     dl,al
  1123.         mov     bl,[postbyte_register]
  1124.         mov     [postbyte_register],0
  1125.         mov     [base_code],0F6h
  1126.         or      bl,bl
  1127.         jz      test_al_imm
  1128.         call    store_nomem_instruction
  1129.         mov     al,dl
  1130.         stos    byte [edi]
  1131.         jmp     instruction_assembled
  1132.       test_al_imm:
  1133.         mov     [base_code],0A8h
  1134.         call    store_instruction_code
  1135.         mov     al,dl
  1136.         stos    byte [edi]
  1137.         jmp     instruction_assembled
  1138.       test_reg_imm_16bit:
  1139.         call    operand_16bit
  1140.         call    get_word_value
  1141.         mov     dx,ax
  1142.         mov     bl,[postbyte_register]
  1143.         mov     [postbyte_register],0
  1144.         mov     [base_code],0F7h
  1145.         or      bl,bl
  1146.         jz      test_ax_imm
  1147.         call    store_nomem_instruction
  1148.         mov     ax,dx
  1149.         call    mark_relocation
  1150.         stos    word [edi]
  1151.         jmp     instruction_assembled
  1152.       test_ax_imm:
  1153.         mov     [base_code],0A9h
  1154.         call    store_instruction_code
  1155.         mov     ax,dx
  1156.         stos    word [edi]
  1157.         jmp     instruction_assembled
  1158.       test_reg_imm_32bit:
  1159.         call    operand_32bit
  1160.         call    get_dword_value
  1161.       test_reg_imm_32bit_store:
  1162.         mov     edx,eax
  1163.         mov     bl,[postbyte_register]
  1164.         mov     [postbyte_register],0
  1165.         mov     [base_code],0F7h
  1166.         or      bl,bl
  1167.         jz      test_eax_imm
  1168.         call    store_nomem_instruction
  1169.         mov     eax,edx
  1170.         call    mark_relocation
  1171.         stos    dword [edi]
  1172.         jmp     instruction_assembled
  1173.       test_eax_imm:
  1174.         mov     [base_code],0A9h
  1175.         call    store_instruction_code
  1176.         mov     eax,edx
  1177.         stos    dword [edi]
  1178.         jmp     instruction_assembled
  1179.       test_reg_imm_64bit:
  1180.         cmp     [size_declared],0
  1181.         jne     long_immediate_not_encodable
  1182.         call    operand_64bit
  1183.         call    get_simm32
  1184.         cmp     [value_type],4
  1185.         jae     long_immediate_not_encodable
  1186.         jmp     test_reg_imm_32bit_store
  1187.       test_reg_mem:
  1188.         call    get_address
  1189.         mov     al,[operand_size]
  1190.         cmp     al,1
  1191.         je      test_reg_mem_8bit
  1192.         call    operand_autodetect
  1193.         inc     [base_code]
  1194.       test_reg_mem_8bit:
  1195.         call    store_instruction
  1196.         jmp     instruction_assembled
  1197. xchg_instruction:
  1198.         mov     [base_code],86h
  1199.         lods    byte [esi]
  1200.         call    get_size_operator
  1201.         cmp     al,10h
  1202.         je      xchg_reg
  1203.         cmp     al,'['
  1204.         jne     invalid_operand
  1205.       xchg_mem:
  1206.         call    get_address
  1207.         push    edx ebx ecx
  1208.         lods    byte [esi]
  1209.         cmp     al,','
  1210.         jne     invalid_operand
  1211.         lods    byte [esi]
  1212.         call    get_size_operator
  1213.         cmp     al,10h
  1214.         je      test_mem_reg
  1215.         jmp     invalid_operand
  1216.       xchg_reg:
  1217.         lods    byte [esi]
  1218.         call    convert_register
  1219.         mov     [postbyte_register],al
  1220.         lods    byte [esi]
  1221.         cmp     al,','
  1222.         jne     invalid_operand
  1223.         lods    byte [esi]
  1224.         call    get_size_operator
  1225.         cmp     al,'['
  1226.         je      test_reg_mem
  1227.         cmp     al,10h
  1228.         jne     invalid_operand
  1229.       xchg_reg_reg:
  1230.         lods    byte [esi]
  1231.         call    convert_register
  1232.         mov     bl,al
  1233.         mov     al,ah
  1234.         cmp     al,1
  1235.         je      xchg_reg_reg_8bit
  1236.         call    operand_autodetect
  1237.         cmp     [postbyte_register],0
  1238.         je      xchg_ax_reg
  1239.         or      bl,bl
  1240.         jnz     xchg_reg_reg_store
  1241.         mov     bl,[postbyte_register]
  1242.       xchg_ax_reg:
  1243.         cmp     [code_type],64
  1244.         jne     xchg_ax_reg_ok
  1245.         cmp     ah,4
  1246.         jne     xchg_ax_reg_ok
  1247.         or      bl,bl
  1248.         jz      xchg_reg_reg_store
  1249.       xchg_ax_reg_ok:
  1250.         test    bl,1000b
  1251.         jz      xchg_ax_reg_store
  1252.         or      [rex_prefix],41h
  1253.         and     bl,111b
  1254.       xchg_ax_reg_store:
  1255.         add     bl,90h
  1256.         mov     [base_code],bl
  1257.         call    store_instruction_code
  1258.         jmp     instruction_assembled
  1259.       xchg_reg_reg_store:
  1260.         inc     [base_code]
  1261.       xchg_reg_reg_8bit:
  1262.         call    store_nomem_instruction
  1263.         jmp     instruction_assembled
  1264. push_instruction:
  1265.         mov     [push_size],al
  1266.       push_next:
  1267.         lods    byte [esi]
  1268.         call    get_size_operator
  1269.         cmp     al,10h
  1270.         je      push_reg
  1271.         cmp     al,'('
  1272.         je      push_imm
  1273.         cmp     al,'['
  1274.         jne     invalid_operand
  1275.       push_mem:
  1276.         call    get_address
  1277.         mov     al,[operand_size]
  1278.         mov     ah,[push_size]
  1279.         cmp     al,2
  1280.         je      push_mem_16bit
  1281.         cmp     al,4
  1282.         je      push_mem_32bit
  1283.         cmp     al,8
  1284.         je      push_mem_64bit
  1285.         or      al,al
  1286.         jnz     invalid_operand_size
  1287.         cmp     ah,2
  1288.         je      push_mem_16bit
  1289.         cmp     ah,4
  1290.         je      push_mem_32bit
  1291.         cmp     ah,8
  1292.         je      push_mem_64bit
  1293.         cmp     [error_line],0
  1294.         jne     push_mem_store
  1295.         mov     eax,[current_line]
  1296.         mov     [error_line],eax
  1297.         mov     [error],operand_size_not_specified
  1298.         jmp     push_mem_store
  1299.       push_mem_16bit:
  1300.         test    ah,not 2
  1301.         jnz     invalid_operand_size
  1302.         call    operand_16bit
  1303.         jmp     push_mem_store
  1304.       push_mem_32bit:
  1305.         test    ah,not 4
  1306.         jnz     invalid_operand_size
  1307.         cmp     [code_type],64
  1308.         je      illegal_instruction
  1309.         call    operand_32bit
  1310.         jmp     push_mem_store
  1311.       push_mem_64bit:
  1312.         test    ah,not 8
  1313.         jnz     invalid_operand_size
  1314.         cmp     [code_type],64
  1315.         jne     illegal_instruction
  1316.       push_mem_store:
  1317.         mov     [base_code],0FFh
  1318.         mov     [postbyte_register],110b
  1319.         call    store_instruction
  1320.         jmp     push_done
  1321.       push_reg:
  1322.         lods    byte [esi]
  1323.         mov     ah,al
  1324.         sub     ah,10h
  1325.         and     ah,al
  1326.         test    ah,0F0h
  1327.         jnz     push_sreg
  1328.         call    convert_register
  1329.         test    al,1000b
  1330.         jz      push_reg_ok
  1331.         or      [rex_prefix],41h
  1332.         and     al,111b
  1333.       push_reg_ok:
  1334.         add     al,50h
  1335.         mov     [base_code],al
  1336.         mov     al,ah
  1337.         mov     ah,[push_size]
  1338.         cmp     al,2
  1339.         je      push_reg_16bit
  1340.         cmp     al,4
  1341.         je      push_reg_32bit
  1342.         cmp     al,8
  1343.         jne     invalid_operand_size
  1344.       push_reg_64bit:
  1345.         test    ah,not 8
  1346.         jnz     invalid_operand_size
  1347.         cmp     [code_type],64
  1348.         jne     illegal_instruction
  1349.         jmp     push_reg_store
  1350.       push_reg_32bit:
  1351.         test    ah,not 4
  1352.         jnz     invalid_operand_size
  1353.         cmp     [code_type],64
  1354.         je      illegal_instruction
  1355.         call    operand_32bit
  1356.         jmp     push_reg_store
  1357.       push_reg_16bit:
  1358.         test    ah,not 2
  1359.         jnz     invalid_operand_size
  1360.         call    operand_16bit
  1361.       push_reg_store:
  1362.         call    store_instruction_code
  1363.         jmp     push_done
  1364.       push_sreg:
  1365.         mov     bl,al
  1366.         mov     dl,[operand_size]
  1367.         mov     dh,[push_size]
  1368.         cmp     dl,2
  1369.         je      push_sreg16
  1370.         cmp     dl,4
  1371.         je      push_sreg32
  1372.         cmp     dl,8
  1373.         je      push_sreg64
  1374.         or      dl,dl
  1375.         jnz     invalid_operand_size
  1376.         cmp     dh,2
  1377.         je      push_sreg16
  1378.         cmp     dh,4
  1379.         je      push_sreg32
  1380.         cmp     dh,8
  1381.         je      push_sreg64
  1382.         jmp     push_sreg_store
  1383.       push_sreg16:
  1384.         test    dh,not 2
  1385.         jnz     invalid_operand_size
  1386.         call    operand_16bit
  1387.         jmp     push_sreg_store
  1388.       push_sreg32:
  1389.         test    dh,not 4
  1390.         jnz     invalid_operand_size
  1391.         cmp     [code_type],64
  1392.         je      illegal_instruction
  1393.         call    operand_32bit
  1394.         jmp     push_sreg_store
  1395.       push_sreg64:
  1396.         test    dh,not 8
  1397.         jnz     invalid_operand_size
  1398.         cmp     [code_type],64
  1399.         jne     illegal_instruction
  1400.       push_sreg_store:
  1401.         mov     al,bl
  1402.         cmp     al,70h
  1403.         jae     invalid_operand
  1404.         sub     al,61h
  1405.         jc      invalid_operand
  1406.         cmp     al,4
  1407.         jae     push_sreg_386
  1408.         shl     al,3
  1409.         add     al,6
  1410.         mov     [base_code],al
  1411.         cmp     [code_type],64
  1412.         je      illegal_instruction
  1413.         jmp     push_reg_store
  1414.       push_sreg_386:
  1415.         sub     al,4
  1416.         shl     al,3
  1417.         add     al,0A0h
  1418.         mov     [extended_code],al
  1419.         mov     [base_code],0Fh
  1420.         jmp     push_reg_store
  1421.       push_imm:
  1422.         mov     al,[operand_size]
  1423.         mov     ah,[push_size]
  1424.         or      al,al
  1425.         je      push_imm_size_ok
  1426.         or      ah,ah
  1427.         je      push_imm_size_ok
  1428.         cmp     al,ah
  1429.         jne     invalid_operand_size
  1430.       push_imm_size_ok:
  1431.         cmp     al,2
  1432.         je      push_imm_16bit
  1433.         cmp     al,4
  1434.         je      push_imm_32bit
  1435.         cmp     al,8
  1436.         je      push_imm_64bit
  1437.         cmp     ah,2
  1438.         je      push_imm_optimized_16bit
  1439.         cmp     ah,4
  1440.         je      push_imm_optimized_32bit
  1441.         cmp     ah,8
  1442.         je      push_imm_optimized_64bit
  1443.         or      al,al
  1444.         jnz     invalid_operand_size
  1445.         cmp     [code_type],16
  1446.         je      push_imm_optimized_16bit
  1447.         cmp     [code_type],32
  1448.         je      push_imm_optimized_32bit
  1449.       push_imm_optimized_64bit:
  1450.         cmp     [code_type],64
  1451.         jne     illegal_instruction
  1452.         call    get_simm32
  1453.         mov     edx,eax
  1454.         cmp     [value_type],0
  1455.         jne     push_imm_32bit_store
  1456.         cmp     eax,-80h
  1457.         jl      push_imm_32bit_store
  1458.         cmp     eax,80h
  1459.         jge     push_imm_32bit_store
  1460.         jmp     push_imm_8bit
  1461.       push_imm_optimized_32bit:
  1462.         cmp     [code_type],64
  1463.         je      illegal_instruction
  1464.         call    get_dword_value
  1465.         mov     edx,eax
  1466.         call    operand_32bit
  1467.         cmp     [value_type],0
  1468.         jne     push_imm_32bit_store
  1469.         cmp     eax,-80h
  1470.         jl      push_imm_32bit_store
  1471.         cmp     eax,80h
  1472.         jge     push_imm_32bit_store
  1473.         jmp     push_imm_8bit
  1474.       push_imm_optimized_16bit:
  1475.         call    get_word_value
  1476.         mov     dx,ax
  1477.         call    operand_16bit
  1478.         cmp     [value_type],0
  1479.         jne     push_imm_16bit_store
  1480.         cmp     ax,-80h
  1481.         jl      push_imm_16bit_store
  1482.         cmp     ax,80h
  1483.         jge     push_imm_16bit_store
  1484.       push_imm_8bit:
  1485.         mov     ah,al
  1486.         mov     [base_code],6Ah
  1487.         call    store_instruction_code
  1488.         mov     al,ah
  1489.         stos    byte [edi]
  1490.         jmp     push_done
  1491.       push_imm_16bit:
  1492.         call    get_word_value
  1493.         mov     dx,ax
  1494.         call    operand_16bit
  1495.       push_imm_16bit_store:
  1496.         mov     [base_code],68h
  1497.         call    store_instruction_code
  1498.         mov     ax,dx
  1499.         call    mark_relocation
  1500.         stos    word [edi]
  1501.         jmp     push_done
  1502.       push_imm_64bit:
  1503.         cmp     [code_type],64
  1504.         jne     illegal_instruction
  1505.         call    get_simm32
  1506.         mov     edx,eax
  1507.         jmp     push_imm_32bit_store
  1508.       push_imm_32bit:
  1509.         cmp     [code_type],64
  1510.         je      illegal_instruction
  1511.         call    get_dword_value
  1512.         mov     edx,eax
  1513.         call    operand_32bit
  1514.       push_imm_32bit_store:
  1515.         mov     [base_code],68h
  1516.         call    store_instruction_code
  1517.         mov     eax,edx
  1518.         call    mark_relocation
  1519.         stos    dword [edi]
  1520.       push_done:
  1521.         lods    byte [esi]
  1522.         dec     esi
  1523.         cmp     al,0Fh
  1524.         je      instruction_assembled
  1525.         or      al,al
  1526.         jz      instruction_assembled
  1527.         mov     [operand_size],0
  1528.         mov     [size_override],0
  1529.         mov     [operand_prefix],0
  1530.         mov     [rex_prefix],0
  1531.         jmp     push_next
  1532. pop_instruction:
  1533.         mov     [push_size],al
  1534.       pop_next:
  1535.         lods    byte [esi]
  1536.         call    get_size_operator
  1537.         cmp     al,10h
  1538.         je      pop_reg
  1539.         cmp     al,'['
  1540.         jne     invalid_operand
  1541.       pop_mem:
  1542.         call    get_address
  1543.         mov     al,[operand_size]
  1544.         mov     ah,[push_size]
  1545.         cmp     al,2
  1546.         je      pop_mem_16bit
  1547.         cmp     al,4
  1548.         je      pop_mem_32bit
  1549.         cmp     al,8
  1550.         je      pop_mem_64bit
  1551.         or      al,al
  1552.         jnz     invalid_operand_size
  1553.         cmp     ah,2
  1554.         je      pop_mem_16bit
  1555.         cmp     ah,4
  1556.         je      pop_mem_32bit
  1557.         cmp     ah,8
  1558.         je      pop_mem_64bit
  1559.         cmp     [error_line],0
  1560.         jne     pop_mem_store
  1561.         mov     eax,[current_line]
  1562.         mov     [error_line],eax
  1563.         mov     [error],operand_size_not_specified
  1564.         jmp     pop_mem_store
  1565.       pop_mem_16bit:
  1566.         test    ah,not 2
  1567.         jnz     invalid_operand_size
  1568.         call    operand_16bit
  1569.         jmp     pop_mem_store
  1570.       pop_mem_32bit:
  1571.         test    ah,not 4
  1572.         jnz     invalid_operand_size
  1573.         cmp     [code_type],64
  1574.         je      illegal_instruction
  1575.         call    operand_32bit
  1576.         jmp     pop_mem_store
  1577.       pop_mem_64bit:
  1578.         test    ah,not 8
  1579.         jnz     invalid_operand_size
  1580.         cmp     [code_type],64
  1581.         jne     illegal_instruction
  1582.       pop_mem_store:
  1583.         mov     [base_code],08Fh
  1584.         mov     [postbyte_register],0
  1585.         call    store_instruction
  1586.         jmp     pop_done
  1587.       pop_reg:
  1588.         lods    byte [esi]
  1589.         mov     ah,al
  1590.         sub     ah,10h
  1591.         and     ah,al
  1592.         test    ah,0F0h
  1593.         jnz     pop_sreg
  1594.         call    convert_register
  1595.         test    al,1000b
  1596.         jz      pop_reg_ok
  1597.         or      [rex_prefix],41h
  1598.         and     al,111b
  1599.       pop_reg_ok:
  1600.         add     al,58h
  1601.         mov     [base_code],al
  1602.         mov     al,ah
  1603.         mov     ah,[push_size]
  1604.         cmp     al,2
  1605.         je      pop_reg_16bit
  1606.         cmp     al,4
  1607.         je      pop_reg_32bit
  1608.         cmp     al,8
  1609.         je      pop_reg_64bit
  1610.         jmp     invalid_operand_size
  1611.       pop_reg_64bit:
  1612.         test    ah,not 8
  1613.         jnz     invalid_operand_size
  1614.         cmp     [code_type],64
  1615.         jne     illegal_instruction
  1616.         jmp     pop_reg_store
  1617.       pop_reg_32bit:
  1618.         test    ah,not 4
  1619.         jnz     invalid_operand_size
  1620.         cmp     [code_type],64
  1621.         je      illegal_instruction
  1622.         call    operand_32bit
  1623.         jmp     pop_reg_store
  1624.       pop_reg_16bit:
  1625.         test    ah,not 2
  1626.         jnz     invalid_operand_size
  1627.         call    operand_16bit
  1628.       pop_reg_store:
  1629.         call    store_instruction_code
  1630.       pop_done:
  1631.         lods    byte [esi]
  1632.         dec     esi
  1633.         cmp     al,0Fh
  1634.         je      instruction_assembled
  1635.         or      al,al
  1636.         jz      instruction_assembled
  1637.         mov     [operand_size],0
  1638.         mov     [size_override],0
  1639.         mov     [operand_prefix],0
  1640.         mov     [rex_prefix],0
  1641.         jmp     pop_next
  1642.       pop_sreg:
  1643.         mov     dl,[operand_size]
  1644.         mov     dh,[push_size]
  1645.         cmp     al,62h
  1646.         je      pop_cs
  1647.         mov     bl,al
  1648.         cmp     dl,2
  1649.         je      pop_sreg16
  1650.         cmp     dl,4
  1651.         je      pop_sreg32
  1652.         cmp     dl,8
  1653.         je      pop_sreg64
  1654.         or      dl,dl
  1655.         jnz     invalid_operand_size
  1656.         cmp     dh,2
  1657.         je      pop_sreg16
  1658.         cmp     dh,4
  1659.         je      pop_sreg32
  1660.         cmp     dh,8
  1661.         je      pop_sreg64
  1662.         jmp     pop_sreg_store
  1663.       pop_sreg16:
  1664.         test    dh,not 2
  1665.         jnz     invalid_operand_size
  1666.         call    operand_16bit
  1667.         jmp     pop_sreg_store
  1668.       pop_sreg32:
  1669.         test    dh,not 4
  1670.         jnz     invalid_operand_size
  1671.         cmp     [code_type],64
  1672.         je      illegal_instruction
  1673.         call    operand_32bit
  1674.         jmp     pop_sreg_store
  1675.       pop_sreg64:
  1676.         test    dh,not 8
  1677.         jnz     invalid_operand_size
  1678.         cmp     [code_type],64
  1679.         jne     illegal_instruction
  1680.       pop_sreg_store:
  1681.         mov     al,bl
  1682.         cmp     al,70h
  1683.         jae     invalid_operand
  1684.         sub     al,61h
  1685.         jc      invalid_operand
  1686.         cmp     al,4
  1687.         jae     pop_sreg_386
  1688.         shl     al,3
  1689.         add     al,7
  1690.         mov     [base_code],al
  1691.         cmp     [code_type],64
  1692.         je      illegal_instruction
  1693.         jmp     pop_reg_store
  1694.       pop_cs:
  1695.         cmp     [code_type],16
  1696.         jne     illegal_instruction
  1697.         cmp     dl,2
  1698.         je      pop_cs_store
  1699.         or      dl,dl
  1700.         jnz     invalid_operand_size
  1701.         cmp     dh,2
  1702.         je      pop_cs_store
  1703.         or      dh,dh
  1704.         jnz     illegal_instruction
  1705.       pop_cs_store:
  1706.         test    dh,not 2
  1707.         jnz     invalid_operand_size
  1708.         mov     al,0Fh
  1709.         stos    byte [edi]
  1710.         jmp     pop_done
  1711.       pop_sreg_386:
  1712.         sub     al,4
  1713.         shl     al,3
  1714.         add     al,0A1h
  1715.         mov     [extended_code],al
  1716.         mov     [base_code],0Fh
  1717.         jmp     pop_reg_store
  1718. inc_instruction:
  1719.         mov     [base_code],al
  1720.         lods    byte [esi]
  1721.         call    get_size_operator
  1722.         cmp     al,10h
  1723.         je      inc_reg
  1724.         cmp     al,'['
  1725.         je      inc_mem
  1726.         jne     invalid_operand
  1727.       inc_mem:
  1728.         call    get_address
  1729.         mov     al,[operand_size]
  1730.         cmp     al,1
  1731.         je      inc_mem_8bit
  1732.         jb      inc_mem_nosize
  1733.         call    operand_autodetect
  1734.         mov     al,0FFh
  1735.         xchg    al,[base_code]
  1736.         mov     [postbyte_register],al
  1737.         call    store_instruction
  1738.         jmp     instruction_assembled
  1739.       inc_mem_nosize:
  1740.         cmp     [error_line],0
  1741.         jne     inc_mem_8bit
  1742.         mov     eax,[current_line]
  1743.         mov     [error_line],eax
  1744.         mov     [error],operand_size_not_specified
  1745.       inc_mem_8bit:
  1746.         mov     al,0FEh
  1747.         xchg    al,[base_code]
  1748.         mov     [postbyte_register],al
  1749.         call    store_instruction
  1750.         jmp     instruction_assembled
  1751.       inc_reg:
  1752.         lods    byte [esi]
  1753.         call    convert_register
  1754.         mov     bl,al
  1755.         mov     al,0FEh
  1756.         xchg    al,[base_code]
  1757.         mov     [postbyte_register],al
  1758.         mov     al,ah
  1759.         cmp     al,1
  1760.         je      inc_reg_8bit
  1761.         call    operand_autodetect
  1762.         cmp     [code_type],64
  1763.         je      inc_reg_long_form
  1764.         mov     al,[postbyte_register]
  1765.         shl     al,3
  1766.         add     al,bl
  1767.         add     al,40h
  1768.         mov     [base_code],al
  1769.         call    store_instruction_code
  1770.         jmp     instruction_assembled
  1771.       inc_reg_long_form:
  1772.         inc     [base_code]
  1773.       inc_reg_8bit:
  1774.         call    store_nomem_instruction
  1775.         jmp     instruction_assembled
  1776. set_instruction:
  1777.         mov     [base_code],0Fh
  1778.         mov     [extended_code],al
  1779.         lods    byte [esi]
  1780.         call    get_size_operator
  1781.         cmp     al,10h
  1782.         je      set_reg
  1783.         cmp     al,'['
  1784.         jne     invalid_operand
  1785.       set_mem:
  1786.         call    get_address
  1787.         cmp     [operand_size],1
  1788.         ja      invalid_operand_size
  1789.         mov     [postbyte_register],0
  1790.         call    store_instruction
  1791.         jmp     instruction_assembled
  1792.       set_reg:
  1793.         lods    byte [esi]
  1794.         call    convert_register
  1795.         cmp     ah,1
  1796.         jne     invalid_operand_size
  1797.         mov     bl,al
  1798.         mov     [postbyte_register],0
  1799.         call    store_nomem_instruction
  1800.         jmp     instruction_assembled
  1801. arpl_instruction:
  1802.         cmp     [code_type],64
  1803.         je      illegal_instruction
  1804.         mov     [base_code],63h
  1805.         lods    byte [esi]
  1806.         call    get_size_operator
  1807.         cmp     al,10h
  1808.         je      arpl_reg
  1809.         cmp     al,'['
  1810.         jne     invalid_operand
  1811.         call    get_address
  1812.         lods    byte [esi]
  1813.         cmp     al,','
  1814.         jne     invalid_operand
  1815.         lods    byte [esi]
  1816.         cmp     al,10h
  1817.         jne     invalid_operand
  1818.         lods    byte [esi]
  1819.         call    convert_register
  1820.         mov     [postbyte_register],al
  1821.         cmp     ah,2
  1822.         jne     invalid_operand_size
  1823.         call    store_instruction
  1824.         jmp     instruction_assembled
  1825.       arpl_reg:
  1826.         lods    byte [esi]
  1827.         call    convert_register
  1828.         cmp     ah,2
  1829.         jne     invalid_operand_size
  1830.         mov     bl,al
  1831.         lods    byte [esi]
  1832.         cmp     al,','
  1833.         jne     invalid_operand
  1834.         lods    byte [esi]
  1835.         cmp     al,10h
  1836.         jne     invalid_operand
  1837.         lods    byte [esi]
  1838.         call    convert_register
  1839.         cmp     ah,2
  1840.         jne     invalid_operand_size
  1841.         mov     [postbyte_register],al
  1842.         call    store_nomem_instruction
  1843.         jmp     instruction_assembled
  1844. bound_instruction:
  1845.         cmp     [code_type],64
  1846.         je      illegal_instruction
  1847.         lods    byte [esi]
  1848.         call    get_size_operator
  1849.         cmp     al,10h
  1850.         jne     invalid_operand
  1851.         lods    byte [esi]
  1852.         call    convert_register
  1853.         mov     [postbyte_register],al
  1854.         lods    byte [esi]
  1855.         cmp     al,','
  1856.         jne     invalid_operand
  1857.         lods    byte [esi]
  1858.         call    get_size_operator
  1859.         cmp     al,'['
  1860.         jne     invalid_operand
  1861.         call    get_address
  1862.         mov     al,[operand_size]
  1863.         cmp     al,2
  1864.         je      bound_16bit
  1865.         cmp     al,4
  1866.         je      bound_32bit
  1867.         jmp     invalid_operand_size
  1868.       bound_32bit:
  1869.         call    operand_32bit
  1870.         mov     [base_code],62h
  1871.         call    store_instruction
  1872.         jmp     instruction_assembled
  1873.       bound_16bit:
  1874.         call    operand_16bit
  1875.         mov     [base_code],62h
  1876.         call    store_instruction
  1877.         jmp     instruction_assembled
  1878. enter_instruction:
  1879.         lods    byte [esi]
  1880.         call    get_size_operator
  1881.         cmp     ah,2
  1882.         je      enter_imm16_size_ok
  1883.         or      ah,ah
  1884.         jnz     invalid_operand_size
  1885.       enter_imm16_size_ok:
  1886.         cmp     al,'('
  1887.         jne     invalid_operand
  1888.         call    get_word_value
  1889.         cmp     [next_pass_needed],0
  1890.         jne     enter_imm16_ok
  1891.         cmp     [value_type],0
  1892.         jne     invalid_use_of_symbol
  1893.       enter_imm16_ok:
  1894.         push    eax
  1895.         mov     [operand_size],0
  1896.         lods    byte [esi]
  1897.         cmp     al,','
  1898.         jne     invalid_operand
  1899.         lods    byte [esi]
  1900.         call    get_size_operator
  1901.         cmp     ah,1
  1902.         je      enter_imm8_size_ok
  1903.         or      ah,ah
  1904.         jnz     invalid_operand_size
  1905.       enter_imm8_size_ok:
  1906.         cmp     al,'('
  1907.         jne     invalid_operand
  1908.         call    get_byte_value
  1909.         mov     dl,al
  1910.         pop     ebx
  1911.         mov     al,0C8h
  1912.         stos    byte [edi]
  1913.         mov     ax,bx
  1914.         stos    word [edi]
  1915.         mov     al,dl
  1916.         stos    byte [edi]
  1917.         jmp     instruction_assembled
  1918. ret_instruction_only64:
  1919.         cmp     [code_type],64
  1920.         jne     illegal_instruction
  1921.         jmp     ret_instruction
  1922. ret_instruction_32bit_except64:
  1923.         cmp     [code_type],64
  1924.         je      illegal_instruction
  1925. ret_instruction_32bit:
  1926.         call    operand_32bit
  1927.         jmp     ret_instruction
  1928. ret_instruction_16bit:
  1929.         call    operand_16bit
  1930.         jmp     ret_instruction
  1931. retf_instruction:
  1932.         cmp     [code_type],64
  1933.         jne     ret_instruction
  1934. ret_instruction_64bit:
  1935.         call    operand_64bit
  1936. ret_instruction:
  1937.         mov     [base_code],al
  1938.         lods    byte [esi]
  1939.         dec     esi
  1940.         or      al,al
  1941.         jz      simple_ret
  1942.         cmp     al,0Fh
  1943.         je      simple_ret
  1944.         lods    byte [esi]
  1945.         call    get_size_operator
  1946.         or      ah,ah
  1947.         jz      ret_imm
  1948.         cmp     ah,2
  1949.         je      ret_imm
  1950.         jmp     invalid_operand_size
  1951.       ret_imm:
  1952.         cmp     al,'('
  1953.         jne     invalid_operand
  1954.         call    get_word_value
  1955.         cmp     [next_pass_needed],0
  1956.         jne     ret_imm_ok
  1957.         cmp     [value_type],0
  1958.         jne     invalid_use_of_symbol
  1959.       ret_imm_ok:
  1960.         cmp     [size_declared],0
  1961.         jne     ret_imm_store
  1962.         or      ax,ax
  1963.         jz      simple_ret
  1964.       ret_imm_store:
  1965.         mov     dx,ax
  1966.         call    store_instruction_code
  1967.         mov     ax,dx
  1968.         stos    word [edi]
  1969.         jmp     instruction_assembled
  1970.       simple_ret:
  1971.         inc     [base_code]
  1972.         call    store_instruction_code
  1973.         jmp     instruction_assembled
  1974. lea_instruction:
  1975.         mov     [base_code],8Dh
  1976.         lods    byte [esi]
  1977.         call    get_size_operator
  1978.         cmp     al,10h
  1979.         jne     invalid_operand
  1980.         lods    byte [esi]
  1981.         call    convert_register
  1982.         mov     [postbyte_register],al
  1983.         lods    byte [esi]
  1984.         cmp     al,','
  1985.         jne     invalid_operand
  1986.         xor     al,al
  1987.         xchg    al,[operand_size]
  1988.         push    eax
  1989.         lods    byte [esi]
  1990.         call    get_size_operator
  1991.         cmp     al,'['
  1992.         jne     invalid_operand
  1993.         mov     [size_override],-1
  1994.         call    get_address
  1995.         pop     eax
  1996.         mov     [operand_size],al
  1997.         call    operand_autodetect
  1998.         call    store_instruction
  1999.         jmp     instruction_assembled
  2000. ls_instruction:
  2001.         or      al,al
  2002.         jz      les_instruction
  2003.         cmp     al,3
  2004.         jz      lds_instruction
  2005.         add     al,0B0h
  2006.         mov     [extended_code],al
  2007.         mov     [base_code],0Fh
  2008.         jmp     ls_code_ok
  2009.       les_instruction:
  2010.         mov     [base_code],0C4h
  2011.         jmp     ls_short_code
  2012.       lds_instruction:
  2013.         mov     [base_code],0C5h
  2014.       ls_short_code:
  2015.         cmp     [code_type],64
  2016.         je      illegal_instruction
  2017.       ls_code_ok:
  2018.         lods    byte [esi]
  2019.         call    get_size_operator
  2020.         cmp     al,10h
  2021.         jne     invalid_operand
  2022.         lods    byte [esi]
  2023.         call    convert_register
  2024.         mov     [postbyte_register],al
  2025.         lods    byte [esi]
  2026.         cmp     al,','
  2027.         jne     invalid_operand
  2028.         add     [operand_size],2
  2029.         lods    byte [esi]
  2030.         call    get_size_operator
  2031.         cmp     al,'['
  2032.         jne     invalid_operand
  2033.         call    get_address
  2034.         mov     al,[operand_size]
  2035.         cmp     al,4
  2036.         je      ls_16bit
  2037.         cmp     al,6
  2038.         je      ls_32bit
  2039.         cmp     al,10
  2040.         je      ls_64bit
  2041.         jmp     invalid_operand_size
  2042.       ls_16bit:
  2043.         call    operand_16bit
  2044.         call    store_instruction
  2045.         jmp     instruction_assembled
  2046.       ls_32bit:
  2047.         call    operand_32bit
  2048.         call    store_instruction
  2049.         jmp     instruction_assembled
  2050.       ls_64bit:
  2051.         call    operand_64bit
  2052.         call    store_instruction
  2053.         jmp     instruction_assembled
  2054. sh_instruction:
  2055.         mov     [postbyte_register],al
  2056.         lods    byte [esi]
  2057.         call    get_size_operator
  2058.         cmp     al,10h
  2059.         je      sh_reg
  2060.         cmp     al,'['
  2061.         jne     invalid_operand
  2062.       sh_mem:
  2063.         call    get_address
  2064.         push    edx ebx ecx
  2065.         mov     al,[operand_size]
  2066.         push    eax
  2067.         mov     [operand_size],0
  2068.         lods    byte [esi]
  2069.         cmp     al,','
  2070.         jne     invalid_operand
  2071.         lods    byte [esi]
  2072.         call    get_size_operator
  2073.         cmp     al,'('
  2074.         je      sh_mem_imm
  2075.         cmp     al,10h
  2076.         jne     invalid_operand
  2077.       sh_mem_reg:
  2078.         lods    byte [esi]
  2079.         cmp     al,11h
  2080.         jne     invalid_operand
  2081.         pop     eax ecx ebx edx
  2082.         cmp     al,1
  2083.         je      sh_mem_cl_8bit
  2084.         jb      sh_mem_cl_nosize
  2085.         call    operand_autodetect
  2086.         mov     [base_code],0D3h
  2087.         call    store_instruction
  2088.         jmp     instruction_assembled
  2089.       sh_mem_cl_nosize:
  2090.         cmp     [error_line],0
  2091.         jne     sh_mem_cl_8bit
  2092.         mov     eax,[current_line]
  2093.         mov     [error_line],eax
  2094.         mov     [error],operand_size_not_specified
  2095.       sh_mem_cl_8bit:
  2096.         mov     [base_code],0D2h
  2097.         call    store_instruction
  2098.         jmp     instruction_assembled
  2099.       sh_mem_imm:
  2100.         mov     al,[operand_size]
  2101.         or      al,al
  2102.         jz      sh_mem_imm_size_ok
  2103.         cmp     al,1
  2104.         jne     invalid_operand_size
  2105.       sh_mem_imm_size_ok:
  2106.         call    get_byte_value
  2107.         mov     byte [value],al
  2108.         pop     eax ecx ebx edx
  2109.         cmp     al,1
  2110.         je      sh_mem_imm_8bit
  2111.         jb      sh_mem_imm_nosize
  2112.         call    operand_autodetect
  2113.         cmp     byte [value],1
  2114.         je      sh_mem_1
  2115.         mov     [base_code],0C1h
  2116.         call    store_instruction_with_imm8
  2117.         jmp     instruction_assembled
  2118.       sh_mem_1:
  2119.         mov     [base_code],0D1h
  2120.         call    store_instruction
  2121.         jmp     instruction_assembled
  2122.       sh_mem_imm_nosize:
  2123.         cmp     [error_line],0
  2124.         jne     sh_mem_imm_8bit
  2125.         mov     eax,[current_line]
  2126.         mov     [error_line],eax
  2127.         mov     [error],operand_size_not_specified
  2128.       sh_mem_imm_8bit:
  2129.         cmp     byte [value],1
  2130.         je      sh_mem_1_8bit
  2131.         mov     [base_code],0C0h
  2132.         call    store_instruction_with_imm8
  2133.         jmp     instruction_assembled
  2134.       sh_mem_1_8bit:
  2135.         mov     [base_code],0D0h
  2136.         call    store_instruction
  2137.         jmp     instruction_assembled
  2138.       sh_reg:
  2139.         lods    byte [esi]
  2140.         call    convert_register
  2141.         mov     bx,ax
  2142.         mov     [operand_size],0
  2143.         lods    byte [esi]
  2144.         cmp     al,','
  2145.         jne     invalid_operand
  2146.         lods    byte [esi]
  2147.         call    get_size_operator
  2148.         cmp     al,'('
  2149.         je      sh_reg_imm
  2150.         cmp     al,10h
  2151.         jne     invalid_operand
  2152.       sh_reg_reg:
  2153.         lods    byte [esi]
  2154.         cmp     al,11h
  2155.         jne     invalid_operand
  2156.         mov     al,bh
  2157.         cmp     al,1
  2158.         je      sh_reg_cl_8bit
  2159.         call    operand_autodetect
  2160.         mov     [base_code],0D3h
  2161.         call    store_nomem_instruction
  2162.         jmp     instruction_assembled
  2163.       sh_reg_cl_8bit:
  2164.         mov     [base_code],0D2h
  2165.         call    store_nomem_instruction
  2166.         jmp     instruction_assembled
  2167.       sh_reg_imm:
  2168.         mov     al,[operand_size]
  2169.         or      al,al
  2170.         jz      sh_reg_imm_size_ok
  2171.         cmp     al,1
  2172.         jne     invalid_operand_size
  2173.       sh_reg_imm_size_ok:
  2174.         push    ebx
  2175.         call    get_byte_value
  2176.         mov     dl,al
  2177.         pop     ebx
  2178.         mov     al,bh
  2179.         cmp     al,1
  2180.         je      sh_reg_imm_8bit
  2181.         call    operand_autodetect
  2182.         cmp     dl,1
  2183.         je      sh_reg_1
  2184.         mov     [base_code],0C1h
  2185.         call    store_nomem_instruction
  2186.         mov     al,dl
  2187.         stos    byte [edi]
  2188.         jmp     instruction_assembled
  2189.       sh_reg_1:
  2190.         mov     [base_code],0D1h
  2191.         call    store_nomem_instruction
  2192.         jmp     instruction_assembled
  2193.       sh_reg_imm_8bit:
  2194.         cmp     dl,1
  2195.         je      sh_reg_1_8bit
  2196.         mov     [base_code],0C0h
  2197.         call    store_nomem_instruction
  2198.         mov     al,dl
  2199.         stos    byte [edi]
  2200.         jmp     instruction_assembled
  2201.       sh_reg_1_8bit:
  2202.         mov     [base_code],0D0h
  2203.         call    store_nomem_instruction
  2204.         jmp     instruction_assembled
  2205. shd_instruction:
  2206.         mov     [base_code],0Fh
  2207.         mov     [extended_code],al
  2208.         lods    byte [esi]
  2209.         call    get_size_operator
  2210.         cmp     al,10h
  2211.         je      shd_reg
  2212.         cmp     al,'['
  2213.         jne     invalid_operand
  2214.       shd_mem:
  2215.         call    get_address
  2216.         push    edx ebx ecx
  2217.         lods    byte [esi]
  2218.         cmp     al,','
  2219.         jne     invalid_operand
  2220.         lods    byte [esi]
  2221.         call    get_size_operator
  2222.         cmp     al,10h
  2223.         jne     invalid_operand
  2224.         lods    byte [esi]
  2225.         call    convert_register
  2226.         mov     [postbyte_register],al
  2227.         lods    byte [esi]
  2228.         cmp     al,','
  2229.         jne     invalid_operand
  2230.         mov     al,ah
  2231.         mov     [operand_size],0
  2232.         push    eax
  2233.         lods    byte [esi]
  2234.         call    get_size_operator
  2235.         cmp     al,'('
  2236.         je      shd_mem_reg_imm
  2237.         cmp     al,10h
  2238.         jne     invalid_operand
  2239.         lods    byte [esi]
  2240.         cmp     al,11h
  2241.         jne     invalid_operand
  2242.         pop     eax ecx ebx edx
  2243.         call    operand_autodetect
  2244.         inc     [extended_code]
  2245.         call    store_instruction
  2246.         jmp     instruction_assembled
  2247.       shd_mem_reg_imm:
  2248.         mov     al,[operand_size]
  2249.         or      al,al
  2250.         jz      shd_mem_reg_imm_size_ok
  2251.         cmp     al,1
  2252.         jne     invalid_operand_size
  2253.       shd_mem_reg_imm_size_ok:
  2254.         call    get_byte_value
  2255.         mov     byte [value],al
  2256.         pop     eax ecx ebx edx
  2257.         call    operand_autodetect
  2258.         call    store_instruction_with_imm8
  2259.         jmp     instruction_assembled
  2260.       shd_reg:
  2261.         lods    byte [esi]
  2262.         call    convert_register
  2263.         mov     [postbyte_register],al
  2264.         lods    byte [esi]
  2265.         cmp     al,','
  2266.         jne     invalid_operand
  2267.         lods    byte [esi]
  2268.         call    get_size_operator
  2269.         cmp     al,10h
  2270.         jne     invalid_operand
  2271.         lods    byte [esi]
  2272.         call    convert_register
  2273.         mov     bl,[postbyte_register]
  2274.         mov     [postbyte_register],al
  2275.         mov     al,ah
  2276.         push    eax ebx
  2277.         lods    byte [esi]
  2278.         cmp     al,','
  2279.         jne     invalid_operand
  2280.         mov     [operand_size],0
  2281.         lods    byte [esi]
  2282.         call    get_size_operator
  2283.         cmp     al,'('
  2284.         je      shd_reg_reg_imm
  2285.         cmp     al,10h
  2286.         jne     invalid_operand
  2287.         lods    byte [esi]
  2288.         cmp     al,11h
  2289.         jne     invalid_operand
  2290.         pop     ebx eax
  2291.         call    operand_autodetect
  2292.         inc     [extended_code]
  2293.         call    store_nomem_instruction
  2294.         jmp     instruction_assembled
  2295.       shd_reg_reg_imm:
  2296.         mov     al,[operand_size]
  2297.         or      al,al
  2298.         jz      shd_reg_reg_imm_size_ok
  2299.         cmp     al,1
  2300.         jne     invalid_operand_size
  2301.       shd_reg_reg_imm_size_ok:
  2302.         call    get_byte_value
  2303.         mov     dl,al
  2304.         pop     ebx eax
  2305.         call    operand_autodetect
  2306.         call    store_nomem_instruction
  2307.         mov     al,dl
  2308.         stos    byte [edi]
  2309.         jmp     instruction_assembled
  2310. movx_instruction:
  2311.         mov     [base_code],0Fh
  2312.         mov     [extended_code],al
  2313.         lods    byte [esi]
  2314.         call    get_size_operator
  2315.         cmp     al,10h
  2316.         jne     invalid_operand
  2317.         lods    byte [esi]
  2318.         call    convert_register
  2319.         mov     [postbyte_register],al
  2320.         mov     al,ah
  2321.         push    eax
  2322.         lods    byte [esi]
  2323.         cmp     al,','
  2324.         jne     invalid_operand
  2325.         mov     [operand_size],0
  2326.         lods    byte [esi]
  2327.         call    get_size_operator
  2328.         cmp     al,10h
  2329.         je      movx_reg
  2330.         cmp     al,'['
  2331.         jne     invalid_operand
  2332.         call    get_address
  2333.         pop     eax
  2334.         mov     ah,[operand_size]
  2335.         or      ah,ah
  2336.         jz      movx_unknown_size
  2337.         cmp     ah,al
  2338.         jae     invalid_operand_size
  2339.         cmp     ah,1
  2340.         je      movx_mem_8bit
  2341.         cmp     ah,2
  2342.         jne     invalid_operand_size
  2343.       movx_mem_16bit:
  2344.         inc     [extended_code]
  2345.         call    operand_autodetect
  2346.         call    store_instruction
  2347.         jmp     instruction_assembled
  2348.       movx_unknown_size:
  2349.         cmp     [error_line],0
  2350.         jne     movx_mem_8bit
  2351.         mov     eax,[current_line]
  2352.         mov     [error_line],eax
  2353.         mov     [error],operand_size_not_specified
  2354.       movx_mem_8bit:
  2355.         call    operand_autodetect
  2356.         call    store_instruction
  2357.         jmp     instruction_assembled
  2358.       movx_reg:
  2359.         lods    byte [esi]
  2360.         call    convert_register
  2361.         pop     ebx
  2362.         xchg    bl,al
  2363.         cmp     ah,al
  2364.         jae     invalid_operand_size
  2365.         cmp     ah,1
  2366.         je      movx_reg_8bit
  2367.         cmp     ah,2
  2368.         je      movx_reg_16bit
  2369.         jmp     invalid_operand_size
  2370.       movx_reg_8bit:
  2371.         call    operand_autodetect
  2372.         call    store_nomem_instruction
  2373.         jmp     instruction_assembled
  2374.       movx_reg_16bit:
  2375.         call    operand_autodetect
  2376.         inc     [extended_code]
  2377.         call    store_nomem_instruction
  2378.         jmp     instruction_assembled
  2379. movsxd_instruction:
  2380.         mov     [base_code],al
  2381.         lods    byte [esi]
  2382.         call    get_size_operator
  2383.         cmp     al,10h
  2384.         jne     invalid_operand
  2385.         lods    byte [esi]
  2386.         call    convert_register
  2387.         mov     [postbyte_register],al
  2388.         cmp     ah,8
  2389.         jne     invalid_operand_size
  2390.         lods    byte [esi]
  2391.         cmp     al,','
  2392.         jne     invalid_operand
  2393.         mov     [operand_size],0
  2394.         lods    byte [esi]
  2395.         call    get_size_operator
  2396.         cmp     al,10h
  2397.         je      movsxd_reg
  2398.         cmp     al,'['
  2399.         jne     invalid_operand
  2400.         call    get_address
  2401.         cmp     [operand_size],4
  2402.         je      movsxd_mem_store
  2403.         cmp     [operand_size],0
  2404.         jne     invalid_operand_size
  2405.       movsxd_mem_store:
  2406.         call    operand_64bit
  2407.         call    store_instruction
  2408.         jmp     instruction_assembled
  2409.       movsxd_reg:
  2410.         lods    byte [esi]
  2411.         call    convert_register
  2412.         cmp     ah,4
  2413.         jne     invalid_operand_size
  2414.         mov     bl,al
  2415.         call    operand_64bit
  2416.         call    store_nomem_instruction
  2417.         jmp     instruction_assembled
  2418. bt_instruction:
  2419.         mov     [postbyte_register],al
  2420.         shl     al,3
  2421.         add     al,83h
  2422.         mov     [extended_code],al
  2423.         mov     [base_code],0Fh
  2424.         lods    byte [esi]
  2425.         call    get_size_operator
  2426.         cmp     al,10h
  2427.         je      bt_reg
  2428.         cmp     al,'['
  2429.         jne     invalid_operand
  2430.         call    get_address
  2431.         push    eax ebx ecx
  2432.         lods    byte [esi]
  2433.         cmp     al,','
  2434.         jne     invalid_operand
  2435.         cmp     byte [esi],'('
  2436.         je      bt_mem_imm
  2437.         cmp     byte [esi],11h
  2438.         jne     bt_mem_reg
  2439.         cmp     byte [esi+2],'('
  2440.         je      bt_mem_imm
  2441.       bt_mem_reg:
  2442.         lods    byte [esi]
  2443.         call    get_size_operator
  2444.         cmp     al,10h
  2445.         jne     invalid_operand
  2446.         lods    byte [esi]
  2447.         call    convert_register
  2448.         mov     [postbyte_register],al
  2449.         pop     ecx ebx edx
  2450.         mov     al,ah
  2451.         call    operand_autodetect
  2452.         call    store_instruction
  2453.         jmp     instruction_assembled
  2454.       bt_mem_imm:
  2455.         xor     al,al
  2456.         xchg    al,[operand_size]
  2457.         push    eax
  2458.         lods    byte [esi]
  2459.         call    get_size_operator
  2460.         cmp     al,'('
  2461.         jne     invalid_operand
  2462.         mov     al,[operand_size]
  2463.         or      al,al
  2464.         jz      bt_mem_imm_size_ok
  2465.         cmp     al,1
  2466.         jne     invalid_operand_size
  2467.       bt_mem_imm_size_ok:
  2468.         call    get_byte_value
  2469.         mov     byte [value],al
  2470.         pop     eax
  2471.         or      al,al
  2472.         jz      bt_mem_imm_nosize
  2473.         call    operand_autodetect
  2474.       bt_mem_imm_store:
  2475.         pop     ecx ebx edx
  2476.         mov     [extended_code],0BAh
  2477.         call    store_instruction_with_imm8
  2478.         jmp     instruction_assembled
  2479.       bt_mem_imm_nosize:
  2480.         cmp     [error_line],0
  2481.         jne     bt_mem_imm_store
  2482.         mov     eax,[current_line]
  2483.         mov     [error_line],eax
  2484.         mov     [error],operand_size_not_specified
  2485.         jmp     bt_mem_imm_store
  2486.       bt_reg:
  2487.         lods    byte [esi]
  2488.         call    convert_register
  2489.         mov     bl,al
  2490.         lods    byte [esi]
  2491.         cmp     al,','
  2492.         jne     invalid_operand
  2493.         cmp     byte [esi],'('
  2494.         je      bt_reg_imm
  2495.         cmp     byte [esi],11h
  2496.         jne     bt_reg_reg
  2497.         cmp     byte [esi+2],'('
  2498.         je      bt_reg_imm
  2499.       bt_reg_reg:
  2500.         lods    byte [esi]
  2501.         call    get_size_operator
  2502.         cmp     al,10h
  2503.         jne     invalid_operand
  2504.         lods    byte [esi]
  2505.         call    convert_register
  2506.         mov     [postbyte_register],al
  2507.         mov     al,ah
  2508.         call    operand_autodetect
  2509.         call    store_nomem_instruction
  2510.         jmp     instruction_assembled
  2511.       bt_reg_imm:
  2512.         xor     al,al
  2513.         xchg    al,[operand_size]
  2514.         push    eax ebx
  2515.         lods    byte [esi]
  2516.         call    get_size_operator
  2517.         cmp     al,'('
  2518.         jne     invalid_operand
  2519.         mov     al,[operand_size]
  2520.         or      al,al
  2521.         jz      bt_reg_imm_size_ok
  2522.         cmp     al,1
  2523.         jne     invalid_operand_size
  2524.       bt_reg_imm_size_ok:
  2525.         call    get_byte_value
  2526.         mov     byte [value],al
  2527.         pop     ebx eax
  2528.         call    operand_autodetect
  2529.       bt_reg_imm_store:
  2530.         mov     [extended_code],0BAh
  2531.         call    store_nomem_instruction
  2532.         mov     al,byte [value]
  2533.         stos    byte [edi]
  2534.         jmp     instruction_assembled
  2535. bs_instruction:
  2536.         mov     [extended_code],al
  2537.         mov     [base_code],0Fh
  2538.         lods    byte [esi]
  2539.         call    get_size_operator
  2540.         cmp     al,10h
  2541.         jne     invalid_operand
  2542.         lods    byte [esi]
  2543.         call    convert_register
  2544.         mov     [postbyte_register],al
  2545.         lods    byte [esi]
  2546.         cmp     al,','
  2547.         jne     invalid_operand
  2548.         lods    byte [esi]
  2549.         call    get_size_operator
  2550.         cmp     al,10h
  2551.         je      bs_reg_reg
  2552.         cmp     al,'['
  2553.         jne     invalid_argument
  2554.         call    get_address
  2555.         mov     al,[operand_size]
  2556.         call    operand_autodetect
  2557.         call    store_instruction
  2558.         jmp     instruction_assembled
  2559.       bs_reg_reg:
  2560.         lods    byte [esi]
  2561.         call    convert_register
  2562.         mov     bl,al
  2563.         mov     al,ah
  2564.         call    operand_autodetect
  2565.         call    store_nomem_instruction
  2566.         jmp     instruction_assembled
  2567. imul_instruction:
  2568.         mov     [base_code],0F6h
  2569.         mov     [postbyte_register],5
  2570.         lods    byte [esi]
  2571.         call    get_size_operator
  2572.         cmp     al,10h
  2573.         je      imul_reg
  2574.         cmp     al,'['
  2575.         jne     invalid_operand
  2576.       imul_mem:
  2577.         call    get_address
  2578.         mov     al,[operand_size]
  2579.         cmp     al,1
  2580.         je      imul_mem_8bit
  2581.         jb      imul_mem_nosize
  2582.         call    operand_autodetect
  2583.         inc     [base_code]
  2584.         call    store_instruction
  2585.         jmp     instruction_assembled
  2586.       imul_mem_nosize:
  2587.         cmp     [error_line],0
  2588.         jne     imul_mem_8bit
  2589.         mov     eax,[current_line]
  2590.         mov     [error_line],eax
  2591.         mov     [error],operand_size_not_specified
  2592.       imul_mem_8bit:
  2593.         call    store_instruction
  2594.         jmp     instruction_assembled
  2595.       imul_reg:
  2596.         lods    byte [esi]
  2597.         call    convert_register
  2598.         cmp     byte [esi],','
  2599.         je      imul_reg_
  2600.         mov     bl,al
  2601.         mov     al,ah
  2602.         cmp     al,1
  2603.         je      imul_reg_8bit
  2604.         call    operand_autodetect
  2605.         inc     [base_code]
  2606.         call    store_nomem_instruction
  2607.         jmp     instruction_assembled
  2608.       imul_reg_8bit:
  2609.         call    store_nomem_instruction
  2610.         jmp     instruction_assembled
  2611.       imul_reg_:
  2612.         mov     [postbyte_register],al
  2613.         inc     esi
  2614.         cmp     byte [esi],'('
  2615.         je      imul_reg_imm
  2616.         cmp     byte [esi],11h
  2617.         jne     imul_reg_noimm
  2618.         cmp     byte [esi+2],'('
  2619.         je      imul_reg_imm
  2620.       imul_reg_noimm:
  2621.         lods    byte [esi]
  2622.         call    get_size_operator
  2623.         cmp     al,10h
  2624.         je      imul_reg_reg
  2625.         cmp     al,'['
  2626.         jne     invalid_operand
  2627.       imul_reg_mem:
  2628.         call    get_address
  2629.         push    edx ebx ecx
  2630.         cmp     byte [esi],','
  2631.         je      imul_reg_mem_imm
  2632.         mov     al,[operand_size]
  2633.         call    operand_autodetect
  2634.         pop     ecx ebx edx
  2635.         mov     [base_code],0Fh
  2636.         mov     [extended_code],0AFh
  2637.         call    store_instruction
  2638.         jmp     instruction_assembled
  2639.       imul_reg_mem_imm:
  2640.         inc     esi
  2641.         lods    byte [esi]
  2642.         call    get_size_operator
  2643.         cmp     al,'('
  2644.         jne     invalid_operand
  2645.         mov     al,[operand_size]
  2646.         cmp     al,2
  2647.         je      imul_reg_mem_imm_16bit
  2648.         cmp     al,4
  2649.         je      imul_reg_mem_imm_32bit
  2650.         cmp     al,8
  2651.         je      imul_reg_mem_imm_64bit
  2652.         jmp     invalid_operand_size
  2653.       imul_reg_mem_imm_16bit:
  2654.         call    operand_16bit
  2655.         call    get_word_value
  2656.         mov     word [value],ax
  2657.         cmp     [value_type],0
  2658.         jne     imul_reg_mem_imm_16bit_store
  2659.         cmp     [size_declared],0
  2660.         jne     imul_reg_mem_imm_16bit_store
  2661.         cmp     ax,-80h
  2662.         jl      imul_reg_mem_imm_16bit_store
  2663.         cmp     ax,80h
  2664.         jl      imul_reg_mem_imm_8bit_store
  2665.       imul_reg_mem_imm_16bit_store:
  2666.         pop     ecx ebx edx
  2667.         mov     [base_code],69h
  2668.         call    store_instruction_with_imm16
  2669.         jmp     instruction_assembled
  2670.       imul_reg_mem_imm_32bit:
  2671.         call    operand_32bit
  2672.         call    get_dword_value
  2673.       imul_reg_mem_imm_32bit_ok:
  2674.         mov     dword [value],eax
  2675.         cmp     [value_type],0
  2676.         jne     imul_reg_mem_imm_32bit_store
  2677.         cmp     [size_declared],0
  2678.         jne     imul_reg_mem_imm_32bit_store
  2679.         cmp     eax,-80h
  2680.         jl      imul_reg_mem_imm_32bit_store
  2681.         cmp     eax,80h
  2682.         jl      imul_reg_mem_imm_8bit_store
  2683.       imul_reg_mem_imm_32bit_store:
  2684.         pop     ecx ebx edx
  2685.         mov     [base_code],69h
  2686.         call    store_instruction_with_imm32
  2687.         jmp     instruction_assembled
  2688.       imul_reg_mem_imm_64bit:
  2689.         cmp     [size_declared],0
  2690.         jne     long_immediate_not_encodable
  2691.         call    operand_64bit
  2692.         call    get_simm32
  2693.         cmp     [value_type],4
  2694.         jae     long_immediate_not_encodable
  2695.         jmp     imul_reg_mem_imm_32bit_ok
  2696.       imul_reg_mem_imm_8bit_store:
  2697.         pop     ecx ebx edx
  2698.         mov     [base_code],6Bh
  2699.         call    store_instruction_with_imm8
  2700.         jmp     instruction_assembled
  2701.       imul_reg_imm:
  2702.         mov     bl,[postbyte_register]
  2703.         dec     esi
  2704.         jmp     imul_reg_reg_imm
  2705.       imul_reg_reg:
  2706.         lods    byte [esi]
  2707.         call    convert_register
  2708.         mov     bl,al
  2709.         cmp     byte [esi],','
  2710.         je      imul_reg_reg_imm
  2711.         mov     al,ah
  2712.         call    operand_autodetect
  2713.         mov     [base_code],0Fh
  2714.         mov     [extended_code],0AFh
  2715.         call    store_nomem_instruction
  2716.         jmp     instruction_assembled
  2717.       imul_reg_reg_imm:
  2718.         inc     esi
  2719.         lods    byte [esi]
  2720.         call    get_size_operator
  2721.         cmp     al,'('
  2722.         jne     invalid_operand
  2723.         mov     al,[operand_size]
  2724.         cmp     al,2
  2725.         je      imul_reg_reg_imm_16bit
  2726.         cmp     al,4
  2727.         je      imul_reg_reg_imm_32bit
  2728.         cmp     al,8
  2729.         je      imul_reg_reg_imm_64bit
  2730.         jmp     invalid_operand_size
  2731.       imul_reg_reg_imm_16bit:
  2732.         call    operand_16bit
  2733.         push    ebx
  2734.         call    get_word_value
  2735.         pop     ebx
  2736.         mov     dx,ax
  2737.         cmp     [value_type],0
  2738.         jne     imul_reg_reg_imm_16bit_store
  2739.         cmp     [size_declared],0
  2740.         jne     imul_reg_reg_imm_16bit_store
  2741.         cmp     ax,-80h
  2742.         jl      imul_reg_reg_imm_16bit_store
  2743.         cmp     ax,80h
  2744.         jl      imul_reg_reg_imm_8bit_store
  2745.       imul_reg_reg_imm_16bit_store:
  2746.         mov     [base_code],69h
  2747.         call    store_nomem_instruction
  2748.         mov     ax,dx
  2749.         call    mark_relocation
  2750.         stos    word [edi]
  2751.         jmp     instruction_assembled
  2752.       imul_reg_reg_imm_32bit:
  2753.         call    operand_32bit
  2754.         push    ebx
  2755.         call    get_dword_value
  2756.       imul_reg_reg_imm_32bit_ok:
  2757.         pop     ebx
  2758.         mov     edx,eax
  2759.         cmp     [value_type],0
  2760.         jne     imul_reg_reg_imm_32bit_store
  2761.         cmp     [size_declared],0
  2762.         jne     imul_reg_reg_imm_32bit_store
  2763.         cmp     eax,-80h
  2764.         jl      imul_reg_reg_imm_32bit_store
  2765.         cmp     eax,80h
  2766.         jl      imul_reg_reg_imm_8bit_store
  2767.       imul_reg_reg_imm_32bit_store:
  2768.         mov     [base_code],69h
  2769.         call    store_nomem_instruction
  2770.         mov     eax,edx
  2771.         call    mark_relocation
  2772.         stos    dword [edi]
  2773.         jmp     instruction_assembled
  2774.       imul_reg_reg_imm_64bit:
  2775.         cmp     [size_declared],0
  2776.         jne     long_immediate_not_encodable
  2777.         call    operand_64bit
  2778.         push    ebx
  2779.         call    get_simm32
  2780.         cmp     [value_type],4
  2781.         jae     long_immediate_not_encodable
  2782.         jmp     imul_reg_reg_imm_32bit_ok
  2783.       imul_reg_reg_imm_8bit_store:
  2784.         mov     [base_code],6Bh
  2785.         call    store_nomem_instruction
  2786.         mov     al,dl
  2787.         stos    byte [edi]
  2788.         jmp     instruction_assembled
  2789. in_instruction:
  2790.         lods    byte [esi]
  2791.         call    get_size_operator
  2792.         cmp     al,10h
  2793.         jne     invalid_operand
  2794.         lods    byte [esi]
  2795.         call    convert_register
  2796.         or      al,al
  2797.         jnz     invalid_operand
  2798.         lods    byte [esi]
  2799.         cmp     al,','
  2800.         jne     invalid_operand
  2801.         mov     al,ah
  2802.         push    eax
  2803.         mov     [operand_size],0
  2804.         lods    byte [esi]
  2805.         call    get_size_operator
  2806.         cmp     al,'('
  2807.         je      in_imm
  2808.         cmp     al,10h
  2809.         je      in_reg
  2810.         jmp     invalid_operand
  2811.       in_reg:
  2812.         lods    byte [esi]
  2813.         cmp     al,22h
  2814.         jne     invalid_operand
  2815.         pop     eax
  2816.         cmp     al,1
  2817.         je      in_al_dx
  2818.         cmp     al,2
  2819.         je      in_ax_dx
  2820.         cmp     al,4
  2821.         je      in_eax_dx
  2822.         jmp     invalid_operand_size
  2823.       in_al_dx:
  2824.         mov     al,0ECh
  2825.         stos    byte [edi]
  2826.         jmp     instruction_assembled
  2827.       in_ax_dx:
  2828.         call    operand_16bit
  2829.         mov     [base_code],0EDh
  2830.         call    store_instruction_code
  2831.         jmp     instruction_assembled
  2832.       in_eax_dx:
  2833.         call    operand_32bit
  2834.         mov     [base_code],0EDh
  2835.         call    store_instruction_code
  2836.         jmp     instruction_assembled
  2837.       in_imm:
  2838.         mov     al,[operand_size]
  2839.         or      al,al
  2840.         jz      in_imm_size_ok
  2841.         cmp     al,1
  2842.         jne     invalid_operand_size
  2843.       in_imm_size_ok:
  2844.         call    get_byte_value
  2845.         mov     dl,al
  2846.         pop     eax
  2847.         cmp     al,1
  2848.         je      in_al_imm
  2849.         cmp     al,2
  2850.         je      in_ax_imm
  2851.         cmp     al,4
  2852.         je      in_eax_imm
  2853.         jmp     invalid_operand_size
  2854.       in_al_imm:
  2855.         mov     al,0E4h
  2856.         stos    byte [edi]
  2857.         mov     al,dl
  2858.         stos    byte [edi]
  2859.         jmp     instruction_assembled
  2860.       in_ax_imm:
  2861.         call    operand_16bit
  2862.         mov     [base_code],0E5h
  2863.         call    store_instruction_code
  2864.         mov     al,dl
  2865.         stos    byte [edi]
  2866.         jmp     instruction_assembled
  2867.       in_eax_imm:
  2868.         call    operand_32bit
  2869.         mov     [base_code],0E5h
  2870.         call    store_instruction_code
  2871.         mov     al,dl
  2872.         stos    byte [edi]
  2873.         jmp     instruction_assembled
  2874. out_instruction:
  2875.         lods    byte [esi]
  2876.         call    get_size_operator
  2877.         cmp     al,'('
  2878.         je      out_imm
  2879.         cmp     al,10h
  2880.         jne     invalid_operand
  2881.         lods    byte [esi]
  2882.         cmp     al,22h
  2883.         jne     invalid_operand
  2884.         lods    byte [esi]
  2885.         cmp     al,','
  2886.         jne     invalid_operand
  2887.         mov     [operand_size],0
  2888.         lods    byte [esi]
  2889.         call    get_size_operator
  2890.         cmp     al,10h
  2891.         jne     invalid_operand
  2892.         lods    byte [esi]
  2893.         call    convert_register
  2894.         or      al,al
  2895.         jnz     invalid_operand
  2896.         mov     al,ah
  2897.         cmp     al,1
  2898.         je      out_dx_al
  2899.         cmp     al,2
  2900.         je      out_dx_ax
  2901.         cmp     al,4
  2902.         je      out_dx_eax
  2903.         jmp     invalid_operand_size
  2904.       out_dx_al:
  2905.         mov     al,0EEh
  2906.         stos    byte [edi]
  2907.         jmp     instruction_assembled
  2908.       out_dx_ax:
  2909.         call    operand_16bit
  2910.         mov     [base_code],0EFh
  2911.         call    store_instruction_code
  2912.         jmp     instruction_assembled
  2913.       out_dx_eax:
  2914.         call    operand_32bit
  2915.         mov     [base_code],0EFh
  2916.         call    store_instruction_code
  2917.         jmp     instruction_assembled
  2918.       out_imm:
  2919.         mov     al,[operand_size]
  2920.         or      al,al
  2921.         jz      out_imm_size_ok
  2922.         cmp     al,1
  2923.         jne     invalid_operand_size
  2924.       out_imm_size_ok:
  2925.         call    get_byte_value
  2926.         mov     dl,al
  2927.         lods    byte [esi]
  2928.         cmp     al,','
  2929.         jne     invalid_operand
  2930.         mov     [operand_size],0
  2931.         lods    byte [esi]
  2932.         call    get_size_operator
  2933.         cmp     al,10h
  2934.         jne     invalid_operand
  2935.         lods    byte [esi]
  2936.         call    convert_register
  2937.         or      al,al
  2938.         jnz     invalid_operand
  2939.         mov     al,ah
  2940.         cmp     al,1
  2941.         je      out_imm_al
  2942.         cmp     al,2
  2943.         je      out_imm_ax
  2944.         cmp     al,4
  2945.         je      out_imm_eax
  2946.         jmp     invalid_operand_size
  2947.       out_imm_al:
  2948.         mov     al,0E6h
  2949.         stos    byte [edi]
  2950.         mov     al,dl
  2951.         stos    byte [edi]
  2952.         jmp     instruction_assembled
  2953.       out_imm_ax:
  2954.         call    operand_16bit
  2955.         mov     [base_code],0E7h
  2956.         call    store_instruction_code
  2957.         mov     al,dl
  2958.         stos    byte [edi]
  2959.         jmp     instruction_assembled
  2960.       out_imm_eax:
  2961.         call    operand_32bit
  2962.         mov     [base_code],0E7h
  2963.         call    store_instruction_code
  2964.         mov     al,dl
  2965.         stos    byte [edi]
  2966.         jmp     instruction_assembled
  2967.  
  2968. call_instruction:
  2969.         mov     [postbyte_register],10b
  2970.         mov     [base_code],0E8h
  2971.         mov     [extended_code],9Ah
  2972.         jmp     process_jmp
  2973. jmp_instruction:
  2974.         mov     [postbyte_register],100b
  2975.         mov     [base_code],0E9h
  2976.         mov     [extended_code],0EAh
  2977.       process_jmp:
  2978.         lods    byte [esi]
  2979.         call    get_jump_operator
  2980.         call    get_size_operator
  2981.         cmp     al,'('
  2982.         je      jmp_imm
  2983.         mov     [base_code],0FFh
  2984.         cmp     al,10h
  2985.         je      jmp_reg
  2986.         cmp     al,'['
  2987.         jne     invalid_operand
  2988.       jmp_mem:
  2989.         cmp     [jump_type],1
  2990.         je      illegal_instruction
  2991.         call    get_address
  2992.         mov     edx,eax
  2993.         mov     al,[operand_size]
  2994.         or      al,al
  2995.         jz      jmp_mem_size_not_specified
  2996.         cmp     al,2
  2997.         je      jmp_mem_16bit
  2998.         cmp     al,4
  2999.         je      jmp_mem_32bit
  3000.         cmp     al,6
  3001.         je      jmp_mem_48bit
  3002.         cmp     al,8
  3003.         je      jmp_mem_64bit
  3004.         cmp     al,10
  3005.         je      jmp_mem_80bit
  3006.         jmp     invalid_operand_size
  3007.       jmp_mem_size_not_specified:
  3008.         cmp     [jump_type],3
  3009.         je      jmp_mem_far
  3010.         cmp     [jump_type],2
  3011.         je      jmp_mem_near
  3012.         cmp     [error_line],0
  3013.         jne     jmp_mem_near
  3014.         mov     eax,[current_line]
  3015.         mov     [error_line],eax
  3016.         mov     [error],operand_size_not_specified
  3017.       jmp_mem_near:
  3018.         cmp     [code_type],16
  3019.         je      jmp_mem_16bit
  3020.         cmp     [code_type],32
  3021.         je      jmp_mem_near_32bit
  3022.       jmp_mem_64bit:
  3023.         cmp     [jump_type],3
  3024.         je      invalid_operand_size
  3025.         cmp     [code_type],64
  3026.         jne     illegal_instruction
  3027.         call    store_instruction
  3028.         jmp     instruction_assembled
  3029.       jmp_mem_far:
  3030.         cmp     [code_type],16
  3031.         je      jmp_mem_far_32bit
  3032.       jmp_mem_48bit:
  3033.         call    operand_32bit
  3034.       jmp_mem_far_store:
  3035.         cmp     [jump_type],2
  3036.         je      invalid_operand_size
  3037.         inc     [postbyte_register]
  3038.         call    store_instruction
  3039.         jmp     instruction_assembled
  3040.       jmp_mem_80bit:
  3041.         call    operand_64bit
  3042.         jmp     jmp_mem_far_store
  3043.       jmp_mem_far_32bit:
  3044.         call    operand_16bit
  3045.         jmp     jmp_mem_far_store
  3046.       jmp_mem_32bit:
  3047.         cmp     [jump_type],3
  3048.         je      jmp_mem_far_32bit
  3049.         cmp     [jump_type],2
  3050.         je      jmp_mem_near_32bit
  3051.         cmp     [code_type],16
  3052.         je      jmp_mem_far_32bit
  3053.       jmp_mem_near_32bit:
  3054.         cmp     [code_type],64
  3055.         je      illegal_instruction
  3056.         call    operand_32bit
  3057.         call    store_instruction
  3058.         jmp     instruction_assembled
  3059.       jmp_mem_16bit:
  3060.         cmp     [jump_type],3
  3061.         je      invalid_operand_size
  3062.         call    operand_16bit
  3063.         call    store_instruction
  3064.         jmp     instruction_assembled
  3065.       jmp_reg:
  3066.         test    [jump_type],1
  3067.         jnz     invalid_operand
  3068.         lods    byte [esi]
  3069.         call    convert_register
  3070.         mov     bl,al
  3071.         mov     al,ah
  3072.         cmp     al,2
  3073.         je      jmp_reg_16bit
  3074.         cmp     al,4
  3075.         je      jmp_reg_32bit
  3076.         cmp     al,8
  3077.         jne     invalid_operand_size
  3078.       jmp_reg_64bit:
  3079.         cmp     [code_type],64
  3080.         jne     illegal_instruction
  3081.         call    store_nomem_instruction
  3082.         jmp     instruction_assembled
  3083.       jmp_reg_32bit:
  3084.         cmp     [code_type],64
  3085.         je      illegal_instruction
  3086.         call    store_nomem_instruction
  3087.         jmp     instruction_assembled
  3088.       jmp_reg_16bit:
  3089.         call    operand_16bit
  3090.         call    store_nomem_instruction
  3091.         jmp     instruction_assembled
  3092.       jmp_imm:
  3093.         cmp     byte [esi],'.'
  3094.         je      invalid_value
  3095.         mov     ebx,esi
  3096.         dec     esi
  3097.         call    skip_symbol
  3098.         xchg    esi,ebx
  3099.         cmp     byte [ebx],':'
  3100.         je      jmp_far
  3101.         cmp     [jump_type],3
  3102.         je      invalid_operand
  3103.       jmp_near:
  3104.         mov     al,[operand_size]
  3105.         cmp     al,2
  3106.         je      jmp_imm_16bit
  3107.         cmp     al,4
  3108.         je      jmp_imm_32bit
  3109.         cmp     al,8
  3110.         je      jmp_imm_64bit
  3111.         or      al,al
  3112.         jnz     invalid_operand_size
  3113.         cmp     [code_type],16
  3114.         je      jmp_imm_16bit
  3115.         cmp     [code_type],64
  3116.         je      jmp_imm_64bit
  3117.       jmp_imm_32bit:
  3118.         cmp     [code_type],64
  3119.         je      invalid_operand_size
  3120.         call    get_address_dword_value
  3121.         cmp     [code_type],16
  3122.         jne     jmp_imm_32bit_prefix_ok
  3123.         mov     byte [edi],66h
  3124.         inc     edi
  3125.       jmp_imm_32bit_prefix_ok:
  3126.         call    calculate_jump_offset
  3127.         cdq
  3128.         call    check_for_short_jump
  3129.         jc      jmp_short
  3130.       jmp_imm_32bit_store:
  3131.         mov     edx,eax
  3132.         sub     edx,3
  3133.         mov     al,[base_code]
  3134.         stos    byte [edi]
  3135.         mov     eax,edx
  3136.         call    mark_relocation
  3137.         stos    dword [edi]
  3138.         jmp     instruction_assembled
  3139.       jmp_imm_64bit:
  3140.         cmp     [code_type],64
  3141.         jne     invalid_operand_size
  3142.         call    get_address_qword_value
  3143.         call    calculate_jump_offset
  3144.         mov     ecx,edx
  3145.         cdq
  3146.         cmp     edx,ecx
  3147.         jne     value_out_of_range
  3148.         call    check_for_short_jump
  3149.         jnc     jmp_imm_32bit_store
  3150.       jmp_short:
  3151.         mov     ah,al
  3152.         mov     al,0EBh
  3153.         stos    word [edi]
  3154.         jmp     instruction_assembled
  3155.       jmp_imm_16bit:
  3156.         call    get_address_word_value
  3157.         cmp     [code_type],16
  3158.         je      jmp_imm_16bit_prefix_ok
  3159.         mov     byte [edi],66h
  3160.         inc     edi
  3161.       jmp_imm_16bit_prefix_ok:
  3162.         call    calculate_jump_offset
  3163.         cwde
  3164.         cdq
  3165.         call    check_for_short_jump
  3166.         jc      jmp_short
  3167.         cmp     [value_type],0
  3168.         jne     invalid_use_of_symbol
  3169.         mov     edx,eax
  3170.         dec     edx
  3171.         mov     al,[base_code]
  3172.         stos    byte [edi]
  3173.         mov     eax,edx
  3174.         stos    word [edi]
  3175.         jmp     instruction_assembled
  3176.       calculate_jump_offset:
  3177.         add     edi,2
  3178.         call    calculate_relative_offset
  3179.         sub     edi,2
  3180.         ret
  3181.       check_for_short_jump:
  3182.         cmp     [jump_type],1
  3183.         je      forced_short
  3184.         ja      no_short_jump
  3185.         cmp     [base_code],0E8h
  3186.         je      no_short_jump
  3187.         cmp     [value_type],0
  3188.         jne     no_short_jump
  3189.         cmp     eax,80h
  3190.         jb      short_jump
  3191.         cmp     eax,-80h
  3192.         jae     short_jump
  3193.       no_short_jump:
  3194.         clc
  3195.         ret
  3196.       forced_short:
  3197.         cmp     [base_code],0E8h
  3198.         je      illegal_instruction
  3199.         cmp     [next_pass_needed],0
  3200.         jne     jmp_short_value_type_ok
  3201.         cmp     [value_type],0
  3202.         jne     invalid_use_of_symbol
  3203.       jmp_short_value_type_ok:
  3204.         cmp     eax,-80h
  3205.         jae     short_jump
  3206.         cmp     eax,80h
  3207.         jae     jump_out_of_range
  3208.       short_jump:
  3209.         stc
  3210.         ret
  3211.       jump_out_of_range:
  3212.         cmp     [error_line],0
  3213.         jne     instruction_assembled
  3214.         mov     eax,[current_line]
  3215.         mov     [error_line],eax
  3216.         mov     [error],relative_jump_out_of_range
  3217.         jmp     instruction_assembled
  3218.       jmp_far:
  3219.         cmp     [jump_type],2
  3220.         je      invalid_operand
  3221.         cmp     [code_type],64
  3222.         je      illegal_instruction
  3223.         mov     al,[extended_code]
  3224.         mov     [base_code],al
  3225.         call    get_word_value
  3226.         push    eax
  3227.         inc     esi
  3228.         lods    byte [esi]
  3229.         cmp     al,'('
  3230.         jne     invalid_operand
  3231.         mov     al,[value_type]
  3232.         push    eax [symbol_identifier]
  3233.         cmp     byte [esi],'.'
  3234.         je      invalid_value
  3235.         mov     al,[operand_size]
  3236.         cmp     al,4
  3237.         je      jmp_far_16bit
  3238.         cmp     al,6
  3239.         je      jmp_far_32bit
  3240.         or      al,al
  3241.         jnz     invalid_operand_size
  3242.         cmp     [code_type],16
  3243.         jne     jmp_far_32bit
  3244.       jmp_far_16bit:
  3245.         call    get_word_value
  3246.         mov     ebx,eax
  3247.         call    operand_16bit
  3248.         call    store_instruction_code
  3249.         mov     ax,bx
  3250.         call    mark_relocation
  3251.         stos    word [edi]
  3252.       jmp_far_segment:
  3253.         pop     [symbol_identifier] eax
  3254.         mov     [value_type],al
  3255.         pop     eax
  3256.         call    mark_relocation
  3257.         stos    word [edi]
  3258.         jmp     instruction_assembled
  3259.       jmp_far_32bit:
  3260.         call    get_dword_value
  3261.         mov     ebx,eax
  3262.         call    operand_32bit
  3263.         call    store_instruction_code
  3264.         mov     eax,ebx
  3265.         call    mark_relocation
  3266.         stos    dword [edi]
  3267.         jmp     jmp_far_segment
  3268. conditional_jump:
  3269.         mov     [base_code],al
  3270.         lods    byte [esi]
  3271.         call    get_jump_operator
  3272.         cmp     [jump_type],3
  3273.         je      invalid_operand
  3274.         call    get_size_operator
  3275.         cmp     al,'('
  3276.         jne     invalid_operand
  3277.         cmp     byte [esi],'.'
  3278.         je      invalid_value
  3279.         mov     al,[operand_size]
  3280.         cmp     al,2
  3281.         je      conditional_jump_16bit
  3282.         cmp     al,4
  3283.         je      conditional_jump_32bit
  3284.         cmp     al,8
  3285.         je      conditional_jump_64bit
  3286.         or      al,al
  3287.         jnz     invalid_operand_size
  3288.         cmp     [code_type],16
  3289.         je      conditional_jump_16bit
  3290.         cmp     [code_type],64
  3291.         je      conditional_jump_64bit
  3292.       conditional_jump_32bit:
  3293.         cmp     [code_type],64
  3294.         je      invalid_operand_size
  3295.         call    get_address_dword_value
  3296.         cmp     [code_type],16
  3297.         jne     conditional_jump_32bit_prefix_ok
  3298.         mov     byte [edi],66h
  3299.         inc     edi
  3300.       conditional_jump_32bit_prefix_ok:
  3301.         call    calculate_jump_offset
  3302.         cdq
  3303.         call    check_for_short_jump
  3304.         jc      conditional_jump_short
  3305.       conditional_jump_32bit_store:
  3306.         mov     edx,eax
  3307.         sub     edx,4
  3308.         mov     ah,[base_code]
  3309.         add     ah,10h
  3310.         mov     al,0Fh
  3311.         stos    word [edi]
  3312.         mov     eax,edx
  3313.         call    mark_relocation
  3314.         stos    dword [edi]
  3315.         jmp     instruction_assembled
  3316.       conditional_jump_64bit:
  3317.         cmp     [code_type],64
  3318.         jne     invalid_operand_size
  3319.         call    get_address_qword_value
  3320.         call    calculate_jump_offset
  3321.         mov     ecx,edx
  3322.         cdq
  3323.         cmp     edx,ecx
  3324.         jne     value_out_of_range
  3325.         call    check_for_short_jump
  3326.         jnc     conditional_jump_32bit_store
  3327.       conditional_jump_short:
  3328.         mov     ah,al
  3329.         mov     al,[base_code]
  3330.         stos    word [edi]
  3331.         jmp     instruction_assembled
  3332.       conditional_jump_16bit:
  3333.         call    get_address_word_value
  3334.         cmp     [code_type],16
  3335.         je      conditional_jump_16bit_prefix_ok
  3336.         mov     byte [edi],66h
  3337.         inc     edi
  3338.       conditional_jump_16bit_prefix_ok:
  3339.         call    calculate_jump_offset
  3340.         cwde
  3341.         cdq
  3342.         call    check_for_short_jump
  3343.         jc      conditional_jump_short
  3344.         cmp     [value_type],0
  3345.         jne     invalid_use_of_symbol
  3346.         mov     edx,eax
  3347.         sub     edx,2
  3348.         mov     ah,[base_code]
  3349.         add     ah,10h
  3350.         mov     al,0Fh
  3351.         stos    word [edi]
  3352.         mov     eax,edx
  3353.         stos    word [edi]
  3354.         jmp     instruction_assembled
  3355. loop_instruction_16bit:
  3356.         cmp     [code_type],64
  3357.         je      illegal_instruction
  3358.         cmp     [code_type],16
  3359.         je      loop_instruction
  3360.         mov     [operand_prefix],67h
  3361.         jmp     loop_instruction
  3362. loop_instruction_32bit:
  3363.         cmp     [code_type],32
  3364.         je      loop_instruction
  3365.         mov     [operand_prefix],67h
  3366.       jmp     loop_instruction
  3367. loop_instruction_64bit:
  3368.         cmp     [code_type],64
  3369.         jne     illegal_instruction
  3370. loop_instruction:
  3371.         mov     [base_code],al
  3372.         lods    byte [esi]
  3373.         call    get_jump_operator
  3374.         cmp     [jump_type],1
  3375.         ja      invalid_operand
  3376.         call    get_size_operator
  3377.         cmp     al,'('
  3378.         jne     invalid_operand
  3379.         cmp     byte [esi],'.'
  3380.         je      invalid_value
  3381.         mov     al,[operand_size]
  3382.         cmp     al,2
  3383.         je      loop_jump_16bit
  3384.         cmp     al,4
  3385.         je      loop_jump_32bit
  3386.         cmp     al,8
  3387.         je      loop_jump_64bit
  3388.         or      al,al
  3389.         jnz     invalid_operand_size
  3390.         cmp     [code_type],16
  3391.         je      loop_jump_16bit
  3392.         cmp     [code_type],64
  3393.         je      loop_jump_64bit
  3394.       loop_jump_32bit:
  3395.         cmp     [code_type],64
  3396.         je      invalid_operand_size
  3397.         call    get_address_dword_value
  3398.         cmp     [code_type],16
  3399.         jne     loop_jump_32bit_prefix_ok
  3400.         mov     byte [edi],66h
  3401.         inc     edi
  3402.       loop_jump_32bit_prefix_ok:
  3403.         call    loop_counter_size
  3404.         call    calculate_jump_offset
  3405.         cdq
  3406.       make_loop_jump:
  3407.         call    check_for_short_jump
  3408.         jc      conditional_jump_short
  3409.         jmp     jump_out_of_range
  3410.       loop_counter_size:
  3411.         cmp     [operand_prefix],0
  3412.         je      loop_counter_size_ok
  3413.         push    eax
  3414.         mov     al,[operand_prefix]
  3415.         stos    byte [edi]
  3416.         pop     eax
  3417.       loop_counter_size_ok:
  3418.         ret
  3419.       loop_jump_64bit:
  3420.         cmp     [code_type],64
  3421.         jne     invalid_operand_size
  3422.         call    get_address_qword_value
  3423.         call    calculate_jump_offset
  3424.         mov     ecx,edx
  3425.         cdq
  3426.         cmp     edx,ecx
  3427.         jne     value_out_of_range
  3428.         jmp     make_loop_jump
  3429.       loop_jump_16bit:
  3430.         call    get_address_word_value
  3431.         cmp     [code_type],16
  3432.         je      loop_jump_16bit_prefix_ok
  3433.         mov     byte [edi],66h
  3434.         inc     edi
  3435.       loop_jump_16bit_prefix_ok:
  3436.         call    loop_counter_size
  3437.         call    calculate_jump_offset
  3438.         cwde
  3439.         cdq
  3440.         jmp     make_loop_jump
  3441.  
  3442. movs_instruction:
  3443.         lods    byte [esi]
  3444.         call    get_size_operator
  3445.         cmp     al,'['
  3446.         jne     invalid_operand
  3447.         call    get_address
  3448.         or      eax,eax
  3449.         jnz     invalid_address
  3450.         or      bl,ch
  3451.         jnz     invalid_address
  3452.         cmp     [segment_register],1
  3453.         ja      invalid_address
  3454.         push    ebx
  3455.         lods    byte [esi]
  3456.         cmp     al,','
  3457.         jne     invalid_operand
  3458.         lods    byte [esi]
  3459.         call    get_size_operator
  3460.         cmp     al,'['
  3461.         jne     invalid_operand
  3462.         call    get_address
  3463.         pop     edx
  3464.         or      eax,eax
  3465.         jnz     invalid_address
  3466.         or      bl,ch
  3467.         jnz     invalid_address
  3468.         mov     al,dh
  3469.         mov     ah,bh
  3470.         shr     al,4
  3471.         shr     ah,4
  3472.         cmp     al,ah
  3473.         jne     address_sizes_do_not_agree
  3474.         and     bh,111b
  3475.         and     dh,111b
  3476.         cmp     bh,6
  3477.         jne     invalid_address
  3478.         cmp     dh,7
  3479.         jne     invalid_address
  3480.         cmp     al,2
  3481.         je      movs_address_16bit
  3482.         cmp     al,4
  3483.         je      movs_address_32bit
  3484.         cmp     [code_type],64
  3485.         jne     invalid_address_size
  3486.         jmp     movs_store
  3487.       movs_address_32bit:
  3488.         call    address_32bit_prefix
  3489.         jmp     movs_store
  3490.       movs_address_16bit:
  3491.         cmp     [code_type],64
  3492.         je      invalid_address_size
  3493.         call    address_16bit_prefix
  3494.       movs_store:
  3495.         cmp     [segment_register],4
  3496.         je      movs_segment_ok
  3497.         call    store_segment_prefix
  3498.       movs_segment_ok:
  3499.         mov     al,0A4h
  3500.         mov     bl,[operand_size]
  3501.         cmp     bl,1
  3502.         je      simple_instruction
  3503.         inc     al
  3504.         cmp     bl,2
  3505.         je      simple_instruction_16bit
  3506.         cmp     bl,4
  3507.         je      simple_instruction_32bit
  3508.         cmp     bl,8
  3509.         je      simple_instruction_64bit
  3510.         or      bl,bl
  3511.         jz      operand_size_not_specified
  3512.         jmp     invalid_operand_size
  3513. lods_instruction:
  3514.         lods    byte [esi]
  3515.         call    get_size_operator
  3516.         cmp     al,'['
  3517.         jne     invalid_operand
  3518.         call    get_address
  3519.         or      eax,eax
  3520.         jnz     invalid_address
  3521.         or      bl,ch
  3522.         jnz     invalid_address
  3523.         cmp     bh,26h
  3524.         je      lods_address_16bit
  3525.         cmp     bh,46h
  3526.         je      lods_address_32bit
  3527.         cmp     bh,86h
  3528.         jne     invalid_address
  3529.         cmp     [code_type],64
  3530.         jne     invalid_address_size
  3531.         jmp     lods_store
  3532.       lods_address_32bit:
  3533.         call    address_32bit_prefix
  3534.         jmp     lods_store
  3535.       lods_address_16bit:
  3536.         cmp     [code_type],64
  3537.         je      invalid_address_size
  3538.         call    address_16bit_prefix
  3539.       lods_store:
  3540.         cmp     [segment_register],4
  3541.         je      lods_segment_ok
  3542.         call    store_segment_prefix
  3543.       lods_segment_ok:
  3544.         mov     al,0ACh
  3545.         mov     bl,[operand_size]
  3546.         cmp     bl,1
  3547.         je      simple_instruction
  3548.         inc     al
  3549.         cmp     bl,2
  3550.         je      simple_instruction_16bit
  3551.         cmp     bl,4
  3552.         je      simple_instruction_32bit
  3553.         cmp     bl,8
  3554.         je      simple_instruction_64bit
  3555.         or      bl,bl
  3556.         jz      operand_size_not_specified
  3557.         jmp     invalid_operand_size
  3558. stos_instruction:
  3559.         mov     [base_code],al
  3560.         lods    byte [esi]
  3561.         call    get_size_operator
  3562.         cmp     al,'['
  3563.         jne     invalid_operand
  3564.         call    get_address
  3565.         or      eax,eax
  3566.         jnz     invalid_address
  3567.         or      bl,ch
  3568.         jnz     invalid_address
  3569.         cmp     bh,27h
  3570.         je      stos_address_16bit
  3571.         cmp     bh,47h
  3572.         je      stos_address_32bit
  3573.         cmp     bh,87h
  3574.         jne     invalid_address
  3575.         cmp     [code_type],64
  3576.         jne     invalid_address_size
  3577.         jmp     stos_store
  3578.       stos_address_32bit:
  3579.         call    address_32bit_prefix
  3580.         jmp     stos_store
  3581.       stos_address_16bit:
  3582.         cmp     [code_type],64
  3583.         je      invalid_address_size
  3584.         call    address_16bit_prefix
  3585.       stos_store:
  3586.         cmp     [segment_register],1
  3587.         ja      invalid_address
  3588.         mov     al,[base_code]
  3589.         mov     bl,[operand_size]
  3590.         cmp     bl,1
  3591.         je      simple_instruction
  3592.         inc     al
  3593.         cmp     bl,2
  3594.         je      simple_instruction_16bit
  3595.         cmp     bl,4
  3596.         je      simple_instruction_32bit
  3597.         cmp     bl,8
  3598.         je      simple_instruction_64bit
  3599.         or      bl,bl
  3600.         jz      operand_size_not_specified
  3601.         jmp     invalid_operand_size
  3602. cmps_instruction:
  3603.         lods    byte [esi]
  3604.         call    get_size_operator
  3605.         cmp     al,'['
  3606.         jne     invalid_operand
  3607.         call    get_address
  3608.         or      eax,eax
  3609.         jnz     invalid_address
  3610.         or      bl,ch
  3611.         jnz     invalid_address
  3612.         mov     al,[segment_register]
  3613.         push    eax ebx
  3614.         lods    byte [esi]
  3615.         cmp     al,','
  3616.         jne     invalid_operand
  3617.         lods    byte [esi]
  3618.         call    get_size_operator
  3619.         cmp     al,'['
  3620.         jne     invalid_operand
  3621.         call    get_address
  3622.         or      eax,eax
  3623.         jnz     invalid_address
  3624.         or      bl,ch
  3625.         jnz     invalid_address
  3626.         pop     edx eax
  3627.         cmp     [segment_register],1
  3628.         ja      invalid_address
  3629.         mov     [segment_register],al
  3630.         mov     al,dh
  3631.         mov     ah,bh
  3632.         shr     al,4
  3633.         shr     ah,4
  3634.         cmp     al,ah
  3635.         jne     address_sizes_do_not_agree
  3636.         and     bh,111b
  3637.         and     dh,111b
  3638.         cmp     bh,7
  3639.         jne     invalid_address
  3640.         cmp     dh,6
  3641.         jne     invalid_address
  3642.         cmp     al,2
  3643.         je      cmps_address_16bit
  3644.         cmp     al,4
  3645.         je      cmps_address_32bit
  3646.         cmp     [code_type],64
  3647.         jne     invalid_address_size
  3648.         jmp     cmps_store
  3649.       cmps_address_32bit:
  3650.         call    address_32bit_prefix
  3651.         jmp     cmps_store
  3652.       cmps_address_16bit:
  3653.         cmp     [code_type],64
  3654.         je      invalid_address_size
  3655.         call    address_16bit_prefix
  3656.       cmps_store:
  3657.         cmp     [segment_register],4
  3658.         je      cmps_segment_ok
  3659.         call    store_segment_prefix
  3660.       cmps_segment_ok:
  3661.         mov     al,0A6h
  3662.         mov     bl,[operand_size]
  3663.         cmp     bl,1
  3664.         je      simple_instruction
  3665.         inc     al
  3666.         cmp     bl,2
  3667.         je      simple_instruction_16bit
  3668.         cmp     bl,4
  3669.         je      simple_instruction_32bit
  3670.         cmp     bl,8
  3671.         je      simple_instruction_64bit
  3672.         or      bl,bl
  3673.         jz      operand_size_not_specified
  3674.         jmp     invalid_operand_size
  3675. ins_instruction:
  3676.         lods    byte [esi]
  3677.         call    get_size_operator
  3678.         cmp     al,'['
  3679.         jne     invalid_operand
  3680.         call    get_address
  3681.         or      eax,eax
  3682.         jnz     invalid_address
  3683.         or      bl,ch
  3684.         jnz     invalid_address
  3685.         cmp     bh,27h
  3686.         je      ins_address_16bit
  3687.         cmp     bh,47h
  3688.         je      ins_address_32bit
  3689.         cmp     bh,87h
  3690.         jne     invalid_address
  3691.         cmp     [code_type],64
  3692.         jne     invalid_address_size
  3693.         jmp     ins_store
  3694.       ins_address_32bit:
  3695.         call    address_32bit_prefix
  3696.         jmp     ins_store
  3697.       ins_address_16bit:
  3698.         cmp     [code_type],64
  3699.         je      invalid_address_size
  3700.         call    address_16bit_prefix
  3701.       ins_store:
  3702.         cmp     [segment_register],1
  3703.         ja      invalid_address
  3704.         lods    byte [esi]
  3705.         cmp     al,','
  3706.         jne     invalid_operand
  3707.         lods    byte [esi]
  3708.         cmp     al,10h
  3709.         jne     invalid_operand
  3710.         lods    byte [esi]
  3711.         cmp     al,22h
  3712.         jne     invalid_operand
  3713.         mov     al,6Ch
  3714.         mov     bl,[operand_size]
  3715.         cmp     bl,1
  3716.         je      simple_instruction
  3717.         inc     al
  3718.         cmp     bl,2
  3719.         je      simple_instruction_16bit
  3720.         cmp     bl,4
  3721.         je      simple_instruction_32bit
  3722.         or      bl,bl
  3723.         jz      operand_size_not_specified
  3724.         jmp     invalid_operand_size
  3725. outs_instruction:
  3726.         lods    byte [esi]
  3727.         cmp     al,10h
  3728.         jne     invalid_operand
  3729.         lods    byte [esi]
  3730.         cmp     al,22h
  3731.         jne     invalid_operand
  3732.         lods    byte [esi]
  3733.         cmp     al,','
  3734.         jne     invalid_operand
  3735.         lods    byte [esi]
  3736.         call    get_size_operator
  3737.         cmp     al,'['
  3738.         jne     invalid_operand
  3739.         call    get_address
  3740.         or      eax,eax
  3741.         jnz     invalid_address
  3742.         or      bl,ch
  3743.         jnz     invalid_address
  3744.         cmp     bh,26h
  3745.         je      outs_address_16bit
  3746.         cmp     bh,46h
  3747.         je      outs_address_32bit
  3748.         cmp     bh,86h
  3749.         jne     invalid_address
  3750.         cmp     [code_type],64
  3751.         jne     invalid_address_size
  3752.         jmp     outs_store
  3753.       outs_address_32bit:
  3754.         call    address_32bit_prefix
  3755.         jmp     outs_store
  3756.       outs_address_16bit:
  3757.         cmp     [code_type],64
  3758.         je      invalid_address_size
  3759.         call    address_16bit_prefix
  3760.       outs_store:
  3761.         cmp     [segment_register],4
  3762.         je      outs_segment_ok
  3763.         call    store_segment_prefix
  3764.       outs_segment_ok:
  3765.         mov     al,6Eh
  3766.         mov     bl,[operand_size]
  3767.         cmp     bl,1
  3768.         je      simple_instruction
  3769.         inc     al
  3770.         cmp     bl,2
  3771.         je      simple_instruction_16bit
  3772.         cmp     bl,4
  3773.         je      simple_instruction_32bit
  3774.         or      bl,bl
  3775.         jz      operand_size_not_specified
  3776.         jmp     invalid_operand_size
  3777. xlat_instruction:
  3778.         lods    byte [esi]
  3779.         call    get_size_operator
  3780.         cmp     al,'['
  3781.         jne     invalid_operand
  3782.         call    get_address
  3783.         or      eax,eax
  3784.         jnz     invalid_address
  3785.         or      bl,ch
  3786.         jnz     invalid_address
  3787.         cmp     bh,23h
  3788.         je      xlat_address_16bit
  3789.         cmp     bh,43h
  3790.         je      xlat_address_32bit
  3791.         cmp     bh,83h
  3792.         jne     invalid_address
  3793.         cmp     [code_type],64
  3794.         jne     invalid_address_size
  3795.         jmp     xlat_store
  3796.       xlat_address_32bit:
  3797.         call    address_32bit_prefix
  3798.         jmp     xlat_store
  3799.       xlat_address_16bit:
  3800.         cmp     [code_type],64
  3801.         je      invalid_address_size
  3802.         call    address_16bit_prefix
  3803.       xlat_store:
  3804.         call    store_segment_prefix_if_necessary
  3805.         mov     al,0D7h
  3806.         cmp     [operand_size],1
  3807.         jbe     simple_instruction
  3808.         jmp     invalid_operand_size
  3809.  
  3810. pm_word_instruction:
  3811.         mov     ah,al
  3812.         shr     ah,4
  3813.         and     al,111b
  3814.         mov     [base_code],0Fh
  3815.         mov     [extended_code],ah
  3816.         mov     [postbyte_register],al
  3817.         lods    byte [esi]
  3818.         call    get_size_operator
  3819.         cmp     al,10h
  3820.         je      pm_reg
  3821.       pm_mem:
  3822.         cmp     al,'['
  3823.         jne     invalid_operand
  3824.         call    get_address
  3825.         mov     al,[operand_size]
  3826.         cmp     al,2
  3827.         je      pm_mem_store
  3828.         or      al,al
  3829.         jnz     invalid_operand_size
  3830.       pm_mem_store:
  3831.         call    store_instruction
  3832.         jmp     instruction_assembled
  3833.       pm_reg:
  3834.         lods    byte [esi]
  3835.         call    convert_register
  3836.         mov     bl,al
  3837.         cmp     ah,2
  3838.         jne     invalid_operand_size
  3839.         call    store_nomem_instruction
  3840.         jmp     instruction_assembled
  3841. pm_store_word_instruction:
  3842.         mov     ah,al
  3843.         shr     ah,4
  3844.         and     al,111b
  3845.         mov     [base_code],0Fh
  3846.         mov     [extended_code],ah
  3847.         mov     [postbyte_register],al
  3848.         lods    byte [esi]
  3849.         call    get_size_operator
  3850.         cmp     al,10h
  3851.         jne     pm_mem
  3852.         lods    byte [esi]
  3853.         call    convert_register
  3854.         mov     bl,al
  3855.         mov     al,ah
  3856.         call    operand_autodetect
  3857.         call    store_nomem_instruction
  3858.         jmp     instruction_assembled
  3859. lgdt_instruction:
  3860.         mov     [base_code],0Fh
  3861.         mov     [extended_code],1
  3862.         mov     [postbyte_register],al
  3863.         lods    byte [esi]
  3864.         call    get_size_operator
  3865.         cmp     al,'['
  3866.         jne     invalid_operand
  3867.         call    get_address
  3868.         mov     al,[operand_size]
  3869.         cmp     al,6
  3870.         je      lgdt_mem_48bit
  3871.         cmp     al,10
  3872.         je      lgdt_mem_80bit
  3873.         or      al,al
  3874.         jnz     invalid_operand_size
  3875.         jmp     lgdt_mem_store
  3876.       lgdt_mem_80bit:
  3877.         cmp     [code_type],64
  3878.         jne     illegal_instruction
  3879.         jmp     lgdt_mem_store
  3880.       lgdt_mem_48bit:
  3881.         cmp     [code_type],64
  3882.         je      illegal_instruction
  3883.         cmp     [postbyte_register],2
  3884.         jb      lgdt_mem_store
  3885.         call    operand_32bit
  3886.       lgdt_mem_store:
  3887.         call    store_instruction
  3888.         jmp     instruction_assembled
  3889. lar_instruction:
  3890.         mov     [extended_code],al
  3891.         mov     [base_code],0Fh
  3892.         lods    byte [esi]
  3893.         call    get_size_operator
  3894.         cmp     al,10h
  3895.         jne     invalid_operand
  3896.         lods    byte [esi]
  3897.         call    convert_register
  3898.         mov     [postbyte_register],al
  3899.         lods    byte [esi]
  3900.         cmp     al,','
  3901.         jne     invalid_operand
  3902.         xor     al,al
  3903.         xchg    al,[operand_size]
  3904.         call    operand_autodetect
  3905.         lods    byte [esi]
  3906.         call    get_size_operator
  3907.         cmp     al,10h
  3908.         je      lar_reg_reg
  3909.         cmp     al,'['
  3910.         jne     invalid_operand
  3911.         call    get_address
  3912.         mov     al,[operand_size]
  3913.         or      al,al
  3914.         jz      lar_reg_mem
  3915.         cmp     al,2
  3916.         jne     invalid_operand_size
  3917.       lar_reg_mem:
  3918.         call    store_instruction
  3919.         jmp     instruction_assembled
  3920.       lar_reg_reg:
  3921.         lods    byte [esi]
  3922.         call    convert_register
  3923.         cmp     ah,2
  3924.         jne     invalid_operand_size
  3925.         mov     bl,al
  3926.         call    store_nomem_instruction
  3927.         jmp     instruction_assembled
  3928. invlpg_instruction:
  3929.         mov     [base_code],0Fh
  3930.         mov     [extended_code],1
  3931.         mov     [postbyte_register],7
  3932.         lods    byte [esi]
  3933.         call    get_size_operator
  3934.         cmp     al,'['
  3935.         jne     invalid_operand
  3936.         call    get_address
  3937.         call    store_instruction
  3938.         jmp     instruction_assembled
  3939. swapgs_instruction:
  3940.         mov     [base_code],0Fh
  3941.         mov     [extended_code],1
  3942.         mov     [postbyte_register],7
  3943.         mov     bl,al
  3944.         call    store_nomem_instruction
  3945.         jmp     instruction_assembled
  3946.  
  3947. basic_486_instruction:
  3948.         mov     [base_code],0Fh
  3949.         mov     [extended_code],al
  3950.         lods    byte [esi]
  3951.         call    get_size_operator
  3952.         cmp     al,10h
  3953.         je      basic_486_reg
  3954.         cmp     al,'['
  3955.         jne     invalid_operand
  3956.         call    get_address
  3957.         push    edx ebx ecx
  3958.         lods    byte [esi]
  3959.         cmp     al,','
  3960.         jne     invalid_operand
  3961.         lods    byte [esi]
  3962.         call    get_size_operator
  3963.         cmp     al,10h
  3964.         jne     invalid_operand
  3965.         lods    byte [esi]
  3966.         call    convert_register
  3967.         mov     [postbyte_register],al
  3968.         pop     ecx ebx edx
  3969.         mov     al,ah
  3970.         cmp     al,1
  3971.         je      basic_486_mem_reg_8bit
  3972.         call    operand_autodetect
  3973.         inc     [extended_code]
  3974.       basic_486_mem_reg_8bit:
  3975.         call    store_instruction
  3976.         jmp     instruction_assembled
  3977.       basic_486_reg:
  3978.         lods    byte [esi]
  3979.         call    convert_register
  3980.         mov     [postbyte_register],al
  3981.         lods    byte [esi]
  3982.         cmp     al,','
  3983.         jne     invalid_operand
  3984.         lods    byte [esi]
  3985.         call    get_size_operator
  3986.         cmp     al,10h
  3987.         jne     invalid_operand
  3988.         lods    byte [esi]
  3989.         call    convert_register
  3990.         mov     bl,[postbyte_register]
  3991.         mov     [postbyte_register],al
  3992.         mov     al,ah
  3993.         cmp     al,1
  3994.         je      basic_486_reg_reg_8bit
  3995.         call    operand_autodetect
  3996.         inc     [extended_code]
  3997.       basic_486_reg_reg_8bit:
  3998.         call    store_nomem_instruction
  3999.         jmp     instruction_assembled
  4000. bswap_instruction:
  4001.         lods    byte [esi]
  4002.         call    get_size_operator
  4003.         cmp     al,10h
  4004.         jne     invalid_operand
  4005.         lods    byte [esi]
  4006.         call    convert_register
  4007.         test    al,1000b
  4008.         jz      bswap_reg_code_ok
  4009.         or      [rex_prefix],41h
  4010.         and     al,111b
  4011.       bswap_reg_code_ok:
  4012.         add     al,0C8h
  4013.         mov     [extended_code],al
  4014.         mov     [base_code],0Fh
  4015.         cmp     ah,8
  4016.         je      bswap_reg64
  4017.         cmp     ah,4
  4018.         jne     invalid_operand_size
  4019.         call    operand_32bit
  4020.         call    store_instruction_code
  4021.         jmp     instruction_assembled
  4022.       bswap_reg64:
  4023.         call    operand_64bit
  4024.         call    store_instruction_code
  4025.         jmp     instruction_assembled
  4026. cmpxchgx_instruction:
  4027.         mov     [base_code],0Fh
  4028.         mov     [extended_code],0C7h
  4029.         mov     [postbyte_register],al
  4030.         lods    byte [esi]
  4031.         call    get_size_operator
  4032.         cmp     al,'['
  4033.         jne     invalid_operand
  4034.         call    get_address
  4035.         mov     ah,1
  4036.         xchg    [postbyte_register],ah
  4037.         mov     al,[operand_size]
  4038.         or      al,al
  4039.         jz      cmpxchgx_size_ok
  4040.         cmp     al,ah
  4041.         jne     invalid_operand_size
  4042.       cmpxchgx_size_ok:
  4043.         cmp     ah,16
  4044.         jne     cmpxchgx_store
  4045.         call    operand_64bit
  4046.       cmpxchgx_store:
  4047.         call    store_instruction
  4048.         jmp     instruction_assembled
  4049. nop_instruction:
  4050.         mov     ah,[esi]
  4051.         cmp     ah,10h
  4052.         je      extended_nop
  4053.         cmp     ah,11h
  4054.         je      extended_nop
  4055.         cmp     ah,'['
  4056.         je      extended_nop
  4057.         stos    byte [edi]
  4058.         jmp     instruction_assembled
  4059.       extended_nop:
  4060.         mov     [base_code],0Fh
  4061.         mov     [extended_code],1Fh
  4062.         mov     [postbyte_register],0
  4063.         lods    byte [esi]
  4064.         call    get_size_operator
  4065.         cmp     al,10h
  4066.         je      extended_nop_reg
  4067.         cmp     al,'['
  4068.         jne     invalid_operand
  4069.         call    get_address
  4070.         mov     al,[operand_size]
  4071.         or      al,al
  4072.         jz      extended_nop_nosize
  4073.         call    operand_autodetect
  4074.       extended_nop_store:
  4075.         call    store_instruction
  4076.         jmp     instruction_assembled
  4077.       extended_nop_nosize:
  4078.         cmp     [error_line],0
  4079.         jne     extended_nop_store
  4080.         mov     eax,[current_line]
  4081.         mov     [error_line],eax
  4082.         mov     [error],operand_size_not_specified
  4083.         jmp     extended_nop_store
  4084.       extended_nop_reg:
  4085.         lods    byte [esi]
  4086.         call    convert_register
  4087.         mov     bl,al
  4088.         mov     al,ah
  4089.         call    operand_autodetect
  4090.         call    store_nomem_instruction
  4091.         jmp     instruction_assembled
  4092.  
  4093. basic_fpu_instruction:
  4094.         mov     [postbyte_register],al
  4095.         mov     [base_code],0D8h
  4096.         lods    byte [esi]
  4097.         call    get_size_operator
  4098.         cmp     al,10h
  4099.         je      basic_fpu_streg
  4100.         cmp     al,'['
  4101.         je      basic_fpu_mem
  4102.         dec     esi
  4103.         mov     ah,[postbyte_register]
  4104.         cmp     ah,2
  4105.         jb      invalid_operand
  4106.         cmp     ah,3
  4107.         ja      invalid_operand
  4108.         mov     bl,1
  4109.         call    store_nomem_instruction
  4110.         jmp     instruction_assembled
  4111.       basic_fpu_mem:
  4112.         call    get_address
  4113.         mov     al,[operand_size]
  4114.         cmp     al,4
  4115.         je      basic_fpu_mem_32bit
  4116.         cmp     al,8
  4117.         je      basic_fpu_mem_64bit
  4118.         or      al,al
  4119.         jnz     invalid_operand_size
  4120.         cmp     [error_line],0
  4121.         jne     basic_fpu_mem_32bit
  4122.         mov     eax,[current_line]
  4123.         mov     [error_line],eax
  4124.         mov     [error],operand_size_not_specified
  4125.       basic_fpu_mem_32bit:
  4126.         call    store_instruction
  4127.         jmp     instruction_assembled
  4128.       basic_fpu_mem_64bit:
  4129.         mov     [base_code],0DCh
  4130.         call    store_instruction
  4131.         jmp     instruction_assembled
  4132.       basic_fpu_streg:
  4133.         lods    byte [esi]
  4134.         call    convert_fpu_register
  4135.         mov     bl,al
  4136.         mov     ah,[postbyte_register]
  4137.         cmp     ah,2
  4138.         je      basic_fpu_single_streg
  4139.         cmp     ah,3
  4140.         je      basic_fpu_single_streg
  4141.         or      al,al
  4142.         jz      basic_fpu_st0
  4143.         test    ah,110b
  4144.         jz      basic_fpu_streg_st0
  4145.         xor     [postbyte_register],1
  4146.       basic_fpu_streg_st0:
  4147.         lods    byte [esi]
  4148.         cmp     al,','
  4149.         jne     invalid_operand
  4150.         lods    byte [esi]
  4151.         call    get_size_operator
  4152.         cmp     al,10h
  4153.         jne     invalid_operand
  4154.         lods    byte [esi]
  4155.         call    convert_fpu_register
  4156.         or      al,al
  4157.         jnz     invalid_operand
  4158.         mov     [base_code],0DCh
  4159.         call    store_nomem_instruction
  4160.         jmp     instruction_assembled
  4161.       basic_fpu_st0:
  4162.         lods    byte [esi]
  4163.         cmp     al,','
  4164.         jne     invalid_operand
  4165.         lods    byte [esi]
  4166.         call    get_size_operator
  4167.         cmp     al,10h
  4168.         jne     invalid_operand
  4169.         lods    byte [esi]
  4170.         call    convert_fpu_register
  4171.         mov     bl,al
  4172.       basic_fpu_single_streg:
  4173.         mov     [base_code],0D8h
  4174.         call    store_nomem_instruction
  4175.         jmp     instruction_assembled
  4176. simple_fpu_instruction:
  4177.         mov     ah,al
  4178.         or      ah,11000000b
  4179.         mov     al,0D9h
  4180.         stos    word [edi]
  4181.         jmp     instruction_assembled
  4182. fi_instruction:
  4183.         mov     [postbyte_register],al
  4184.         lods    byte [esi]
  4185.         call    get_size_operator
  4186.         cmp     al,'['
  4187.         jne     invalid_operand
  4188.         call    get_address
  4189.         mov     al,[operand_size]
  4190.         cmp     al,2
  4191.         je      fi_mem_16bit
  4192.         cmp     al,4
  4193.         je      fi_mem_32bit
  4194.         or      al,al
  4195.         jnz     invalid_operand_size
  4196.         cmp     [error_line],0
  4197.         jne     fi_mem_32bit
  4198.         mov     eax,[current_line]
  4199.         mov     [error_line],eax
  4200.         mov     [error],operand_size_not_specified
  4201.       fi_mem_32bit:
  4202.         mov     [base_code],0DAh
  4203.         call    store_instruction
  4204.         jmp     instruction_assembled
  4205.       fi_mem_16bit:
  4206.         mov     [base_code],0DEh
  4207.         call    store_instruction
  4208.         jmp     instruction_assembled
  4209. fld_instruction:
  4210.         mov     [postbyte_register],al
  4211.         lods    byte [esi]
  4212.         call    get_size_operator
  4213.         cmp     al,10h
  4214.         je      fld_streg
  4215.         cmp     al,'['
  4216.         jne     invalid_operand
  4217.         call    get_address
  4218.         mov     al,[operand_size]
  4219.         cmp     al,4
  4220.         je      fld_mem_32bit
  4221.         cmp     al,8
  4222.         je      fld_mem_64bit
  4223.         cmp     al,10
  4224.         je      fld_mem_80bit
  4225.         or      al,al
  4226.         jnz     invalid_operand_size
  4227.         cmp     [error_line],0
  4228.         jne     fld_mem_32bit
  4229.         mov     eax,[current_line]
  4230.         mov     [error_line],eax
  4231.         mov     [error],operand_size_not_specified
  4232.       fld_mem_32bit:
  4233.         mov     [base_code],0D9h
  4234.         call    store_instruction
  4235.         jmp     instruction_assembled
  4236.       fld_mem_64bit:
  4237.         mov     [base_code],0DDh
  4238.         call    store_instruction
  4239.         jmp     instruction_assembled
  4240.       fld_mem_80bit:
  4241.         mov     al,[postbyte_register]
  4242.         cmp     al,0
  4243.         je      fld_mem_80bit_store
  4244.         dec     [postbyte_register]
  4245.         cmp     al,3
  4246.         je      fld_mem_80bit_store
  4247.         jmp     invalid_operand_size
  4248.       fld_mem_80bit_store:
  4249.         add     [postbyte_register],5
  4250.         mov     [base_code],0DBh
  4251.         call    store_instruction
  4252.         jmp     instruction_assembled
  4253.       fld_streg:
  4254.         lods    byte [esi]
  4255.         call    convert_fpu_register
  4256.         mov     bl,al
  4257.         cmp     [postbyte_register],2
  4258.         jae     fst_streg
  4259.         mov     [base_code],0D9h
  4260.         call    store_nomem_instruction
  4261.         jmp     instruction_assembled
  4262.       fst_streg:
  4263.         mov     [base_code],0DDh
  4264.         call    store_nomem_instruction
  4265.         jmp     instruction_assembled
  4266. fild_instruction:
  4267.         mov     [postbyte_register],al
  4268.         lods    byte [esi]
  4269.         call    get_size_operator
  4270.         cmp     al,'['
  4271.         jne     invalid_operand
  4272.         call    get_address
  4273.         mov     al,[operand_size]
  4274.         cmp     al,2
  4275.         je      fild_mem_16bit
  4276.         cmp     al,4
  4277.         je      fild_mem_32bit
  4278.         cmp     al,8
  4279.         je      fild_mem_64bit
  4280.         or      al,al
  4281.         jnz     invalid_operand_size
  4282.         cmp     [error_line],0
  4283.         jne     fild_mem_32bit
  4284.         mov     eax,[current_line]
  4285.         mov     [error_line],eax
  4286.         mov     [error],operand_size_not_specified
  4287.       fild_mem_32bit:
  4288.         mov     [base_code],0DBh
  4289.         call    store_instruction
  4290.         jmp     instruction_assembled
  4291.       fild_mem_16bit:
  4292.         mov     [base_code],0DFh
  4293.         call    store_instruction
  4294.         jmp     instruction_assembled
  4295.       fild_mem_64bit:
  4296.         mov     al,[postbyte_register]
  4297.         cmp     al,1
  4298.         je      fisttp_64bit_store
  4299.         jb      fild_mem_64bit_store
  4300.         dec     [postbyte_register]
  4301.         cmp     al,3
  4302.         je      fild_mem_64bit_store
  4303.         jmp     invalid_operand_size
  4304.       fild_mem_64bit_store:
  4305.         add     [postbyte_register],5
  4306.         mov     [base_code],0DFh
  4307.         call    store_instruction
  4308.         jmp     instruction_assembled
  4309.       fisttp_64bit_store:
  4310.         mov     [base_code],0DDh
  4311.         call    store_instruction
  4312.         jmp     instruction_assembled
  4313. fbld_instruction:
  4314.         mov     [postbyte_register],al
  4315.         lods    byte [esi]
  4316.         call    get_size_operator
  4317.         cmp     al,'['
  4318.         jne     invalid_operand
  4319.         call    get_address
  4320.         mov     al,[operand_size]
  4321.         or      al,al
  4322.         jz      fbld_mem_80bit
  4323.         cmp     al,10
  4324.         je      fbld_mem_80bit
  4325.         jmp     invalid_operand_size
  4326.       fbld_mem_80bit:
  4327.         mov     [base_code],0DFh
  4328.         call    store_instruction
  4329.         jmp     instruction_assembled
  4330. faddp_instruction:
  4331.         mov     [postbyte_register],al
  4332.         mov     [base_code],0DEh
  4333.         mov     edx,esi
  4334.         lods    byte [esi]
  4335.         call    get_size_operator
  4336.         cmp     al,10h
  4337.         je      faddp_streg
  4338.         mov     esi,edx
  4339.         mov     bl,1
  4340.         call    store_nomem_instruction
  4341.         jmp     instruction_assembled
  4342.       faddp_streg:
  4343.         lods    byte [esi]
  4344.         call    convert_fpu_register
  4345.         mov     bl,al
  4346.         lods    byte [esi]
  4347.         cmp     al,','
  4348.         jne     invalid_operand
  4349.         lods    byte [esi]
  4350.         call    get_size_operator
  4351.         cmp     al,10h
  4352.         jne     invalid_operand
  4353.         lods    byte [esi]
  4354.         call    convert_fpu_register
  4355.         or      al,al
  4356.         jnz     invalid_operand
  4357.         call    store_nomem_instruction
  4358.         jmp     instruction_assembled
  4359. fcompp_instruction:
  4360.         mov     ax,0D9DEh
  4361.         stos    word [edi]
  4362.         jmp     instruction_assembled
  4363. fucompp_instruction:
  4364.         mov     ax,0E9DAh
  4365.         stos    word [edi]
  4366.         jmp     instruction_assembled
  4367. fxch_instruction:
  4368.         mov     dx,01D9h
  4369.         jmp     fpu_single_operand
  4370. ffreep_instruction:
  4371.         mov     dx,00DFh
  4372.         jmp     fpu_single_operand
  4373. ffree_instruction:
  4374.         mov     dl,0DDh
  4375.         mov     dh,al
  4376.       fpu_single_operand:
  4377.         mov     ebx,esi
  4378.         lods    byte [esi]
  4379.         call    get_size_operator
  4380.         cmp     al,10h
  4381.         je      fpu_streg
  4382.         or      dh,dh
  4383.         jz      invalid_operand
  4384.         mov     esi,ebx
  4385.         shl     dh,3
  4386.         or      dh,11000001b
  4387.         mov     ax,dx
  4388.         stos    word [edi]
  4389.         jmp     instruction_assembled
  4390.       fpu_streg:
  4391.         lods    byte [esi]
  4392.         call    convert_fpu_register
  4393.         shl     dh,3
  4394.         or      dh,al
  4395.         or      dh,11000000b
  4396.         mov     ax,dx
  4397.         stos    word [edi]
  4398.         jmp     instruction_assembled
  4399. fstenv_instruction:
  4400.         mov     byte [edi],9Bh
  4401.         inc     edi
  4402. fldenv_instruction:
  4403.         mov     [base_code],0D9h
  4404.         jmp     fpu_mem
  4405. fsave_instruction:
  4406.         mov     byte [edi],9Bh
  4407.         inc     edi
  4408. fnsave_instruction:
  4409.         mov     [base_code],0DDh
  4410.       fpu_mem:
  4411.         mov     [postbyte_register],al
  4412.         lods    byte [esi]
  4413.         call    get_size_operator
  4414.         cmp     al,'['
  4415.         jne     invalid_operand
  4416.         call    get_address
  4417.         cmp     [operand_size],0
  4418.         jne     invalid_operand_size
  4419.         call    store_instruction
  4420.         jmp     instruction_assembled
  4421. fstcw_instruction:
  4422.         mov     byte [edi],9Bh
  4423.         inc     edi
  4424. fldcw_instruction:
  4425.         mov     [postbyte_register],al
  4426.         mov     [base_code],0D9h
  4427.         lods    byte [esi]
  4428.         call    get_size_operator
  4429.         cmp     al,'['
  4430.         jne     invalid_operand
  4431.         call    get_address
  4432.         mov     al,[operand_size]
  4433.         or      al,al
  4434.         jz      fldcw_mem_16bit
  4435.         cmp     al,2
  4436.         je      fldcw_mem_16bit
  4437.         jmp     invalid_operand_size
  4438.       fldcw_mem_16bit:
  4439.         call    store_instruction
  4440.         jmp     instruction_assembled
  4441. fstsw_instruction:
  4442.         mov     al,9Bh
  4443.         stos    byte [edi]
  4444. fnstsw_instruction:
  4445.         mov     [base_code],0DDh
  4446.         mov     [postbyte_register],7
  4447.         lods    byte [esi]
  4448.         call    get_size_operator
  4449.         cmp     al,10h
  4450.         je      fstsw_reg
  4451.         cmp     al,'['
  4452.         jne     invalid_operand
  4453.         call    get_address
  4454.         mov     al,[operand_size]
  4455.         or      al,al
  4456.         jz      fstsw_mem_16bit
  4457.         cmp     al,2
  4458.         je      fstsw_mem_16bit
  4459.         jmp     invalid_operand_size
  4460.       fstsw_mem_16bit:
  4461.         call    store_instruction
  4462.         jmp     instruction_assembled
  4463.       fstsw_reg:
  4464.         lods    byte [esi]
  4465.         call    convert_register
  4466.         cmp     ax,0200h
  4467.         jne     invalid_operand
  4468.         mov     ax,0E0DFh
  4469.         stos    word [edi]
  4470.         jmp     instruction_assembled
  4471. finit_instruction:
  4472.         mov     byte [edi],9Bh
  4473.         inc     edi
  4474. fninit_instruction:
  4475.         mov     ah,al
  4476.         mov     al,0DBh
  4477.         stos    word [edi]
  4478.         jmp     instruction_assembled
  4479. fcmov_instruction:
  4480.         mov     dh,0DAh
  4481.         jmp     fcomi_streg
  4482. fcomi_instruction:
  4483.         mov     dh,0DBh
  4484.         jmp     fcomi_streg
  4485. fcomip_instruction:
  4486.         mov     dh,0DFh
  4487.       fcomi_streg:
  4488.         mov     dl,al
  4489.         lods    byte [esi]
  4490.         call    get_size_operator
  4491.         cmp     al,10h
  4492.         jne     invalid_operand
  4493.         lods    byte [esi]
  4494.         call    convert_fpu_register
  4495.         mov     ah,al
  4496.         cmp     byte [esi],','
  4497.         je      fcomi_st0_streg
  4498.         add     ah,dl
  4499.         mov     al,dh
  4500.         stos    word [edi]
  4501.         jmp     instruction_assembled
  4502.       fcomi_st0_streg:
  4503.         or      ah,ah
  4504.         jnz     invalid_operand
  4505.         inc     esi
  4506.         lods    byte [esi]
  4507.         call    get_size_operator
  4508.         cmp     al,10h
  4509.         jne     invalid_operand
  4510.         lods    byte [esi]
  4511.         call    convert_fpu_register
  4512.         mov     ah,al
  4513.         add     ah,dl
  4514.         mov     al,dh
  4515.         stos    word [edi]
  4516.         jmp     instruction_assembled
  4517.  
  4518. basic_mmx_instruction:
  4519.         mov     [base_code],0Fh
  4520.         mov     [extended_code],al
  4521.       mmx_instruction:
  4522.         lods    byte [esi]
  4523.         call    get_size_operator
  4524.         cmp     al,10h
  4525.         jne     invalid_operand
  4526.         lods    byte [esi]
  4527.         call    convert_mmx_register
  4528.         call    make_mmx_prefix
  4529.         mov     [postbyte_register],al
  4530.         lods    byte [esi]
  4531.         cmp     al,','
  4532.         jne     invalid_operand
  4533.         lods    byte [esi]
  4534.         call    get_size_operator
  4535.         cmp     al,10h
  4536.         je      mmx_mmreg_mmreg
  4537.         cmp     al,'['
  4538.         jne     invalid_operand
  4539.       mmx_mmreg_mem:
  4540.         call    get_address
  4541.         call    store_instruction
  4542.         jmp     instruction_assembled
  4543.       mmx_mmreg_mmreg:
  4544.         lods    byte [esi]
  4545.         call    convert_mmx_register
  4546.         mov     bl,al
  4547.         call    store_nomem_instruction
  4548.         jmp     instruction_assembled
  4549. mmx_ps_instruction:
  4550.         mov     [base_code],0Fh
  4551.         mov     [extended_code],al
  4552.         lods    byte [esi]
  4553.         call    get_size_operator
  4554.         cmp     al,10h
  4555.         jne     invalid_operand
  4556.         lods    byte [esi]
  4557.         call    convert_mmx_register
  4558.         call    make_mmx_prefix
  4559.         mov     [postbyte_register],al
  4560.         lods    byte [esi]
  4561.         cmp     al,','
  4562.         jne     invalid_operand
  4563.         mov     [operand_size],0
  4564.         lods    byte [esi]
  4565.         call    get_size_operator
  4566.         cmp     al,10h
  4567.         je      mmx_mmreg_mmreg
  4568.         cmp     al,'('
  4569.         je      mmx_ps_mmreg_imm8
  4570.         cmp     al,'['
  4571.         je      mmx_mmreg_mem
  4572.         jmp     invalid_operand
  4573.       mmx_ps_mmreg_imm8:
  4574.         call    get_byte_value
  4575.         mov     byte [value],al
  4576.         test    [operand_size],not 1
  4577.         jnz     invalid_value
  4578.         mov     bl,[extended_code]
  4579.         mov     al,bl
  4580.         shr     bl,4
  4581.         and     al,1111b
  4582.         add     al,70h
  4583.         mov     [extended_code],al
  4584.         sub     bl,0Ch
  4585.         shl     bl,1
  4586.         xchg    bl,[postbyte_register]
  4587.         call    store_nomem_instruction
  4588.         mov     al,byte [value]
  4589.         stos    byte [edi]
  4590.         jmp     instruction_assembled
  4591. pextrw_instruction:
  4592.         mov     [base_code],0Fh
  4593.         mov     [extended_code],al
  4594.         lods    byte [esi]
  4595.         call    get_size_operator
  4596.         cmp     al,10h
  4597.         jne     invalid_operand
  4598.         lods    byte [esi]
  4599.         call    convert_register
  4600.         cmp     ah,4
  4601.         jnz     invalid_operand_size
  4602.         mov     [postbyte_register],al
  4603.         mov     [operand_size],0
  4604.         lods    byte [esi]
  4605.         cmp     al,','
  4606.         jne     invalid_operand
  4607.         lods    byte [esi]
  4608.         call    get_size_operator
  4609.         cmp     al,10h
  4610.         jne     invalid_operand
  4611.         lods    byte [esi]
  4612.         call    convert_mmx_register
  4613.         mov     bl,al
  4614.         call    make_mmx_prefix
  4615.         cmp     [extended_code],0C5h
  4616.         je      mmx_nomem_imm8
  4617.         call    store_nomem_instruction
  4618.         jmp     instruction_assembled
  4619.       mmx_imm8:
  4620.         push    ebx ecx edx
  4621.         mov     [operand_size],0
  4622.         lods    byte [esi]
  4623.         cmp     al,','
  4624.         jne     invalid_operand
  4625.         lods    byte [esi]
  4626.         call    get_size_operator
  4627.         test    ah,not 1
  4628.         jnz     invalid_operand_size
  4629.         cmp     al,'('
  4630.         jne     invalid_operand
  4631.         call    get_byte_value
  4632.         mov     byte [value],al
  4633.         pop     edx ecx ebx
  4634.         call    store_instruction_with_imm8
  4635.         jmp     instruction_assembled
  4636.       mmx_nomem_imm8:
  4637.         call    store_nomem_instruction
  4638.         mov     [operand_size],0
  4639.         lods    byte [esi]
  4640.         cmp     al,','
  4641.         jne     invalid_operand
  4642.         lods    byte [esi]
  4643.         call    get_size_operator
  4644.         test    ah,not 1
  4645.         jnz     invalid_operand_size
  4646.         cmp     al,'('
  4647.         jne     invalid_operand
  4648.         call    get_byte_value
  4649.         stosb
  4650.         jmp     instruction_assembled
  4651. pinsrw_instruction:
  4652.         mov     [extended_code],al
  4653.         mov     [base_code],0Fh
  4654.         lods    byte [esi]
  4655.         call    get_size_operator
  4656.         cmp     al,10h
  4657.         jne     invalid_operand
  4658.         lods    byte [esi]
  4659.         call    convert_mmx_register
  4660.         call    make_mmx_prefix
  4661.         mov     [postbyte_register],al
  4662.         mov     [operand_size],0
  4663.         lods    byte [esi]
  4664.         cmp     al,','
  4665.         jne     invalid_operand
  4666.         lods    byte [esi]
  4667.         call    get_size_operator
  4668.         cmp     al,10h
  4669.         je      pinsrw_mmreg_reg
  4670.         cmp     al,'['
  4671.         jne     invalid_operand
  4672.         call    get_address
  4673.         cmp     [operand_size],0
  4674.         je      mmx_imm8
  4675.         cmp     [operand_size],2
  4676.         jne     invalid_operand_size
  4677.         jmp     mmx_imm8
  4678.       pinsrw_mmreg_reg:
  4679.         lods    byte [esi]
  4680.         call    convert_register
  4681.         cmp     ah,4
  4682.         jne     invalid_operand_size
  4683.         mov     bl,al
  4684.         jmp     mmx_nomem_imm8
  4685. pshufw_instruction:
  4686.         mov     [mmx_size],8
  4687.         mov     [operand_prefix],al
  4688.         jmp     pshuf_instruction
  4689. pshufd_instruction:
  4690.         mov     [mmx_size],16
  4691.         mov     [operand_prefix],al
  4692.       pshuf_instruction:
  4693.         mov     [base_code],0Fh
  4694.         mov     [extended_code],70h
  4695.         lods    byte [esi]
  4696.         call    get_size_operator
  4697.         cmp     al,10h
  4698.         jne     invalid_operand
  4699.         lods    byte [esi]
  4700.         call    convert_mmx_register
  4701.         cmp     ah,[mmx_size]
  4702.         jne     invalid_operand_size
  4703.         mov     [postbyte_register],al
  4704.         lods    byte [esi]
  4705.         cmp     al,','
  4706.         jne     invalid_operand
  4707.         lods    byte [esi]
  4708.         call    get_size_operator
  4709.         cmp     al,10h
  4710.         je      pshuf_mmreg_mmreg
  4711.         cmp     al,'['
  4712.         jne     invalid_operand
  4713.         call    get_address
  4714.         jmp     mmx_imm8
  4715.       pshuf_mmreg_mmreg:
  4716.         lods    byte [esi]
  4717.         call    convert_mmx_register
  4718.         mov     bl,al
  4719.         jmp     mmx_nomem_imm8
  4720. movd_instruction:
  4721.         mov     [base_code],0Fh
  4722.         mov     [extended_code],7Eh
  4723.         lods    byte [esi]
  4724.         call    get_size_operator
  4725.         cmp     al,10h
  4726.         je      movd_reg
  4727.         cmp     al,'['
  4728.         jne     invalid_operand
  4729.         call    get_address
  4730.         test    [operand_size],not 4
  4731.         jnz     invalid_operand_size
  4732.         mov     [operand_size],0
  4733.         lods    byte [esi]
  4734.         cmp     al,','
  4735.         jne     invalid_operand
  4736.         lods    byte [esi]
  4737.         call    get_size_operator
  4738.         cmp     al,10h
  4739.         jne     invalid_operand
  4740.         lods    byte [esi]
  4741.         call    convert_mmx_register
  4742.         call    make_mmx_prefix
  4743.         mov     [postbyte_register],al
  4744.         call    store_instruction
  4745.         jmp     instruction_assembled
  4746.       movd_reg:
  4747.         lods    byte [esi]
  4748.         cmp     al,0B0h
  4749.         jae     movd_mmreg
  4750.         call    convert_register
  4751.         cmp     ah,4
  4752.         jne     invalid_operand_size
  4753.         mov     [operand_size],0
  4754.         mov     bl,al
  4755.         lods    byte [esi]
  4756.         cmp     al,','
  4757.         jne     invalid_operand
  4758.         lods    byte [esi]
  4759.         call    get_size_operator
  4760.         cmp     al,10h
  4761.         jne     invalid_operand
  4762.         lods    byte [esi]
  4763.         call    convert_mmx_register
  4764.         mov     [postbyte_register],al
  4765.         call    make_mmx_prefix
  4766.         call    store_nomem_instruction
  4767.         jmp     instruction_assembled
  4768.       movd_mmreg:
  4769.         mov     [extended_code],6Eh
  4770.         call    convert_mmx_register
  4771.         call    make_mmx_prefix
  4772.         mov     [postbyte_register],al
  4773.         mov     [operand_size],0
  4774.         lods    byte [esi]
  4775.         cmp     al,','
  4776.         jne     invalid_operand
  4777.         lods    byte [esi]
  4778.         call    get_size_operator
  4779.         cmp     al,10h
  4780.         je      movd_mmreg_reg
  4781.         cmp     al,'['
  4782.         jne     invalid_operand
  4783.         call    get_address
  4784.         test    [operand_size],not 4
  4785.         jnz     invalid_operand_size
  4786.         call    store_instruction
  4787.         jmp     instruction_assembled
  4788.       movd_mmreg_reg:
  4789.         lods    byte [esi]
  4790.         call    convert_register
  4791.         cmp     ah,4
  4792.         jne     invalid_operand_size
  4793.         mov     bl,al
  4794.         call    store_nomem_instruction
  4795.         jmp     instruction_assembled
  4796.       make_mmx_prefix:
  4797.         cmp     [operand_size],16
  4798.         jne     no_mmx_prefix
  4799.         mov     [operand_prefix],66h
  4800.       no_mmx_prefix:
  4801.         ret
  4802. movq_instruction:
  4803.         mov     [base_code],0Fh
  4804.         lods    byte [esi]
  4805.         call    get_size_operator
  4806.         cmp     al,10h
  4807.         je      movq_reg
  4808.         cmp     al,'['
  4809.         jne     invalid_operand
  4810.         call    get_address
  4811.         test    [operand_size],not 8
  4812.         jnz     invalid_operand_size
  4813.         mov     [operand_size],0
  4814.         lods    byte [esi]
  4815.         cmp     al,','
  4816.         jne     invalid_operand
  4817.         lods    byte [esi]
  4818.         cmp     al,10h
  4819.         jne     invalid_operand
  4820.         lods    byte [esi]
  4821.         call    convert_mmx_register
  4822.         mov     [postbyte_register],al
  4823.         cmp     ah,16
  4824.         je      movq_mem_xmmreg
  4825.         mov     [extended_code],7Fh
  4826.         call    store_instruction
  4827.         jmp     instruction_assembled
  4828.      movq_mem_xmmreg:
  4829.         mov     [extended_code],0D6h
  4830.         mov     [operand_prefix],66h
  4831.         call    store_instruction
  4832.         jmp     instruction_assembled
  4833.      movq_reg:
  4834.         lods    byte [esi]
  4835.         cmp     al,0B0h
  4836.         jae     movq_mmreg
  4837.         call    convert_register
  4838.         cmp     ah,8
  4839.         jne     invalid_operand_size
  4840.         mov     bl,al
  4841.         lods    byte [esi]
  4842.         cmp     al,','
  4843.         jne     invalid_operand
  4844.         lods    byte [esi]
  4845.         call    get_size_operator
  4846.         cmp     al,10h
  4847.         jne     invalid_operand
  4848.         mov     [operand_size],0
  4849.         lods    byte [esi]
  4850.         call    convert_mmx_register
  4851.         mov     [postbyte_register],al
  4852.         call    make_mmx_prefix
  4853.         mov     [extended_code],7Eh
  4854.         call    operand_64bit
  4855.         call    store_nomem_instruction
  4856.         jmp     instruction_assembled
  4857.      movq_mmreg:
  4858.         call    convert_mmx_register
  4859.         mov     [postbyte_register],al
  4860.         mov     [extended_code],6Fh
  4861.         mov     [mmx_size],ah
  4862.         cmp     ah,16
  4863.         jne     movq_mmreg_
  4864.         mov     [extended_code],7Eh
  4865.         mov     [operand_prefix],0F3h
  4866.       movq_mmreg_:
  4867.         lods    byte [esi]
  4868.         cmp     al,','
  4869.         jne     invalid_operand
  4870.         mov     [operand_size],0
  4871.         lods    byte [esi]
  4872.         call    get_size_operator
  4873.         cmp     al,10h
  4874.         je      movq_mmreg_reg
  4875.         call    get_address
  4876.         test    [operand_size],not 8
  4877.         jnz     invalid_operand_size
  4878.         call    store_instruction
  4879.         jmp     instruction_assembled
  4880.       movq_mmreg_reg:
  4881.         lods    byte [esi]
  4882.         cmp     al,0B0h
  4883.         jae     movq_mmreg_mmreg
  4884.         mov     [operand_size],0
  4885.         call    convert_register
  4886.         cmp     ah,8
  4887.         jne     invalid_operand_size
  4888.         mov     [extended_code],6Eh
  4889.         mov     [operand_prefix],0
  4890.         mov     bl,al
  4891.         cmp     [mmx_size],16
  4892.         jne     movq_mmreg_reg_store
  4893.         mov     [operand_prefix],66h
  4894.       movq_mmreg_reg_store:
  4895.         call    operand_64bit
  4896.         call    store_nomem_instruction
  4897.         jmp     instruction_assembled
  4898.       movq_mmreg_mmreg:
  4899.         call    convert_mmx_register
  4900.         cmp     ah,[mmx_size]
  4901.         jne     invalid_operand_size
  4902.         mov     bl,al
  4903.         call    store_nomem_instruction
  4904.         jmp     instruction_assembled
  4905. movdq_instruction:
  4906.         mov     [operand_prefix],al
  4907.         mov     [base_code],0Fh
  4908.         mov     [extended_code],6Fh
  4909.         lods    byte [esi]
  4910.         call    get_size_operator
  4911.         cmp     al,10h
  4912.         je      movdq_mmreg
  4913.         cmp     al,'['
  4914.         jne     invalid_operand
  4915.         call    get_address
  4916.         lods    byte [esi]
  4917.         cmp     al,','
  4918.         jne     invalid_operand
  4919.         lods    byte [esi]
  4920.         call    get_size_operator
  4921.         cmp     al,10h
  4922.         jne     invalid_operand
  4923.         lods    byte [esi]
  4924.         call    convert_mmx_register
  4925.         cmp     ah,16
  4926.         jne     invalid_operand_size
  4927.         mov     [postbyte_register],al
  4928.         mov     [extended_code],7Fh
  4929.         call    store_instruction
  4930.         jmp     instruction_assembled
  4931.       movdq_mmreg:
  4932.         lods    byte [esi]
  4933.         call    convert_mmx_register
  4934.         cmp     ah,16
  4935.         jne     invalid_operand_size
  4936.         mov     [postbyte_register],al
  4937.         lods    byte [esi]
  4938.         cmp     al,','
  4939.         jne     invalid_operand
  4940.         lods    byte [esi]
  4941.         call    get_size_operator
  4942.         cmp     al,10h
  4943.         je      movdq_mmreg_mmreg
  4944.         cmp     al,'['
  4945.         jne     invalid_operand
  4946.         call    get_address
  4947.         call    store_instruction
  4948.         jmp     instruction_assembled
  4949.       movdq_mmreg_mmreg:
  4950.         lods    byte [esi]
  4951.         call    convert_mmx_register
  4952.         cmp     ah,16
  4953.         jne     invalid_operand_size
  4954.         mov     bl,al
  4955.         call    store_nomem_instruction
  4956.         jmp     instruction_assembled
  4957. lddqu_instruction:
  4958.         lods    byte [esi]
  4959.         call    get_size_operator
  4960.         cmp     al,10h
  4961.         jne     invalid_operand
  4962.         lods    byte [esi]
  4963.         call    convert_mmx_register
  4964.         cmp     ah,16
  4965.         jne     invalid_operand_size
  4966.         push    eax
  4967.         lods    byte [esi]
  4968.         cmp     al,','
  4969.         jne     invalid_operand
  4970.         lods    byte [esi]
  4971.         call    get_size_operator
  4972.         cmp     al,'['
  4973.         jne     invalid_operand
  4974.         call    get_address
  4975.         pop     eax
  4976.         mov     [postbyte_register],al
  4977.         mov     [operand_prefix],0F2h
  4978.         mov     [base_code],0Fh
  4979.         mov     [extended_code],0F0h
  4980.         call    store_instruction
  4981.         jmp     instruction_assembled
  4982. movq2dq_instruction:
  4983.         lods    byte [esi]
  4984.         call    get_size_operator
  4985.         cmp     al,10h
  4986.         jne     invalid_operand
  4987.         lods    byte [esi]
  4988.         call    convert_mmx_register
  4989.         cmp     ah,16
  4990.         jne     invalid_operand_size
  4991.         mov     [postbyte_register],al
  4992.         mov     [operand_size],0
  4993.         lods    byte [esi]
  4994.         cmp     al,','
  4995.         jne     invalid_operand
  4996.         lods    byte [esi]
  4997.         call    get_size_operator
  4998.         cmp     al,10h
  4999.         jne     invalid_operand
  5000.         lods    byte [esi]
  5001.         call    convert_mmx_register
  5002.         cmp     ah,8
  5003.         jne     invalid_operand_size
  5004.         mov     bl,al
  5005.         mov     [operand_prefix],0F3h
  5006.         mov     [base_code],0Fh
  5007.         mov     [extended_code],0D6h
  5008.         call    store_nomem_instruction
  5009.         jmp     instruction_assembled
  5010. movdq2q_instruction:
  5011.         lods    byte [esi]
  5012.         call    get_size_operator
  5013.         cmp     al,10h
  5014.         jne     invalid_operand
  5015.         lods    byte [esi]
  5016.         call    convert_mmx_register
  5017.         cmp     ah,8
  5018.         jne     invalid_operand_size
  5019.         mov     [postbyte_register],al
  5020.         mov     [operand_size],0
  5021.         lods    byte [esi]
  5022.         cmp     al,','
  5023.         jne     invalid_operand
  5024.         lods    byte [esi]
  5025.         call    get_size_operator
  5026.         cmp     al,10h
  5027.         jne     invalid_operand
  5028.         lods    byte [esi]
  5029.         call    convert_mmx_register
  5030.         cmp     ah,16
  5031.         jne     invalid_operand_size
  5032.         mov     bl,al
  5033.         mov     [operand_prefix],0F2h
  5034.         mov     [base_code],0Fh
  5035.         mov     [extended_code],0D6h
  5036.         call    store_nomem_instruction
  5037.         jmp     instruction_assembled
  5038.  
  5039. sse_ps_instruction_imm8:
  5040.         mov     [immediate_size],8
  5041. sse_ps_instruction:
  5042.         mov     [mmx_size],16
  5043.         jmp     sse_instruction
  5044. sse_pd_instruction_imm8:
  5045.         mov     [immediate_size],8
  5046. sse_pd_instruction:
  5047.         mov     [mmx_size],16
  5048.         mov     [operand_prefix],66h
  5049.         jmp     sse_instruction
  5050. sse_ss_instruction:
  5051.         mov     [mmx_size],4
  5052.         mov     [operand_prefix],0F3h
  5053.         jmp     sse_instruction
  5054. sse_sd_instruction:
  5055.         mov     [mmx_size],8
  5056.         mov     [operand_prefix],0F2h
  5057.         jmp     sse_instruction
  5058. comiss_instruction:
  5059.         mov     [mmx_size],4
  5060.         jmp     sse_instruction
  5061. comisd_instruction:
  5062.         mov     [mmx_size],8
  5063.         mov     [operand_prefix],66h
  5064.         jmp     sse_instruction
  5065. cvtps2pd_instruction:
  5066.         mov     [mmx_size],8
  5067.         jmp     sse_instruction
  5068. cvtpd2dq_instruction:
  5069.         mov     [mmx_size],16
  5070.         mov     [operand_prefix],0F2h
  5071.         jmp     sse_instruction
  5072. cvtdq2pd_instruction:
  5073.         mov     [mmx_size],16
  5074.         mov     [operand_prefix],0F3h
  5075. sse_instruction:
  5076.         mov     [base_code],0Fh
  5077.         mov     [extended_code],al
  5078.         lods    byte [esi]
  5079.         call    get_size_operator
  5080.         cmp     al,10h
  5081.         jne     invalid_operand
  5082.       sse_xmmreg:
  5083.         lods    byte [esi]
  5084.         call    convert_mmx_register
  5085.         cmp     ah,16
  5086.         jne     invalid_operand_size
  5087.       sse_reg:
  5088.         mov     [postbyte_register],al
  5089.         mov     [operand_size],0
  5090.         lods    byte [esi]
  5091.         cmp     al,','
  5092.         jne     invalid_operand
  5093.         lods    byte [esi]
  5094.         call    get_size_operator
  5095.         cmp     al,10h
  5096.         je      sse_xmmreg_xmmreg
  5097.       sse_reg_mem:
  5098.         cmp     al,'['
  5099.         jne     invalid_operand
  5100.         call    get_address
  5101.         cmp     [operand_size],0
  5102.         je      sse_mem_size_ok
  5103.         mov     al,[mmx_size]
  5104.         cmp     [operand_size],al
  5105.         jne     invalid_operand_size
  5106.       sse_mem_size_ok:
  5107.         cmp     [immediate_size],8
  5108.         je      mmx_imm8
  5109.         cmp     [immediate_size],-1
  5110.         jne     sse_ok
  5111.         call    take_additional_xmm0
  5112.       sse_ok:
  5113.         call    store_instruction
  5114.         jmp     instruction_assembled
  5115.       sse_xmmreg_xmmreg:
  5116.         cmp     [operand_prefix],66h
  5117.         jne     sse_xmmreg_xmmreg_ok
  5118.         cmp     [extended_code],12h
  5119.         je      invalid_operand
  5120.         cmp     [extended_code],16h
  5121.         je      invalid_operand
  5122.       sse_xmmreg_xmmreg_ok:
  5123.         lods    byte [esi]
  5124.         call    convert_mmx_register
  5125.         cmp     ah,16
  5126.         jne     invalid_operand_size
  5127.         mov     bl,al
  5128.         cmp     [immediate_size],8
  5129.         je      mmx_nomem_imm8
  5130.         cmp     [immediate_size],-1
  5131.         jne     sse_nomem_ok
  5132.         call    take_additional_xmm0
  5133.       sse_nomem_ok:
  5134.         call    store_nomem_instruction
  5135.         jmp     instruction_assembled
  5136.       take_additional_xmm0:
  5137.         lods    byte [esi]
  5138.         cmp     al,','
  5139.         jne     invalid_operand
  5140.         lods    byte [esi]
  5141.         cmp     al,10h
  5142.         jne     invalid_operand
  5143.         lods    byte [esi]
  5144.         call    convert_mmx_register
  5145.         cmp     ah,16
  5146.         jne     invalid_operand_size
  5147.         test    al,al
  5148.         jnz     invalid_operand
  5149.         ret
  5150.  
  5151. ps_dq_instruction:
  5152.         mov     [postbyte_register],al
  5153.         mov     [operand_prefix],66h
  5154.         mov     [base_code],0Fh
  5155.         mov     [extended_code],73h
  5156.         lods    byte [esi]
  5157.         call    get_size_operator
  5158.         cmp     al,10h
  5159.         jne     invalid_operand
  5160.         lods    byte [esi]
  5161.         call    convert_mmx_register
  5162.         cmp     ah,16
  5163.         jne     invalid_operand_size
  5164.         mov     bl,al
  5165.         jmp     mmx_nomem_imm8
  5166. movpd_instruction:
  5167.         mov     [operand_prefix],66h
  5168. movps_instruction:
  5169.         mov     [base_code],0Fh
  5170.         mov     [extended_code],al
  5171.         mov     [mmx_size],16
  5172.         jmp     sse_mov_instruction
  5173. movss_instruction:
  5174.         mov     [mmx_size],4
  5175.         mov     [operand_prefix],0F3h
  5176.         jmp     sse_movs
  5177. movsd_instruction:
  5178.         mov     al,0A5h
  5179.         mov     ah,[esi]
  5180.         or      ah,ah
  5181.         jz      simple_instruction_32bit
  5182.         cmp     ah,0Fh
  5183.         je      simple_instruction_32bit
  5184.         mov     [mmx_size],8
  5185.         mov     [operand_prefix],0F2h
  5186.       sse_movs:
  5187.         mov     [base_code],0Fh
  5188.         mov     [extended_code],10h
  5189.         jmp     sse_mov_instruction
  5190. sse_mov_instruction:
  5191.         lods    byte [esi]
  5192.         call    get_size_operator
  5193.         cmp     al,10h
  5194.         je      sse_xmmreg
  5195.       sse_mem:
  5196.         cmp     al,'['
  5197.         jne     invalid_operand
  5198.         inc     [extended_code]
  5199.         call    get_address
  5200.         cmp     [operand_size],0
  5201.         je      sse_mem_xmmreg
  5202.         mov     al,[mmx_size]
  5203.         cmp     [operand_size],al
  5204.         jne     invalid_operand_size
  5205.         mov     [operand_size],0
  5206.       sse_mem_xmmreg:
  5207.         lods    byte [esi]
  5208.         cmp     al,','
  5209.         jne     invalid_operand
  5210.         lods    byte [esi]
  5211.         call    get_size_operator
  5212.         cmp     al,10h
  5213.         jne     invalid_operand
  5214.         lods    byte [esi]
  5215.         call    convert_mmx_register
  5216.         cmp     ah,16
  5217.         jne     invalid_operand_size
  5218.         mov     [postbyte_register],al
  5219.         call    store_instruction
  5220.         jmp     instruction_assembled
  5221. movlpd_instruction:
  5222.         mov     [operand_prefix],66h
  5223. movlps_instruction:
  5224.         mov     [base_code],0Fh
  5225.         mov     [extended_code],al
  5226.         mov     [mmx_size],8
  5227.         lods    byte [esi]
  5228.         call    get_size_operator
  5229.         cmp     al,10h
  5230.         jne     sse_mem
  5231.         lods    byte [esi]
  5232.         call    convert_mmx_register
  5233.         cmp     ah,16
  5234.         jne     invalid_operand_size
  5235.         mov     [postbyte_register],al
  5236.         mov     [operand_size],0
  5237.         lods    byte [esi]
  5238.         cmp     al,','
  5239.         jne     invalid_operand
  5240.         lods    byte [esi]
  5241.         call    get_size_operator
  5242.         jmp     sse_reg_mem
  5243. movhlps_instruction:
  5244.         mov     [base_code],0Fh
  5245.         mov     [extended_code],al
  5246.         mov     [mmx_size],0
  5247.         lods    byte [esi]
  5248.         call    get_size_operator
  5249.         cmp     al,10h
  5250.         jne     invalid_operand
  5251.         lods    byte [esi]
  5252.         call    convert_mmx_register
  5253.         cmp     ah,16
  5254.         jne     invalid_operand_size
  5255.         mov     [postbyte_register],al
  5256.         lods    byte [esi]
  5257.         cmp     al,','
  5258.         jne     invalid_operand
  5259.         lods    byte [esi]
  5260.         call    get_size_operator
  5261.         cmp     al,10h
  5262.         je      sse_xmmreg_xmmreg_ok
  5263.         jmp     invalid_operand
  5264. maskmovq_instruction:
  5265.         mov     cl,8
  5266.         jmp     maskmov_instruction
  5267. maskmovdqu_instruction:
  5268.         mov     cl,16
  5269.         mov     [operand_prefix],66h
  5270.       maskmov_instruction:
  5271.         mov     [base_code],0Fh
  5272.         mov     [extended_code],0F7h
  5273.         lods    byte [esi]
  5274.         call    get_size_operator
  5275.         cmp     al,10h
  5276.         jne     invalid_operand
  5277.         lods    byte [esi]
  5278.         call    convert_mmx_register
  5279.         cmp     ah,cl
  5280.         jne     invalid_operand_size
  5281.         mov     [postbyte_register],al
  5282.         lods    byte [esi]
  5283.         cmp     al,','
  5284.         jne     invalid_operand
  5285.         lods    byte [esi]
  5286.         call    get_size_operator
  5287.         cmp     al,10h
  5288.         jne     invalid_operand
  5289.         lods    byte [esi]
  5290.         call    convert_mmx_register
  5291.         mov     bl,al
  5292.         call    store_nomem_instruction
  5293.         jmp     instruction_assembled
  5294. movmskpd_instruction:
  5295.         mov     [operand_prefix],66h
  5296. movmskps_instruction:
  5297.         mov     [base_code],0Fh
  5298.         mov     [extended_code],50h
  5299.         lods    byte [esi]
  5300.         call    get_size_operator
  5301.         cmp     al,10h
  5302.         jne     invalid_operand
  5303.         lods    byte [esi]
  5304.         call    convert_register
  5305.         cmp     ah,4
  5306.         jne     invalid_operand_size
  5307.         mov     [operand_size],0
  5308.         mov     [postbyte_register],al
  5309.         lods    byte [esi]
  5310.         cmp     al,','
  5311.         jne     invalid_operand
  5312.         lods    byte [esi]
  5313.         call    get_size_operator
  5314.         cmp     al,10h
  5315.         jne     invalid_operand
  5316.         lods    byte [esi]
  5317.         call    convert_mmx_register
  5318.         cmp     ah,16
  5319.         jne     invalid_operand_size
  5320.         mov     bl,al
  5321.         call    store_nomem_instruction
  5322.         jmp     instruction_assembled
  5323. cmppd_instruction:
  5324.         mov     [operand_prefix],66h
  5325. cmpps_instruction:
  5326.         mov     [base_code],0Fh
  5327.         mov     [extended_code],0C2h
  5328.         mov     [mmx_size],16
  5329.         mov     byte [value],-1
  5330.         jmp     sse_cmp_instruction
  5331. cmp_pd_instruction:
  5332.         mov     [operand_prefix],66h
  5333. cmp_ps_instruction:
  5334.         mov     [base_code],0Fh
  5335.         mov     [extended_code],0C2h
  5336.         mov     [mmx_size],16
  5337.         mov     byte [value],al
  5338.         jmp     sse_cmp_instruction
  5339. cmpss_instruction:
  5340.         mov     [mmx_size],4
  5341.         mov     [operand_prefix],0F3h
  5342.         jmp     cmpsx_instruction
  5343. cmpsd_instruction:
  5344.         mov     al,0A7h
  5345.         mov     ah,[esi]
  5346.         or      ah,ah
  5347.         jz      simple_instruction_32bit
  5348.         cmp     ah,0Fh
  5349.         je      simple_instruction_32bit
  5350.         mov     [mmx_size],8
  5351.         mov     [operand_prefix],0F2h
  5352.       cmpsx_instruction:
  5353.         mov     [base_code],0Fh
  5354.         mov     [extended_code],0C2h
  5355.         mov     byte [value],-1
  5356.         jmp     sse_cmp_instruction
  5357. cmp_ss_instruction:
  5358.         mov     [mmx_size],4
  5359.         mov     [operand_prefix],0F3h
  5360.         jmp     cmp_sx_instruction
  5361. cmp_sd_instruction:
  5362.         mov     [mmx_size],8
  5363.         mov     [operand_prefix],0F2h
  5364.       cmp_sx_instruction:
  5365.         mov     [base_code],0Fh
  5366.         mov     [extended_code],0C2h
  5367.         mov     byte [value],al
  5368. sse_cmp_instruction:
  5369.         lods    byte [esi]
  5370.         call    get_size_operator
  5371.         cmp     al,10h
  5372.         jne     invalid_operand
  5373.         lods    byte [esi]
  5374.         call    convert_mmx_register
  5375.         cmp     ah,16
  5376.         jne     invalid_operand_size
  5377.         mov     [postbyte_register],al
  5378.         lods    byte [esi]
  5379.         cmp     al,','
  5380.         jne     invalid_operand
  5381.         mov     [operand_size],0
  5382.         lods    byte [esi]
  5383.         call    get_size_operator
  5384.         cmp     al,10h
  5385.         je      sse_cmp_xmmreg_xmmreg
  5386.         cmp     al,'['
  5387.         jne     invalid_operand
  5388.         call    get_address
  5389.         mov     al,[operand_size]
  5390.         or      al,al
  5391.         jz      sse_cmp_size_ok
  5392.         cmp     al,[mmx_size]
  5393.         jne     invalid_operand_size
  5394.       sse_cmp_size_ok:
  5395.         push    ebx ecx edx
  5396.         call    get_nextbyte
  5397.         pop     edx ecx ebx
  5398.         call    store_instruction_with_imm8
  5399.         jmp     instruction_assembled
  5400.       sse_cmp_xmmreg_xmmreg:
  5401.         lods    byte [esi]
  5402.         call    convert_mmx_register
  5403.         cmp     ah,16
  5404.         jne     invalid_operand_size
  5405.         mov     bl,al
  5406.         call    store_nomem_instruction
  5407.         call    get_nextbyte
  5408.         mov     al,byte [value]
  5409.         stos    byte [edi]
  5410.         jmp     instruction_assembled
  5411.       get_nextbyte:
  5412.         cmp     byte [value],-1
  5413.         jne     nextbyte_ok
  5414.         mov     [operand_size],0
  5415.         lods    byte [esi]
  5416.         cmp     al,','
  5417.         jne     invalid_operand
  5418.         lods    byte [esi]
  5419.         call    get_size_operator
  5420.         test    [operand_size],not 1
  5421.         jnz     invalid_value
  5422.         cmp     al,'('
  5423.         jne     invalid_operand
  5424.         call    get_byte_value
  5425.         cmp     al,7
  5426.         ja      invalid_value
  5427.         mov     byte [value],al
  5428.       nextbyte_ok:
  5429.         ret
  5430. cvtpi2pd_instruction:
  5431.         mov     [operand_prefix],66h
  5432. cvtpi2ps_instruction:
  5433.         mov     [base_code],0Fh
  5434.         mov     [extended_code],al
  5435.         lods    byte [esi]
  5436.         call    get_size_operator
  5437.         cmp     al,10h
  5438.         jne     invalid_operand
  5439.         lods    byte [esi]
  5440.         call    convert_mmx_register
  5441.         cmp     ah,16
  5442.         jne     invalid_operand_size
  5443.         mov     [postbyte_register],al
  5444.         mov     [operand_size],0
  5445.         lods    byte [esi]
  5446.         cmp     al,','
  5447.         jne     invalid_operand
  5448.         lods    byte [esi]
  5449.         call    get_size_operator
  5450.         cmp     al,10h
  5451.         je      cvtpi_xmmreg_xmmreg
  5452.         cmp     al,'['
  5453.         jne     invalid_operand
  5454.         call    get_address
  5455.         cmp     [operand_size],0
  5456.         je      cvtpi_size_ok
  5457.         cmp     [operand_size],8
  5458.         jne     invalid_operand_size
  5459.       cvtpi_size_ok:
  5460.         call    store_instruction
  5461.         jmp     instruction_assembled
  5462.       cvtpi_xmmreg_xmmreg:
  5463.         lods    byte [esi]
  5464.         call    convert_mmx_register
  5465.         cmp     ah,8
  5466.         jne     invalid_operand_size
  5467.         mov     bl,al
  5468.         call    store_nomem_instruction
  5469.         jmp     instruction_assembled
  5470. cvtsi2ss_instruction:
  5471.         mov     [operand_prefix],0F3h
  5472.         jmp     cvtsi_instruction
  5473. cvtsi2sd_instruction:
  5474.         mov     [operand_prefix],0F2h
  5475.       cvtsi_instruction:
  5476.         mov     [base_code],0Fh
  5477.         mov     [extended_code],al
  5478.         lods    byte [esi]
  5479.         call    get_size_operator
  5480.         cmp     al,10h
  5481.         jne     invalid_operand
  5482.         lods    byte [esi]
  5483.         call    convert_mmx_register
  5484.         cmp     ah,16
  5485.         jne     invalid_operand_size
  5486.         mov     [postbyte_register],al
  5487.         mov     [operand_size],0
  5488.         lods    byte [esi]
  5489.         cmp     al,','
  5490.         jne     invalid_operand
  5491.         lods    byte [esi]
  5492.         call    get_size_operator
  5493.         cmp     al,10h
  5494.         je      cvtsi_xmmreg_reg
  5495.         cmp     al,'['
  5496.         jne     invalid_operand
  5497.         call    get_address
  5498.         cmp     [operand_size],0
  5499.         je      cvtsi_size_ok
  5500.         cmp     [operand_size],4
  5501.         jne     invalid_operand_size
  5502.       cvtsi_size_ok:
  5503.         call    store_instruction
  5504.         jmp     instruction_assembled
  5505.       cvtsi_xmmreg_reg:
  5506.         lods    byte [esi]
  5507.         call    convert_register
  5508.         cmp     ah,4
  5509.         je      cvtsi_xmmreg_reg_store
  5510.         cmp     ah,8
  5511.         jne     invalid_operand_size
  5512.         call    operand_64bit
  5513.       cvtsi_xmmreg_reg_store:
  5514.         mov     bl,al
  5515.         call    store_nomem_instruction
  5516.         jmp     instruction_assembled
  5517. cvtps2pi_instruction:
  5518.         mov     [mmx_size],8
  5519.         jmp     cvtpd_instruction
  5520. cvtpd2pi_instruction:
  5521.         mov     [operand_prefix],66h
  5522.         mov     [mmx_size],16
  5523.       cvtpd_instruction:
  5524.         mov     [base_code],0Fh
  5525.         mov     [extended_code],al
  5526.         lods    byte [esi]
  5527.         call    get_size_operator
  5528.         cmp     al,10h
  5529.         jne     invalid_operand
  5530.         lods    byte [esi]
  5531.         call    convert_mmx_register
  5532.         cmp     ah,8
  5533.         jne     invalid_operand_size
  5534.         mov     [operand_size],0
  5535.         jmp     sse_reg
  5536. cvtss2si_instruction:
  5537.         mov     [operand_prefix],0F3h
  5538.         mov     [mmx_size],4
  5539.         jmp     cvt2si_instruction
  5540. cvtsd2si_instruction:
  5541.         mov     [operand_prefix],0F2h
  5542.         mov     [mmx_size],8
  5543.       cvt2si_instruction:
  5544.         mov     [extended_code],al
  5545.         mov     [base_code],0Fh
  5546.         lods    byte [esi]
  5547.         call    get_size_operator
  5548.         cmp     al,10h
  5549.         jne     invalid_operand
  5550.         lods    byte [esi]
  5551.         call    convert_register
  5552.         mov     [operand_size],0
  5553.         cmp     ah,4
  5554.         je      sse_reg
  5555.         cmp     ah,8
  5556.         jne     invalid_operand_size
  5557.         call    operand_64bit
  5558.         jmp     sse_reg
  5559.  
  5560. ssse3_instruction:
  5561.         mov     [base_code],0Fh
  5562.         mov     [extended_code],38h
  5563.         mov     [supplemental_code],al
  5564.         jmp     mmx_instruction
  5565. palignr_instruction:
  5566.         mov     [base_code],0Fh
  5567.         mov     [extended_code],3Ah
  5568.         mov     [supplemental_code],0Fh
  5569.         lods    byte [esi]
  5570.         call    get_size_operator
  5571.         cmp     al,10h
  5572.         jne     invalid_operand
  5573.         lods    byte [esi]
  5574.         call    convert_mmx_register
  5575.         call    make_mmx_prefix
  5576.         mov     [postbyte_register],al
  5577.         lods    byte [esi]
  5578.         cmp     al,','
  5579.         jne     invalid_operand
  5580.         lods    byte [esi]
  5581.         call    get_size_operator
  5582.         cmp     al,10h
  5583.         je      palignr_mmreg_mmreg
  5584.         cmp     al,'['
  5585.         jne     invalid_operand
  5586.         call    get_address
  5587.         jmp     mmx_imm8
  5588.       palignr_mmreg_mmreg:
  5589.         lods    byte [esi]
  5590.         call    convert_mmx_register
  5591.         mov     bl,al
  5592.         jmp     mmx_nomem_imm8
  5593. amd3dnow_instruction:
  5594.         mov     [base_code],0Fh
  5595.         mov     [extended_code],0Fh
  5596.         mov     byte [value],al
  5597.         lods    byte [esi]
  5598.         call    get_size_operator
  5599.         cmp     al,10h
  5600.         jne     invalid_operand
  5601.         lods    byte [esi]
  5602.         call    convert_mmx_register
  5603.         cmp     ah,8
  5604.         jne     invalid_operand_size
  5605.         mov     [postbyte_register],al
  5606.         lods    byte [esi]
  5607.         cmp     al,','
  5608.         jne     invalid_operand
  5609.         lods    byte [esi]
  5610.         call    get_size_operator
  5611.         cmp     al,10h
  5612.         je      amd3dnow_mmreg_mmreg
  5613.         cmp     al,'['
  5614.         jne     invalid_operand
  5615.         call    get_address
  5616.         call    store_instruction_with_imm8
  5617.         jmp     instruction_assembled
  5618.       amd3dnow_mmreg_mmreg:
  5619.         lods    byte [esi]
  5620.         call    convert_mmx_register
  5621.         cmp     ah,8
  5622.         jne     invalid_operand_size
  5623.         mov     bl,al
  5624.         call    store_nomem_instruction
  5625.         mov     al,byte [value]
  5626.         stos    byte [edi]
  5627.         jmp     instruction_assembled
  5628.  
  5629. sse4_instruction_38_xmm0:
  5630.         mov     [immediate_size],-1
  5631.         jmp     sse4_instruction_38
  5632. sse4_instruction_38_imm8:
  5633.         mov     [immediate_size],8
  5634. sse4_instruction_38:
  5635.         mov     [operand_prefix],66h
  5636.         mov     [base_code],0Fh
  5637.         mov     [supplemental_code],al
  5638.         mov     al,38h
  5639.         jmp     sse_instruction
  5640. sse4_instruction_3a_imm8:
  5641.         mov     [immediate_size],8
  5642. sse4_instruction_3a:
  5643.         mov     [operand_prefix],66h
  5644.         mov     [base_code],0Fh
  5645.         mov     [supplemental_code],al
  5646.         mov     al,3Ah
  5647.         jmp     sse_instruction
  5648.  
  5649. fxsave_instruction:
  5650.         mov     [extended_code],0AEh
  5651.         mov     [base_code],0Fh
  5652.         mov     [postbyte_register],al
  5653.         lods    byte [esi]
  5654.         call    get_size_operator
  5655.         cmp     al,'['
  5656.         jne     invalid_operand
  5657.         call    get_address
  5658.         mov     ah,[operand_size]
  5659.         or      ah,ah
  5660.         jz      fxsave_size_ok
  5661.         mov     al,[postbyte_register]
  5662.         cmp     al,111b
  5663.         je      clflush_size_check
  5664.         cmp     al,10b
  5665.         jb      invalid_operand_size
  5666.         cmp     al,11b
  5667.         ja      invalid_operand_size
  5668.         cmp     ah,4
  5669.         jne     invalid_operand_size
  5670.         jmp     fxsave_size_ok
  5671.       clflush_size_check:
  5672.         cmp     ah,1
  5673.         jne     invalid_operand_size
  5674.       fxsave_size_ok:
  5675.         call    store_instruction
  5676.         jmp     instruction_assembled
  5677. prefetch_instruction:
  5678.         mov     [extended_code],18h
  5679.       prefetch_mem_8bit:
  5680.         mov     [base_code],0Fh
  5681.         mov     [postbyte_register],al
  5682.         lods    byte [esi]
  5683.         call    get_size_operator
  5684.         cmp     al,'['
  5685.         jne     invalid_operand
  5686.         or      ah,ah
  5687.         jz      prefetch_size_ok
  5688.         cmp     ah,1
  5689.         jne     invalid_operand_size
  5690.       prefetch_size_ok:
  5691.         call    get_address
  5692.         call    store_instruction
  5693.         jmp     instruction_assembled
  5694. amd_prefetch_instruction:
  5695.         mov     [extended_code],0Dh
  5696.         jmp     prefetch_mem_8bit
  5697. fence_instruction:
  5698.         mov     bl,al
  5699.         mov     ax,0AE0Fh
  5700.         stos    word [edi]
  5701.         mov     al,bl
  5702.         stos    byte [edi]
  5703.         jmp     instruction_assembled
  5704. pause_instruction:
  5705.         mov     ax,90F3h
  5706.         stos    word [edi]
  5707.         jmp     instruction_assembled
  5708. movntq_instruction:
  5709.         mov     [mmx_size],8
  5710.         jmp     movnt_instruction
  5711. movntps_instruction:
  5712.         mov     [mmx_size],16
  5713.         jmp     movnt_instruction
  5714. movntdq_instruction:
  5715.         mov     [operand_prefix],66h
  5716.         mov     [mmx_size],16
  5717.       movnt_instruction:
  5718.         mov     [extended_code],al
  5719.         mov     [base_code],0Fh
  5720.         lods    byte [esi]
  5721.         call    get_size_operator
  5722.         cmp     al,'['
  5723.         jne     invalid_operand
  5724.         call    get_address
  5725.         lods    byte [esi]
  5726.         cmp     al,','
  5727.         jne     invalid_operand
  5728.         lods    byte [esi]
  5729.         call    get_size_operator
  5730.         cmp     al,10h
  5731.         jne     invalid_operand
  5732.         lods    byte [esi]
  5733.         call    convert_mmx_register
  5734.         cmp     ah,[mmx_size]
  5735.         jne     invalid_operand_size
  5736.         mov     [postbyte_register],al
  5737.         call    store_instruction
  5738.         jmp     instruction_assembled
  5739. movnti_instruction:
  5740.         mov     [base_code],0Fh
  5741.         mov     [extended_code],al
  5742.         lods    byte [esi]
  5743.         call    get_size_operator
  5744.         cmp     al,'['
  5745.         jne     invalid_operand
  5746.         call    get_address
  5747.         lods    byte [esi]
  5748.         cmp     al,','
  5749.         jne     invalid_operand
  5750.         lods    byte [esi]
  5751.         call    get_size_operator
  5752.         cmp     al,10h
  5753.         jne     invalid_operand
  5754.         lods    byte [esi]
  5755.         call    convert_register
  5756.         cmp     ah,4
  5757.         je      movnti_store
  5758.         cmp     ah,8
  5759.         jne     invalid_operand_size
  5760.         call    operand_64bit
  5761.       movnti_store:
  5762.         mov     [postbyte_register],al
  5763.         call    store_instruction
  5764.         jmp     instruction_assembled
  5765. monitor_instruction:
  5766.         mov     [postbyte_register],al
  5767.         lods    byte [esi]
  5768.         call    get_size_operator
  5769.         cmp     al,10h
  5770.         jne     invalid_operand
  5771.         lods    byte [esi]
  5772.         call    convert_register
  5773.         cmp     ax,0400h
  5774.         jne     invalid_operand
  5775.         lods    byte [esi]
  5776.         cmp     al,','
  5777.         jne     invalid_operand
  5778.         lods    byte [esi]
  5779.         call    get_size_operator
  5780.         cmp     al,10h
  5781.         jne     invalid_operand
  5782.         lods    byte [esi]
  5783.         call    convert_register
  5784.         cmp     ax,0401h
  5785.         jne     invalid_operand
  5786.         cmp     [postbyte_register],0C8h
  5787.         jne     monitor_instruction_store
  5788.         lods    byte [esi]
  5789.         cmp     al,','
  5790.         jne     invalid_operand
  5791.         lods    byte [esi]
  5792.         call    get_size_operator
  5793.         cmp     al,10h
  5794.         jne     invalid_operand
  5795.         lods    byte [esi]
  5796.         call    convert_register
  5797.         cmp     ax,0402h
  5798.         jne     invalid_operand
  5799.       monitor_instruction_store:
  5800.         mov     ax,010Fh
  5801.         stos    word [edi]
  5802.         mov     al,[postbyte_register]
  5803.         stos    byte [edi]
  5804.         jmp     instruction_assembled
  5805.  
  5806. simple_vmx_instruction:
  5807.         mov     ah,al
  5808.         mov     al,0Fh
  5809.         stos    byte [edi]
  5810.         mov     al,1
  5811.         stos    word [edi]
  5812.         jmp     instruction_assembled
  5813. vmclear_instruction:
  5814.         mov     [operand_prefix],66h
  5815.         jmp     vmx_instruction
  5816. vmxon_instruction:
  5817.         mov     [operand_prefix],0F3h
  5818. vmx_instruction:
  5819.         mov     [postbyte_register],al
  5820.         mov     [extended_code],0C7h
  5821.         lods    byte [esi]
  5822.         call    get_size_operator
  5823.         cmp     al,'['
  5824.         jne     invalid_operand
  5825.         call    get_address
  5826.         mov     al,[operand_size]
  5827.         or      al,al
  5828.         jz      vmx_size_ok
  5829.         cmp     al,8
  5830.         jne     invalid_operand_size
  5831.       vmx_size_ok:
  5832.         mov     [base_code],0Fh
  5833.         call    store_instruction
  5834.         jmp     instruction_assembled
  5835. vmread_instruction:
  5836.         mov     [extended_code],78h
  5837.         lods    byte [esi]
  5838.         call    get_size_operator
  5839.         cmp     al,10h
  5840.         je      vmread_nomem
  5841.         cmp     al,'['
  5842.         jne     invalid_operand
  5843.         call    get_address
  5844.         lods    byte [esi]
  5845.         cmp     al,','
  5846.         jne     invalid_operand
  5847.         call    vmread_check_size
  5848.         mov     [operand_size],0
  5849.         lods    byte [esi]
  5850.         call    get_size_operator
  5851.         cmp     al,10h
  5852.         jne     invalid_operand
  5853.         lods    byte [esi]
  5854.         call    convert_register
  5855.         mov     [postbyte_register],al
  5856.         call    vmread_check_size
  5857.         jmp     vmx_size_ok
  5858.       vmread_nomem:
  5859.         lods    byte [esi]
  5860.         call    convert_register
  5861.         push    eax
  5862.         call    vmread_check_size
  5863.         lods    byte [esi]
  5864.         cmp     al,','
  5865.         jne     invalid_operand
  5866.         mov     [operand_size],0
  5867.         lods    byte [esi]
  5868.         call    get_size_operator
  5869.         cmp     al,10h
  5870.         jne     invalid_operand
  5871.         lods    byte [esi]
  5872.         call    convert_register
  5873.         mov     [postbyte_register],al
  5874.         call    vmread_check_size
  5875.         pop     ebx
  5876.         mov     [base_code],0Fh
  5877.         call    store_nomem_instruction
  5878.         jmp     instruction_assembled
  5879.       vmread_check_size:
  5880.         cmp     [code_type],64
  5881.         je      vmread_long
  5882.         cmp     [operand_size],4
  5883.         jne     invalid_operand_size
  5884.         ret
  5885.       vmread_long:
  5886.         cmp     [operand_size],8
  5887.         jne     invalid_operand_size
  5888.         ret
  5889. vmwrite_instruction:
  5890.         mov     [extended_code],79h
  5891.         lods    byte [esi]
  5892.         call    get_size_operator
  5893.         cmp     al,10h
  5894.         jne     invalid_operand
  5895.         lods    byte [esi]
  5896.         call    convert_register
  5897.         mov     [postbyte_register],al
  5898.         call    vmread_check_size
  5899.         mov     [operand_size],0
  5900.         lods    byte [esi]
  5901.         cmp     al,','
  5902.         jne     invalid_operand
  5903.         lods    byte [esi]
  5904.         call    get_size_operator
  5905.         cmp     al,10h
  5906.         je      vmwrite_nomem
  5907.         cmp     al,'['
  5908.         jne     invalid_operand
  5909.         call    get_address
  5910.         call    vmread_check_size
  5911.         jmp     vmx_size_ok
  5912.       vmwrite_nomem:
  5913.         lods    byte [esi]
  5914.         call    convert_register
  5915.         mov     bl,al
  5916.         mov     [base_code],0Fh
  5917.         call    store_nomem_instruction
  5918.         jmp     instruction_assembled
  5919. simple_svm_instruction:
  5920.         push    eax
  5921.         mov     [base_code],0Fh
  5922.         mov     [extended_code],1
  5923.         lods    byte [esi]
  5924.         call    get_size_operator
  5925.         cmp     al,10h
  5926.         jne     invalid_operand
  5927.         lods    byte [esi]
  5928.         call    convert_register
  5929.         or      al,al
  5930.         jnz     invalid_operand
  5931.       simple_svm_detect_size:
  5932.         cmp     ah,2
  5933.         je      simple_svm_16bit
  5934.         cmp     ah,4
  5935.         je      simple_svm_32bit
  5936.         cmp     [code_type],64
  5937.         jne     invalid_operand_size
  5938.         jmp     simple_svm_store
  5939.       simple_svm_16bit:
  5940.         cmp     [code_type],16
  5941.         je      simple_svm_store
  5942.         cmp     [code_type],64
  5943.         je      invalid_operand_size
  5944.         jmp     prefixed_svm_store
  5945.       simple_svm_32bit:
  5946.         cmp     [code_type],32
  5947.         je      simple_svm_store
  5948.       prefixed_svm_store:
  5949.         mov     al,67h
  5950.         stos    byte [edi]
  5951.       simple_svm_store:
  5952.         call    store_instruction_code
  5953.         pop     eax
  5954.         stos    byte [edi]
  5955.         jmp     instruction_assembled
  5956. skinit_instruction:
  5957.         lods    byte [esi]
  5958.         call    get_size_operator
  5959.         cmp     al,10h
  5960.         jne     invalid_operand
  5961.         lods    byte [esi]
  5962.         call    convert_register
  5963.         cmp     ax,0400h
  5964.         jne     invalid_operand
  5965.         mov     al,0DEh
  5966.         jmp     simple_vmx_instruction
  5967. invlpga_instruction:
  5968.         push    eax
  5969.         mov     [base_code],0Fh
  5970.         mov     [extended_code],1
  5971.         lods    byte [esi]
  5972.         call    get_size_operator
  5973.         cmp     al,10h
  5974.         jne     invalid_operand
  5975.         lods    byte [esi]
  5976.         call    convert_register
  5977.         or      al,al
  5978.         jnz     invalid_operand
  5979.         mov     bl,ah
  5980.         mov     [operand_size],0
  5981.         lods    byte [esi]
  5982.         cmp     al,','
  5983.         jne     invalid_operand
  5984.         lods    byte [esi]
  5985.         call    get_size_operator
  5986.         cmp     al,10h
  5987.         jne     invalid_operand
  5988.         lods    byte [esi]
  5989.         call    convert_register
  5990.         cmp     ax,0401h
  5991.         jne     invalid_operand
  5992.         mov     ah,bl
  5993.         jmp     simple_svm_detect_size
  5994.  
  5995. convert_register:
  5996.         mov     ah,al
  5997.         shr     ah,4
  5998.         and     al,0Fh
  5999.         cmp     ah,8
  6000.         je      match_register_size
  6001.         cmp     ah,4
  6002.         ja      invalid_operand
  6003.         cmp     ah,1
  6004.         ja      match_register_size
  6005.         cmp     al,4
  6006.         jb      match_register_size
  6007.         or      ah,ah
  6008.         jz      high_byte_register
  6009.         or      [rex_prefix],40h
  6010.       match_register_size:
  6011.         cmp     ah,[operand_size]
  6012.         je      register_size_ok
  6013.         cmp     [operand_size],0
  6014.         jne     operand_sizes_do_not_match
  6015.         mov     [operand_size],ah
  6016.       register_size_ok:
  6017.         ret
  6018.       high_byte_register:
  6019.         mov     ah,1
  6020.         or      [rex_prefix],80h
  6021.         jmp     match_register_size
  6022. convert_fpu_register:
  6023.         mov     ah,al
  6024.         shr     ah,4
  6025.         and     al,111b
  6026.         cmp     ah,10
  6027.         jne     invalid_operand
  6028.         jmp     match_register_size
  6029. convert_mmx_register:
  6030.         mov     ah,al
  6031.         shr     ah,4
  6032.         cmp     ah,0Ch
  6033.         je      xmm_register
  6034.         ja      invalid_operand
  6035.         and     al,111b
  6036.         cmp     ah,0Bh
  6037.         jne     invalid_operand
  6038.         mov     ah,8
  6039.         jmp     match_register_size
  6040.       xmm_register:
  6041.         and     al,0Fh
  6042.         mov     ah,16
  6043.         cmp     al,8
  6044.         jb      match_register_size
  6045.         cmp     [code_type],64
  6046.         jne     invalid_operand
  6047.         jmp     match_register_size
  6048. get_size_operator:
  6049.         xor     ah,ah
  6050.         cmp     al,11h
  6051.         jne     no_size_operator
  6052.         mov     [size_declared],1
  6053.         lods    word [esi]
  6054.         xchg    al,ah
  6055.         mov     [size_override],1
  6056.         cmp     ah,[operand_size]
  6057.         je      size_operator_ok
  6058.         cmp     [operand_size],0
  6059.         jne     operand_sizes_do_not_match
  6060.         mov     [operand_size],ah
  6061.       size_operator_ok:
  6062.         ret
  6063.       no_size_operator:
  6064.         mov     [size_declared],0
  6065.         cmp     al,'['
  6066.         jne     size_operator_ok
  6067.         mov     [size_override],0
  6068.         ret
  6069. get_jump_operator:
  6070.         mov     [jump_type],0
  6071.         cmp     al,12h
  6072.         jne     jump_operator_ok
  6073.         lods    word [esi]
  6074.         mov     [jump_type],al
  6075.         mov     al,ah
  6076.       jump_operator_ok:
  6077.         ret
  6078. get_address:
  6079.         mov     [segment_register],0
  6080.         mov     [address_size],0
  6081.         mov     al,[code_type]
  6082.         shr     al,3
  6083.         mov     [value_size],al
  6084.         mov     al,[esi]
  6085.         and     al,11110000b
  6086.         cmp     al,60h
  6087.         jne     get_size_prefix
  6088.         lods    byte [esi]
  6089.         sub     al,60h
  6090.         mov     [segment_register],al
  6091.         mov     al,[esi]
  6092.         and     al,11110000b
  6093.       get_size_prefix:
  6094.         cmp     al,70h
  6095.         jne     address_size_prefix_ok
  6096.         lods    byte [esi]
  6097.         sub     al,70h
  6098.         cmp     al,2
  6099.         jb      invalid_address_size
  6100.         cmp     al,8
  6101.         ja      invalid_address_size
  6102.         mov     [address_size],al
  6103.         mov     [value_size],al
  6104.       address_size_prefix_ok:
  6105.         call    calculate_address
  6106.         cmp     byte [esi-1],']'
  6107.         jne     invalid_address
  6108.         mov     [address_high],edx
  6109.         mov     edx,eax
  6110.         cmp     [code_type],64
  6111.         jne     address_ok
  6112.         or      bx,bx
  6113.         jnz     address_ok
  6114.         test    ch,0Fh
  6115.         jnz     address_ok
  6116.       calculate_relative_address:
  6117.         mov     edx,[address_symbol]
  6118.         mov     [symbol_identifier],edx
  6119.         mov     edx,[address_high]
  6120.         call    calculate_relative_offset
  6121.         mov     [address_high],edx
  6122.         cdq
  6123.         cmp     edx,[address_high]
  6124.         je      address_high_ok
  6125.         cmp     [error_line],0
  6126.         jne     address_high_ok
  6127.         mov     ebx,[current_line]
  6128.         mov     [error_line],ebx
  6129.         mov     [error],value_out_of_range
  6130.       address_high_ok:
  6131.         mov     edx,eax
  6132.         ror     ecx,16
  6133.         mov     cl,[value_type]
  6134.         rol     ecx,16
  6135.         mov     bx,0FF00h
  6136.       address_ok:
  6137.         ret
  6138. operand_16bit:
  6139.         cmp     [code_type],16
  6140.         je      size_prefix_ok
  6141.         mov     [operand_prefix],66h
  6142.         ret
  6143. operand_32bit:
  6144.         cmp     [code_type],16
  6145.         jne     size_prefix_ok
  6146.         mov     [operand_prefix],66h
  6147.       size_prefix_ok:
  6148.         ret
  6149. operand_64bit:
  6150.         cmp     [code_type],64
  6151.         jne     illegal_instruction
  6152.         or      [rex_prefix],48h
  6153.         ret
  6154. operand_autodetect:
  6155.         cmp     al,2
  6156.         je      operand_16bit
  6157.         cmp     al,4
  6158.         je      operand_32bit
  6159.         cmp     al,8
  6160.         je      operand_64bit
  6161.         jmp     invalid_operand_size
  6162. store_segment_prefix_if_necessary:
  6163.         mov     al,[segment_register]
  6164.         or      al,al
  6165.         jz      segment_prefix_ok
  6166.         cmp     al,3
  6167.         je      ss_prefix
  6168.         cmp     al,4
  6169.         ja      segment_prefix_386
  6170.         jb      segment_prefix_86
  6171.         cmp     bl,25h
  6172.         je      segment_prefix_86
  6173.         cmp     bh,25h
  6174.         je      segment_prefix_86
  6175.         cmp     bh,45h
  6176.         je      segment_prefix_86
  6177.         cmp     bh,44h
  6178.         je      segment_prefix_86
  6179.         ret
  6180.       ss_prefix:
  6181.         cmp     bl,25h
  6182.         je      segment_prefix_ok
  6183.         cmp     bh,25h
  6184.         je      segment_prefix_ok
  6185.         cmp     bh,45h
  6186.         je      segment_prefix_ok
  6187.         cmp     bh,44h
  6188.         je      segment_prefix_ok
  6189.         jmp     segment_prefix_86
  6190. store_segment_prefix:
  6191.         mov     al,[segment_register]
  6192.         or      al,al
  6193.         jz      segment_prefix_ok
  6194.         cmp     al,5
  6195.         jae     segment_prefix_386
  6196.       segment_prefix_86:
  6197.         dec     al
  6198.         shl     al,3
  6199.         add     al,26h
  6200.         stos    byte [edi]
  6201.         jmp     segment_prefix_ok
  6202.       segment_prefix_386:
  6203.         add     al,64h-5
  6204.         stos    byte [edi]
  6205.       segment_prefix_ok:
  6206.         ret
  6207. store_instruction_code:
  6208.         mov     al,[operand_prefix]
  6209.         or      al,al
  6210.         jz      operand_prefix_ok
  6211.         stos    byte [edi]
  6212.       operand_prefix_ok:
  6213.         mov     al,[rex_prefix]
  6214.         test    al,40h
  6215.         jz      rex_prefix_ok
  6216.         cmp     [code_type],64
  6217.         jne     invalid_operand
  6218.         test    al,0B0h
  6219.         jnz     prefix_conflict
  6220.         stos    byte [edi]
  6221.       rex_prefix_ok:
  6222.         mov     al,[base_code]
  6223.         stos    byte [edi]
  6224.         cmp     al,0Fh
  6225.         jne     instruction_code_ok
  6226.       store_extended_code:
  6227.         mov     al,[extended_code]
  6228.         stos    byte [edi]
  6229.         cmp     al,38h
  6230.         je      store_supplemental_code
  6231.         cmp     al,3Ah
  6232.         je      store_supplemental_code
  6233.       instruction_code_ok:
  6234.         ret
  6235.       store_supplemental_code:
  6236.         mov     al,[supplemental_code]
  6237.         stos    byte [edi]
  6238.         ret
  6239. store_nomem_instruction:
  6240.         test    [postbyte_register],1000b
  6241.         jz      nomem_reg_code_ok
  6242.         or      [rex_prefix],44h
  6243.         and     [postbyte_register],111b
  6244.       nomem_reg_code_ok:
  6245.         test    bl,1000b
  6246.         jz      nomem_rm_code_ok
  6247.         or      [rex_prefix],41h
  6248.         and     bl,111b
  6249.       nomem_rm_code_ok:
  6250.         call    store_instruction_code
  6251.         mov     al,[postbyte_register]
  6252.         shl     al,3
  6253.         or      al,bl
  6254.         or      al,11000000b
  6255.         stos    byte [edi]
  6256.         ret
  6257. store_instruction:
  6258.         mov     [current_offset],edi
  6259.         test    [postbyte_register],1000b
  6260.         jz      reg_code_ok
  6261.         or      [rex_prefix],44h
  6262.         and     [postbyte_register],111b
  6263.       reg_code_ok:
  6264.         call    store_segment_prefix_if_necessary
  6265.         or      bx,bx
  6266.         jz      address_immediate
  6267.         cmp     bx,0F800h
  6268.         je      address_rip_based
  6269.         cmp     bx,0F400h
  6270.         je      address_eip_based
  6271.         cmp     bx,0FF00h
  6272.         je      address_relative
  6273.         mov     al,bl
  6274.         or      al,bh
  6275.         and     al,11110000b
  6276.         cmp     al,80h
  6277.         je      postbyte_64bit
  6278.         cmp     al,40h
  6279.         je      postbyte_32bit
  6280.         cmp     al,20h
  6281.         jne     invalid_address
  6282.         cmp     [code_type],64
  6283.         je      invalid_address_size
  6284.         call    address_16bit_prefix
  6285.         call    store_instruction_code
  6286.         cmp     bx,2326h
  6287.         je      address_bx_si
  6288.         cmp     bx,2623h
  6289.         je      address_bx_si
  6290.         cmp     bx,2327h
  6291.         je      address_bx_di
  6292.         cmp     bx,2723h
  6293.         je      address_bx_di
  6294.         cmp     bx,2526h
  6295.         je      address_bp_si
  6296.         cmp     bx,2625h
  6297.         je      address_bp_si
  6298.         cmp     bx,2527h
  6299.         je      address_bp_di
  6300.         cmp     bx,2725h
  6301.         je      address_bp_di
  6302.         cmp     bx,2600h
  6303.         je      address_si
  6304.         cmp     bx,2700h
  6305.         je      address_di
  6306.         cmp     bx,2300h
  6307.         je      address_bx
  6308.         cmp     bx,2500h
  6309.         je      address_bp
  6310.         jmp     invalid_address
  6311.       address_bx_si:
  6312.         xor     al,al
  6313.         jmp     postbyte_16bit
  6314.       address_bx_di:
  6315.         mov     al,1
  6316.         jmp     postbyte_16bit
  6317.       address_bp_si:
  6318.         mov     al,10b
  6319.         jmp     postbyte_16bit
  6320.       address_bp_di:
  6321.         mov     al,11b
  6322.         jmp     postbyte_16bit
  6323.       address_si:
  6324.         mov     al,100b
  6325.         jmp     postbyte_16bit
  6326.       address_di:
  6327.         mov     al,101b
  6328.         jmp     postbyte_16bit
  6329.       address_bx:
  6330.         mov     al,111b
  6331.         jmp     postbyte_16bit
  6332.       address_bp:
  6333.         mov     al,110b
  6334.       postbyte_16bit:
  6335.         test    ch,22h
  6336.         jnz     address_16bit_value
  6337.         or      ch,ch
  6338.         jnz     address_sizes_do_not_agree
  6339.         cmp     edx,10000h
  6340.         jge     value_out_of_range
  6341.         cmp     edx,-8000h
  6342.         jl      value_out_of_range
  6343.         or      dx,dx
  6344.         jz      address
  6345.         cmp     dx,80h
  6346.         jb      address_8bit_value
  6347.         cmp     dx,-80h
  6348.         jae     address_8bit_value
  6349.       address_16bit_value:
  6350.         or      al,10000000b
  6351.         mov     cl,[postbyte_register]
  6352.         shl     cl,3
  6353.         or      al,cl
  6354.         stos    byte [edi]
  6355.         mov     eax,edx
  6356.         stos    word [edi]
  6357.         ret
  6358.       address_8bit_value:
  6359.         or      al,01000000b
  6360.         mov     cl,[postbyte_register]
  6361.         shl     cl,3
  6362.         or      al,cl
  6363.         stos    byte [edi]
  6364.         mov     al,dl
  6365.         stos    byte [edi]
  6366.         cmp     dx,80h
  6367.         jge     value_out_of_range
  6368.         cmp     dx,-80h
  6369.         jl      value_out_of_range
  6370.         ret
  6371.       address:
  6372.         cmp     al,110b
  6373.         je      address_8bit_value
  6374.         mov     cl,[postbyte_register]
  6375.         shl     cl,3
  6376.         or      al,cl
  6377.         stos    byte [edi]
  6378.         ret
  6379.       postbyte_32bit:
  6380.         call    address_32bit_prefix
  6381.         jmp     address_prefix_ok
  6382.       postbyte_64bit:
  6383.         cmp     [code_type],64
  6384.         jne     invalid_address_size
  6385.       address_prefix_ok:
  6386.         test    bh,1000b
  6387.         jz      base_code_ok
  6388.         or      [rex_prefix],41h
  6389.       base_code_ok:
  6390.         test    bl,1000b
  6391.         jz      index_code_ok
  6392.         or      [rex_prefix],42h
  6393.       index_code_ok:
  6394.         call    store_instruction_code
  6395.         cmp     bl,44h
  6396.         je      swap_base_with_index
  6397.         cmp     bl,84h
  6398.         jne     base_register_ok
  6399.       swap_base_with_index:
  6400.         cmp     cl,1
  6401.         jne     invalid_address
  6402.         xchg    bl,bh
  6403.         cmp     bl,44h
  6404.         je      invalid_address
  6405.         cmp     bl,84h
  6406.         je      invalid_address
  6407.       base_register_ok:
  6408.         or      cl,cl
  6409.         jz      only_base_register
  6410.       base_and_index:
  6411.         mov     al,100b
  6412.         xor     ah,ah
  6413.         cmp     cl,1
  6414.         je      scale_ok
  6415.         cmp     cl,2
  6416.         je      scale_1
  6417.         cmp     cl,4
  6418.         je      scale_2
  6419.         or      ah,11000000b
  6420.         jmp     scale_ok
  6421.       scale_2:
  6422.         or      ah,10000000b
  6423.         jmp     scale_ok
  6424.       scale_1:
  6425.         or      ah,01000000b
  6426.       scale_ok:
  6427.         or      bh,bh
  6428.         jz      only_index_register
  6429.         and     bl,111b
  6430.         shl     bl,3
  6431.         or      ah,bl
  6432.         and     bh,111b
  6433.         or      ah,bh
  6434.         test    ch,44h
  6435.         jnz     sib_address_32bit_value
  6436.         test    ch,88h
  6437.         jnz     sib_address_32bit_value
  6438.         or      ch,ch
  6439.         jnz     address_sizes_do_not_agree
  6440.         cmp     bh,5
  6441.         je      address_value
  6442.         or      edx,edx
  6443.         jz      sib_address
  6444.       address_value:
  6445.         cmp     edx,80h
  6446.         jb      sib_address_8bit_value
  6447.         cmp     edx,-80h
  6448.         jae     sib_address_8bit_value
  6449.       sib_address_32bit_value:
  6450.         or      al,10000000b
  6451.         mov     cl,[postbyte_register]
  6452.         shl     cl,3
  6453.         or      al,cl
  6454.         stos    word [edi]
  6455.       address_32bit_value:
  6456.         cmp     [code_type],64
  6457.         jne     store_address_32bit_value
  6458.         mov     eax,edx
  6459.         cdq
  6460.         cmp     edx,[address_high]
  6461.         je      address_32bit_value_ok
  6462.         cmp     [error_line],0
  6463.         jne     address_32bit_value_ok
  6464.         mov     edx,[current_line]
  6465.         mov     [error_line],edx
  6466.         mov     [error],value_out_of_range
  6467.       address_32bit_value_ok:
  6468.         mov     edx,eax
  6469.         jmp     store_address_32bit_value
  6470.       sib_address_8bit_value:
  6471.         or      al,01000000b
  6472.         mov     cl,[postbyte_register]
  6473.         shl     cl,3
  6474.         or      al,cl
  6475.         stos    word [edi]
  6476.         mov     al,dl
  6477.         stos    byte [edi]
  6478.         cmp     edx,80h
  6479.         jge     value_out_of_range
  6480.         cmp     edx,-80h
  6481.         jl      value_out_of_range
  6482.         ret
  6483.       sib_address:
  6484.         mov     cl,[postbyte_register]
  6485.         shl     cl,3
  6486.         or      al,cl
  6487.         stos    word [edi]
  6488.         ret
  6489.       only_index_register:
  6490.         or      ah,101b
  6491.         and     bl,111b
  6492.         shl     bl,3
  6493.         or      ah,bl
  6494.         mov     cl,[postbyte_register]
  6495.         shl     cl,3
  6496.         or      al,cl
  6497.         stos    word [edi]
  6498.         test    ch,44h
  6499.         jnz     address_32bit_value
  6500.         test    ch,88h
  6501.         jnz     address_32bit_value
  6502.         or      ch,ch
  6503.         jnz     invalid_address_size
  6504.         jmp     address_32bit_value
  6505.       zero_index_register:
  6506.         mov     bl,4
  6507.         mov     cl,1
  6508.         jmp     base_and_index
  6509.       only_base_register:
  6510.         mov     al,bh
  6511.         and     al,111b
  6512.         cmp     al,4
  6513.         je      zero_index_register
  6514.         test    ch,44h
  6515.         jnz     simple_address_32bit_value
  6516.         test    ch,88h
  6517.         jnz     simple_address_32bit_value
  6518.         or      ch,ch
  6519.         jnz     address_sizes_do_not_agree
  6520.         or      edx,edx
  6521.         jz      simple_address
  6522.         cmp     edx,80h
  6523.         jb      simple_address_8bit_value
  6524.         cmp     edx,-80h
  6525.         jae     simple_address_8bit_value
  6526.       simple_address_32bit_value:
  6527.         or      al,10000000b
  6528.         mov     cl,[postbyte_register]
  6529.         shl     cl,3
  6530.         or      al,cl
  6531.         stos    byte [edi]
  6532.         jmp     address_32bit_value
  6533.       simple_address_8bit_value:
  6534.         or      al,01000000b
  6535.         mov     cl,[postbyte_register]
  6536.         shl     cl,3
  6537.         or      al,cl
  6538.         stos    byte [edi]
  6539.         mov     al,dl
  6540.         stos    byte [edi]
  6541.         cmp     edx,80h
  6542.         jge     value_out_of_range
  6543.         cmp     edx,-80h
  6544.         jl      value_out_of_range
  6545.         ret
  6546.       simple_address:
  6547.         cmp     al,5
  6548.         je      simple_address_8bit_value
  6549.         mov     cl,[postbyte_register]
  6550.         shl     cl,3
  6551.         or      al,cl
  6552.         stos    byte [edi]
  6553.         ret
  6554.       address_immediate:
  6555.         cmp     [code_type],64
  6556.         je      address_immediate_sib
  6557.         test    ch,44h
  6558.         jnz     address_immediate_32bit
  6559.         test    ch,22h
  6560.         jnz     address_immediate_16bit
  6561.         or      ch,ch
  6562.         jnz     invalid_address_size
  6563.         cmp     [code_type],16
  6564.         je      addressing_16bit
  6565.       address_immediate_32bit:
  6566.         call    address_32bit_prefix
  6567.         call    store_instruction_code
  6568.       store_immediate_address:
  6569.         mov     al,101b
  6570.         mov     cl,[postbyte_register]
  6571.         shl     cl,3
  6572.         or      al,cl
  6573.         stos    byte [edi]
  6574.       store_address_32bit_value:
  6575.         test    ch,0F0h
  6576.         jz      address_32bit_relocation_ok
  6577.         mov     eax,ecx
  6578.         shr     eax,16
  6579.         cmp     al,4
  6580.         jne     address_32bit_relocation
  6581.         mov     al,2
  6582.       address_32bit_relocation:
  6583.         xchg    [value_type],al
  6584.         mov     ebx,[address_symbol]
  6585.         xchg    ebx,[symbol_identifier]
  6586.         call    mark_relocation
  6587.         mov     [value_type],al
  6588.         mov     [symbol_identifier],ebx
  6589.       address_32bit_relocation_ok:
  6590.         mov     eax,edx
  6591.         stos    dword [edi]
  6592.         ret
  6593.       store_address_64bit_value:
  6594.         test    ch,0F0h
  6595.         jz      address_64bit_relocation_ok
  6596.         mov     eax,ecx
  6597.         shr     eax,16
  6598.         xchg    [value_type],al
  6599.         mov     ebx,[address_symbol]
  6600.         xchg    ebx,[symbol_identifier]
  6601.         call    mark_relocation
  6602.         mov     [value_type],al
  6603.         mov     [symbol_identifier],ebx
  6604.       address_64bit_relocation_ok:
  6605.         mov     eax,edx
  6606.         stos    dword [edi]
  6607.         mov     eax,[address_high]
  6608.         stos    dword [edi]
  6609.         ret
  6610.       address_immediate_sib:
  6611.         test    ch,not 44h
  6612.         jnz     invalid_address_size
  6613.         test    ecx,0FF0000h
  6614.         jnz     address_immediate_sib_nosignextend
  6615.         test    edx,80000000h
  6616.         jz      address_immediate_sib_prefix_ok
  6617.       address_immediate_sib_nosignextend:
  6618.         call    address_32bit_prefix
  6619.       address_immediate_sib_prefix_ok:
  6620.         call    store_instruction_code
  6621.         mov     al,100b
  6622.         mov     ah,100101b
  6623.         mov     cl,[postbyte_register]
  6624.         shl     cl,3
  6625.         or      al,cl
  6626.         stos    word [edi]
  6627.         jmp     store_address_32bit_value
  6628.       address_eip_based:
  6629.         mov     al,67h
  6630.         stos    byte [edi]
  6631.       address_rip_based:
  6632.         cmp     [code_type],64
  6633.         jne     invalid_address
  6634.         call    store_instruction_code
  6635.         jmp     store_immediate_address
  6636.       address_relative:
  6637.         call    store_instruction_code
  6638.         movzx   eax,[immediate_size]
  6639.         add     eax,edi
  6640.         sub     eax,[current_offset]
  6641.         add     eax,5
  6642.         sub     edx,eax
  6643.         jo      value_out_of_range
  6644.         mov     al,101b
  6645.         mov     cl,[postbyte_register]
  6646.         shl     cl,3
  6647.         or      al,cl
  6648.         stos    byte [edi]
  6649.         shr     ecx,16
  6650.         xchg    [value_type],cl
  6651.         mov     ebx,[address_symbol]
  6652.         xchg    ebx,[symbol_identifier]
  6653.         mov     eax,edx
  6654.         call    mark_relocation
  6655.         mov     [value_type],cl
  6656.         mov     [symbol_identifier],ebx
  6657.         stos    dword [edi]
  6658.         ret
  6659.       addressing_16bit:
  6660.         cmp     edx,10000h
  6661.         jge     address_immediate_32bit
  6662.         cmp     edx,-8000h
  6663.         jl      address_immediate_32bit
  6664.         movzx   edx,dx
  6665.       address_immediate_16bit:
  6666.         call    address_16bit_prefix
  6667.         call    store_instruction_code
  6668.         mov     al,110b
  6669.         mov     cl,[postbyte_register]
  6670.         shl     cl,3
  6671.         or      al,cl
  6672.         stos    byte [edi]
  6673.         mov     eax,edx
  6674.         stos    word [edi]
  6675.         cmp     edx,10000h
  6676.         jge     value_out_of_range
  6677.         cmp     edx,-8000h
  6678.         jl      value_out_of_range
  6679.         ret
  6680.       address_16bit_prefix:
  6681.         cmp     [code_type],16
  6682.         je      instruction_prefix_ok
  6683.         mov     al,67h
  6684.         stos    byte [edi]
  6685.         ret
  6686.       address_32bit_prefix:
  6687.         cmp     [code_type],32
  6688.         je      instruction_prefix_ok
  6689.         mov     al,67h
  6690.         stos    byte [edi]
  6691.       instruction_prefix_ok:
  6692.         ret
  6693. store_instruction_with_imm8:
  6694.         mov     [immediate_size],1
  6695.         call    store_instruction
  6696.         mov     al,byte [value]
  6697.         stos    byte [edi]
  6698.         ret
  6699. store_instruction_with_imm16:
  6700.         mov     [immediate_size],2
  6701.         call    store_instruction
  6702.         mov     ax,word [value]
  6703.         call    mark_relocation
  6704.         stos    word [edi]
  6705.         ret
  6706. store_instruction_with_imm32:
  6707.         mov     [immediate_size],4
  6708.         call    store_instruction
  6709.         mov     eax,dword [value]
  6710.         call    mark_relocation
  6711.         stos    dword [edi]
  6712.         ret
  6713.