Need help with my program, please!



High Level Assembler(HLASM) for MVS & VM & VSE

Need help with my program, please!

Postby pintu1228 » Mon Mar 23, 2015 12:43 am

I am having trouble fixing my code to print out the data from a file from my school server.

i keep getting errors like abend and termination error, can someone help me fix this issue?


Thanks
You do not have the required permissions to view the files attached to this post.
pintu1228
 
Posts: 48
Joined: Mon Mar 23, 2015 12:41 am
Has thanked: 5 times
Been thanked: 0 time

Re: Need help with my program, please!

 

Re: Need help with my program, please!

Postby Robert Sample » Mon Mar 23, 2015 2:30 am

You are getting the S0C4 because you are attempting to load register 3 from register 7 and register 7 has junk in it -- F4F4F4F4 is 4444 in hexadecimal. Almost certainly address F4F4F4F4 is not part of your program and hence the storage exception. Several other registers have the same value, so you have a basic problem in that you are loading junk and propagating it. You need to use the ASSIST facilities to trace through your program to find out where you're loading the bad data from.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Need help with my program, please!

Postby pintu1228 » Mon Mar 23, 2015 2:39 am

can you help me with this?

I have been trying for hours to figure this out.
pintu1228
 
Posts: 48
Joined: Mon Mar 23, 2015 12:41 am
Has thanked: 5 times
Been thanked: 0 time

Re: Need help with my program, please!

Postby steve-myers » Mon Mar 23, 2015 5:14 am

Mr. Sample has told you just about everything that can be deduced from the file - which apparently was downloaded to your workstation incorrectly - you sent to us. To help you more we at least require the program. By the way, I can tell you Mr. Sample is very good at extracting useful information from marginal data. Certainly better than me!

As for spending hours, I got news for you. I've been writing Assembler code for 45 years, and I've been known to get stuck like that, though not very often. You just have to keep plugging away at it. Mr. Sample mentioned that you have bad data in reg 7. Try to figure out how the bad data got into reg 7 in the first place and you may have solved your problem.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Need help with my program, please!

Postby BillyBoyo » Mon Mar 23, 2015 6:18 am

I think you're taking "subroutine" far too seriously. Probably due to experience in other languages. If you are just branching to/returning from different areas in the same program, there is no need to for the Save Area, STM, LM stuff. In attempting to do that, you've got a little confused. Your comments are "out by one", the initial R15 value is the address of the entry-point (MAIN as you have called it), not BUILD.

Have a close look at the output you received from XDUMP TABLE,300. That you would expect to show 300 bytes from the start of the storage labelled TABLE. But, if you look, you'll see instructions there at the beginning. Your TABLE is eight bytes "out".

You have XREAD into your table. You then XDECI on the space you reserved for CARD. I don't think you're testing for the * correctly to stop doing the XDECI.

Your PLINE is only one byte.

I think you need to take a long step backward, and carefully sort all these out. Your multiple "save areas" are getting trashed, and then you load the trashed values into the Registers (LM) and attempt to use them.

The code is in the attachment.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need help with my program, please!

Postby Robert Sample » Mon Mar 23, 2015 6:32 am

1. In BUILD, you point R2 to the start of TABLE. You then use XREAD 0(R2),80 to wipe out the first 80 bytes of TABLE and replace them with the record you are reading instead of using XREAD CARD,80.
2. You XDUMP TABLE before you branch to the subroutine. You do not use XDUMP to check TABLE after the subprogram -- WHY?
3. Your BUILD subprogram does not initialize R5 yet uses it to increment through TABLE.
4. Your MAIN program does some really weird register stuff -- LA R9,1 followed by L R9,DIV for example (why use the LA if you just throw away that value immediately?) The same question for the next two lines of code with R10.
5, You pass 4 parameters to PRINT yet you use LM R2,R4 -- what about the 4th parameter?
6. Your PRINT subprogram uses R7 without initializing it, just as BUILD used R5.
7. PLINE is defined wrong -- it should be at least 75 bytes long (CL75 or 75CL1) to match your XPRNT. And carriage control comes FIRST in the line, so if you think the 75 bytes of spaces before PLINE will be used for your XPRNT, you are wrong; those 75 bytes are not being used by PRINT for anything.
I did NOT bring up my ASSIST documentation to check the syntax for your ASSIST commands (XREAD, XPRNT, end of file and so forth). They may be right but you need to double-check each of them.

Since you did not use CARD but the actual TABLE in your XREAD in BUILD, you have spaces for a batch of table entries. Spaces most likely get converted to 4444 in the XDECO and hence the ABEND in PRINT. The program is attempting to read up to 70 values in from cards, store them in a table, and print all the input values on a report. Whether or not this is what you want the program to do is another question; as written, the program is reading / storing / printing table entries (when the various problems and issues are corrected, of course).
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post