View previous topic :: View next topic
|
Author |
Message |
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
I'd suggest you refer to the zArchitecture Principles of operations manual at 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
Garry. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|