Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need some help on Assembler Code

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

Active User


Joined: 10 Aug 2009
Posts: 158
Location: India

PostPosted: Thu Aug 28, 2014 11:36 am    Post subject: Need some help on Assembler Code
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 User


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

PostPosted: Thu Aug 28, 2014 4:38 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Aug 28, 2014 5:01 pm    Post subject: Reply to: Need some help on Assembler Code
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 User


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

PostPosted: Thu Aug 28, 2014 9:21 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us