Rev 3010 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3010 | Rev 4039 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; flat assembler core |
1 | ; flat assembler core |
2 | ; Copyright (c) 1999-2012, Tomasz Grysztar. |
2 | ; Copyright (c) 1999-2013, Tomasz Grysztar. |
3 | ; All rights reserved. |
3 | ; All rights reserved. |
Line 4... | Line 4... | ||
4 | 4 | ||
5 | simple_instruction_except64: |
5 | simple_instruction_except64: |
6 | cmp [code_type],64 |
6 | cmp [code_type],64 |
Line 2987... | Line 2987... | ||
2987 | stos word [edi] |
2987 | stos word [edi] |
2988 | jmp instruction_assembled |
2988 | jmp instruction_assembled |
2989 | calculate_jump_offset: |
2989 | calculate_jump_offset: |
2990 | add edi,2 |
2990 | add edi,2 |
2991 | call calculate_relative_offset |
2991 | mov ebp,[addressing_space] |
- | 2992 | call calculate_relative_offset |
|
2992 | sub edi,2 |
2993 | sub edi,2 |
2993 | ret |
2994 | ret |
2994 | check_for_short_jump: |
2995 | check_for_short_jump: |
2995 | cmp [jump_type],1 |
2996 | cmp [jump_type],1 |
2996 | je forced_short |
2997 | je forced_short |
Line 5980... | Line 5981... | ||
5980 | pop ecx ebx edx |
5981 | pop ecx ebx edx |
5981 | mov al,[operand_size] |
5982 | mov al,[operand_size] |
5982 | call operand_autodetect |
5983 | call operand_autodetect |
5983 | jmp instruction_ready |
5984 | jmp instruction_ready |
5984 | 5985 | adx_instruction: |
|
- | 5986 | mov [base_code],0Fh |
|
- | 5987 | mov [extended_code],38h |
|
- | 5988 | mov [supplemental_code],0F6h |
|
- | 5989 | mov [operand_prefix],al |
|
- | 5990 | call get_reg_mem |
|
- | 5991 | jc adx_reg_reg |
|
- | 5992 | mov al,[operand_size] |
|
- | 5993 | cmp al,4 |
|
- | 5994 | je instruction_ready |
|
- | 5995 | cmp al,8 |
|
- | 5996 | jne invalid_operand_size |
|
- | 5997 | call operand_64bit |
|
- | 5998 | jmp instruction_ready |
|
- | 5999 | adx_reg_reg: |
|
- | 6000 | cmp ah,4 |
|
- | 6001 | je nomem_instruction_ready |
|
- | 6002 | cmp ah,8 |
|
- | 6003 | jne invalid_operand_size |
|
- | 6004 | call operand_64bit |
|
- | 6005 | jmp nomem_instruction_ready |
|
- | 6006 | ||
Line 5985... | Line 6007... | ||
5985 | simple_vmx_instruction: |
6007 | simple_vmx_instruction: |
5986 | mov ah,al |
6008 | mov ah,al |
5987 | mov al,0Fh |
6009 | mov al,0Fh |
5988 | stos byte [edi] |
6010 | stos byte [edi] |
Line 6249... | Line 6271... | ||
6249 | je xbegin_32bit |
6271 | je xbegin_32bit |
6250 | xbegin_16bit: |
6272 | xbegin_16bit: |
6251 | call get_address_word_value |
6273 | call get_address_word_value |
6252 | add edi,4 |
6274 | add edi,4 |
6253 | call calculate_relative_offset |
6275 | mov ebp,[addressing_space] |
- | 6276 | call calculate_relative_offset |
|
6254 | sub edi,4 |
6277 | sub edi,4 |
6255 | shl eax,16 |
6278 | shl eax,16 |
6256 | mov ax,0F8C7h |
6279 | mov ax,0F8C7h |
6257 | stos dword [edi] |
6280 | stos dword [edi] |
6258 | jmp instruction_assembled |
6281 | jmp instruction_assembled |
Line 6262... | Line 6285... | ||
6262 | xbegin_64bit: |
6285 | xbegin_64bit: |
6263 | call get_address_qword_value |
6286 | call get_address_qword_value |
6264 | xbegin_address_ok: |
6287 | xbegin_address_ok: |
6265 | add edi,5 |
6288 | add edi,5 |
6266 | call calculate_relative_offset |
6289 | mov ebp,[addressing_space] |
- | 6290 | call calculate_relative_offset |
|
6267 | sub edi,5 |
6291 | sub edi,5 |
6268 | mov edx,eax |
6292 | mov edx,eax |
6269 | cwde |
6293 | cwde |
6270 | cmp eax,edx |
6294 | cmp eax,edx |
6271 | jne xbegin_rel32 |
6295 | jne xbegin_rel32 |
Line 6381... | Line 6405... | ||
6381 | ret |
6405 | ret |
6382 | get_address: |
6406 | get_address: |
6383 | mov [segment_register],0 |
6407 | mov [segment_register],0 |
6384 | mov [address_size],0 |
6408 | mov [address_size],0 |
6385 | mov al,[code_type] |
6409 | mov [free_address_range],0 |
- | 6410 | mov al,[code_type] |
|
6386 | shr al,3 |
6411 | shr al,3 |
6387 | mov [value_size],al |
6412 | mov [value_size],al |
6388 | mov al,[esi] |
6413 | mov al,[esi] |
6389 | and al,11110000b |
6414 | and al,11110000b |
6390 | cmp al,60h |
6415 | cmp al,60h |
Line 6420... | Line 6445... | ||
6420 | calculate_relative_address: |
6445 | calculate_relative_address: |
6421 | mov edx,[address_symbol] |
6446 | mov edx,[address_symbol] |
6422 | mov [symbol_identifier],edx |
6447 | mov [symbol_identifier],edx |
6423 | mov edx,[address_high] |
6448 | mov edx,[address_high] |
6424 | call calculate_relative_offset |
6449 | mov ebp,[addressing_space] |
- | 6450 | call calculate_relative_offset |
|
6425 | mov [address_high],edx |
6451 | mov [address_high],edx |
6426 | cdq |
6452 | cdq |
6427 | cmp edx,[address_high] |
6453 | cmp edx,[address_high] |
6428 | je address_high_ok |
6454 | je address_high_ok |
6429 | call recoverable_overflow |
6455 | call recoverable_overflow |