Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 160
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:

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
CKBRKER  CLI   ENDFLAG,X'FF'
         BE    MVZERO
         CLC   INBRKER(5),BRKRNO   CMP -- 8

Variable Declaration:

ACBRKNO  DS    PL4
BRKRNO   DC    CL5'0'
INBRKER  DS    CL5



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

Quote:
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.

Thanks,
Sati
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
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

Code:
STC   R6,BRKRNO+4             


Garry.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10310
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

Code:
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 Sr SW Eng-Rocket Software (Assembler,... Kenneth Barton Lasky Mainframe Jobs 0 Fri Aug 25, 2017 12:29 am
No new posts Dump analysis of an assembler module monica1 PL/I & Assembler 4 Tue May 09, 2017 10:05 am
No new posts Need help in building a logic Benchwarmer All Other Mainframe Topics 4 Wed Feb 22, 2017 2:49 am
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us