www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/03/09:44:51

Message-ID: <39103287.92B19ACF@htsol.com>
Date: Wed, 03 May 2000 17:07:04 +0300
From: Yoram Hofman <yoram AT htsol DOT com>
Organization: Hi-Tech Solutions
X-Mailer: Mozilla 4.61 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Assembly code doesn't work properly.
NNTP-Posting-Host: 212.25.87.147
X-Trace: 3 May 2000 17:06:17 +0200, 212.25.87.147
Lines: 82
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.
--------------8284094661CA2C93DA57E5FA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Assembly code doesn't work properly.
I need to transfer an image from frame memory controller (far physical
address - "src" in my program) to DRAM.
To optimize the transfer I wrote simple assembly code (my first)
The problem is that it works well in little application. But when I put
this module (.c file as is) to our project it stops to work.

int Read_image_directly(unsigned long src, unsigned char * dest)
{
 unsigned long dest_index = 0;
 unsigned long src_index  = src;
 src_index += IMAGE_START;
 src_index += 1L;

 _farsetsel(mem_sel);

/*      this is original code I want to optimize
 while( dest_index < IMAGE_SIZE )  //IMAGE_SIZE = 154560 bytes
 {
  *(dest + dest_index) = _farnspeekb( src_index );
  dest_index++;
  src_index = src_index + 4;
 }
*/

/* my assembly */
 asm("m_loop:
            cmpl $154559, -4(%ebp)
            jle m_code
            jmp m_end
          m_code:
            movl 12(%ebp),%eax
            movl -4(%ebp),%edx
            addl %edx,%eax
            movl -8(%ebp),%edx
            .byte 0x64
            movb (%edx),%cl
            movb %cl,(%eax)
            incl -4(%ebp)
            incl -8(%ebp)
            incl -8(%ebp)
            incl -8(%ebp)
            incl -8(%ebp)
            jmp m_loop
          m_end:");

 return 1;
}
What's the problem?
One more question for what ".byte 0x64" do I need? (It doesn't work at
all without it)
Lev Nikulin

--------------8284094661CA2C93DA57E5FA
Content-Type: text/x-vcard; charset=us-ascii;
 name="yoram.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Yoram Hofman
Content-Disposition: attachment;
 filename="yoram.vcf"

begin:vcard 
n:Hofman;Yoram
x-mozilla-html:FALSE
org:Hi-Tech Solutions
version:2.1
email;internet:yoram AT htsol DOT com
tel;cell:(972)52614327
tel;fax:(972)66441870
tel;work:(972)66441890
title:R&D Mgr & Intl Mkt
adr;quoted-printable:;;3 Industry Rd    ITH Building=0D=0ARamat Gabriel Industrial Park=0D=0APoBox #133;Migdal Haemek;;10500;Israel
fn:Yoram Hofman
end:vcard

--------------8284094661CA2C93DA57E5FA--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019