× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The following are the first 3 PowerPC instructions the RPG compiler emits
when an immediate value is added to a pointer.

Here is the RPG:
 d pData          s            *
 d pResult        s            *
  /free
       pResult    = pData + 352 ;

Here are the PowerPC instructions:
  LQ     24, 0x1e50(30), 6
  SELRI  26, 25, 0, 41
  ADDI   18, 26, 352

LQ ( load quad word ) loads the 16 bytes ( an os400 pointer ) starting at EA
(effective address ) reg30 + 0x1e50 into registers 24 and 25.

SELRI is taking register 25 ( the address portion of the loaded pointer ),
doing something to it and the result ends up in reg26.

ADDI adds 352 ( pData + 352 ) to reg26 and places the result in reg18.

I have two questions.  What is the 3rd operand of the LQ instruction used
for?
  LQ  24, 0x1e50(30), 6

This very good PowerPC assembler reference site
http://www.nersc.gov/vendor_docs/ibm/asm/mastertoc.htm
http://www.nersc.gov/vendor_docs/ibm/asm/lq.htm#lq_instruction

calls the 3rd operand "PT" and says it is a 4 bit unsigned immediate value.

What is the SELRI instruction?  There is also a SELRR which appears to be
pointer related also.  I cant find online documentation for those
instructions.

-Steve Richter



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.