IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to code and compute an arithmetic expression


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

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

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

Moderator Emeritus


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

PostPosted: Sat Jan 10, 2009 1:17 am
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Jan 10, 2009 9:46 am
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

Moderator Emeritus


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

PostPosted: Sat Jan 10, 2009 9:47 am
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
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

Moderator Emeritus


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

PostPosted: Sat Jan 10, 2009 10:43 am
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:
ibmmainframes.com/viewtopic.php?p=47486#47486
ibmmainframes.com/viewtopic.php?t=34815
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).
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Jan 10, 2009 1:46 pm
Reply with quote

take a look at
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top