View previous topic :: View next topic
|
Author |
Message |
futuremsk
New User
Joined: 20 Dec 2007 Posts: 10 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
futuremsk
New User
Joined: 20 Dec 2007 Posts: 10 Location: chennai
|
|
|
|
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 |
|
|
futuremsk
New User
Joined: 20 Dec 2007 Posts: 10 Location: chennai
|
|
|
|
What will the foll code do ?
IF (MSOCIN+15,EQ,C'P',CLI),THEN
DOPROC SETUNPK
e |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
futuremsk
New User
Joined: 20 Dec 2007 Posts: 10 Location: chennai
|
|
|
|
i didnt understand what is MSOCIN+15 .... |
|
Back to top |
|
|
futuremsk
New User
Joined: 20 Dec 2007 Posts: 10 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
futuremsk
New User
Joined: 20 Dec 2007 Posts: 10 Location: chennai
|
|
|
|
thanks a lot enrico... iam very much thankful for you .... |
|
Back to top |
|
|
|