Moving from S/360 to z390... using Bill Qualls book..

69 views
Skip to first unread message

Anthony Delosa

unread,
Dec 22, 2020, 12:06:00 AM12/22/20
to z390
Hi everyone.

I am in the process of learning assembler using the Bill Qualls book available here (Mainframe Assembler Programming by Bill Qualls) and the z390 assembler.
My background is mainframe, but all COBOL and minimal asm exposure. Its been a long term goal for me to become sufficient with ASM.

I believe most people using this book now are using the MVS 3.8j distro rather than PC/370 to do the exercises but I was really want to use a PC based environment like the IBM Z Open Editor.. Yes, I know you can be very efficient on the 3270 based editors.. I have worked extensively on them, but I also want to encourage the new gen to learn z systems without having to introduce them to "the editor"

I have setup the following repo where I have completed exercises from the book using the z390 tools.


It has required a little tuning, but not too much.. I would be happy for any comments on what I have put together so far as my assembler experience is limited.
README has the differences I have encountered.
 
In chapter 7, the book introduces the PC/370 debugger. I have been able to run the program that abends (S0c7.mlc) using the TEST option but the interface and process seems quite different from PC/370. 

I have had a look through the manuals, but I am still struggling on how to set a break point based on the address provided from the abend message.

EZ390E error 11 ABEND PSW=07852600 800FFFF0 FA10D07CD07F AP ABEND S0C7
R0-R3 F4F4F4F4800FFF78 F4F4F4F400002300 F4F4F4F4F4F4F4F4 F4F4F4F4F4F4F4F4
R4-R7 F4F4F4F4F4F4F4F4 F4F4F4F4F4F4F4F4 F4F4F4F4F4F4F4F4 F4F4F4F4F4F4F4F4
R8-RB F4F4F4F4F4F4F4F4 F4F4F4F4F4F4F4F4 F4F4F4F4F4F4F4F4 F4F4F4F4F4F4F4F4
RC-RF F4F4F4F4F4F4F4F4 F4F4F4F4800FFF80 F4F4F4F400002018 F4F4F4F4800FFF80

 
Would anyone be able to provide pointers on completing the exercise as per the book to set a break point on the instruction that causes the abend based on the information above.

Thanks
Anthony

John Ganci

unread,
Dec 27, 2020, 1:41:47 AM12/27/20
to z390
Perhaps you can use the "G <address>" command when running your program under TEST. The "G" command is documented on page 13 of the "z390 User Guide" found at http://z390.org/z390_User_Guide.pdf.

Here is a sample session showing its use. The "rmode31" loads the program above the line. The "<--- comment" are comments added to the output.

EXEC <full path>/TD001 mem(32) rmode31 test
echo off
23:58:35 TD001     EZ390 START USING z390 V1.7.02 ON J2SE 1.8.0_201 12/26/20
test enter command or h for help
23:58:35 TD001     EZ390 START USING z390 V1.7.02 ON J2SE 1.8.0_201 12/26/20
test cmd:  exit
test batch exit request
test cmd: psw16   <--- show current PSW
 PSW16  07850600 80000000 00000000 01FFF7B8
test cmd: l 1fff7b8. 128   <--- list first 128 bytes of the program
 01FFF7B8 *47F0F01A 14E3C4F0 F0F17AF2 F0F2F0F1 * *å00’ TD001:20201*
 01FFF7C8 *F2F2F67A F2F34BF2 F5F690EC D00C18CF * *226:23.256°Ö}..õ*
 01FFF7D8 *41000098 18104100 00000A04 5010D008 * * ..q.. ...Žœ&.}—*
 01FFF7E8 *50D01004 18D11700 5000D000 5810D004 * *&}.œ.J‡.&.}.ì.}œ*
 01FFF7F8 *98E1100C 5010D050 EBCCD054 0026B917 * *q÷..&.}&Ôö}è..¾‡*
 01FFF808 *00CCD207 D048C170 58B0C178 C0F00000 * *.öK }çAøì¬AÌ{0..*
 01FFF818 *01A60DEF C0F00000 01270DEF 5820D068 * *.w.Õ{0.....Õì€}Ç*   <--- we will stop just before the "5820D068" instruction
 01FFF828 *5830D06C 1A3218E2 18F3A503 0064A502 * *ì }%’..S.3v..Àv.*
