IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need some help on Assembler Code


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Thu Aug 28, 2014 11:36 am
Reply with quote

Hi All,

I am analysing an Assembler program and I am not able to understand the below code.

Code:
 CLI   RPPTR(R14),X'FE'         
 NC    RPEX(,R14),RPEX(R14)
 BNZ   RTRNLD

 RPPTR    EQU   X'08',04,C'F'
 RPEX     EQU   X'0C',04,C'F'


Could someone explain me the functionality and the relationship between CLI and NC statements.

Thanks in advance.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Aug 28, 2014 4:38 pm
Reply with quote

Read the discussion of the two operations in Principles of Operation. If there is something you do not understand, ask here.

Another important difference is the NC instruction operates on 4 bytes of data since you defined the length of RPEX as 4. The CLI instruction operates on one byte of data.

Both instructions set the condition code. Since you do not provide a conditional branch instruction after the CLI instruction, it effectively does nothing since the NC instruction resets the condition code.

To me, neither instruction, as coded, makes any sense at all.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 28, 2014 5:01 pm
Reply with quote

Code:
Set thing to test by Method 1
Set thing to test by Method 2
Test thing to test


Method 1 is superfluous. Perhaps someone inserted the Method 2 without realising its effects, and perhaps it looked like it was working, but was not well tested. Or put the CLI in without a clue of what they were doing. Or deleted something interpreting the first condition code setting. Or something else.

The code at RTRNLD may give you some clues as which was there first, so which the BNZ was originally intended for.

Also, look to your Source Management system and see the change, what it was connected to, who did it, and go at it that way.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Aug 28, 2014 9:21 pm
Reply with quote

Bill - BNZ is not commonly used after a CLI, though it is the same as BNE. Condition code 00 will not be set by the NC unless all the bits are 0; I can only conclude the NC is what I would regard as a confusing way to test if the 4 bytes are binary 0s.

Since all we have are the confused EQU statements and instructions that specify the symbols used in the EQU statements, it is difficult to make any conclusion about the intent of the code. Worse, the EQU for RBPTR identifies the presumed data area as 4 bytes, but the CLI just tests 1 byte.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top