Skip to content

Commit

Permalink
Fix issues with GUAM.MAC (z390development#532)
Browse files Browse the repository at this point in the history
* Fix issues with GUAM.MAC

* Add comments and test case by John Ganci

* Add annotated reference output file TGUAM.TF1

* Various changes from review process
  • Loading branch information
abekornelis authored Jun 10, 2024
1 parent bf18378 commit 3b70952
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ cics/TESTBEC7.[mM][lL][cC]
cics/TESTBEC8.[mM][lL][cC]
cics/TESTBEC9.[mM][lL][cC]
cics/TESTBMC1.[mM][lL][cC]
cics/TESTGUIC.[mM][lL][cC]
cics/TESTICC1.[mM][lL][cC]
cics/TESTVSC1.[mM][lL][cC]
cics/TESTVSC2.[mM][lL][cC]
Expand Down
45 changes: 45 additions & 0 deletions guam/test/TGUAM.MLC
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
TGUAM CSECT
STM 14,12,12(13) save caller's registers
LR 12,15 set base register
USING TGUAM,12 establish addressability
LA 15,SA usable save area
ST 13,4(,15) chain save areas
ST 15,8(,13)
LR 13,15 current save area
*
LA 2,A begin area to SNAP
LA 3,B end area to SNAP
*
GUAM WINDOW,FONT,16
ORG *-2
DC X'0700' nullify SVC
STM 0,1,R0R1 save for SNAP

SNAP ID=1,PDATA=,STORAGE=((2),(3))
*
GUAM WINDOW,VIEW,SCREEN,24,80,3
ORG *-2
DC X'0700' nullify SVC
STM 0,1,R0R1 save for SNAP

SNAP ID=2,PDATA=,STORAGE=((2),(3))
*
SR 15,15 set return code
*
L 13,4(,13) caller's save area
L 14,12(,13) restore caller's registers
LM 0,12,20(13) ... except 15
BR 14 return to caller
A DS 0D
DC CL8'Regs0-1'
R0R1 DS 2F
DC CL8'LitPool'
*
LTORG ,
*
B DS 0D
SA DC 18F'0' usable save area
*
GUAM SYMBOLS
*
END
38 changes: 38 additions & 0 deletions guam/test/TGUAM.TF1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Expected SNAP output, annotated for clarity.

1. With first GUAM.MAC corrrection, not second correction.

SNAP DUMP ID=1
000FFF80 *D98587A2 F060F140 00000104 000FFF9C* *Regs0-1 ........* <-- R1 = 000FFF9C = A(1 word parm list)
000FFF90 *D389A3D7 96969340 00000010 000FFF98* *LitPool .......q* <-- parm 1 value, parm 1 address
======== --------
fontSize parmList
000FFFA0 *00000002 00000018 00000050 00000003* *...........&....*
000FFFB0 *00000018 00000050 * *.......& *
SNAP DUMP ID=2
000FFF80 *D98587A2 F060F140 00000105 000FFFA0* *Regs0-1 ........* <-- R1 = 000FFFA0 = A(4 word parm list)
000FFF90 *D389A3D7 96969340 00000010 000FFF98* *LitPool .......q*
000FFFA0 *00000002 000FFFB0 000FFFB4 00000003* *................* <-- the 4 word parm list; 4th parm not set!
-------- -------- -------- --------
------------ parmList -------------
000FFFB0 *00000018 00000050 * *.......& * <-- parm 2 value, parm 3 value; no parm 4
======== ========
parm 2 parm 3

2. With second GUAM.MAC correction.

SNAP DUMP ID=2
000FFF78 *D98587A2 F060F140 00000105 000FFF98* *Regs0-1 .......q* <-- R1 = 000FFF98 = A(4 word parm list)
000FFF88 *D389A3D7 96969340 00000010 000FFF90* *LitPool ........*
000FFF98 *00000002 000FFFA8 000FFFAC 000FFFB0* *.......y........* <-- the 4 word parm list; all parm addrs set
-------- -------- -------- --------
------------ parmList -------------
000FFFA8 *00000018 00000050 00000003 F6F6F6F6* *.......&....6666* <-- parm 2, parm 3, parm 4 values
======== ======== ========
parm 2 parm 3 parm 4

End




10 changes: 8 additions & 2 deletions mac/GUAM.MAC
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
.* 02/21/06 RPI205 RENAME GUI MACRO TO GUAM TO REDUCE CONFUSION
.* 02/24/06 RPI217 CORRECT GRAPH,TEXT COMMAND TO SET TEXT LENGTH
.* 05/08/06 RPI308 FIX WINDOW,VIEW TO SWITCH WITH NO RESET OPTIONS
.* 05/24/06 RPI227 ADD SCREEN,COLOR TO SET BACKGROUND AND TEXT COLOR
.* 05/24/06 RPI227 ADD SCREEN,COLOR TO SET BACKGROUND AND TEXT COLOR
.* 08/21/07 RPI 670 CORRECT REG OPTIMIZATION TO HANDLE ANY REG SYMBOL
.* 04/19/08 RPI 833 add SETC quotes for HLASM compatibility
.* 06/06/24 #530 Various bugs in GUAM.MAC reported by John Hennesy
.*********************************************************************
.* GUI GRAPHICAL USER ACCESS METHOD MACRO FOR Z390
.*********************************************************************
Expand Down Expand Up @@ -92,7 +93,7 @@
AGO .SVC
.WINDOW_FONT ANOP R1=FONT (8,30)
LA 0,GUI_WINDOW_FONT
LA 15,-A(&SYSLIST(3)) R1=A(FONT SIZE) (8-30)
LA 15,=A(&SYSLIST(3)) R1=A(FONT SIZE) (8-30) #530
LA 1,=A(*-*)
ST 15,0(1) R1=A(A(FONT))
AGO .SVC
Expand All @@ -114,6 +115,11 @@
LA 15,=A(&SYSLIST(5))
ST 15,8(1)
.SKPLIT2 ANOP
AIF ('&SYSLIST(6)'(1,1) LT '0' OR '&SYSLIST(6)'(1,1) GT '8')X
.SKPLIT3 #530
LA 15,=A(&SYSLIST(6)) #530
ST 15,12(1) #530
.SKPLIT3 ANOP , #530
AGO .SVC
.WINDOW_GETVIEW ANOP R1=VIEW (0-3)
LA 0,GUI_WINDOW_GETVIEW SET R0 = CURRENT VIEW (0-3)
Expand Down
1 change: 1 addition & 0 deletions rt/RTGUAM.BAT
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ call rt\RT1 guam\test\TESTGP1 guam %1 %2 %3 %4 %5 %6 %7 %8 %9
call rt\RT1 guam\test\TESTGP2 guam %1 %2 %3 %4 %5 %6 %7 %8 %9
call rt\RT1 guam\test\TESTGP3 guam %1 %2 %3 %4 %5 %6 %7 %8 %9
call rt\RT1 guam\test\TESTGP4 guam %1 %2 %3 %4 %5 %6 %7 %8 %9
call rt\RT1 guam\test\TGUAM %1 %2 %3 %4 %5 %6 %7 %8 %9
call rt\RTCOMP guam\demo rt\guam\demo\save rt\guam\demo\dif
call rt\RTCOMP guam\test rt\guam\test\save rt\guam\test\dif
erase rt\guam\dif\*.* /q
Expand Down

0 comments on commit 3b70952

Please sign in to comment.