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

Question in assembler coding


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
futuremsk

New User


Joined: 20 Dec 2007
Posts: 10
Location: chennai

PostPosted: Thu Dec 20, 2007 1:11 pm
Reply with quote

Actually i am working in assembler for the past 3 months..
i got a program to work for... i didnt understand the coding which is below...

IF(WRKIT(5),EQ,ZERO5,CLC),AND,
(WRKIT+5(4),NE,ZERO4,CLC),AND,
(WRKIT+5(4),Z,TRTNUM,TRT),THEN

AP TABSSM,=P'1'
MVI SSRTNC,C'0'
ELSE
MVI SSFORM,C'C'
L R15,SSSAVE
CALL (15),SSWORK
EIF

Can anyone explain whats happening here...

WRKIT - its given as work area - CL100
ZERO5 - 00000
TRTNUM - DC 256X'FF'
ORG TRTNUM+C'0'
DC 10X'00'
ORG TRTNUM+256 [/b]
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Dec 20, 2007 1:57 pm
Reply with quote

which part You do not understand ???
the if tests for 3 conditions

1) five bytes of wrkit ( starting at offset 0/position 1) equal to "00000"
2) four bytes of wrkit ( starting at offset 5/position 6) NOT equal to "0000"
3) four bytes of wrkit ( starting at offset 5/position 6) numerics only
( thats what a properly written Translate-And-Test does )

if all the tree conditions are satisfied exec the the then path...

else exec the .....
Back to top
View user's profile Send private message
futuremsk

New User


Joined: 20 Dec 2007
Posts: 10
Location: chennai

PostPosted: Thu Dec 20, 2007 2:10 pm
Reply with quote

thanks for your information... i didnt understand what will happen when the if condition is true & what will be if false.... since i dont know more abt assembler commands
Back to top
View user's profile Send private message
futuremsk

New User


Joined: 20 Dec 2007
Posts: 10
Location: chennai

PostPosted: Thu Dec 20, 2007 2:17 pm
Reply with quote

What will the foll code do ?

IF (MSOCIN+15,EQ,C'P',CLI),THEN

DOPROC SETUNPK




e
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Dec 20, 2007 2:24 pm
Reply with quote

the logic is a simple if then with only one statement for the then part

if the condition is true then ...

doproc is a call to an internal subroutine/procedure

look at the hlasm toolkit docs for the description of
the structured programming assembler macros ...
Back to top
View user's profile Send private message
futuremsk

New User


Joined: 20 Dec 2007
Posts: 10
Location: chennai

PostPosted: Thu Dec 20, 2007 2:33 pm
Reply with quote

i didnt understand what is MSOCIN+15 ....
Back to top
View user's profile Send private message
futuremsk

New User


Joined: 20 Dec 2007
Posts: 10
Location: chennai

PostPosted: Thu Dec 20, 2007 2:35 pm
Reply with quote

AP TABSSM,=P'1'

MVI SSRTNC,C'0'

ELSE

MVI SSFORM,C'C'

L R15,SSSAVE

CALL (15),SSWORK


IF U DONT MIND CAN YOU EXPLAIN THE FUNCTION OF EACH COMMMAND IN THE ABOVE PROGRAM IN SHORT .... IT WILL BE GOOD IF U SAY.... ADVANCE THANKS FOR YOU ENRICO.....
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Dec 20, 2007 2:38 pm
Reply with quote

Quote:
Actually i am working in assembler for the past 3 months..


Quote:
didnt understand what is MSOCIN+15


it should be easy it' s one of the first advanced concepts taught in assembler classes

given that MSOCIN Is pointing to some memory address,
msocin+15 will point to an address 15 bytes higher

in pseodo mathematical notation

if msocin(1) is the first byte ...
msocin+15 will be
msocin(1+15) ... the sixteenth byte

as usually do not confuse the byte number with the offset
offset 0 is the first byte :-)
[/code]
Back to top
View user's profile Send private message
futuremsk

New User


Joined: 20 Dec 2007
Posts: 10
Location: chennai

PostPosted: Thu Dec 20, 2007 2:43 pm
Reply with quote

thanks a lot enrico... iam very much thankful for you ....
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 Question for file manager IBM Tools 7
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts question for Pedro TSO/ISPF 2
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts How Can I Recall a Migrated Data Set ... PL/I & Assembler 3
Search our Forums:

Back to Top