Skip to content

Commit

Permalink
Fixing incompatibilities with HLASM for optable(ZOP)
Browse files Browse the repository at this point in the history
  • Loading branch information
abekornelis committed Aug 23, 2024
1 parent 4834909 commit c27866a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 17 deletions.
15 changes: 15 additions & 0 deletions rt/bat/RUNOPTABLES.BAT
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ if %z_ReturnCode% EQU 0 (echo %0 - OPTB# "optable(ESA)" is okay
)
if %1. NEQ . if /I %1. NEQ /Q. goto return

rem Optable ZOP
:ZOP
set Z390PRN=rt\mlc\OPTB#ZOP.PRN
set HLASMPRN=rt\mlc\OPTB#ZOP.TF1
call bat\asmlg.bat %z_TraceMode% rt\mlc\OPTB# @rt\mlc\OPTB#ZOP.OPT sysprn(%Z390PRN%)
set z_ReturnCode=%ERRORLEVEL%
if %z_ReturnCode% EQU 0 (echo %0 - OPTB# "optable(ZOP)" is okay
set /A count_ok=%count_ok%+1
) else (
echo %0 ERROR: OPTB# returned %z_ReturnCode% for "optable(ZOP)"
set /A count_err=%count_err%+1
if (%z_ReturnCode% GTR %z_MaxRetCode% (set z_MaxRetCode=%z_ReturnCode%)
)
if %1. NEQ . if /I %1. NEQ /Q. goto return

rem Optable uni
:uni
set Z390PRN=rt\mlc\OPTB#UNI.PRN
Expand Down
6 changes: 6 additions & 0 deletions rt/mlc/OPTB#ZOP.OPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
noallow
optable(ZOP,list)
stats
noloadhigh
nodump
notest
17 changes: 14 additions & 3 deletions src/az390.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ public class az390 implements Runnable {
* 2024-08-09 AFK #543 Correct OPTABLE(XA,LIST) output to match HLASM
* 2024-08-12 #545 Extend generated java doco to include private methods
* 2024-08-15 AFK #554 Correct OPTABLE(ESA,LIST) output to match HLASM
* 2024-08-23 AFK #561 Correct OPTABLE(ZOP,LIST) output to match HLASM
*****************************************************
* Global variables last rpi
*****************************************************/
Expand Down Expand Up @@ -2041,7 +2042,7 @@ else if (tz390.op_name[index].equals("MVCK")
break;
case 23:
my_format="RIE"; // #500
my_operands="R1,R3,I2"; // #500
my_operands="R1,R3,RI2"; // #500 #561
break;
case 24:
my_format="RXE"; // #500
Expand Down Expand Up @@ -2083,8 +2084,18 @@ else if (tz390.op_name[index].equals("MVCK")
case 33:
// Our op_code table has the last two nibbles swapped
my_format="RIL"; // #500
my_hexop=my_hexop.substring(0,2)+my_hexop.substring(3)+my_hexop.substring(2,3); // #500
my_operands="I2"; // #500
if (my_hexop.length() == 3) // mask excluded? // #561
{my_hexop=my_hexop.substring(0,2)+"."+my_hexop.substring(2,3); // #561
short_op = 1; // mark short opcode // #561
} // #561
else // mask included! // #561
{my_hexop=my_hexop.substring(0,2)+my_hexop.substring(3)+my_hexop.substring(2,3); // #500 #561
short_op = 0; // mark full opcode // #561
} // #561
if (short_op == 1) // short opcode // #561
my_operands="M1,RI2"; // #561
else // full opcode // #561
my_operands="RI2"; // mask implied by menmonic // #561
break;
case 34:
my_format="RRF"; // #500
Expand Down
42 changes: 28 additions & 14 deletions src/tz390.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ public class tz390 {
* 2024-08-01 AFK #543 Correct OPTABLE(XA,LIST) output to match HLASM
* 2024-08-12 #545 Extend generated java doco to include private methods
* 2024-08-15 AFK #554 Correct OPTABLE(ESA,LIST) output to match HLASM
* 2024-08-23 AFK #561 Correct OPTABLE(ZOP,LIST) output to match HLASM
********************************************************
* Shared z390 tables (last RPI)
*****************************************************/
Expand Down Expand Up @@ -2145,6 +2146,13 @@ public class tz390 {
{"C04=JLC,16,330", // 5180 "C04" "BRCL" "RIL" 16 #554
"C004=JLNOP,16,330", // 5180 "C04" "BRCL" "RIL" 16 #554
}; // #554
// Instructions PGIN and PGOUT were introduced with the ESA architecture #561
// But HLASM has never supported these instructions #561
// See Jonathan Scott's contribution to the ASSEMBLER-LIST 2024-04-06 #561
String[] op_table_ESA_allow = // Instructions defined for ESA but never supported by HLASM #561
{"B22E=PGIN,14,140", // 2860 "B22E" "PGIN" "RRE" 14 #561
"B22F=PGOUT,14,140", // 2870 "B22F" "PGOUT" "RRE" 14 #561
}; // #561
String[] op_table_ZOP = // Table added for RPI 1209A
{"010E=SAM64,1,10", // 70 "010E" "SAM64" "E" 1
"A50=IIHH,73,730", // 1820 "A50" "IIHH" "RI" 12 // RPI 1522
Expand Down Expand Up @@ -2172,18 +2180,7 @@ public class tz390 {
"A7D=MGHI,73,731", // 2470 "A7D" "MGHI" "RI" 12 // RPI 1522
"A7F=CGHI,73,731", // 2490 "A7F" "CGHI" "RI" 12 // RPI 1522
"B250=CSP,14,140", // 3150 "B250" "CSP" "RRE" 14
"B280=LPP,7,70", // S,LPP,D1(B1) RPI 2221
"B284=LCCTL,7,70", // S,LCCTL,D1(B1) RPI 2221
"B285=LPCTL,7,70", // S,LPCTL,D1(B1) RPI 2221
"B286=QSI,7,70", // S,QSI,D1(B1) RPI 2221
"B287=LSCTL,7,70", // S,LSCTL,D1(B1) RPI 2221
"B28E=QCTRI,7,70", // S,QCTRI,D1(B1) RPI 2221
"B2B2=LPSWE,7,70", // 3390 "B2B2" "LPSWE" "S" 7
"B2E0=SCCTR,14,142", // RRE,SCCTR,R1,R2 RPI 2221
"B2E1=SPCTR,14,142", // RRE,SPCTR,R1,R2 RPI 2221
"B2E4=ECCTR,14,142", // RRE B2E4 R1,R2", // RPI 2221
"B2E5=EPCTR,14,142", // RRE B2E5 R1,R2", // RPI 2221
"B2ED=ECPGA,14,142", // RRE B2ED R1,R2", // RPI 2221
"B3A4=CEGBR,53,141", // 4250 "B3A4" "CEGBR" "RRE" 53 RPI 1125 Z196
"B3A5=CDGBR,53,141", // 4260 "B3A5" "CDGBR" "RRE" 53 RPI 1125 Z196
"B3A6=CXGBR,53,141", // 4270 "B3A6" "CXGBR" "RRE" 53 RPI 1125 Z196
Expand Down Expand Up @@ -2317,8 +2314,19 @@ public class tz390 {
"EF=LMD,28,280", // 7030 "EF" "LMD" "SS4" 28
};
String[] op_table_YOP = // Table added for RPI 1209A
{"B2A6=CU21,14,140", // 3350 "B2A6" "CU21" "RRE" 14
{"B280=LPP,7,70", // S,LPP,D1(B1) RPI 2221
"B284=LCCTL,7,70", // S,LCCTL,D1(B1) RPI 2221
"B285=LPCTL,7,70", // S,LPCTL,D1(B1) RPI 2221
"B286=QSI,7,70", // S,QSI,D1(B1) RPI 2221
"B287=LSCTL,7,70", // S,LSCTL,D1(B1) RPI 2221
"B28E=QCTRI,7,70", // S,QCTRI,D1(B1) RPI 2221
"B2A6=CU21,14,140", // 3350 "B2A6" "CU21" "RRE" 14
"B2A7=CU12,14,140", // 3370 "B2A7" "CU12" "RRE" 14
"B2E0=SCCTR,14,142", // RRE,SCCTR,R1,R2 RPI 2221
"B2E1=SPCTR,14,142", // RRE,SPCTR,R1,R2 RPI 2221
"B2E4=ECCTR,14,142", // RRE B2E4 R1,R2", // RPI 2221
"B2E5=EPCTR,14,142", // RRE B2E5 R1,R2", // RPI 2221
"B2ED=ECPGA,14,142", // RRE B2ED R1,R2", // RPI 2221
"B32E=MAER,15,150", // 3760 "B32E" "MAER" "RRF1" 15
"B32F=MSER,15,150", // 3770 "B32F" "MSER" "RRF1" 15
"B33E=MADR,15,150", // 3800 "B33E" "MADR" "RRF1" 15
Expand Down Expand Up @@ -3322,8 +3330,6 @@ public class tz390 {
{"83=DIAGNOSE,10,100", // RPI 2213 ADD DIAGNOSE/DIAG RS
"83=DIAG,10,100", // RPI 2213 ADD DIAGNOSE/DIAG RS
// "B214=SIE,7,70", // RPI 2213 ADD START INTERPRETIVE EXEC S #543 - moved to optable for XA
"B22E=PGIN,14,140", // 2860 "B22E" "PGIN" "RRE" 14
"B22F=PGOUT,14,140", // 2870 "B22F" "PGOUT" "RRE" 14
};
String[] op_table_DFLT_directives = // Split directives from opcodes #533
{"--=ACALLPRM,228,--", // "ACALLPRM" resets ACALL parms just before AENTRY #533
Expand Down Expand Up @@ -3656,6 +3662,7 @@ public void create_opcodes() // Routine added for RPI 1209
process_opcodes(op_table_XA);
process_opcodes(op_table_ESA);
process_opcodes(op_table_ESA_only); // #554
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_360_20_directives); // #543
process_opcodes(op_table_DOS_directives);
process_opcodes(op_table_370_directives);
Expand All @@ -3666,6 +3673,7 @@ public void create_opcodes() // Routine added for RPI 1209
process_opcodes(op_table_370);
process_opcodes(op_table_XA);
process_opcodes(op_table_ESA);
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_ZOP);
process_opcodes(op_table_360_20_directives); // #543
process_opcodes(op_table_DOS_directives);
Expand All @@ -3677,6 +3685,7 @@ public void create_opcodes() // Routine added for RPI 1209
process_opcodes(op_table_370);
process_opcodes(op_table_XA);
process_opcodes(op_table_ESA);
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_ZOP);
process_opcodes(op_table_YOP);
process_opcodes(op_table_360_20_directives); // #543
Expand All @@ -3689,6 +3698,7 @@ public void create_opcodes() // Routine added for RPI 1209
process_opcodes(op_table_370);
process_opcodes(op_table_XA);
process_opcodes(op_table_ESA);
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_ZOP);
process_opcodes(op_table_YOP);
process_opcodes(op_table_ZS3);
Expand All @@ -3702,6 +3712,7 @@ public void create_opcodes() // Routine added for RPI 1209
process_opcodes(op_table_370);
process_opcodes(op_table_XA);
process_opcodes(op_table_ESA);
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_ZOP);
process_opcodes(op_table_YOP);
process_opcodes(op_table_ZS3);
Expand All @@ -3717,6 +3728,7 @@ public void create_opcodes() // Routine added for RPI 1209
process_opcodes(op_table_370);
process_opcodes(op_table_XA);
process_opcodes(op_table_ESA);
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_ZOP);
process_opcodes(op_table_YOP);
process_opcodes(op_table_ZS3);
Expand All @@ -3732,6 +3744,7 @@ public void create_opcodes() // Routine added for RPI 1209
process_opcodes(op_table_370); // #503
process_opcodes(op_table_XA); // #503
process_opcodes(op_table_ESA); // #503
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_ZOP); // #503
process_opcodes(op_table_YOP); // #503
process_opcodes(op_table_ZS3); // #503
Expand All @@ -3753,6 +3766,7 @@ public void create_opcodes() // Routine added for RPI 1209
}
process_opcodes(op_table_XA);
process_opcodes(op_table_ESA);
if (opt_allow) process_opcodes(op_table_ESA_allow); // #561
process_opcodes(op_table_ZOP);
process_opcodes(op_table_YOP);
process_opcodes(op_table_ZS3);
Expand Down

0 comments on commit c27866a

Please sign in to comment.