🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #237

Re: help sought, possible asm/cpu/other problem???

#237
From: Bob Gonder
Date: Thu, 17 Jul 2008 00:48
55 lines
2384 bytes
dhoke wrote:

>(Thanks in advance...  Sorry if this seems off-topic to some, but it really 
>didn't seem non-technical in nature.)

Perhaps the TASM group?

>1)Please report if you spot an error in the BytesOK() routine.  Its intended 
>purposes is to scan the nbytes bytes starting at location pAddr, verifying 
>that all of those bytes have value bval.  It does not explicitly clear 
>direction flag, but CPU pane reports direction flag as clear (see further 
>below.)

Well, there's an error to start:
It Does clear the direction flag.

>int BytesOK(unsigned char *pAddr, unsigned char bval, unsigned nbytes)
>{
>    unsigned ui ;
Warning: ui not used
>    _asm
>    {
>         cld
>         mov   al, bval
>         mov   ecx, nbytes
>         mov   edi, pAddr
>         repe  scasb
>         lahf
>         //now, which bit is the zero/equal bit?
>    } ;
>    //if(_ECX)
>    if(!(_EAX & 0x4000)) //0x40 set in AH
>    {
>         if(!MM3AdminData.survivalmode)
>            if(MM3AdminData.callint3onerror) __asm int 3 ;
>         return 1 ;
>    }
>    return 0 ;
>}
>pAddr == 0x044003e0
>bval == 0xff
>nbytes == 32
>dump pane all bytes from 0x044003E0 through 0x044003FF as byte value 0xff

I think you need to look a bit closer.
 
>ECX == 0x7

There were 7 bytes to go when it failed.

>EDI ==		0x044003F9
>pAddr ==	0x044003e0
		0x00000019 = 25
pAddr[25] != bval
might be [24], forget exactly how repe handles edi.
Technical Details
Message-ID: <op3t7457p6inr75u4kkbfsr16r98gen5rm@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed.kamp.net!newsfeed.kamp.net!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <487e5d3c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ced19374283c232f
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <none@nowhere.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: help sought, possible asm/cpu/other problem???
Date: Wed, 16 Jul 2008 17:48:33 -0700
Message-ID: <op3t7457p6inr75u4kkbfsr16r98gen5rm@4ax.com>
References: <487e5d3c$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.147.31
X-Trace: newsgroups.borland.com 1216255712 67.77.147.31 (16 Jul 2008 17:48:32 -0700)
Lines: 58
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed.kamp.net!newsfeed.kamp.net!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail