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


Explain the Assembler Logic

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

Active User

Joined: 10 Aug 2009
Posts: 158
Location: India

PostPosted: Fri Apr 30, 2010 1:12 pm    Post subject: Explain the Assembler Logic
Reply with quote

Hi All,

My heartfelt thank to all of you for your kind support and help.

Just I moved to Assembler project where in I do not have 1 day experience in Assembler.

I was analyzing following peace of code:

         UNPK  BRKRNO(5),ACBRKNO+1(3) -- 1
         MVZ   BRKRNO+4(1),=X'F0'     -- 2
         CLI   BRKRNO,X'F0'           -- 3
         BL    CKBRKER                -- 4
         IC    R6,BRKRNO              -- 5
         SH    R6,=H'57'              -- 6
         STC   R6,BRKRNO              -- 7
         BE    MVZERO
         CLC   INBRKER(5),BRKRNO   CMP -- 8

Variable Declaration:

BRKRNO   DC    CL5'0'

1 - 8 number are line number and my understanding to corresponding line is mentioned below.

1. Convert ACBRKNO i.e. packed Agent No (from 2nd Position) to BRKRNO(5)zoned Agent No
2. Moves the zone portion (left half of a byte).
3. Compare BRKRNO with X'F0'
4. Branch to CKBRKER when BRKRNO is low.
5. Insert BRKRNO into R6 register at right most side.
6. Subtracts 57 from R6 register i.e. from last two-byte value.
7. Stores one character at right most byte from BRKRNO.
8. Character comparision.

Please correct me if my understanding is wrong.

Kindly, explain me this logic with an example. Please.

Thanks in advance.

Back to top
View user's profile Send private message

Garry Carroll

Active Member

Joined: 08 May 2006
Posts: 986
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Apr 30, 2010 2:07 pm    Post subject:
Reply with quote

I'd suggest you refer to the zArchitecture Principles of operations manual at http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dz9zr002/CCONTENTS

#5 in your example does insert a character into the rightmost byte of R6 - but the other 3 bytes are unchanged.

#6 subtract of 57 may not give you the expected result because of #5.

#7 the single character will be stored in the first (leftmost) byte of BRKRNO. To store in the rightmost byte you need to code

STC   R6,BRKRNO+4             

Back to top
View user's profile Send private message

Global Moderator

Joined: 14 Mar 2007
Posts: 10176
Location: italy

PostPosted: Fri Apr 30, 2010 2:22 pm    Post subject: Reply to: Explain the Assembler Logic
Reply with quote

and to add a bit more ..

the result of the unpack will yield an F zone for every digit,
the move zone will force a F zone for the last digit
all this implies that all all the digits will be grater than F0
the comparison as coded will always give a false and the negative branch will be never taken

but if the code is trying do fiddle around with some kind of hex conversion
to printables

x'A.....' ==> x'FAF.F.F.F.'

x'FA' ==> 250 ; 250 - 57 = 193 ==> x'C1' ==> c'A'

the code would be wrong because of my previous explanation
the comparison should be made with an x'FA'

not the best way to do it
unless the only byte to be converted is the first one
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 Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am
This topic is locked: you cannot edit posts or make replies. MVS Assembler profiles for Pune Locat... shailesh_do Mainframe Jobs 0 Mon Feb 22, 2016 6:21 pm
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm

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