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 Member


Joined: 30 Nov 2013
Posts: 508
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: 7315

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 Member


Joined: 30 Nov 2013
Posts: 508
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 Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm


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