develooper Front page | perl.perl5.porters | Postings from December 2013

Re: An article on writing Perl extensions without XS

Thread Previous | Thread Next
From:
bulk88
Date:
December 17, 2013 21:36
Subject:
Re: An article on writing Perl extensions without XS
Message ID:
BLU0-SMTP1596582015BC65693C85ECFDFDB0@phx.gbl
Karl Williamson wrote:
> ISTR ax and ix being hardware register names in some assembly language 
> on some platform

On x86, ax is the 16 bit version (union) of general purpose register 
"A", as in AL, AH, EAX and RAX. The "A" stands for Accumulator but I'm 
not sure if that is an backronym or a nickname that became legitimized. 
There are some x86 opcodes that can be written in a shorter byte 
sequence when using EAX vs any GPR. There is also a SI/DI (now extended 
to ESI/EDI/RSI/RDI) called Source Index and Destination Index. SI/DI 
have a strlen() and memcpy() clone opcode that requires the pointers to 
be in SI/DI. Most literature says never to use the strlen/memcpy 
instruction because they are "slow", "deprecated", and "emulated in 
microcode, not silicon". A small amount of literature says to use them 
on AMD64 CPUs vs doing the algorithm using more modern ops and that they 
are faster on AMD64 than mov, test, increment, jmpcondition.

Google says IX is a Z80 register that contains a pointer to memory 
address, on which to do an op. The op doesn't take a register from a 
pool, it only works on IX. I'm not sure if this influenced P5 in any way.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About