Rev 992 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 992 | Rev 1039 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; flat assembler core |
1 | ; flat assembler core |
2 | ; Copyright (c) 1999-2007, Tomasz Grysztar. |
2 | ; Copyright (c) 1999-2009, Tomasz Grysztar. |
3 | ; All rights reserved. |
3 | ; All rights reserved. |
Line 4... | Line 4... | ||
4 | 4 | ||
5 | assembler: |
5 | assembler: |
6 | xor eax,eax |
6 | xor eax,eax |
Line 355... | Line 355... | ||
355 | ; mov [size_override],0 |
355 | ; mov [size_override],0 |
356 | ; mov [operand_prefix],0 |
356 | ; mov [operand_prefix],0 |
357 | ; mov [rex_prefix],0 |
357 | ; mov [rex_prefix],0 |
358 | mov dword [operand_size],0 |
358 | mov dword [operand_size],0 |
359 | mov [immediate_size],0 |
359 | mov [opcode_prefix],0 |
- | 360 | mov [immediate_size],0 |
|
360 | movzx ebx,word [esi] |
361 | movzx ebx,word [esi] |
361 | mov al,[esi+2] |
362 | mov al,[esi+2] |
362 | add ebx,assembler |
363 | add ebx,assembler |
363 | add esi,3 |
364 | add esi,3 |
364 | jmp near ebx |
365 | jmp near ebx |
Line 1585... | Line 1586... | ||
1585 | mov eax,[esi+4] |
1586 | mov eax,[esi+4] |
1586 | stos dword [edi] |
1587 | stos dword [edi] |
1587 | mov ax,[esi+8] |
1588 | mov ax,[esi+8] |
1588 | add ax,3FFFh |
1589 | add ax,3FFFh |
1589 | cmp ax,8000h |
1590 | jo value_out_of_range |
- | 1591 | cmp ax,7FFFh |
|
1590 | jae value_out_of_range |
1592 | jge value_out_of_range |
- | 1593 | cmp ax,0 |
|
- | 1594 | jg tword_exp_ok |
|
- | 1595 | mov cx,ax |
|
- | 1596 | neg cx |
|
- | 1597 | inc cx |
|
- | 1598 | cmp cx,64 |
|
- | 1599 | jae value_out_of_range |
|
1591 | mov bl,[esi+11] |
1600 | cmp cx,32 |
- | 1601 | ja large_shift |
|
- | 1602 | mov eax,[esi] |
|
- | 1603 | mov edx,[esi+4] |
|
- | 1604 | mov ebx,edx |
|
- | 1605 | shr edx,cl |
|
- | 1606 | shrd eax,ebx,cl |
|
- | 1607 | jmp tword_mantissa_shift_done |
|
- | 1608 | large_shift: |
|
- | 1609 | sub cx,32 |
|
- | 1610 | xor edx,edx |
|
- | 1611 | mov eax,[esi+4] |
|
- | 1612 | shr eax,cl |
|
- | 1613 | tword_mantissa_shift_done: |
|
- | 1614 | jnc store_shifted_mantissa |
|
- | 1615 | add eax,1 |
|
- | 1616 | adc edx,0 |
|
- | 1617 | store_shifted_mantissa: |
|
- | 1618 | mov [edi-8],eax |
|
- | 1619 | mov [edi-4],edx |
|
- | 1620 | xor ax,ax |
|
- | 1621 | test edx,1 shl 31 |
|
- | 1622 | jz tword_exp_ok |
|
- | 1623 | inc ax |
|
- | 1624 | tword_exp_ok: |
|
- | 1625 | mov bl,[esi+11] |
|
1592 | shl bx,15 |
1626 | shl bx,15 |
1593 | or ax,bx |
1627 | or ax,bx |
1594 | stos word [edi] |
1628 | stos word [edi] |
1595 | add esi,13 |
1629 | add esi,13 |
1596 | ret |
1630 | ret |
Line 1987... | Line 2021... | ||
1987 | stos word [edi] |
2021 | stos word [edi] |
1988 | nops_stosw_ok: |
2022 | nops_stosw_ok: |
1989 | rep stos dword [edi] |
2023 | rep stos dword [edi] |
1990 | jmp reserved_data |
2024 | jmp reserved_data |
1991 | 2025 | err_directive: |
|
- | 2026 | mov al,[esi] |
|
- | 2027 | cmp al,0Fh |
|
- | 2028 | je invoked_error |
|
- | 2029 | or al,al |
|
- | 2030 | jz invoked_error |
|
- | 2031 | jmp extra_characters_on_line |
|
- | 2032 |