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
 

 

Fourth Day Class (Assembler E-learning Cource)

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

New User


Joined: 19 Nov 2004
Posts: 24
Location: Banglore

PostPosted: Wed Dec 21, 2005 3:06 pm    Post subject: Fourth Day Class (Assembler E-learning Cource)
Reply with quote

I will explain simple Program
For adding two numbers
here is the code

NAME OPERATION OPERND FIELD
SAMPLE START 0
BALR 12,0
USING *,12

L 3,A1
A 3,A2
ST 3,RESULT

A1 DC F'10'
A2 DC F'20'
RESULT DS F
BR 14
END

This is a simple assembler code which adds two numbers and place the result in result variable.
Every assembler program should start with START command and ends with END command. In assembly language we will perform all operations uding registers tottaly 16 register we will use.
In assembler coding we have to establish addersabilty of the program. This can be achieved by using two instructions ie; BALR and Using
BALR is RR instruction in which the next sequential instruction vale will stired in the first operand. In this sample next sequential instruction value will be stored in 12 register and the secon opernad specifies the place where u want to branch. Here BALR 12,0 specifies 0 means no branching.
L--> stands for Load
L 3,A1
Load instructuion says that load the content of the memory location(A1) into the register 3
A--> Stands for Addition
A 3,A2
Add the content of memory loction (A2) to the register 3
ST--> Stands for Store
ST 3,Result
Store the content of the register (3) to the variabke Result
Then we need to define the space for the memory variables this can done by suing DC & DS statements
DC -Define Constant
By using this we can reserve memry space for a variable as well as we can assign value to the variale
DS --> Define Storage
By using this we can only reserve space for a variable

BR 14 --> Branch 14
It halts the execution of assembler program. Its like Stoprun in cobol.
Back to top
View user's profile Send private message

Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Fri Jan 06, 2006 11:48 pm    Post subject: Re: Fourth Day Class (Assembler E-learning Cource)
Reply with quote

Thanks for the Class,

Learnt Assembler a bit.

-Gau
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts XFACILIT class setting for Fault Anal... egrove IBM Tools 2 Thu Aug 11, 2016 8:02 pm
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm
No new posts Missing Java main class akg Java & MQSeries 3 Wed May 25, 2016 4:05 pm


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