diff --git a/mac/WTO.MAC b/mac/WTO.MAC index 1e9be1c55..545c832e1 100644 --- a/mac/WTO.MAC +++ b/mac/WTO.MAC @@ -31,6 +31,7 @@ .* 06/14/07 RPI 641 DEFAULT MF=I .* 08/21/07 RPI 670 CORRECT REG OPTIMIZATION TO HANDLE ANY REG SYMBOL .* 04/19/08 RPI 833 ADD STRING QUOTES FOR HLASM COMPATIBILITY +.* 05/31/24 #500 BRAS not supported when optable DOS is used .********************************************************************* &N WTO &MSG, 'TEXT' OR TEXT= REQUIRED X &TEXT=, MULTIPLE QUOTED TEXT ELSE ERROR X @@ -58,8 +59,11 @@ AIF ('&MSG'(1,2) NE '(''').ERR2 &MSGTEXT SETC '&MSG'(2,K'&MSG-2) .WTOMSG ANOP - BRAS 1,*+(WTO#&SYSNDX._EOT-*+1)/2*2 - DC AL2(WTO#&SYSNDX._EOT-*,0),C&MSGTEXT + AIF (O'BRAS NE 'U').GENBRAS BRAS opcode defined? #500 +.GENBAL BAL 1,*+(WTO#&SYSNDX._EOT-*+1)/2*2 #500 + AGO .GENTXT #500 +.GENBRAS BRAS 1,*+(WTO#&SYSNDX._EOT-*+1)/2*2 #500 +.GENTXT DC AL2(WTO#&SYSNDX._EOT-*,0),C&MSGTEXT WTO#&SYSNDX._EOT EQU * SVC 35 MEXIT diff --git a/mac/ZRTOPTBL.CPY b/mac/ZRTOPTBL.CPY new file mode 100644 index 000000000..75099e13a --- /dev/null +++ b/mac/ZRTOPTBL.CPY @@ -0,0 +1,314 @@ +*********************************************************************** +* Start create : 2024-05-31 +* 1st delivery : +* Designer : AF Kornelis +* Programmer : AF Kornelis +* Purpose : Standard routine to +* compare a z390 optable listing +* with the HLASM equivalent +*********************************************************************** + +*********************************************************************** +* +* Program initialization +* +*********************************************************************** +MAINLINE DS 0H +* +* Open all datasets + OPEN (Z390PRN,,HLASMPRN) + LTR R15,R15 * Check return code + BNZ ERROR01 * On error exit + + BAL R14,GETZ390 * Read all z390 opcode entries + BAL R14,GETHLASM * Read all hlasm opcode entries + BAL R14,COMPARE * Compare entries in both tables +* +* Close all datasets +CLOSEFILES DS 0H + CLOSE (Z390PRN,,HLASMPRN) + LTR R15,R15 * Check return code + BNZ ERROR02 * On error exit + +*********************************************************************** +* +* Program exit, returncode in field RETCODE +* +*********************************************************************** +EXIT DS 0H * Workarea handling + XR R15,R15 * Reset for return code + IC R15,RETCODE * Pick up return code + L R13,4(,R13) * Get ptr to prev savearea + L R14,12(,R13) * Retrieve return address +******* L R15,16(,R13) * Return code already in R15 + LM R0,R12,20(R13) * Reset all other registers + BR R14 * Return + +*********************************************************************** +* +* Read routine for z390 listing +* +*********************************************************************** +GETZ390 DS 0H + ST R14,GETZ390_RET * Save return address +* +* Reset LASTOPCD to spaces +* We're using the fact that entries are sorted by mnemonic +* to detect the end of the opcode list + MVC LASTOPCD,=CL8' ' * Set to spaces + L R5,=AL4(Z390TBL) * Point entries buffer + +* +* Read record, at end set eof indicator +GETZ390_READ DS 0H + GET Z390PRN,Z390REC * Retrieve record +GETZ390_READ2 DS 0H * Resume point after EOF +.* LTR R15,R15 * Get does not return error +.* BNZ ERROR03 * indicator + + CLI Z390EOF,X'FF' * EOF reached? + BE GETZ390_END * Okay - we're done + + CLI Z390EOF,X'10' * opcode table detected? + BE GETZ390_PROCESS * Yes: process input record + +* +* Opcode table not yet started: scan for marker + CLC MARKER,Z390REC+1 * Record has marker? + BNE GETZ390_READ * No: ignore record + MVI Z390EOF,X'10' * Indicate marker found + B GETZ390_READ * go process the entries + +GETZ390_PROCESS DS 0H +* +* Ignore any lines that start with a non-blank character + CLI Z390REC,C' ' * blank char in first pos? + BNE GETZ390_READ * no: get next record +* +* Ignore any lines having the marker + CLC MARKER,Z390REC+1 * Record has marker? + BE GETZ390_READ * Yes: ignore record +* +* Should be a valid line with up to three entries + LA R4,Z390REC+1 * point first entry +GETZ390_PROCENT DS 0H * Process an entry + CLC LASTOPCD,0(R4) * Compare mnemonics + BNL GETZ390_END * End of list reached! + C R5,=AL4(Z390TBL_END) * Table overflow? + BNL ERROR05 * Oh no - need bigger table! + MVC 0(L'MARKER,R5),0(R4) * Copy the entry + MVC LASTOPCD,0(R4) * update last mnemonic + LA R5,L'MARKER(,R5) * Bump buffer pointer + LA R4,L'MARKER(,R4) * Bump input pointer + C R4,=AL4(Z390REC+1+3*L'MARKER) * record done? + BL GETZ390_PROCENT * no: process next entry + B GETZ390_READ * yes: get next record + +GETZ390_END DS 0H + ST R5,Z390MPT * Save ptr to empty entry + MVC 0(8,R5),=CL8'99999999' * terminator mnemonic + L R14,GETZ390_RET * Get return address + BR R14 * Return + +*********************************************************************** +* +* Read routine for HLASM listing +* +*********************************************************************** +GETHLASM DS 0H + ST R14,GETHLASM_RET * Save return address +* +* Reset LASTOPCD to spaces +* We're using the fact that entries are sorted by mnemonic +* to detect the end of the opcode list + MVC LASTOPCD,=CL8' ' * Set to spaces + L R5,=AL4(HLASMTBL) * Point entries buffer + +* +* Read record, at end set eof indicator +GETHLASM_READ DS 0H + GET HLASMPRN,HLASMREC * Retrieve record +GETHLASM_READ2 DS 0H * Resume point after EOF +.* LTR R15,R15 * Get does not return error +.* BNZ ERROR04 * indicator + + CLI HLASMEOF,X'FF' * EOF reached? + BE GETHLASM_END * Okay - we're done + + CLI HLASMEOF,X'10' * opcode table detected? + BE GETHLASM_PROCESS * Yes: process input record + +* +* Opcode table not yet started: scan for marker + CLC MARKER,HLASMREC+1 * Record has marker? + BNE GETHLASM_READ * No: ignore record + MVI HLASMEOF,X'10' * Indicate marker found + B GETHLASM_READ * go process the entries + +GETHLASM_PROCESS DS 0H +* +* Ignore any lines that have a non-blank character in position 2 +* (column 1 is reserved for the ASA printer control character) + CLI HLASMREC+1,C' ' * blank char in second pos? + BE GETHLASM_READ * yes: get next record +* +* Ignore any lines having the marker + CLC MARKER,HLASMREC+1 * Record has marker? + BE GETHLASM_READ * Yes: ignore record +* +* Should be a valid line with up to three entries + LA R4,HLASMREC+1 * point first entry +GETHLASM_PROCENT DS 0H * Process an entry + CLC LASTOPCD,0(R4) * Compare mnemonics + BNL GETHLASM_END * End of list reached! + C R5,=AL4(HLASMTBL_END) * Table overflow? + BNL ERROR05 * Oh no - need bigger table! + MVC 0(L'MARKER,R5),0(R4) * Copy the entry + MVC LASTOPCD,0(R4) * update last mnemonic + LA R5,L'MARKER(,R5) * Bump buffer pointer + LA R4,L'MARKER(,R4) * Bump input pointer + C R4,=AL4(HLASMREC+1+3*L'MARKER) * record done? + BL GETHLASM_PROCENT * no: process next entry + B GETHLASM_READ * yes: get next record + +GETHLASM_END DS 0H + ST R5,HLASMMPT * Save ptr to empty entry + MVC 0(8,R5),=CL8'99999999' * terminator mnemonic + L R14,GETHLASM_RET * Get return address + BR R14 * Return + +*********************************************************************** +* +* Compare routine for extracted opcode definitions +* +*********************************************************************** +COMPARE DS 0H + ST R14,COMPARE_RET * Save return address + + L R4,=AL4(Z390TBL) * Point entries buffer + L R5,Z390MPT * end of buffer + L R6,=AL4(HLASMTBL) * Point entries buffer + L R7,HLASMMPT * Table overflow? + +COMPARE_LOOP DS 0H + CLC 0(8,R4),0(R6) * Compare mnemonics + BL ERROR06 * Superfluous z390 opcode + BH ERROR07 * Missing z390 opcode + CLC 0(&ENTRYLEN.,R4),0(R6) * Compare entire entry + BNE ERROR08 * Report incorrec definition + LA R4,&ENTRYLEN.(,R4) * Bump z390 entry pointer + LA R6,&ENTRYLEN.(,R6) * Bump hlasm entry pointer +COMPARE_NEXT DS 0H * advance to next entry + CLR R4,R5 * z390 table exhausted? + BL COMPARE_LOOP * no: compare next entry + CLR R6,R7 * hlasm table exhausted? + BL COMPARE_LOOP * no: compare next entry + +* +* We're done: both tables are exhausted + L R14,COMPARE_RET * Get return address + BR R14 * Return + +*********************************************************************** +* +* EOF routines +* +*********************************************************************** +Z390END DS 0H + MVI Z390EOF,X'FF' * switch eof indicator on + BR R14 + +HLASMEND DS 0H + MVI HLASMEOF,X'FF' * switch eof indicator on + BR R14 + +*********************************************************************** +* +* Error routines +* +*********************************************************************** +ERROR01 DS 0H + WTO 'Error: Open failed',ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + B EXIT + +ERROR02 DS 0H + WTO 'Error: Close failed',ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + B EXIT + +ERROR03 DS 0H + WTO 'Error reading z390 listing',ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + B CLOSEFILES + +ERROR04 DS 0H + WTO 'Error reading HLASM listing',ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + B CLOSEFILES + +ERROR05 DS 0H + WTO 'Error: Internal tables are too small', * + ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + B CLOSEFILES + +ERROR06 DS 0H + MVC *+30(8),0(R4) * insert mnemonic into msg + WTO 'Error: mnemonic xxxxxxxx was not expected', * + ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + LA R4,&ENTRYLEN.(,R4) * Bump z390 entry pointer only + B COMPARE_NEXT + +ERROR07 DS 0H + MVC *+30(8),0(R6) * insert mnemonic into msg + WTO 'Error: mnemonic xxxxxxxx was expected but not found', * + ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + LA R6,&ENTRYLEN.(,R6) * Bump hlasm entry pointer only + B COMPARE_NEXT + +ERROR08 DS 0H + MVC *+30(8),0(R4) * insert mnemonic into msg + WTO 'Error: mnemonic xxxxxxxx incorrectly defined', * + ROUTCDE=11,DESC=(6) + MVI RETCODE,8 + LA R4,&ENTRYLEN.(,R4) * Bump z390 entry pointer + LA R6,&ENTRYLEN.(,R6) * Bump hlasm entry pointer + B COMPARE_NEXT + +*********************************************************************** +* +* Data areas +* +*********************************************************************** + LTORG , + +SAVEAREA DS 0D + DS 18F * Savearea for chaining +GETZ390_RET DS F * Return address +GETHLASM_RET DS F * Return address +COMPARE_RET DS F * Return address + +Z390PRN DCB DSORG=PS,MACRF=GM,DDNAME=Z390PRN,EODAD=Z390END, * + RECFM=FT,LRECL=&Z390LEN +HLASMPRN DCB DSORG=PS,MACRF=GM,DDNAME=HLASMPRN,EODAD=HLASMEND, * + RECFM=FT,LRECL=&HLASMLEN + +LASTOPCD DS CL8 * Last mnemonic processed +Z390MPT DS AL4 * Ptr to empty entry (=end) +HLASMMPT DS AL4 * Ptr to empty entry (=end) + +Z390EOF DC XL1'00' +HLASMEOF DC XL1'00' +RETCODE DC XL1'00' * Return code from program +Z390REC DS CL(&Z390LEN) +HLASMREC DS CL(&HLASMLEN) + + DS 0D +Z390TBL DS (&TBLSIZE)CL(&ENTRYLEN) * room for lots of opcodes +Z390TBL_END EQU *-1 * Last byte of table + DS 0D +HLASMTBL DS (&TBLSIZE)CL(&ENTRYLEN) * room for lots of opcodes +HLASMTBL_END EQU *-1 * Last byte of table diff --git a/rt/bat/RUNOPTABLES.BAT b/rt/bat/RUNOPTABLES.BAT new file mode 100644 index 000000000..49d368a4e --- /dev/null +++ b/rt/bat/RUNOPTABLES.BAT @@ -0,0 +1,31 @@ +@if /I "%1" == "tron" (echo on) else (echo off) +rem regression test z390 instructions + +setlocal +if /I "%1" == "tron" (set z_TraceMode=tron + shift /1 + ) else (if /I "%1" == "troff" (set z_TraceMode=troff + shift /1 + ) else (set z_TraceMode=) + ) +set /A z_NestLevel=%z_NestLevel%+1 +rem ----- Lvl(%z_NestLevel%) Start %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 + +pushd %~dps0..\.. +set z_MaxRetCode=0 + +rem Optable DOS +set Z390PRN=rt\rt\OPCD$DOS.PRN +set HLASMPRN=rt\rt\OPCD$DOS.TF1 +set SYSOUT=rt\rt\OPCD$DOS.OUT +call bat\asmlg.bat %z_TraceMode% rt\rt\OPCD$DOS @rt\rt\OPCD$DOS.OPT +set z_ReturnCode=%ERRORLEVEL% +if %z_ReturnCode% EQU 0 (echo %0 - OPCD$DOS "optable(DOS)" is okay + ) else ( + echo %0 ERROR: OPCD$DOS returned %z_ReturnCode% for "optable(DOS)" + if (%z_ReturnCode% GTR %z_MaxRetCode% (set z_MaxRetCode=%z_ReturnCode%) + ) +:return +popd +rem ----- Lvl(%z_NestLevel%) End %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 +exit /b %z_MaxRetCode% diff --git a/rt/rt/OPCD$DOS.MLC b/rt/rt/OPCD$DOS.MLC new file mode 100644 index 000000000..58c52a979 --- /dev/null +++ b/rt/rt/OPCD$DOS.MLC @@ -0,0 +1,46 @@ +OPCD$DOS TITLE 'Validate DOS opcode table' +*********************************************************************** +* Start create : 2024-05-31 +* 1st delivery : +* Designer : AF Kornelis +* Programmer : AF Kornelis +* Purpose : For testing +*********************************************************************** + + YREGS , * register equates + +*********************************************************************** +* +* Program entry and linkage +* +*********************************************************************** +OPCD$DOS CSECT , * +*PCD$DOS AMODE 24 * Not supported in DOS +*PCD$DOS RMODE 24 * Not supported in DOS + + USING OPCD$DOS,R15 * Establish addressability + B START * Skip header data + DC AL1(START-*),C'&SYSECT &SYSDATE &SYSTIME' +START DS 0H + STM R14,R12,12(R13) * Save GPRs + LR R12,R15 * Copy base address + DROP R15 * No longer needed + USING OPCD$DOS,R12 * Re-establish addressability + + LA R15,SAVEAREA * Point new savearea + ST R15,8(,R13) * Set ptr to new savearea + ST R13,4(,R15) * Set ptr from new to prev save + LR R13,R15 * Activate new savearea + + B MAINLINE * Start the program +* +* Major constants for this program +MARKER DC C'Mnemonic Frmt HexOP Operands ' +&ENTRYLEN SETA (L'MARKER) * Marker Length = Entry Length +&TBLSIZE SETA 5000 * Max nr of opcodes to expect +&Z390LEN SETA 256 * Length of z390 listing record +&HLASMLEN SETA 160 * Length of HLASM listing record + + COPY ZRTOPTBL * Logic to compare optable lists + + END , * diff --git a/rt/rt/OPCD$DOS.OPT b/rt/rt/OPCD$DOS.OPT new file mode 100644 index 000000000..dfce0b632 --- /dev/null +++ b/rt/rt/OPCD$DOS.OPT @@ -0,0 +1,5 @@ +optable(dos,list) + stats +noloadhigh + dump +notest diff --git a/rt/rt/OPCD$DOS.TF1 b/rt/rt/OPCD$DOS.TF1 new file mode 100644 index 000000000..9c6f6a9eb --- /dev/null +++ b/rt/rt/OPCD$DOS.TF1 @@ -0,0 +1,200 @@ +1 High Level Assembler Option Summary (PTF UI80020) Page 1 +- HLASM R6.0 2024/05/29 10.11 +0 No Overriding ASMAOPT Parameters + Overriding Parameters- OPTABLE(DOS,LIST) + No Process Statements + + + Options for this Assembly +0 NOADATA + ALIGN + ASA + BATCH + CODEPAGE(047C) + NOCOMPAT + NODATAMAP + NODBCS + NODECK + DXREF + ESD + NOEXIT + FAIL(NOMSG,NOMNOTE,MAXERRS(500)) + FLAG(0,ALIGN,CONT,EXLITW,NOIMPLEN,NOLONGER,NOPAGE0,PUSH,RECORD,RENT,NOSIGNED,NOSUBSTR,NOTRUNC, + USING0) + NOFOLD + NOGOFF + ILMA + NOINFO + LANGUAGE(EN) + NOLIBMAC + LINECOUNT(60) + LIST(121) + 3 PARM/OPTION MACHINE(,LIST) + MXREF(SOURCE) + OBJECT + 3 PARM/OPTION OPTABLE(DOS,LIST) + NOPCONTROL + NOPESTOP + NOPROFILE + NORA2 + NORENT + RLD + RXREF + SECTALGN(8) + SIZE(MAX) + NOSUPRWARN + SYSPARM() + NOTERM + NOTEST + THREAD + NOTRANSLATE + TYPECHECK(MAGNITUDE,REGISTER,SIGNED) + USING(NOLIMIT,MAP,WARN(15)) + NOWORKFILE + XREF(SHORT,UNREFS) + + No Overriding DD Names +1 High Level Assembler Operation Code Table Contents Page 2 +- HLASM R6.0 2024/05/29 10.11 +0Mnemonic Frmt HexOP Operands Mnemonic Frmt HexOP Operands Mnemonic Frmt HexOP Operands +0A RX 5A R1,D2(X2,B2) ACTR HLASM AD RX 6A R1,D2(X2,B2) + ADR RR 2A R1,R2 AE RX 7A R1,D2(X2,B2) AER RR 3A R1,R2 + AGO HLASM AGOB HLASM AH RX 4A R1,D2(X2,B2) + AIF HLASM AIFB HLASM AL RX 5E R1,D2(X2,B2) + ALR RR 1E R1,R2 ANOP HLASM AP SS FA D1(L1,B1),D2(L2,B2) + AR RR 1A R1,R2 AU RX 7E R1,D2(X2,B2) AUR RR 3E R1,R2 + AW RX 6E R1,D2(X2,B2) AWR RR 2E R1,R2 AXR RR 36 R1,R2 + B RX 47F. D2(X2,B2) BAL RX 45 R1,D2(X2,B2) BALR RR 05 R1,R2 + BC RX 47 M1,D2(X2,B2) BCR RR 07 M1,R2 BCT RX 46 R1,D2(X2,B2) + BCTR RR 06 R1,R2 BE RX 478. D2(X2,B2) BER RR 078. R2 + BH RX 472. D2(X2,B2) BHR RR 072. R2 BL RX 474. D2(X2,B2) + BLR RR 074. R2 BM RX 474. D2(X2,B2) BMR RR 074. R2 + BNE RX 477. D2(X2,B2) BNER RR 077. R2 BNH RX 47D. D2(X2,B2) + BNHR RR 07D. R2 BNL RX 47B. D2(X2,B2) BNLR RR 07B. R2 + BNM RX 47B. D2(X2,B2) BNMR RR 07B. R2 BNO RX 47E. D2(X2,B2) + BNOR RR 07E. R2 BNP RX 47D. D2(X2,B2) BNPR RR 07D. R2 + BNZ RX 477. D2(X2,B2) BNZR RR 077. R2 BO RX 471. D2(X2,B2) + BOR RR 071. R2 BP RX 472. D2(X2,B2) BPR RR 072. R2 + BR RR 07F. R2 BXH RS 86 R1,R3,D2(B2) BXLE RS 87 R1,R3,D2(B2) + BZ RX 478. D2(X2,B2) BZR RR 078. R2 C RX 59 R1,D2(X2,B2) + CCW HLASM CD RX 69 R1,D2(X2,B2) CDR RR 29 R1,R2 + CDS RS BB R1,R3,D2(B2) CE RX 79 R1,D2(X2,B2) CER RR 39 R1,R2 + CH RX 49 R1,D2(X2,B2) CL RX 55 R1,D2(X2,B2) CLC SS D5 D1(L,B1),D2(B2) + CLCL RR 0F R1,R2 CLI SI 95 D1(B1),I2 CLM RS BD R1,M3,D2(B2) + CLR RR 15 R1,R2 CLRIO S 9D01 D2(B2) CNOP HLASM + COM HLASM COPY HLASM CP SS F9 D1(L1,B1),D2(L2,B2) + CR RR 19 R1,R2 CS RS BA R1,R3,D2(B2) CSECT HLASM + CVB RX 4F R1,D2(X2,B2) CVD RX 4E R1,D2(X2,B2) D RX 5D R1,D2(X2,B2) + DC HLASM DD RX 6D R1,D2(X2,B2) DDR RR 2D R1,R2 + DE RX 7D R1,D2(X2,B2) DER RR 3D R1,R2 DP SS FD D1(L1,B1),D2(L2,B2) + DR RR 1D R1,R2 DROP HLASM DS HLASM + DSECT HLASM ED SS DE D1(L,B1),D2(B2) EDMK SS DF D1(L,B1),D2(B2) + EJECT HLASM END HLASM ENTRY HLASM + EQU HLASM EX RX 44 R1,D2(X2,B2) EXTRN HLASM + GBLA HLASM GBLB HLASM GBLC HLASM + HDR RR 24 R1,R2 HDV S 9E01 D2(B2) HER RR 34 R1,R2 + HIO S 9E00 D2(B2) IC RX 43 R1,D2(X2,B2) ICM RS BF R1,M3,D2(B2) + ICTL HLASM IPK S B20B ISEQ HLASM + ISK RR 09 R1,R2 L RX 58 R1,D2(X2,B2) LA RX 41 R1,D2(X2,B2) + LCDR RR 23 R1,R2 LCER RR 33 R1,R2 LCLA HLASM + LCLB HLASM LCLC HLASM LCR RR 13 R1,R2 + LCTL RS B7 R1,R3,D2(B2) LD RX 68 R1,D2(X2,B2) LDR RR 28 R1,R2 + LE RX 78 R1,D2(X2,B2) LER RR 38 R1,R2 LH RX 48 R1,D2(X2,B2) + LM RS 98 R1,R3,D2(B2) LNDR RR 21 R1,R2 LNER RR 31 R1,R2 + LNR RR 11 R1,R2 LPDR RR 20 R1,R2 LPER RR 30 R1,R2 + LPR RR 10 R1,R2 LPSW SI 82 D1(B1) LR RR 18 R1,R2 + LRA RX B1 R1,D2(X2,B2) LRDR RR 25 R1,R2 LRER RR 35 R1,R2 + LTDR RR 22 R1,R2 LTER RR 32 R1,R2 LTORG HLASM + LTR RR 12 R1,R2 M RX 5C R1,D2(X2,B2) MACRO HLASM + MC SI AF D1(B1),I2 MD RX 6C R1,D2(X2,B2) MDE RX 7C R1,D2(X2,B2) + MDER RR 3C R1,R2 MDR RR 2C R1,R2 ME RX 7C R1,D2(X2,B2) + MEND HLASM MER RR 3C R1,R2 MEXIT HLASM + MH RX 4C R1,D2(X2,B2) MNOTE HLASM MP SS FC D1(L1,B1),D2(L2,B2) +1 High Level Assembler Operation Code Table Contents Page 3 +- HLASM R6.0 2024/05/29 10.11 +0Mnemonic Frmt HexOP Operands Mnemonic Frmt HexOP Operands Mnemonic Frmt HexOP Operands +0MR RR 1C R1,R2 MVC SS D2 D1(L,B1),D2(B2) MVCIN SS E8 D1(L,B1),D2(B2) + MVCL RR 0E R1,R2 MVI SI 92 D1(B1),I2 MVN SS D1 D1(L,B1),D2(B2) + MVO SS F1 D1(L1,B1),D2(L2,B2) MVZ SS D3 D1(L,B1),D2(B2) MXD RX 67 R1,D2(X2,B2) + MXDR RR 27 R1,R2 MXR RR 26 R1,R2 N RX 54 R1,D2(X2,B2) + NC SS D4 D1(L,B1),D2(B2) NI SI 94 D1(B1),I2 NOP RX 470. D2(X2,B2) + NOPR RR 070. R2 NR RR 14 R1,R2 O RX 56 R1,D2(X2,B2) + OC SS D6 D1(L,B1),D2(B2) OI SI 96 D1(B1),I2 OR RR 16 R1,R2 + ORG HLASM PACK SS F2 D1(L1,B1),D2(L2,B2) PRINT HLASM + PTLB S B20D PUNCH HLASM RDD SI 85 D1(B1),I2 + REPRO HLASM RRB S B213 D2(B2) S RX 5B R1,D2(X2,B2) + SCK S B204 D2(B2) SCKC S B206 D2(B2) SD RX 6B R1,D2(X2,B2) + SDR RR 2B R1,R2 SE RX 7B R1,D2(X2,B2) SER RR 3B R1,R2 + SETA HLASM SETB HLASM SETC HLASM + SH RX 4B R1,D2(X2,B2) SIO S 9C00 D2(B2) SIOF S 9C01 D2(B2) + SL RX 5F R1,D2(X2,B2) SLA RS 8B R1,D2(B2) SLDA RS 8F R1,D2(B2) + SLDL RS 8D R1,D2(B2) SLL RS 89 R1,D2(B2) SLR RR 1F R1,R2 + SP SS FB D1(L1,B1),D2(L2,B2) SPACE HLASM SPKA S B20A D2(B2) + SPM RR 04 R1 SPT S B208 D2(B2) SR RR 1B R1,R2 + SRA RS 8A R1,D2(B2) SRDA RS 8E R1,D2(B2) SRDL RS 8C R1,D2(B2) + SRL RS 88 R1,D2(B2) SRP SS F0 D1(L1,B1),D2(B2),I3 SSK RR 08 R1,R2 + SSM SI 80 D1(B1) ST RX 50 R1,D2(X2,B2) START HLASM + STC RX 42 R1,D2(X2,B2) STCK S B205 D2(B2) STCKC S B207 D2(B2) + STCM RS BE R1,M3,D2(B2) STCTL RS B6 R1,R3,D2(B2) STD RX 60 R1,D2(X2,B2) + STE RX 70 R1,D2(X2,B2) STH RX 40 R1,D2(X2,B2) STIDC S B203 D2(B2) + STIDP S B202 D2(B2) STM RS 90 R1,R3,D2(B2) STNSM SI AC D1(B1),I2 + STOSM SI AD D1(B1),I2 STPT S B209 D2(B2) SU RX 7F R1,D2(X2,B2) + SUR RR 3F R1,R2 SVC RR 0A I1 SW RX 6F R1,D2(X2,B2) + SWR RR 2F R1,R2 SXR RR 37 R1,R2 TCH S 9F00 D2(B2) + TIO S 9D00 D2(B2) TITLE HLASM TM SI 91 D1(B1),I2 + TR SS DC D1(L,B1),D2(B2) TRT SS DD D1(L,B1),D2(B2) TS SI 93 D1(B1) + UNPK SS F3 D1(L1,B1),D2(L2,B2) USING HLASM WRD SI 84 D1(B1),I2 + WXTRN HLASM X RX 57 R1,D2(X2,B2) XC SS D7 D1(L,B1),D2(B2) + XI SI 97 D1(B1),I2 XR RR 17 R1,R2 ZAP SS F8 D1(L1,B1),D2(L2,B2) +1 External Symbol Dictionary Page 4 +-Symbol Type Id Address Length Owner Id Flags Alias-of HLASM R6.0 2024/05/29 10.11 +0IEFBR14 SD 00000001 00000000 00000004 00 +1 Page 5 + Active Usings: None +0 Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R6.0 2024/05/29 10.11 +0000000 00000 00004 1 IEFBR14 CSECT + 000000 1BFF 2 SR 15,15 + 000002 07FE 3 BR 14 + 4 END +1 Unreferenced Symbols Defined in CSECTs Page 6 +- Defn Symbol HLASM R6.0 2024/05/29 10.11 +0 1 IEFBR14 +1 General Purpose Register Cross Reference Page 7 +- Register References (M=modified, B=branch, U=USING, D=DROP, N=index) HLASM R6.0 2024/05/29 10.11 +0 0(0) (no references identified) + 1(1) (no references identified) + 2(2) (no references identified) + 3(3) (no references identified) + 4(4) (no references identified) + 5(5) (no references identified) + 6(6) (no references identified) + 7(7) (no references identified) + 8(8) (no references identified) + 9(9) (no references identified) + 10(A) (no references identified) + 11(B) (no references identified) + 12(C) (no references identified) + 13(D) (no references identified) + 14(E) 3B + 15(F) 2M 2 +1 Diagnostic Cross Reference and Assembler Summary Page 8 +- HLASM R6.0 2024/05/29 10.11 +0 No Statements Flagged in this Assembly + HIGH LEVEL ASSEMBLER, 5696-234, RELEASE 6.0, PTF UI80020 +0SYSTEM: z/OS 02.05.00 JOBNAME: JGANCI1 STEPNAME: ASM PROCSTEP: C +0Unicode Module: ASMA047C From Page 1148 To Page 17584 ECECP: International 1 + Data Sets Allocated for this Assembly + Con DDname Data Set Name Volume Member + P1 SYSIN JGANCI.TEST.SOURCE xxxxxx IEFBR14 + L1 SYSLIB JGANCI.TEST.MACRO xxxxxx + L2 SYS1.MACLIB xxxxxx + L3 SYS1.MODGEN CBTRSB + SYSLIN SYS24150.T101157.RA000.JGANCI1.OBJ.H01 WORK0B + SYSPRINT JGANCI.TEST.SYSPRINT xxxxxx IEFBR14 + + 26600K allocated to Buffer Pool Storage required 200K + 4 Primary Input Records Read 0 Library Records Read 0 Work File Reads + 0 ASMAOPT Records Read 200 Primary Print Records Written 0 Work File Writes + 3 Object Records Written 0 ADATA Records Written +0Assembly Start Time: 10.11.57 Stop Time: 10.11.57 Processor Time: 00.00.00.0004 + Return Code 000 diff --git a/src/az390.java b/src/az390.java index c2bf985ea..5ee7c0af4 100644 --- a/src/az390.java +++ b/src/az390.java @@ -421,6 +421,7 @@ public class az390 implements Runnable { * 2022-06-10 DSH z16 #423 correct rotate instruction errors reported by Dan Greiner * 2022-10-24 jjg #451 z390 ignores CODEPAGE option for input; * replace non-printable with '.' in PRN, BAL, PCH + * 2024-05-29 afk #500 List suboption for options optable/machine not implemented correctly ***************************************************** * Global variables last rpi *****************************************************/ @@ -1731,141 +1732,181 @@ private void reset_lits(){ Arrays.fill(lit_gen,0,tot_lit,(byte)0); // RPI 411 } } + + + + /** // #500 + * Lists all menmonics in the selected opcode table + * + * All menmonics from the current opcode table are converted into report entries + * The report entries are sorted + * The sorted entries are printed (three on a print line) preceded by a header line + * + * @param (none) + * @return (none) + */ + private void gen_list_mnemonics() // Routine added for RPI 1209A {int index; String entry; String[] report_entries = null; // See process_opcodes() RPI 1209G /* Create Array of strings listing the opcodes supported by current optable */ + /* each entry consists of four subfields: Mnemonic Format HexOP Operands */ // #500 + /* The logic breaks down into three sections: */ // #500 + /* 1. for each instruction select the proper value for each subfield */ // #500 + /* internal instructions are suppressed */ // #500 + /* 2. for each instruction format the four subfields into a complete entry */ // #500 + /* 3. sort the entries, then print three entries per line */ // #500 + String my_mnemonic; // #500 + String my_format; // #500 + String my_hexop; // #500 + String my_operands; // #500 + String my_hdr = "Mnemonic Frmt HexOP Operands "; // #500 + String my_spc = " "; // #500 + int mnem_len =8; // length of mnemonic column // #500 + int format_len =4; // length of format column // #500 + int hexop_len =4; // length of hexop column // #500 + int operand_len=20; // length of operands column // #500 + String my_prn_line; // print line being constructed // #500 + int my_entry_count; // nr of entries on current print line // #500 report_entries = new String[tz390.op_name.length]; index=0; while (index < tz390.op_name.length) - {entry=tz390.op_name[index]+" "; - entry=entry.substring(0,9); - if (tz390.op_type[index] >= 100) - {entry=entry+"HLASM"; + {if (tz390.op_type[index] >= 100) // #500 + {my_mnemonic=tz390.op_name[index]; // #500 + my_format="HLASM"; // #500 + my_hexop=""; // #500 + my_operands=""; // #500 + my_mnemonic=(my_mnemonic+my_spc).substring(0,mnem_len ); // #500 + entry=my_mnemonic+" "+my_format+" "+my_hexop+" "+my_operands; // #500 + entry=(entry+my_spc).substring(0,mnem_len+format_len+hexop_len+operand_len+3); // #500 } - else - {switch (tz390.op_type[index]) + else // types 0-99 are for normal instructions // #500 + {my_mnemonic=tz390.op_name[index]; // #500 + my_format=""; // #500 + my_hexop=tz390.op_code[index]; // #500 + my_operands=""; // #500 + switch (tz390.op_type[index]) // #500 {case 0: // comment lines break; case 1: - entry=entry+"E "+tz390.op_code[index]; + my_format="E"; // #500 break; case 2: - entry=entry+"RR "+tz390.op_code[index]; - if (tz390.op_name[index].equals("SPM")) - {entry=entry+" R1"; + my_format="RR"; // #500 + my_operands="R1,R2"; // #500 + if (my_mnemonic.equals("SPM")) // #500 + {my_operands="R1"; // #500 } else if (tz390.op_trace_type[index]==30) - {entry=entry+" M1,R2"; - } - else - {entry=entry+" R1,R2"; + {my_operands="R2"; // #500 + my_hexop=my_hexop+"."; // #500 } break; case 3: - entry=entry+"RR "+tz390.op_code[index]+". R2"; + my_format="RR"; // #500 + my_operands="M1,R2"; // #500 break; case 4: - entry=entry+"RR "+tz390.op_code[index]+" I1"; + my_format="RR"; // #500 + my_operands="I1"; // #500 break; case 5: - entry=entry+"RX "+tz390.op_code[index]; - if (tz390.op_name[index].equals("BC")) - {entry=entry+" M1,D2(X2,B2)"; + my_format="RX"; // #500 + if (my_mnemonic.equals("BC")) // #500 + {my_operands="M1,D2(X2,B2)"; // #500 } else - {entry=entry+" R1,D2(X2,B2)"; + {my_operands="R1,D2(X2,B2)"; // #500 } break; case 6: - entry=entry+"RX "+tz390.op_code[index]+". D2(X2,B2)"; + my_format="RX"; // #500 + my_hexop=my_hexop+"."; // #500 + my_operands="D2(X2,B2)"; // #500 break; case 7: - entry=entry+"S "+tz390.op_code[index]; - if (!tz390.op_name[index].equals("IPK") - && !tz390.op_name[index].equals("PTLB") - && !tz390.op_name[index].equals("CSCH") - && !tz390.op_name[index].equals("HSCH") - && !tz390.op_name[index].equals("RCHP") - && !tz390.op_name[index].equals("RSCH") - && !tz390.op_name[index].equals("SCHM") - && !tz390.op_name[index].equals("SAL") - && !tz390.op_name[index].equals("XSCH")) - {entry=entry+" D2(B2)"; + my_format="S"; // #500 + if (my_mnemonic.equals("IPK") // #500 + || my_mnemonic.equals("PTLB")) // #500 + {my_operands=""; // #500 + } // #500 + else if (my_mnemonic.equals("LPSW") // #500 + || my_mnemonic.equals("SSM") // #500 + || my_mnemonic.equals("TS")) // #500 + {my_format="SI"; // #500 + my_hexop=my_hexop.substring(0,2); // #500 + my_operands="D1(B1)"; // #500 + } // #500 + else // #500 + {my_operands="D2(B2)"; // #500 } break; case 8: // Diagnose instruction - entry=entry+"DM "+tz390.op_code[index]; + my_format="DM"; // #500 break; case 9: - entry=entry+"RSI "+tz390.op_code[index]+" R1,R3,I2"; + my_format="RSI"; // #500 + my_operands="R1,R3,I2"; // #500 break; case 10: - entry=entry+"RS "+tz390.op_code[index]; + my_format="RS"; // #500 + my_operands="R1,R3,I2"; // #500 if (tz390.op_trace_type[index]==101) - {entry=entry+" R1,M3,D2(B2)"; + {my_operands="R1,M3,D2(B2)"; // #500 } else if (tz390.op_trace_type[index]==102) - {entry=entry+" R1,D2(B2)"; + {my_operands="R1,D2(B2)"; // #500 } else - {entry=entry+" R1,R3,D2(B2)"; + {my_operands="R1,R3,D2(B2)"; // #500 } break; case 11: - entry=entry+"SI "+tz390.op_code[index]+" D1(B1),I2"; + my_format="SI"; // #500 + my_operands="D1(B1),I2"; // #500 + if (my_mnemonic.equals("LPSW")) // #500 + {my_operands="D1(B1)"; // #500 + } // #500 break; case 12: - entry=entry+"RI "+tz390.op_code[index].substring(0,2)+"."+tz390.op_code[index].substring(2); + my_format="RI"; // #500 + my_hexop=my_hexop.substring(0,2)+"."+my_hexop.substring(2); // #500 if (tz390.op_name[index].equals("BRC")) - {entry=entry+" M1,I2"; + {my_operands="M1,I2"; // #500 } else - {entry=entry+" R1,I2"; + {my_operands="R1,I2"; // #500 } break; case 13: // Our op_code table has the last two nibbles swapped - entry=entry+"RI "+tz390.op_code[index].substring(0,2)+tz390.op_code[index].substring(3)+tz390.op_code[index].substring(2,3)+" I2"; + my_format="RI"; // #500 + my_hexop=my_hexop.substring(0,2)+"."+my_hexop.substring(3)+my_hexop.substring(2,3); // #500 break; case 14: - if (tz390.opt_optable.equals("ZS3") - || tz390.opt_optable.equals("ZS4") - || tz390.opt_optable.equals("Z390") // RPI 2202 INCLUDE ALL - || tz390.opt_optable.equals("UNI") - ) - {if (tz390.op_code[index].equals("B2A6") // CU21 CUUTF - || tz390.op_code[index].equals("B2A7") // CU12 CUTFU - || tz390.op_name[index].equals("CU14") - || tz390.op_name[index].equals("CU24") - || tz390.op_name[index].equals("LPTEA") - || tz390.op_name[index].equals("SSKE") - || tz390.op_trace_type[index] == 143 // TROO TROT TRTO TRTT - ) - {entry=entry+"RRF "+tz390.op_code[index]; - } - else - {entry=entry+"RRE "+tz390.op_code[index]; - } - } - else - {entry=entry+"RRE "+tz390.op_code[index]; - } - if ((tz390.opt_optable.equals("ZS3") - || tz390.opt_optable.equals("ZS4") - || tz390.opt_optable.equals("Z390") // RPI 2202 INCLUDE ALL - || tz390.opt_optable.equals("UNI") - ) - && (tz390.op_code[index].equals("B2A6") // CU21 CUUTF - || tz390.op_code[index].equals("B2A7") // CU12 CUTFU - || tz390.op_name[index].equals("CU14") - || tz390.op_name[index].equals("CU24") - || tz390.op_name[index].equals("SSKE") - )) - {entry=entry+" R1,R2<,M3>"; - } - else if (tz390.op_trace_type[index]==140) + my_format="RRE"; // #500 + my_operands="R1,R2"; // #500 + //**!! // in newer optables some were reclassified as RRF // #500 + //**!! if ((!tz390.opt_optable.equals("DOS") // #500 + //**!! && !tz390.opt_optable.equals("370") // #500 + //**!! && !tz390.opt_optable.equals("XA") // #500 + //**!! && !tz390.opt_optable.equals("ESA") // #500 + //**!! && !tz390.opt_optable.equals("ZOP") // #500 + //**!! && !tz390.opt_optable.equals("YOP") // #500 + //**!! ) // #500 + //**!! && ( tz390.op_code[index].equals("B2A6") // CU21 CUUTF #500 + //**!! || tz390.op_code[index].equals("B2A7") // CU12 CUTFU #500 + //**!! || tz390.op_name[index].equals("CU14") // #500 + //**!! || tz390.op_name[index].equals("CU24") // #500 + //**!! || tz390.op_name[index].equals("LPTEA") // #500 + //**!! || tz390.op_name[index].equals("SSKE") // #500 + //**!! || tz390.op_trace_type[index] == 143 // TROO TROT TRTO TRTT #500 + //**!! )) // #500 + //**!! {my_format="RRF"; // #500 + //**!! my_operands="R1,R2<,M3>"; // #500 + //**!! } // #500 + if (tz390.op_trace_type[index]==140) // #500 {if (tz390.op_name[index].equals("EPAR") || tz390.op_name[index].equals("ESAR") || tz390.op_name[index].equals("IAC") @@ -1873,13 +1914,10 @@ else if (tz390.op_trace_type[index]==140) || tz390.op_name[index].equals("IPM") || tz390.op_name[index].equals("MSTA") ) - {entry=entry+" R1"; + {my_operands="R1"; // #500 } else if (tz390.op_name[index].equals("PALB")) {} - else - {entry=entry+" R1,R2"; - } } else if (tz390.op_trace_type[index]==142) {if (tz390.op_name[index].equals("EFPC") @@ -1889,383 +1927,441 @@ else if (tz390.op_trace_type[index]==142) || tz390.op_name[index].equals("SFPC") || tz390.op_name[index].equals("SFASR") ) - {entry=entry+" R1"; - } - else - {entry=entry+" R1,R2"; - } - } - else if (tz390.op_trace_type[index]==143) - {if (tz390.opt_optable.equals("ZOP") - || tz390.opt_optable.equals("YOP") - ) - {entry=entry+" R1,R2"; - } - else - {entry=entry+" R1,R2<,M3>"; + {my_operands="R1"; // #500 } } + //**!! else if (tz390.op_trace_type[index]==143) + //**!! {if (!tz390.opt_optable.equals("ZOP") // #500 + //**!! && !tz390.opt_optable.equals("YOP") // #500 + //**!! ) // #500 + //**!! {entry=entry+"R1,R2<,M3>"; // #500 + //**!! } // #500 + //**!! } else if (tz390.op_trace_type[index]==144) {if (tz390.op_name[index].equals("ESEA") || tz390.op_name[index].equals("EPAIR") || tz390.op_name[index].equals("ESAIR") || tz390.op_name[index].equals("SSAIR") ) - {entry=entry+" R1"; + {my_operands="R1"; // #500 } else if (tz390.op_name[index].equals("LPTEA")) - {entry=entry+" R1,R3,R2,M4"; + {my_operands="R1,R3,R2,M4"; // #500 } else if (tz390.op_name[index].equals("PCC") || tz390.op_name[index].equals("PCKMO") ) - {} - else - {entry=entry+" R1,R2"; - } + {my_operands=""; // #500 + } // #500 } else if (tz390.op_trace_type[index]==147) - {entry=entry+" R1"; - } - else - {entry=entry+" R1,R2"; + {my_operands="R1"; // #500 } break; case 15: - entry=entry+"RRF "+tz390.op_code[index]+" R1,R3,R2"; + my_format="RRF"; // #500 + my_operands="R1,R3,R2"; // #500 break; case 16: - entry=entry+"RIL "+tz390.op_code[index].substring(0,2)+"."+tz390.op_code[index].substring(2); + my_format="RIL"; // #500 + my_hexop=my_hexop.substring(0,2)+"."+my_hexop.substring(2); // #500 if (tz390.op_name[index].equals("BRCL") || tz390.op_name[index].equals("PFDRL") ) - {entry=entry+" M1,I2"; + {my_operands="M1,I2"; // #500 } else - {entry=entry+" R1,I2"; + {my_operands="R1,I2"; // #500 } break; case 17: - entry=entry+"SS "+tz390.op_code[index]; + my_format="SS"; // #500 if (tz390.op_name[index].equals("PKU")) - {entry=entry+" D1(B1),D2(L2,B2)"; + {my_operands="D1(B1),D2(L2,B2)"; // #500 } else if (tz390.op_name[index].equals("MVCK") || tz390.op_name[index].equals("MVCP") || tz390.op_name[index].equals("MVCS")) - {entry=entry+" D1(R1,B1),D2(B2),R3"; + {my_operands="D1(R1,B1),D2(B2),R3"; // #500 } else - {entry=entry+" D1(L,B1),D2(B2)"; + {my_operands="D1(L,B1),D2(B2)"; // #500 } break; case 18: - if (tz390.opt_optable.equals("ESA") - || tz390.opt_optable.equals("ZOP") - ) - {entry=entry+"RXE "+tz390.op_code[index]; - } - else - {entry=entry+"RXY "+tz390.op_code[index]; - } + my_format="RXY"; // #500 + //**!! if (tz390.opt_optable.equals("ESA") // #500 + //**!! || tz390.opt_optable.equals("ZOP") // #500 + //**!! ) // #500 + //**!! {my_format="RXE"; // #500 + //**!! } // #500 if (tz390.op_trace_type[index]==189) - {entry=entry+" M1,D2(X2,B2)"; + {my_operands="M1,D2(X2,B2)"; // #500 } else - {entry=entry+" R1,D2(X2,B2)"; + {my_operands="R1,D2(X2,B2)"; // #500 } break; case 19: - entry=entry+"SSE "+tz390.op_code[index]+" D1(B1),D2(B2)"; + my_format="SSE"; // #500 + my_operands="D1(B1),D2(B2)"; // #500 break; case 20: - if (tz390.opt_optable.equals("ESA") - || tz390.opt_optable.equals("ZOP") - ) - {entry=entry+"RSE "+tz390.op_code[index]; - } - else - {entry=entry+"RSY "+tz390.op_code[index]; - } + my_format="RSY"; // #500 + my_operands="D1(B1),D2(B2)"; // #500 + //**!! if (tz390.opt_optable.equals("ESA") // #500 + //**!! || tz390.opt_optable.equals("ZOP") // #500 + //**!! ) // #500 + //**!! {entry=entry+"RSE "+tz390.op_code[index]; // #500 + //**!! } // #500 if (tz390.op_trace_type[index]==201 || tz390.op_trace_type[index]==202 ) - {entry=entry+" R1,M3,D2(B2)"; + {my_operands="R1,M3,D2(B2)"; // #500 } else - {entry=entry+" R1,R3,D2(B2)"; + {my_operands=" R1,R3,D2(B2)"; // #500 } break; case 21: - entry=entry+"SIY "+tz390.op_code[index]+" D1(B1),I2"; + my_format="SIY"; // #500 + my_operands="D1(B1),I2"; // #500 break; case 22: - entry=entry+"RSL "+tz390.op_code[index]+" D1(L1,B1)"; + my_format="RSL"; // #500 + my_operands="D1(L1,B1)"; // #500 break; case 23: - entry=entry+"RIE "+tz390.op_code[index]+" R1,R3,I2"; + my_format="RIE"; // #500 + my_operands="R1,R3,I2"; // #500 break; case 24: - entry=entry+"RXE "+tz390.op_code[index]+" R1,D2(X2,B2)"; + my_format="RXE"; // #500 + my_operands="R1,D2(X2,B2)"; // #500 break; case 25: - entry=entry+"RXF "+tz390.op_code[index]+" R1,R3,D2(X2,B2)"; + my_format="RXF"; // #500 + my_operands="R1,R3,D2(X2,B2)"; // #500 break; case 26: - entry=entry+"SS "+tz390.op_code[index]+" D1(L1,B1),D2(L2,B2)"; + my_format="SS"; // #500 + my_operands="D1(L1,B1),D2(L2,B2)"; // #500 break; case 27: - entry=entry+"SS "+tz390.op_code[index]+" R1,D2(B2),R3,D4(B4)"; + my_format="SS"; // #500 + my_operands="R1,D2(B2),R3,D4(B4)"; // #500 break; case 28: - entry=entry+"SS "+tz390.op_code[index]+" R1,R3,D2(B2),D4(B4)"; + my_format="SS"; // #500 + my_operands="R1,R3,D2(B2),D4(B4)"; // #500 break; case 29: - entry=entry+"SS "+tz390.op_code[index]+" D1(L1,B1),D2(B2),I3"; + my_format="SS"; // #500 + my_operands="D1(L1,B1),D2(B2),I3"; // #500 break; case 30: - entry=entry+"RRF "+tz390.op_code[index]; - if (tz390.op_trace_type[index]==301) - {entry=entry+" R1,M3,R2,M4"; - } - else if (tz390.op_trace_type[index]==303) - {entry=entry+" R1,M3,R2,M4"; - } - else if (tz390.op_trace_type[index]==304) - {entry=entry+" R1,M3,R2,M4"; - } - else if (tz390.op_trace_type[index]==305) - {entry=entry+" R1,M3,R2,M4"; - } - else if (tz390.op_trace_type[index]==306) - {entry=entry+" R1,M3,R2,M4"; - } - else if (tz390.op_trace_type[index]==342) - {entry=entry+" R1,M3,R2,M4"; - } - else - {entry=entry+" R1,R3,R2,M4"; - } + my_format="RRF"; // #500 + my_operands="R1,M3,R2,M4"; // #500 break; case 31: - entry=entry+"SS "+tz390.op_code[index]+" D1(B1),D2(L2,B2)"; + my_format="SS"; // #500 + my_operands="D1(B1),D2(L2,B2)"; // #500 break; case 32: - entry=entry+"SSF "+tz390.op_code[index].substring(0,2)+"."+tz390.op_code[index].substring(2)+" D1(B1),D2(B2),R3"; + my_format="SSF"; // #500 + my_hexop=my_hexop.substring(0,2)+"."+my_hexop.substring(2); // #500 + my_operands="D1(B1),D2(B2),R3"; // #500 break; case 33: // Our op_code table has the last two nibbles swapped - entry=entry+"RIL "+tz390.op_code[index].substring(0,2)+tz390.op_code[index].substring(3)+tz390.op_code[index].substring(2,3)+" I2"; + 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 break; case 34: - entry=entry+"RRF "+tz390.op_code[index]; + my_format="RRF"; // #500 + my_operands="R1,M3,R2"; // #500 if (tz390.op_trace_type[index]==340) {if (tz390.op_name[index].equals("IDTE") || tz390.op_name[index].equals("CPSDR") ) - {entry=entry+" R1,R3,R2"; - } - else - {entry=entry+" R1,M3,R2"; + {my_operands="R1,R3,R2"; // #500 } } else if (tz390.op_trace_type[index]==343) - {entry=entry+" R1,R3,R2"; - } - else - {entry=entry+" R1,M3,R2"; + {my_operands="R1,R3,R2"; // #500 } break; case 35: - entry=entry+"RRF "+tz390.op_code[index]+" R1,R2,M4"; + my_format="RRF"; // #500 + my_operands="R1,R2,M4"; // #500 break; case 36: // Alternate formats have mnemonics ending in 'A' - if (tz390.op_name[index].substring(tz390.op_name[index].length()-1).equals("A")) - {entry=entry+"RRF "+tz390.op_code[index]+" R1,R2,R3,M4"; + if (my_mnemonic.substring(my_mnemonic.length()-1).equals("A")) // #500 + {my_format="RRF"; // #500 + my_operands="R1,R2,R3,M4"; // #500 } else - {entry=entry+"RRR "+tz390.op_code[index]+" R1,R2,R3"; + {my_format="RRR"; // #500 + my_operands="R1,R2,R3"; // #500 } break; case 37: // ASSIST instructions - entry=entry+"RX "+tz390.op_code[index]+" R1,S2"; + my_format="RX"; // #500 + my_operands="R1,S2"; // #500 break; case 38: // ASSIST instructions - entry=entry+"RXSS "+tz390.op_code[index]+" S1(X1),S2"; + my_format="RXSS"; // #500 + my_operands="S1(X1),S2"; // #500 break; case 39: if (tz390.op_trace_type[index]==140) - {entry=entry+"RRE "+tz390.op_code[index]+" R1,R2"; + {my_format="RRE"; // #500 + my_operands="R1,R2"; // #500 } else if (tz390.op_trace_type[index]==144) {if (tz390.op_name[index].equals("CHLR")) - {entry=entry+"RRE "+tz390.op_code[index]+" R1,R2"; + {my_format="RRE"; // #500 + my_operands="R1,R2"; // #500 } else - {entry=entry+"RRF "+tz390.op_code[index]+" R1,R2<,M3>"; + {my_format="RRF"; // #500 + my_operands="R1,R2<,M3>"; // #500 } } - else if (tz390.op_trace_type[index]==153) - {entry=entry+"RRR "+tz390.op_code[index]+" R1,R2,R3"; - } - else if (tz390.op_trace_type[index]==154) - {entry=entry+"RRR "+tz390.op_code[index]+" R1,R2,R3"; - } - else if (tz390.op_trace_type[index]==410) - {entry=entry+"RRR "+tz390.op_code[index]+" R1,R2,R3"; + else if (tz390.op_trace_type[index]==153 // #500 + || tz390.op_trace_type[index]==154 // #500 + || tz390.op_trace_type[index]==410 // #500 + ) + {my_format="RRR"; // #500 + my_operands="R1,R2,R3"; // #500 } else - {entry=entry+"RRF "+tz390.op_code[index]+" R1,R2,M3"; + {my_format="RRF"; // #500 + my_operands="R1,R2,M3"; // #500 } break; case 40: - entry=entry+"RRF "+tz390.op_code[index].substring(0,4)+" R1,R2"; + my_format="RRF"; // #500 + my_operands="R1,R2"; // #500 + //**!! entry=entry+"RRF "+tz390.op_code[index].substring(0,4)+" R1,R2"; // #500 break; case 41: - entry=entry+"RIE "+tz390.op_code[index]+" R1,I2,M3"; + my_format="RIE"; // #500 + my_operands="R1,I2,M3"; // #500 break; case 42: - entry=entry+"RIE "+tz390.op_code[index].substring(0,4)+" R1,I2"; + my_format="RIE"; // #500 + my_operands="R1,I2"; // #500 + //**!! entry=entry+"RIE "+tz390.op_code[index].substring(0,4)+" R1,I2"; // #500 break; case 43: - entry=entry+"RIE "+tz390.op_code[index]+" R1,I2,M3,I4"; + my_format="RIE"; // #500 + my_operands="R1,I2,M3,I4"; // #500 break; case 44: - entry=entry+"RIE "+tz390.op_code[index].substring(0,4)+" R1,I2,I4"; + my_format="RIE"; // #500 + my_operands="R1,I2,I4"; // #500 + //**!! entry=entry+"RIE "+tz390.op_code[index].substring(0,4)+" R1,I2,I4"; #500 break; case 45: - entry=entry+"RRS "+tz390.op_code[index]+" R1,R2,M3,D4(B4)"; + my_format="RRS"; // #500 + my_operands="R1,R2,M3,D4(B4)"; // #500 break; case 46: - entry=entry+"RRS "+tz390.op_code[index].substring(0,4)+" R1,R2,D4(B4)"; + my_format="RRS"; // #500 + my_operands="R1,R2,D4(B4)"; // #500 + //**!! entry=entry+"RRS "+tz390.op_code[index].substring(0,4)+" R1,R2,D4(B4)"; #500 break; case 47: - entry=entry+"RIS "+tz390.op_code[index]+" R1,I2,M3,D4(B4)"; + my_format="RIS"; // #500 + my_operands="R1,I2,M3,D4(B4)"; // #500 break; case 48: - entry=entry+"RIS "+tz390.op_code[index].substring(0,4)+" R1,I2,D4(B4)"; + my_format="RIS"; // #500 + my_operands="R1,I2,D4(B4)"; // #500 + //**!! entry=entry+"RIS "+tz390.op_code[index].substring(0,4)+" R1,I2,D4(B4)"; #500 break; case 49: - entry=entry+"RIE "+tz390.op_code[index]+" R1,R2,M3,I4"; + my_format="RIE"; // #500 + my_operands="R1,R2,M3,I4"; // #500 break; case 50: - entry=entry+"RIE "+tz390.op_code[index].substring(0,4)+" R1,R2,I4"; + my_format="RIE"; // #500 + my_operands="R1,R2,I4"; // #500 + //**!! entry=entry+"RIE "+tz390.op_code[index].substring(0,4)+" R1,R2,I4"; #500 break; case 51: - entry=entry+"SIL "+tz390.op_code[index]+" D1(B1),I2"; + my_format="SIL"; // #500 + my_operands="D1(B1),I2"; // #500 break; case 52: - entry=entry+"RIE "+tz390.op_code[index].substring(0,4); - if (tz390.op_code[index].indexOf("$") == -1) - {entry=entry+" R1,R2,I3,I4<,I5>"; - } - else - {entry=entry+" R1,R2"; - } - break; + my_format="RIE"; // #500 + my_operands="R1,R2"; // #500 + //**!! entry=entry+"RIE "+tz390.op_code[index].substring(0,4); #500 + if (my_hexop.indexOf("$") == -1) // #500 + {my_operands="R1,R2,I3,I4<,I5>"; + } + break; case 53: - // Alternate formats have mnemonics ending in 'A' - if (tz390.op_name[index].substring(tz390.op_name[index].length()-1).equals("A")) - {entry=entry+"RRF "+tz390.op_code[index]+" R1,M3,R2,M4"; + if (my_mnemonic.substring(my_mnemonic.length()-1).equals("A")) // #500 + {my_format="RRF"; // #500 + my_operands="R1,M3,R2,M4"; // #500 } else - {entry=entry+"RRE "+tz390.op_code[index]+" R1,R2"; + {my_format="RRE"; // #500 + my_operands="R1,R2"; // #500 } break; case 54: // Alternate formats have mnemonics ending in 'A' - if (tz390.op_name[index].substring(tz390.op_name[index].length()-1).equals("A")) - {entry=entry+"RRF "+tz390.op_code[index]+" R1,M3,R2,M4"; + if (my_mnemonic.substring(my_mnemonic.length()-1).equals("A")) // #500 + {my_format="RRF"; // #500 + my_operands="R1,M3,R2,M4"; // #500 } else - {entry=entry+"RRF "+tz390.op_code[index]+" R1,M3,R2"; + {my_format="RRF"; // #500 + my_operands="R1,M3,R2"; // #500 } break; case 55: - entry=entry+"SSF "+tz390.op_code[index].substring(0,2)+"."+tz390.op_code[index].substring(2)+" R3,D1(B1),D2(B2)"; + my_format="SSF"; // #500 + my_hexop=my_hexop.substring(0,2)+"."+my_hexop.substring(2); // #500 + my_operands="R3,D1(B1),D2(B2)"; // #500 break; case 56: - entry=entry+"RSY "+tz390.op_code[index]+" R1,D2(B2),M3"; + my_format="RSY"; // #500 + my_operands="R1,D2(B2),M3"; // #500 break; case 57: - entry=entry+"RIE "+tz390.op_code[index]+" R1,R3,I2"; + my_format="RIE"; // #500 + my_operands="R1,R3,I2"; // #500 break; case 58: - entry=entry+"QST "+tz390.op_code[index]+" VR1,QR3,RS2(RT2)"; + my_format="QST"; // #500 + my_operands="VR1,QR3,RS2(RT2)"; // #500 break; case 59: - entry=entry+"QV "+tz390.op_code[index]+" VR1,QR3,VR2"; + my_format="QV"; // #500 + my_operands="VR1,QR3,VR2"; // #500 break; case 60: - entry=entry+"VST "+tz390.op_code[index]+" VR1,VR3,RS2(RT2)"; + my_format="VST"; // #500 + my_operands="VR1,VR3,RS2(RT2)"; // #500 break; case 61: - entry=entry+"VV "+tz390.op_code[index]+" VR1,VR2"; + my_format="VV"; // #500 + my_operands="VR1,VR2"; // #500 break; case 62: - entry=entry+"RRE "+tz390.op_code[index]+" R1"; + my_format="RRE"; // #500 + my_operands="R1"; // #500 break; case 63: - entry=entry+"RSEv "+tz390.op_code[index]+" VR1,VR3,D2(B2)"; + my_format="RSEv"; // #500 + my_operands="VR1,VR3,D2(B2)"; // #500 break; case 64: - entry=entry+"S "+tz390.op_code[index]+" D2(B2)"; + my_format="S"; // #500 + my_operands="D2(B2)"; // #500 break; case 65: - entry=entry+"VR "+tz390.op_code[index]+" VR1,QR3,R2"; + my_format="VR"; // #500 + my_operands="VR1,QR3,R2"; // #500 break; case 66: - entry=entry+"VS "+tz390.op_code[index]+" RS2"; + my_format="VS"; // #500 + my_operands="RS2"; // #500 break; case 67: - entry=entry+"RR "+tz390.op_code[index]+" R1,R2"; + my_format="RR"; // #500 + my_operands="R1,R2"; // #500 break; case 68: - entry=entry+"RR "+tz390.op_code[index]+" R1,R2"; + my_format="RR"; // #500 + my_operands="R1,R2"; // #500 break; case 69: - entry=entry+"RR "+tz390.op_code[index]+" M1,R2"; + my_format="RR"; // #500 + my_operands="M1,R2"; // #500 break; case 70: - entry=entry+"R "+tz390.op_code[index]+" R1"; + my_format="R"; // #500 + my_operands="R1"; // #500 + if (my_mnemonic.equals("SPM")) // #500 + {my_format="RR"; // #500 + } // #500 break; case 71: - entry=entry+"RR "+tz390.op_code[index]+" R1,R2"; + my_format="RR"; // #500 + my_operands="R1,R2"; // #500 break; case 72: - entry=entry+"RR "+tz390.op_code[index]+" M1,R2"; + my_format="RR"; // #500 + my_hexop=my_hexop+"."; // #500 + my_operands="R2"; // #500 break; case 73: - entry=entry+"RI "+tz390.op_code[index]+" R1,I2"; + my_format="RI"; // #500 + my_operands="R1,I2"; // #500 break; case 74: - entry=entry+"RRR "+tz390.op_code[index]+" R1,R2,R3,M4"; + my_format="RRR"; // #500 + my_operands="R1,R2,R3,M4"; // #500 break; default: - entry=entry+" op_type "+tz390.op_type[index]+" cannot be listed"; - } + my_format="???"; // #500 + my_operands="*Unknown"; // #500 + } // end of switch statemennt // #500 + // Build entry from the individual columns, aligning properly #500 + my_mnemonic=(my_mnemonic+my_spc).substring(0,mnem_len ); // #500 + my_format =(my_format +my_spc).substring(0,format_len ); // #500 + my_hexop =(my_hexop +my_spc).substring(0,hexop_len ); // #500 + my_operands=(my_operands+my_spc).substring(0,operand_len); // #500 + entry=my_mnemonic+" "+my_format+" "+my_hexop+" "+my_operands; // #500 + } // end of test on tz390.op_type[index] boundary value of 100 // #500 + if (tz390.op_type[index] == 0 // comment lines + || tz390.op_type[index] == 122 // empty lines (not used) + ) + {report_entries[index] = " "; } - if (tz390.op_type[index] == 0 // comment lines - || tz390.op_type[index] == 122 // empty lines (not used) - ) - {report_entries[index] = " "; - } - else - {report_entries[index] = entry; - } - index++; - } + else + {report_entries[index] = entry; + } + index++; + } Arrays.sort(report_entries); + // print the array in lines of three entries each // #500 + put_prn_line(" "+my_hdr+" "+my_hdr+" "+my_hdr.trim()); // #500 index = 0; - while (index < tz390.op_name.length) - {if (!report_entries[index].equals(" ")) - {put_prn_line(report_entries[index]); + my_prn_line = ""; // #500 + my_entry_count = 0; // #500 + while (index < report_entries.length) // #500 + {if (!report_entries[index].equals(" ")) // skip empty #500 + {my_entry_count++; // #500 + if (my_entry_count < 3) // for first and second entries: #500 + {// add entry to line (including whitespace) #500 + my_prn_line = my_prn_line+" "+report_entries[index]; // #500 + } // #500 + else // for third entry: #500 + { // print, adding third entry without padding #500 + put_prn_line(my_prn_line+" "+report_entries[index].trim()); // #500 + my_entry_count = 0; // #500 + my_prn_line = ""; // #500 + } // #500 } index++; } + // print final line with remaining entries // #500 + if (my_entry_count != 0) // #500 + {put_prn_line(my_prn_line); // #500 + } // #500 } + + + private void gen_obj_esds(){ /* * write ESD's for CSECTS, EXTRNS, and ENTRIES diff --git a/src/mz390.java b/src/mz390.java index 34524803b..d944ca8fb 100644 --- a/src/mz390.java +++ b/src/mz390.java @@ -445,6 +445,7 @@ public class mz390 { * replace non-printable with '.' in PRN, BAL, PCH * 2023-04-12 #458 B2C issue; insure X2C length is multiple of 2 * 2023-06-21 #485 fix O attribute value for extended mnemonics + * 2024-06-02 #527 set &SYSOPT_OPTABLE to correct value ******************************************************** * Global variables (last RPI) *****************************************************/ @@ -8492,8 +8493,8 @@ private void init_gbl_sys(){ gbl_setc[gbl_sysm_sev_index] = "000"; // RPI 898 add_gbl_sys("&SYSOPT_DBCS",var_setb_type); // set false indicating no DBCS support add_gbl_sys("&SYSOPT_OPTABLE",var_setc_type); // "z390" opcode table name - gbl_setc[tot_gbl_setc-1] = "z390"; - ; add_gbl_sys("&SYSOPT_RENT",var_setb_type); // set true if RENT option specified + gbl_setc[tot_gbl_setc-1] = tz390.opt_optable; // #527 + add_gbl_sys("&SYSOPT_RENT",var_setb_type); // set true if RENT option specified add_gbl_sys("&SYSOPT_XOBJECT",var_setb_type); //set true if GOFF or XOBJECT add_gbl_sys("&SYSPARM",var_setc_type); gbl_setc[tot_gbl_setc-1] = tz390.opt_sysparm; diff --git a/src/tz390.java b/src/tz390.java index 54b922ecd..b5eec3c15 100644 --- a/src/tz390.java +++ b/src/tz390.java @@ -327,6 +327,7 @@ public class tz390 { * 2023-06-21 AFK #485 fix O attribute value for extended mnemonics * 2023-06-22 AFK #495 fix O attribure value for vector instructions * 2023-07-02 DSH/AFK #503 add support for new z16 instructions to opcode tables + * 2024-05-30 afk #500 List suboption for options optable/machine not implemented correctly ******************************************************** * Shared z390 tables (last RPI) *****************************************************/ @@ -1378,6 +1379,8 @@ public class tz390 { "06=BCTR,RR,20", // 110 "06" "BCTR" "RR" 2 // RPI 1209N "07=BCR,RR-m,30", // 120 "07" "BCR" "RR" 2 // RPI 1209N "07m=BmR,RR-mx,30;0=NOPR", // "07m" "BmR, NOPR" "BRX" 3 // RPI 1209N + "08=SSK,RR,20", // 100 "08" "SSK" "RR" 2 // RPI 1209N #500 + "09=ISK,RR,20", // 100 "09" "ISK" "RR" 2 // RPI 1209N #500 "0A=SVC,4,40", // 290 "0A" "SVC" "I" 4 "0E=MVCL,RR-p,22", // 330 "0E" "MVCL" "RR" 2 // RPI 1209N "0F=CLCL,RR-p,22", // 340 "0F" "CLCL" "RR" 2 // RPI 1209N @@ -1481,6 +1484,8 @@ public class tz390 { "7F=SU,5,58", // 1520 "7F" "SU" "RX" 5 "8000=SSM,7,70", // 1530 "8000" "SSM" "S" 7 "8200=LPSW,7,70", // 1540 "8200" "LPSW" "S" 7 + "84=WRD,SI,110", // "84" "WRD" "SI" 11 #500 + "85=RDD,SI,110", // "85" "RDD" "SI" 11 #500 "86=BXH,10,103", // 1600 "86" "BXH" "RS" 10 "87=BXLE,10,103", // 1610 "87" "BXLE" "RS" 10 "88=SRL,10,102", // 1620 "88" "SRL" "RS" 10 @@ -1500,11 +1505,19 @@ public class tz390 { "96=OI,11,110", // 1760 "96" "OI" "SI" 11 "97=XI,11,110", // 1770 "97" "XI" "SI" 11 "98=LM,10,100", // 1780 "98" "LM" "RS" 10 + "9C00=SIO,64,640", // "9C00" "SIO" "S" 64 #500 + "9C01=SIOF,64,640", // "9C01" "SIOF" "S" 64 #500 + "9D00=TIO,64,640", // "9D00" "TIO" "S" 64 #500 + "9D01=CLRIO,64,640", // "9D01" "CLRIO" "S" 64 #500 + "9E00=HIO,64,640", // "9E00" "HIO" "S" 64 #500 + "9E01=HDV,64,640", // "9E01" "HDV" "S" 64 #500 + "9F00=TCH,64,640", // "9F00" "TCH" "S" 64 #500 "AC=STNSM,11,110", // 2520 "AC" "STNSM" "SI" 11 "AD=STOSM,11,110", // 2530 "AD" "STOSM" "SI" 11 "AF=MC,11,110", // 2550 "AF" "MC" "SI" 11 "B1=LRA,5,50", // 2560 "B1" "LRA" "RX" 5 "B202=STIDP,7,70", // 2570 "B202" "STIDP" "S" 7 + "B203=STIDC,64,640", // "B203" "STIDC" "S" 64 #500 "B204=SCK,7,70", // 2580 "B204" "SCK" "S" 7 "B205=STCK,7,70", // 2590 "B205" "STCK" "S" 7 "B206=SCKC,7,70", // 2600 "B206" "SCKC" "S" 7 @@ -1514,6 +1527,7 @@ public class tz390 { "B20A=SPKA,7,70", // 2640 "B20A" "SPKA" "S" 7 "B20B=IPK,7,70", // 2650 "B20B" "IPK" "S" 7 "B20D=PTLB,7,70", // 2660 "B20D" "PTLB" "S" 7 + "B213=RRB,64,640", // "B213" "RRB" "S" 64 #500 "B6=STCTL,10,100", // 4430 "B6" "STCTL" "RS" 10 "B7=LCTL,10,100", // 4440 "B7" "LCTL" "RS" 10 "BA=CS,10,100", // 5120 "BA" "CS" "RS" 10 @@ -1593,21 +1607,20 @@ public class tz390 { }; String[] op_table_DOS_obsolete = // Table added for RPI 1209N // These instructions are not included in pz390 and therefore cause a S0C1 failure when executed - {"08=SSK,RR,20", // 100 "08" "SSK" "RR" 2 // RPI 1209N - "09=ISK,RR,20", // 100 "09" "ISK" "RR" 2 // RPI 1209N - }; + {}; // list is empty now, to be removed once we are sure it will not be needed anymore #500 String[] op_table_DOS_notsupported = // Table added for RPI 1209A - {"WRD SI 84 D1(B1),I2", - "RDD SI 85 D1(B1),I2", - "SIO S 9C00 D2(B2)", - "SIOF S 9C01 D2(B2)", - "TIO S 9D00 D2(B2)", - "CLRIO S 9D01 D2(B2)", - "HIO S 9E00 D2(B2)", - "HDV S 9E01 D2(B2)", - "TCH S 9F00 D2(B2)", - "STIDC S B203 D2(B2)", - "RRB S B213 D2(B2)", + { // #500 +// "WRD SI 84 D1(B1),I2", #500 +// "RDD SI 85 D1(B1),I2", #500 +// "SIO S 9C00 D2(B2)", #500 +// "SIOF S 9C01 D2(B2)", #500 +// "TIO S 9D00 D2(B2)", #500 +// "CLRIO S 9D01 D2(B2)", #500 +// "HIO S 9E00 D2(B2)", #500 +// "HDV S 9E01 D2(B2)", #500 +// "TCH S 9F00 D2(B2)", #500 +// "STIDC S B203 D2(B2)", #500 +// "RRB S B213 D2(B2)", #500 "HPR SI 99 D1(B1)", // model 360/20 only "SPSW SI 81 D1(B1)", // model 360/20 only "TIOB IO 9A ??", // model 360/20 only