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: 546
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: 546
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
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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