test cmd: g 1fff824.   <--- go until the next instruction to be executed is at X'01FFF824'
 01FFF824 *5820D068 5830D06C 1A3218E2 18F3A503 * *ì€}Çì }%’..S.3v.*
test break on g 1fff824.
 81FFF824 0 5820D068     L     R2=F4F4F4F4 S2(00FFFFA8)=01FF6198
test cmd: psw16   <--- just verifying the location of the next instruction to be executed
 PSW16  07850600 80000000 00000000 01FFF824

Assuming you've already done "asml <full path>/S0C7",  you should start your program via "exec <full path>/S0C7 test"
then list the PSW and storage to verify addresses. You would probably then issue "G FFFF0." to stop just before the offending "FA10D07CD07F" instruction.

Note: it may be hard to see here, but there is a period after the address in the "L" and "G" commands.

Hope this helps.

Regards,

John Ganci

Anthony Delosa

unread,
Dec 27, 2020, 11:08:35 PM12/27/20
to z390
Thats exactly what I was after.. so I will restate what you have said to make sure I understand..

Start the debug session by adding the "TEST" parameter when running.
Use the PSW16 to find the current instruction in memory to be processed  - last 4 bytes

test cmd: psw16
 PSW16  07850600 80000000 00000000 000FFF78

List the memory from this location to review the program instructions.
Command format is address.length

test cmd: l fff78.128
   000FFF78 *90ECD00C 45FF0068 00000000 00000000 * *??}.??.?........*
 000FFF88 *00000000 00000000 00000000 00000000 * *................*
 ........
 000FFFC8 *C2C5C7C9 D5404040 F1F261F2 F861F2F0 * *BEGIN   12/28/20*
 000FFFD8 *F1F34BF5 F0404040 50FD0008 50DF0004 * *13.50   &?.?&?.?*
 000FFFE8 *18DFFA10 D07CD07E FA10D07C D07F9800 * *.??.}@}=?.}@}"q.*

Find the instruction you want to stop at, and use the g address. <-don't forget the full stop

test cmd: g ffff0.
 000FFFF0 *FA10D07C D07F9800 D01407FE 000C1CF6 * *?.}@}"q.}??...6*
test break on g ffff0.
 800FFFF0 2 FA10D07CD07F AP    S1(000FFFFC)=001C S2(000FFFFF)=F6

What does the PSW command do as opposed to the PSW16?

Thanks for your assistance!
Anthony

John Ganci

unread,
Dec 28, 2020, 12:01:45 PM12/28/20
to z390
What you've done is correct. On your "l fff78.128" command, I'm surprised that not having a space
following the period didn't produce an error. Learn something new every day.

The PSW16 command displays the PSW as a 16-byte PSW that has a 64-bit address portion, as opposed
to the PSW command, which displays a "classic" 8-byte PSW with a 31-bit address portion.

By the way, there are many other commands you can issue when in TEST mode. The "h" command shows
help, which shows brief descriptions of the commands. You can also read about them in the User Guide.

An example follows. Apologies in advance if you already know how to do this.

After your "g" command, you are positioned just before the Add Packed Decimal instruction. The instruction
is "AP    X'07C'(2,R13),X'07F'(1,R13)". To see the contents of the two operands you want to display storage
based on register 13. Two ways to do this follow.

1. Get the R13 value. List storage using the value.
1.1. Three ways to get the value: "r" or "r 13" or "l 13r". Assume R13 = X'00aaaaaa'.
1.2. "l aaaaaa.+7c. 2" to see first operand value; "l aaaaaa.+7f. 1" to see second operand. Note all the periods!
1.3. Alternately, "l aaaaaa.+7c. 8" to see both at once.

2. List the storage using the R13 value.
2.1. "l 13r%+7c. 8". If the storage pointed to by R13 were above the line, use "l 13r?+7c. 8".

There's a lot of fun to be had here using these commands!

Regards,

John Ganci
Reply all
Reply to author
Forward
0 new messages