Subversion Repositories Kolibri OS

Rev

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

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