home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,267 of 2,978   
   Marco van de Voort to lothar.behrens@lollisoft.de   
   Re: Assembler question   
   05 Sep 06 13:09:32   
   
   From: marcov@stack.nl   
      
   f-up set.   
      
   On 2006-09-04, lothar.behrens@lollisoft.de  wrote:   
   >   
   > function Scan(var P; Offset: Integer; C: Char): Integer; assembler;   
   > asm   
   > 	CLD   
   > 	LES	DI,P   
   >         ADD     DI,&Offset             <--- &Offset is the problem   
   > 	MOV	CX,256   
   > 	MOV	AL, C   
   >         REPNE	SCASB   
   > 	SUB	CX,256   
   >         NEG	CX   
   >         XCHG	AX,CX   
   > end;   
      
   This is a variant that is fairly common, and hence has been dealt with in   
   FPC rtl to support this on each architecture in an efficient way:   
      
   http://www.freepascal.org/docs-html/rtl/system/indexchar.html   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca