Article View: borland.public.cppbuilder.nativeapi
Article #257Re: help sought, possible asm/cpu/other problem???
From: Larry Griffiths
Date: Fri, 18 Jul 2008 00:49
Date: Fri, 18 Jul 2008 00:49
50 lines
2019 bytes
2019 bytes
I think I like this better...
#########################################################
bool BytesOK( unsigned char *pAddr, unsigned char bval, unsigned nbytes )
{
_asm
{
mov ecx, nbytes // Number of bytes to compare
jz ItsOK:
cld
mov al, bval // Value to compare
mov edi, pAddr // Address of buffer
repe scasb
jz ItsOK:
}
//if(!MM3AdminData.survivalmode)
// if(MM3AdminData.callint3onerror) __asm int 3 ;
return 0 ;
ItsOK:
return 1 ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ASMButtonClick(TObject *Sender)
{
long BytesOKCount = 0;
long BytesNotOKCount = 0;
unsigned char* Buffer[257] = { "BAAB" };
for( int a = 0; a < 5; a++ )
{
if( BytesOK( Buffer[0] + a, 'A', a ) )
{
BytesOKCount++;
}
else
{
BytesNotOKCount++;
}
}
}
#########################################################
Larry Griffiths
Technical Details
Message-ID:
<487fe893$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<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: "Larry Griffiths" <lgriffiths@cox.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <487e5d3c$1@newsgroups.borland.com> Subject: Re: help sought, possible asm/cpu/other problem??? Date: Thu, 17 Jul 2008 19:49:22 -0500 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 24.255.224.5 Message-ID: <487fe893$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1216342163 24.255.224.5 (17 Jul 2008 17:49:23 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail