flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > specific bug in load directive

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 314
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
He is only appearing under pure DOS and only with dos version of fasm.
Code:
macro LoadTest Name
{
  virtual at 0
  NameStart::
    db Name
  Length = $
  end virtual
  repeat Length
    load LETTER byte from NameStart:(%-1)
  end repeat
}
        LoadTest "String"    


Code:
flat assembler  version 1.71.04  (3283967 kilobytes memory)
A.ASM [12]:
        LoadTest "String"
A.ASM [9] LoadTest [7]:
    load LETTER byte from NameStart:(%-1)
error: value out of range.    

_________________
smaller is better
Post 12 Oct 2012, 15:07
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
By "pure" do you mean real mode (without DPMI)? Does the bug disappear if you force it to run with DPMI (for example by installing EMM386 and DPMI driver)?
Post 12 Oct 2012, 16:45
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 314
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
DPMI may be present or not.
Post 12 Oct 2012, 17:16
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
Even if DPMI is present, but you are still in real mode, not V86, fasm will use the real mode instead. Have you tried in V86 mode too? Is FASMD affected by the same bug?

And what version of DOS is it?
Post 12 Oct 2012, 17:24
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 314
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
I tested it with HDPMI32 and JEMM386, MS-DOS version 7.10.
FASMD is not affected this bug.
Post 12 Oct 2012, 19:30
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
So far I tested it under MS-DOS 6.22, but I was unable to reproduce the bug. Do you think it's specific to that DOS version, or perhaps it's related to some other factors?
Post 15 Oct 2012, 07:43
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 314
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
In dos I have 3.2 GB of the free memory. The bug is caused by it.
After starting fasm in with parameter "-m1024", everything is all right.
Code:
      data_address_type_ok:
        mov     ebx,edi
        xor     ecx,ecx
        add     ebx,eax
        adc     ecx,edx
        jnz     bad_data_address        ;<- BUG in this line
        mov     eax,ebx
        sub     eax,[ds:ebp+18h]
        jc      bad_data_address
        movzx   ecx,[operand_size]
        add     eax,ecx
        cmp     eax,[ds:ebp+1Ch]
        ja      bad_data_address
        clc
        ret    

I tested it with my debugger in unreal mode.

_________________
smaller is better


Last edited by CandyMan on 15 Oct 2012, 19:00; edited 1 time in total
Post 15 Oct 2012, 13:01
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
Thank you, now I see where the problem is. The DOS reference was in fact a bit misleading, since it made me test the problem on machine with 24 MB of memory. Very Happy
Post 15 Oct 2012, 13:17
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
Please try it know and let me know if this fixes the problem.
Post 15 Oct 2012, 16:51
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 314
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
The bug still is appearing.
Post 15 Oct 2012, 19:28
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7751
Location: Kraków, Poland
Tomasz Grysztar
And now?
Post 15 Oct 2012, 21:46
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 314
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
Now he is acting.
Thanks.
Post 16 Oct 2012, 06:16
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.