a assembler question about pack?



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

Re: a assembler question about pack?

Postby dick scherrer » Thu Apr 01, 2010 11:45 pm

Hello,

I don't know what you're doing that gave X'00000000D25C5C5C...' instead.
The 5Cs are literals in the code, not the result of the PACK.

Rather than invest much time on why the incorrect PACK coding gave the result it did, i'd suggest concentrating on if the correct code produces the correct result. Does it?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Re: a assembler question about pack?

 

Re: a assembler question about pack?

Postby helen2000 » Fri Apr 02, 2010 12:45 am

I'm sorry, I'm really interested in mainframe assembler. I think it's very useful for undertanding the detail about compiler info as you
said. but so far I still didn't get the permission for code assembler programming in mainframe env. in my organization. no way, I have to use pc/370 mainfrme assembler software intead . maybe there are some difference between pc/370 and mainframe assembler.
but as the Author's said, no difference between the 2 version because it imitate the MVS ASSEMBLER. anyway, thanks you all help.

Helen.
helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: a assembler question about pack?

Postby Frank Yaeger » Fri Apr 02, 2010 1:41 am

Helen,

It took some doing, but I got as close as I could to the "equivalent" of your program to run on the ASMA90 Assembler (but it's not an exact equivalent). The output records looked like this in hex:

Record 1 (before)
F1F0F6F3F95C5C5C14312D5C5C5C0D25

Record 2 (after)
00000041D25C5C5C14312D5C5C5C0D25


So I can only guess that there's something different about the Assembler you're using, or the OREC record is being overlayed at some point.

I do applaud you for your curiosity about what's going on. Good programmers should be curious. I just don't know how to help you more at this point since I can't duplicate what you're seeing.

I personally find TSO TEST a great way to debug Assembler programs (instruction by instruction) but I don't know if you know how to use it or have it available. If you do have something that lets you step through your program instruction by instruction, I'd suggest using that to see what's happening where in your program.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: a assembler question about pack?

Postby helen2000 » Fri Apr 02, 2010 2:44 am

Hi Mr.Frank
I'm very appreciated you give me a encouragement and tell me very valuable info. I have more confidence to do some research under your help.
I will look for a way to step trace my code. I will let you know if I got any valuable info.
thank you again.
have a nice long weekend!
Helen
helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: a assembler question about pack?

Postby Frank Yaeger » Fri Apr 02, 2010 3:47 am

If you can't step trace your code, another trick (though not as good) would be to force an S0C1 ABEND at the point where you want to look to see what's in storage.
For this to work, you need to add

//SYSUDUMP DD SYSOUT=*

to your job so you get the dump.

For example, you could change your code to have:

         ...
         PACK  ONN,OZZ
         LA      3,OREC
         DC     H'0'
         ...


That will give you an S0C1 dump just after the PACK with reg 3 pointing to your OREC area so you can see what's in it (assuming you know how to look at a dump).

Hopefully, you have a MSGCLASS you can set that will let you look at your JES output online so you don't have to print it out.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: a assembler question about pack?

Postby helen2000 » Thu Apr 08, 2010 3:03 am

during a couple of days' working hard, finally I find the answer:
1: at first, we need to understand 2 develop enviorment: pc/370 MVS assmbler imitator in DOS,
MVS Z/os assmbler in mainframe.
2: my code is from pc/370 in Dos;

3: for all display character, ASCII code in DOS, and EBCDIC code in MVS Mainframe.

4: in my code, the following statement is for convert report.txt from EBCDIC to ASCII

OI    REPORT+10,X'08'    PC/370 ONLY - Convert all
*                                 output from EBCDIC to ASCII

5: so, when I remove the above statement, we will get the correct answer. x'14312d' will
be change to x'41d2'.

6: one more question, why do I got the following incorrect output in last test I talked about several days ago?

I will trace my code:
at first take a look main patest.prn list program as following:
 000074                                      39 *+++++++ OPEN  TEACHERS
 000074 4120D118              0128   40          LA       2,TEACHERS
 000078 0A01                               41          SVC      1
 00007A                                       42 *+++++++ OPEN  REPORT
 00007A 4120D17C              018C  43          LA       2,REPORT
 00007E 0A01   290                      44          SVC      1
 000080 D201D1EDD1DD   01FD   01ED   45 ATEND    MVC      OCRLF,WCRLF
 000086                                      46 *+++++++ PUT   REPORT,OREC
 000086 4120D17C             018C   47          LA       2,REPORT
 00008A 4110D1DF             01EF   48          LA       1,OREC
 00008E 0A06                              49          SVC      6
 000090 F242D1DFD1E7   01EF   01F7   50          PACK     ONN,OZZ
 000096                                      51 *+++++++ PUT   REPORT,OREC
♀ PATEST                                             PAGE    2
 PC/370 CROSS ASSEMBLER  OPTIONS=LXACE
    LOC                ADR1   ADR2 LINE LABEL    OP       OPERANDS
 000096 4120D17C             018C   52          LA       2,REPORT
 00009A 4110D1DF             01EF   53          LA       1,OREC
 00009E 0A06                              54          SVC      6
 0000A0                                      55
 0000A0                                      56 *
 0000A0                                      57 *        EOJ processing
 0000A0                                      58 *
 0000A0                                      59 *+++++++ CLOSE TEACHERS
 0000A0 4120D118              0128   60          LA       2,TEACHERS
 0000A4 0A02                             61          SVC      2
 0000A6                                     62 *+++++++ CLOSE REPORT
..........
.........
 

 0001ED 0D25                        109 WCRLF    DC       X'0D25'            PC/
370 ONLY - EBCDIC CR/LF
 0001EF                             110 *        Output (line) definition
 0001EF                             111 *
 0001EF                             112 OREC     DS       0CL16
 0001EF F1F0F6F3F9           113 ONN      DC       CL5'10639'
 0001F4 5C5C5C                 114             DC       CL3'***'
 0001F7 14312D                  115 OZZ      DC       PL3'-14312'
 0001FA 5C5C5C                 116             DC       CL3'***'
 0001FD                             117 OCRLF   DS       CL2                PC/
370 only - CR/LF
 000000                             118          END      BEGIN

**********************

SO, before execute the following SVC 6,
OZZ still is x'14312d' in memory
00008E 0A06                         49          SVC      6

but, after execute SVC 6,
OZZ will be changed to x'00002D'.
I think this is the key of the problem. could you tell me what does it
means this struction: SVC 6 ; what does it do exactly? I can't check it in internet.

thank you, all,

hellen
helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: a assembler question about pack?

Postby Frank Yaeger » Thu Apr 08, 2010 4:03 am

For z/OS Assembler, SVC 6 is LINK. It links to the module you specify.

But for the Assembler you're using, it appears SVC 6 is for PUT. I based that on the information I found here:

http://www.cs.uni.edu/~okane/041/ibm390.html

I doubt that anyone on this Forum knows what code that SVC executes or why it does what it does in your program.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Previous

Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post