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

Re: An article on writing Perl extensions without XS

Thread Previous | Thread Next
December 17, 2013 21:36
Re: An article on writing Perl extensions without XS
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About