[Lazarus] RE : Convert assembler to Pascal
Leonardo M. Ramé
l.rame at griensu.com
Tue Sep 13 16:30:30 CEST 2011
On 2011-09-13 10:50:06 -0300, Leonardo M. Ramé wrote:
> On 2011-09-13 15:40:23 +0200, Ludo Brands wrote:
> > Procedure XorMemPrim(var Mem1; const Mem2; Count : Cardinal);
> > Var i:integer;
> > p1,p2:pointer;
> > Begin
> > p1:=@Mem1;
> > p2:=@Mem2;
> > for i:=1 to count div 4 do
> > begin
> > pdword(p1)^:=pdword(p1)^ xor pdword(p2)^;
> > p1:=p1+4;
> > p2:=p2+4;
> > end;
> > For i:=1 to count mod 4 do
> > begin
> > pbyte(p1)^:=pbyte(p1)^ xor pbyte(p2)^;
> > p1:=p1+1;
> > p2:=p2+1;
> > end;
> > End;
> >
> > Ludo
>
> Wow!, that was fast. Thanks Ludo, I'll try it.
>
Ludo, I did a quick comparison of the results against the Delphi 7
counterpart and the doesn't match.
Also, I tried to compile this in Delphi and I got "Ordinal type
required" on "p1 := P1 + 4". How can avoid this issue?.
--
Leonardo M. Ramé
http://leonardorame.blogspot.com
More information about the Lazarus
mailing list