Xread, Xdeic



High Level Assembler(HLASM) for MVS & VM & VSE

Re: Xread, Xdeic

Postby dick scherrer » Tue Aug 31, 2010 5:52 am

You're welcome.

You might try inserting an XPRNT immediately after the XREAD and see if the first input record is printed. . .

If this code worked properly, what would be the output?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Xread, Xdeic

Postby Robert Sample » Tue Aug 31, 2010 5:53 am

Boy, the memories -- I had to learn assembler without ASSIST but ran across it early on. I've always liked it, despite its big drawbacks.

Have you tried:
//xxxxxxxx JOB ,'belkin 99     ',MSGCLASS=H         
//STEP01 EXEC PGM=ASSIST,PARM='MACRO=F'             
//STEPLIB DD DSN=xxxxxxx.ASSIST.LOADLIB,DISP=SHR   
//SYSIN DD *                                       
          XREAD CARD,80               
CHECKEOF BC    B'0100',EXIT         
          XDECI 2,CARD               
          XDUMP                       
          BC    B'1110',VALIDNUM     
          XPRNT BADNUM,29             
          BC    B'1111',EXIT         
VALIDNUM XDECO R2,OUTPUT             
          XPRNT OUTPUT,81   
//CARD DD *
.
.
.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Xread, Xdeic

Postby steve-myers » Tue Aug 31, 2010 9:41 am

I know almost nothing about Assist, but your code looks not so valid to me.

In XREAD, does CARD represent a data area (which does not appear to be defined in your code), or a DD statement. If it's a DD statement, then where is XREAD reading the data? Or is it returning the address of a data area?

The use of a mask in BC instructions is most unusual, though it's perfectly valid. Most of us have to dig deep into our memory banks to interpret B'0100', or B'1110' for that matter. B'1111', at least, is easy.

In "regular" Assembler, most macros do not set or preserve the condition code, so I have to wonder about the BC after XREAD, or, for that matter, the BC after XDUMP. I have one programmer macro I use in my own code that sets the condition code, but the only reliable BC masks after the macro would be B'1000' or B'0111'. B'0100' or B'0010' would not be reliable even though the macro is supposed to be doing a compare.

The OUTPUT data area specified in XDECO and XPRNT does not appear to be defined

EXIT is not defined.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Xread, Xdeic

Postby belkin99 » Thu Sep 02, 2010 7:33 am

Guys thanks for the Help,

I figured the problem
In simple words, XREAD read 80 bytes as maximum, input record, from in-stream data or DD as a CHAR.

So, Using XDEIC will convert first number from input record, CHAR to Binary ,and to get the second number from the input record, 80 bytes that has been read, we use
Xdeic r,0(,1)
AND TO READ the third number of the the input record, XDEIC r,0(,1) again
continue with this till the end of the input record.

The numbers in r are a binary and you can use them for math operation

To convert the number back to decimal use XDECO

So, following these steps I got the correct answers
I consider this issue has been solved
Thanks,
:)
belkin99
 
Posts: 25
Joined: Mon Aug 30, 2010 6:59 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Xread, Xdeic

Postby dick scherrer » Thu Sep 02, 2010 9:11 am

Good to hear it is working - thank you for letting us know and posting the resolution :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Previous

Return to Assembler