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
 

 

Data overflow in Assebler routine.

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

New User


Joined: 05 May 2005
Posts: 50

PostPosted: Mon Jul 13, 2009 12:39 pm    Post subject: Data overflow in Assebler routine.
Reply with quote

Hi Friends.

I am analyzing a job failure related to assembler routine.
The assembler routine abends due data over flow with registers.

The concerned code is given below for your kind reference.

Code:
           AP    0(0,R2),0(0,R3)   ---> here overflow of data occurs
           BO    DUMP           
END        EQU   *               
           L     R13,SAVEREGS+4 
           RETURN (14,12),RC=0   
DUMP       DS    0H             
           ABEND 0069,DUMP       ----> here it fails wit user- bend

Please suggest me solution to overcome this problem.
Thanks,
Nandakumar
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon Jul 13, 2009 1:03 pm    Post subject: Reply to: Data overflow in Assebler routine.
Reply with quote

Quote:
abends due data over flow with registers.

registers have nothing to do with the abend
the AP instruction is a SS ( storage to storage ) operation
and the registers are used as standard components of a base+displacement addressing scheme

Code:
AP 0(0,R2),0(0,R3)


I suspect You are hiding something,
usually it does not make any sense to add two one byte packed numbers
statistically You will get an overflow in the....
45% of the cases for positive only operands
24.9% of the cases for mixed sign operands

so it would be fair to describe better the issue and the environment
Back to top
View user's profile Send private message
nandakumar
Warnings : 2

New User


Joined: 05 May 2005
Posts: 50

PostPosted: Mon Jul 13, 2009 2:36 pm    Post subject:
Reply with quote

Hi enrico ,

The below given is the concerned assembler code and while executing the code the job failes with U0069 abend , it is conded in the routine itself.

I want to know why the assembler routine failing.

************************************************************

TITLE 'NRADAR1 - ADDS ELEMENTS OF ONE DIMENSIONALARRAYS'
NRADAR1 START 0
SAVE (14,12)
BALR R12,0
USING *,R12
ST R13,SAVEREGS+4
LA R13,SAVEREGS
LM R2,R6,0(R1)
ICM R2,8,=X'00' CLEAR HIGH ORDER BYTE OF
ICM R3,8,=X'00' EACH TABLE ADDRESS REGISTER
L R4,0(0,R4)
L R6,0(0,R6)
*
* PARAMETER REGISTERS
*
* R2 - ADDRESS OF ARRAY TO WHICH VALUES ARE TO BE ADDED
* R3 - ADDRESS OF ARRAY FROM WHICH VALUES ARE TO BE ADDED
* R4 - NUMBER OF FIRST ELEMENT TO BE ADDED
* R5 - ADDRESS OF NUMBER OF ELEMENTS TO BE ADDED
*
* WORK REGISTERS
*
*
* R7 - LIMITING INDEX VALUE
* R8 - LENGTH CODE MODIFIER
* R10- MULTIPLY REGISTER
* R11- MULTIPLY REGISTER
EJECT
LR R11,R4 ) FIRST ELEMENT NUMBER
A R11,0(0,R5) ) + NUMBER OF ELEMENTS
S R11,=F'2' ) - 2
MR R10,R6 ) X LENGTH
LR R7,R11 ) = LIMITING INDEX VALUE
AR R7,R3
S R4,=F'1'
MR R4,R6 STARTING INDEX VALUE
LR R8,R6
S R8,=F'1' LENGTH CODE MOD.1 ACTUAL LENG
CVD R8,DECIMAL SET LENGTH CODE
MP DECIMAL,=P'17' MODIFIER FOR AP INSTRUCTION
CVB R8,DECIMAL (2 LENGTHS)
AR R2,R4 SET INITIAL ELEMENT ADDRESS
AR R3,R4 SET INITIAL ELEMENT ADDRESS
ADDARRAY EQU *
EX R8,ADD EXECUTE ADD, SUPPLYING LENGTH
BO DUMP DUMP ON OVERFLOW
AR R2,R6 INCREMENT
BXLE R3,R6,ADDARRAY
B END
ADD EQU *
AP 0(0,R2),0(0,R3)
BO DUMP
END EQU *
L R13,SAVEREGS+4
RETURN (14,12),RC=0
DUMP DS 0H
ABEND 0069,DUMP
*
SAVEREGS DS 9D
DS 0D
DECIMAL DS PL8
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
END

Thanks,
Nanda
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon Jul 13, 2009 3:19 pm    Post subject: Reply to: Data overflow in Assebler routine.
Reply with quote

You should be able to see it Yourself in the dump by looking at the content of
registers 2,3,8

anyway the r8 content is being built in an overly complicated way
here is a better one ( also easier to understand )
Code:
          lr r8,r6  load 1st lenght
          bctr r8,0 subctract one for ex
          sll r8,4 shift left 4 bits
          or r8,r6 fill nd length
          bctr r8,0 subctract one for ex
Back to top
View user's profile Send private message
nandakumar
Warnings : 2

New User


Joined: 05 May 2005
Posts: 50

PostPosted: Mon Jul 13, 2009 3:31 pm    Post subject:
Reply with quote

Hi enrico,

Can you please let me know how should I check the dump ?

This is first time that I am handling the assembler routine .


Thanks,
Nanda
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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