help with MVS assembler language



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

help with MVS assembler language

Postby dhalberger » Mon Feb 09, 2009 9:49 am

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.
dhalberger
 
Posts: 5
Joined: Sun Feb 08, 2009 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: help with MVS assembler language

Postby dick scherrer » Mon Feb 09, 2009 10:24 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: help with MVS assembler language

Postby dhalberger » Mon Feb 09, 2009 11:09 am

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.
dhalberger
 
Posts: 5
Joined: Sun Feb 08, 2009 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: help with MVS assembler language

Postby dhalberger » Mon Feb 09, 2009 12:05 pm

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 
dhalberger
 
Posts: 5
Joined: Sun Feb 08, 2009 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: help with MVS assembler language

Postby dick scherrer » Wed Feb 11, 2009 10:31 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: help with MVS assembler language

Postby dick scherrer » Sat Feb 14, 2009 3:55 am

Hello,

So, is it soup yet?

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

Have a great weekend :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: help with MVS assembler language

Postby dhalberger » Mon Feb 16, 2009 12:16 pm

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.
dhalberger
 
Posts: 5
Joined: Sun Feb 08, 2009 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: help with MVS assembler language

Postby dick scherrer » Mon Feb 16, 2009 10:41 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: help with MVS assembler language

Postby dick scherrer » Tue Feb 17, 2009 7:32 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: help with MVS assembler language

Postby dhalberger » Mon Mar 02, 2009 10:26 am

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.
dhalberger
 
Posts: 5
Joined: Sun Feb 08, 2009 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to PL/I