Page 1 of 2

help with MVS assembler language

PostPosted: Mon Feb 09, 2009 9:49 am
by dhalberger
I'm new to MVS assembler language and I need some help with my first program I'm supposed to create on my own. I'm supposed to write a program that calculates and prints the income tax due from multiplying the tax rate (15%) and the annual earning ($55,000). This is what I have so far:
BEGIN SAVE (14,12)
BALR 3,0
USING *, 3
ST 13,SAVE+4
LA 13,SAVE
ANNEARN DC CL5'55000'
*Annual Earning*
TAXRATE DC CL4'0.15'
*Tax Rate*
INCTXDU DS CL6
*Income Tax Due*
CALC PACK ANNEARN,TAXRATE
PACK INCTXDU
MP ANNEARN,TAXRATE
UNPK INCTXDU
END

It's probably totally wrong in construction, I know,.. my book doesn't explain things well enough and isn't easy to read. ("MVS Assembler Language")
Any help would be appreciated.
Thank you.

Re: help with MVS assembler language

PostPosted: Mon Feb 09, 2009 10:24 am
by dick scherrer
Hello and welcome to the forum,

Do you "speak" any other procedural programming languages or is this the first?

Suggest you use packed-decimal fields in your program. You also do not want to embed a decimal point. Refer to the syntax for the pack and unpk instructions - both require 2 operands.

Are you attending some class for assembler? Hopefully, there is a testing lab where you can work with the instructor or some other local mentor. The forum can help with understanding something specific, but we are not able to "teach" - it is just too large an undertaking.

my book doesn't explain things well enough and isn't easy to read. ("MVS Assembler Language")
Is this the book from Murach Publishing written by Kevin McQuillen with Anne Prince? This book (and the earlier assembler book that Kevin wrote alone) are two of the better assembler books for beginners. . .

Re: help with MVS assembler language

PostPosted: Mon Feb 09, 2009 11:09 am
by dhalberger
This is my first procedural programming language I'm learning. The only other programming language I'm familiar with is C#, and that's an object-oriented programming language. This class I'm in doesn't have a computer lab for this course so I have no where else to turn to for help. And yes, this is the book by Kevin McQuillen with Anne Prince.

The forum can help with understanding something specific, but we are not able to "teach" - it is just too large an undertaking.

I know what needs to be done (multiply a couple of numbers then print the result) and if I had the code to go along with it, I could more easily "read" into how I'm supposed to put all of the scattered details in the book into a couple of lines of code. Perhaps you can give me the base code for how to create such a program I'm expected to produce. If you can help me out with that, I'd be most thankful.

Re: help with MVS assembler language

PostPosted: Mon Feb 09, 2009 12:05 pm
by dhalberger
Sorry about the double post but I think I have most of the code in place as seen below; I just need some help creating the code that will "print the result" (display it onscreen), as i understand the result of the calculation will overwrite the value of the first operand, so I need to find a way to display that operand. It turns out that there is very relevant information to program I'm supposed to create in chapters the professor did not assign us to read; very aggravating indeed.
***********************************************************************
*         FILENAME:  TAX.MLC                                           
*         AUTHOR  :  *                                     
*         SYSTEM  :  PC/370                                           
*         REMARKS :  This program will display output to a calculation
***********************************************************************
             START 0
             REGS
BEGIN    BEGIN
             WTO   MESSAGE
             RETURN
ANNEARN  DS    CL5'55000'
*Annual Earning $55,000*
TAXRATE  DC    CL2'15'
*Tax Rate 15%*
CALC     PACK  ANNEARN,TAXRATE
             DP    ANNEARN,TAXRATE
             UNPK  ANNEARN,TAXRATE
PRTOUT ??
             END   BEGIN 

Re: help with MVS assembler language

PostPosted: Wed Feb 11, 2009 10:31 am
by dick scherrer
Hello,

See if this link will help:
http://www.simotime.com/asmtrixs.htm#SampleSourceCode

More about packed arithmetic and presenting the output (EDEit ins):
http://csc.colstate.edu/woolbright/PKARITH.HTM

Good luck and i'll keep an eye out for updates.

Re: help with MVS assembler language

PostPosted: Sat Feb 14, 2009 3:55 am
by dick scherrer
Hello,

So, is it soup yet?

Hadn't seen anything recently and thought i'd ask. . .

Have a great weekend :)

d

Re: help with MVS assembler language

PostPosted: Mon Feb 16, 2009 12:16 pm
by dhalberger
Thanks for the links, Dick. I looked over them and found both a bit helpful. Would you by any chance know anybody who is good at this stuff for me to talk to about it?

Thanks.

Re: help with MVS assembler language

PostPosted: Mon Feb 16, 2009 10:41 pm
by dick scherrer
Hello,

If you have questions/problems post the specifics here and someone should be able to offer suggestions.

We won't write the solution, but will help get it done with you.

As far as someone to talk with, hopefully, there is some system programmer in your organization who you could speak with.

Re: help with MVS assembler language

PostPosted: Tue Feb 17, 2009 7:32 am
by dick scherrer
Hello,

Something i'd suggest you download so you'll have it locally is the "Principles of Operations"
http://publibfp.boulder.ibm.com/cgi-bin ... /CCONTENTS

This is possibly the most important manual for working with assembler or troubleshooting dumps.

Re: help with MVS assembler language

PostPosted: Mon Mar 02, 2009 10:26 am
by dhalberger
Sorry, it's been a while.
I couldn't get the zap arithmetic working, but thats not my concern anymore.
This week I'm faced with multiplying two numbers using binary arithmetic. The two numbers will be from an input file and stored in a buffer (storage). Perhaps you can help me by providing some links? The book doesn't give me sufficient examples to piece together all the text that is accompanied by it.
Thanks.
P.S. I'm a college student and have no one I can see in-person to help me with this.