Article View: borland.public.cppbuilder.nativeapi
Article #236Re: help sought, possible asm/cpu/other problem???
From: Bob Gonder
Date: Thu, 17 Jul 2008 00:43
Date: Thu, 17 Jul 2008 00:43
44 lines
2125 bytes
2125 bytes
Remy Lebeau (TeamB) wrote:
>Why use assembly for that? A simple loop would be easier to manage:
It is part of a memory manager, he wants it small and fast.
> int BytesOK(unsigned char *pAddr, unsigned char bval, unsigned nbytes)
> {
> for(unsigned ui = 0; i < nbytes; ++i)
> {
> if( pAddr[ui] != bval )
> {
> if( !MM3AdminData.survivalmode )
> {
> if( MM3AdminData.callint3onerror )
> __asm int 3 ;
> else
> return 0;
> }
> break;
> }
> }
> return 1;
> }
Your returns are backwards.
sb 1 for fail, 0 for ok.
if/else incorrect.
> int BytesOK(unsigned char *pAddr, unsigned char bval, unsigned nbytes)
> {
> for(unsigned ui = 0; i < nbytes; ++i)
> {
> if( pAddr[ui] != bval )
> {
> if( !MM3AdminData.survivalmode )
> {
> if( MM3AdminData.callint3onerror )
> __asm int 3 ;
> }
return 1;
> }
> }
> return 0;
> }
Technical Details
Message-ID:
<v25t74t1gkt8qe9nebrgp5l47prssdrlaq@4ax.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> <487e6fe0$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:43:09 -0700 Message-ID: <v25t74t1gkt8qe9nebrgp5l47prssdrlaq@4ax.com> References: <487e5d3c$1@newsgroups.borland.com> <487e6fe0$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 1216255387 67.77.147.31 (16 Jul 2008 17:43:07 -0700) Lines: 46 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