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
 

 

how to code and compute an arithmetic expression

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

New User


Joined: 18 Oct 2008
Posts: 13
Location: Iran

PostPosted: Sat Jan 10, 2009 12:36 am    Post subject: how to code and compute an arithmetic expression
Reply with quote

i want to code and compute a simple arithmetic expression like below

exp = 3x^2 + 12/5x -3

may someone help me by introducing some source (sites,books,etc) or bring me some sample source codes.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Jan 10, 2009 1:13 am    Post subject:
Reply with quote

PL/I?
Assembler?
COBOL?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 10, 2009 1:17 am    Post subject:
Reply with quote

Hello,

In which language?
Back to top
View user's profile Send private message
ahmad

New User


Joined: 18 Oct 2008
Posts: 13
Location: Iran

PostPosted: Sat Jan 10, 2009 9:32 am    Post subject:
Reply with quote

sorry guys; i thought this part of forum dedicates to assmebly.

I want the code in assembler.
HLASM
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Sat Jan 10, 2009 9:46 am    Post subject:
Reply with quote

This is PL/1 and assembler -- not just assembler. The precise assembler instructions depend on whether or not you're dealing with floating point numbers or fixed values, but in general:
Code:
Load register,X
Multiply register,X
Multiply register,3
Save register,temp
Load register,X
Multiply register,12
Divide register,5
Subtract register,3
Add register,temp
Store register,exp
Some of these instructions require register pairs to work properly.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 10, 2009 9:47 am    Post subject:
Reply with quote

Hello,

Quote:
i thought this part of forum dedicates to assmebly
This part of the forum is for pl/i and assembler. Unfortunately, sometimes other language questions are mistakenly posted here also and we re-locate them.

How much assembler experience do you have (both in terms of how long coding as well as what kind of code - business code or utility code)?
Back to top
View user's profile Send private message
ahmad

New User


Joined: 18 Oct 2008
Posts: 13
Location: Iran

PostPosted: Sat Jan 10, 2009 10:15 am    Post subject:
Reply with quote

I've just started to learn HLASM and I'm in day 5 of 6 days duration of IBM course (Introduction to assembly language programming).
and thanks to Robert Sample, but I need complete source and not just pseudo code. and that's because of getting use to registers and coding manners of HLASM.
thank you guys.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 10, 2009 10:43 am    Post subject:
Reply with quote

Hello,

We are able to help with design and coding/debugging problems, but are not well positioned to conduct introductory training.

These topics have some assembler code in the dialog:
http://ibmmainframes.com/viewtopic.php?p=47486#47486
http://ibmmainframes.com/viewtopic.php?t=34815
http://ibmmainframes.com/viewtopic.php?t=33660
Many other bits of code are also in other topics. Hopefully, you will find some things that are useful.

This link is to instructions in the Principles of Operations Manual (one you will want to bookmark for later use if you continue to work with assembler).
http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dz9zr002/7.0

If you are interested in a book for purchase, Mike Murach (www.murach.com) has an assembler book written by Kevin McQuillen that is very good for people just beginning assembler.

Good luck icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Sat Jan 10, 2009 1:46 pm    Post subject: Reply to: how to code and compute an arithmetic expression
Reply with quote

take a look at
http://www.bsp-gmbh.com/turnkey/assembler/
Back to top
View user's profile Send private message
debajyoti123

New User


Joined: 11 Aug 2008
Posts: 4
Location: Bangalore

PostPosted: Thu Jan 15, 2009 6:32 pm    Post subject: Reply to: how to code and compute an arithmetic expression
Reply with quote

IBM manual specially , Enterprise PL/I for z/os - Language reference can be used .
Or for elaborate example Structured PL/I by Joan Hughes can of good help.
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 How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am


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