flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > bug with stub |
Author |
|
jekyll 17 Jun 2004, 01:43
i write stub program:
Code: format MZ entry main:start segment main use16 start: when i try to make PE with this stub compiler crashes. fasm 1.52 |
|||
17 Jun 2004, 01:43 |
|
Tomasz Grysztar 17 Jun 2004, 13:05
pelaillo wrote: You have created a multisegment exe (With MZ header) and PE is expecting a plain binary file (org 100) without exe header as stub. No, it generally accepts the MZ programs, too (and this is even the recommended option). I have to look into that bug. |
|||
17 Jun 2004, 13:05 |
|
Tomasz Grysztar 18 Jun 2004, 10:21
OK, fixed it for the next release. If you want to quickly fix it yourself in current release, find this piece of code in FORMATS.INC (for fasm 1.52 it should be around line 551):
Code: movzx ecx,word [esi+4] dec ecx shl ecx,9 sub ecx,eax movzx eax,word [esi+2] mov edx,edi add ecx,eax push ecx dec ecx shr ecx,3 inc ecx shl ecx,1 lea eax,[edi+ecx*4] cmp edi,[display_buffer] jae out_of_memory xor eax,eax rep stos dword [edi] pop ecx call read call close add the "jz read_stub_code" jump and "read_stub_code" label, so it becomes: Code: movzx ecx,word [esi+4] dec ecx shl ecx,9 sub ecx,eax movzx eax,word [esi+2] mov edx,edi add ecx,eax jz read_stub_code push ecx dec ecx shr ecx,3 inc ecx shl ecx,1 lea eax,[edi+ecx*4] cmp edi,[display_buffer] jae out_of_memory xor eax,eax rep stos dword [edi] pop ecx read_stub_code: call read call close |
|||
18 Jun 2004, 10:21 |
|
jekyll 21 Jun 2004, 14:57
Great! Thank you Privalov. :D
|
|||
21 Jun 2004, 14:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.