Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
kalpana

New User


Joined: 19 Nov 2004
Posts: 25
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
References
PostPosted: Wed Dec 21, 2005 3:06 pm    Post subject: Re: Fourth Day Class (Assembler E-learning Cource) Reply with quote

Gautam512

Senior Member


Joined: 05 Oct 2005
Posts: 347
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1