├── jobs ├── .gitignore ├── hewo_a60.JES ├── hewo_asm.JES ├── hewo_cob.JES ├── hewo_forg.JES ├── hewo_forh.JES ├── hewo_forw.JES ├── hewo_gcc.JES ├── hewo_jcc.JES ├── hewo_pas.JES ├── hewo_pli.JES ├── hewo_sim.JES ├── sine_a60.JES ├── sine_forg.JES ├── sine_forh.JES ├── sine_forw.JES ├── sine_gcc.JES ├── sine_jcc.JES ├── sine_pas.JES ├── sine_pli.JES ├── sine_sim.JES ├── mcpi_asm_t.JES ├── mcpi_forg_t.JES ├── mcpi_forh_t.JES ├── mcpi_forw_t.JES ├── mcpi_gcc_t.JES ├── mcpi_jcc_t.JES ├── mcpi_pas_t.JES ├── mcpi_pli_t.JES ├── mcpi_sim_t.JES ├── soep_a60_t.JES ├── soep_asm_t.JES ├── soep_gcc_t.JES ├── soep_jcc_t.JES ├── soep_pli_t.JES ├── soeq_asm_t.JES ├── soeq_gcc_f_10.JES ├── soeq_jcc_f_10.JES ├── soeq_jcc_t.JES ├── soeq_pli_t.JES ├── towh_a60_t.JES ├── towh_asm_t.JES ├── towh_forg_t.JES ├── towh_forh_t.JES ├── towh_forw_t.JES ├── towh_gcc_t.JES ├── towh_jcc_t.JES ├── towh_pas_t.JES ├── towh_pli_t.JES ├── towh_sim_t.JES ├── soep_gcc_f.JES ├── soep_jcc_f.JES ├── soeq_gcc_f.JES ├── soeq_gcc_p.JES ├── soeq_gcc_t.JES ├── soeq_jcc_f.JES ├── soeq_jcc_p.JES ├── mcpi_a60_t.JES ├── soep_a60_f.JES ├── soep_forg_f.JES ├── soep_forg_t.JES ├── soep_forh_f.JES ├── soep_forh_t.JES ├── soep_forw_f.JES ├── soep_pli_f.JES ├── soep_pli_p.JES ├── soep_sim_t.JES ├── mcpi_forg_f.JES ├── mcpi_forh_f.JES ├── mcpi_gcc_f.JES ├── mcpi_jcc_f.JES ├── mcpi_pli_f.JES ├── towh_a60_f.JES ├── towh_forg_f.JES ├── towh_forh_f.JES ├── towh_gcc_f.JES ├── towh_jcc_f.JES ├── towh_pli_f.JES ├── soep_a60_p.JES ├── soep_forg_p.JES ├── soep_forh_p.JES ├── soep_forw_t.JES ├── soep_gcc_p.JES ├── soep_jcc_p.JES ├── soep_pas_t.JES ├── soeq_pas_t.JES ├── soeq_pli_p.JES ├── soep_sim_f.JES ├── soeq_pli_f_10.JES ├── mcpi_a60_f.JES ├── mcpi_forw_f.JES ├── mcpi_pas_f.JES ├── mcpi_sim_f.JES ├── soep_asm_f.JES ├── soeq_asm_f.JES ├── soeq_asm_f_10.JES ├── soeq_pli_f.JES ├── towh_forw_f.JES ├── towh_pas_f.JES ├── towh_sim_f.JES ├── soep_forw_p.JES ├── soep_pas_f.JES ├── soep_sim_p.JES ├── mcpi_asm_f.JES ├── towh_asm_f.JES ├── soep_asm_p.JES ├── soeq_asm_p.JES ├── soep_asm_f_c1.JES ├── soep_asm_f_c2.JES ├── soeq_asm_f_c1.JES ├── soeq_asm_f_c2.JES ├── soep_pas_p.JES ├── soeq_pas_p.JES ├── soeq_pas_f.JES ├── soeq_pas_f_10.JES ├── ltlib_del.JES ├── Makefile ├── ltlib_index.txt └── README.md ├── tests ├── .gitignore ├── test_a60calr.dat ├── test_plicalr.dat ├── test_sos.JES ├── test_plical.JES ├── test_a60calr.JES ├── test_plicalr.JES ├── README.md ├── test_a60calr.a60 ├── test_plical.pli └── test_plicalr.pli ├── codes ├── towh_cher.dat ├── towh_cnat.dat ├── towh_ctst.dat ├── soep_cher.dat ├── soep_cnat.dat ├── soep_cprt.dat ├── soep_ctst.dat ├── soeq_cher.dat ├── hewo_a68.a68 ├── mcpi_ctst.dat ├── hewo_a60.a60 ├── mcpi_cher.dat ├── hewo_sim.sim ├── hewo_pas.pas ├── hewo_cob.cob ├── hewo_cc.c ├── mcpi_cnat.dat ├── hewo_pli.pli ├── hewo_for.f ├── sine_cc.c ├── sine_sim.sim ├── hewo_asm.asm ├── sine_pas.pas ├── sine_for.f ├── README.md ├── sine_a60.a60 ├── README_hewo.md ├── towh_pas.pas ├── towh_sim.sim ├── sine_pli.pli ├── soep_cc.c ├── towh_cc.c ├── towh_a60.a60 ├── soep_for.f ├── soep_pas.pas ├── soep_sim.sim ├── soep_a60.a60 ├── README_sine.md ├── towh_pli.pli ├── mcpi_pas.pas ├── mcpi_cc.c ├── mcpi_sim.sim ├── mcpi_a60.a60 ├── soeq_cc.c ├── towh_for.f ├── soep_pli.pli ├── soeq_pli.pli ├── soeq_pas.pas ├── mcpi_pli.pli ├── mcpi_for.f ├── README_towh.md ├── README_soep.md └── README_soeq.md ├── .gitignore ├── .gitmodules ├── .github ├── bin │ ├── shutdown.jcl │ └── deploy.sh └── workflows │ └── ci.yml ├── INSTALL.md ├── jcl ├── job_cob_clg.JESI ├── job_forw_clg.JESI ├── job_gcc_clg.JESI ├── job_forg_clg.JESI ├── job_pli_clg.JESI ├── job_forh_clg.JESI ├── job_jcc_clg.JESI ├── job_sim_clg.JESI ├── job_a60_clg.JESI ├── README.md ├── job_pas_clg.JESI └── job_asm_clg.JESI ├── README_comp.md ├── README_bench.md ├── CHANGELOG.md └── README.md /jobs/.gitignore: -------------------------------------------------------------------------------- 1 | *.jcl 2 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.jcl 2 | -------------------------------------------------------------------------------- /codes/towh_cher.dat: -------------------------------------------------------------------------------- 1 | 22 0 2 | -------------------------------------------------------------------------------- /codes/towh_cnat.dat: -------------------------------------------------------------------------------- 1 | 30 0 2 | -------------------------------------------------------------------------------- /codes/towh_ctst.dat: -------------------------------------------------------------------------------- 1 | 4 1 2 | -------------------------------------------------------------------------------- /codes/soep_cher.dat: -------------------------------------------------------------------------------- 1 | 10000000 0 2 | -------------------------------------------------------------------------------- /codes/soep_cnat.dat: -------------------------------------------------------------------------------- 1 | 1000000000 0 2 | -------------------------------------------------------------------------------- /codes/soep_cprt.dat: -------------------------------------------------------------------------------- 1 | 10000000 1 2 | -------------------------------------------------------------------------------- /codes/soep_ctst.dat: -------------------------------------------------------------------------------- 1 | 100000 1 2 | -------------------------------------------------------------------------------- /codes/soeq_cher.dat: -------------------------------------------------------------------------------- 1 | 100000000 0 2 | -------------------------------------------------------------------------------- /tests/test_a60calr.dat: -------------------------------------------------------------------------------- 1 | 1000000 10 2 | -------------------------------------------------------------------------------- /tests/test_plicalr.dat: -------------------------------------------------------------------------------- 1 | 1000000 10 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # backup files 2 | *~ 3 | # make auto-dependency 4 | *.dep 5 | -------------------------------------------------------------------------------- /codes/hewo_a68.a68: -------------------------------------------------------------------------------- 1 | main:( 2 | print(("Hello world !",new line)) 3 | ) 4 | -------------------------------------------------------------------------------- /codes/mcpi_ctst.dat: -------------------------------------------------------------------------------- 1 | 1 1 1 2 | 10 3 | 0 4 | -------------------------------------------------------------------------------- /tests/test_sos.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TSOS#ASM 2 | //** ##define DDSRC test_sos.asm 3 | //** ##define DDDAT /dev/null 4 | //** ##include ../jcl/job_asm_clg.JESI 5 | -------------------------------------------------------------------------------- /tests/test_plical.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TPLICAL 2 | //** ##define DDSRC test_plical.pli 3 | //** ##define DDDAT test_plicalr.dat 4 | //** ##include ../jcl/job_pli_clg.JESI 5 | -------------------------------------------------------------------------------- /tests/test_a60calr.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TA60CAL 2 | //** ##define DDSRC test_a60calr.a60 3 | //** ##define DDDAT test_a60calr.dat 4 | //** ##include ../jcl/job_a60_clg.JESI 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "herc-tools"] 2 | path = herc-tools 3 | url = https://github.com/wfjm/herc-tools.git 4 | [submodule "sios"] 5 | path = sios 6 | url = https://github.com/wfjm/mvs38j-sios.git 7 | -------------------------------------------------------------------------------- /jobs/hewo_a60.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#A60 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_a60.a60 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_a60_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_asm.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#ASM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_asm.asm 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_asm_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_cob.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#COB 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_cob.cob 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_cob_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_forg.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#FOG 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_for.f 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_forg_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_forh.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#FOH 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_for.f 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_forh_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_forw.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#FOW 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_for.f 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_forw_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_gcc.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#GCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_cc.c 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_gcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_jcc.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#JCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_cc.c 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_jcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_pas.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#PAS 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_pas.pas 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_pas_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_pli.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#PLI 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_pli.pli 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_pli_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/hewo_sim.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB HEWO#SIM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/hewo_sim.sim 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_sim_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_a60.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#A60 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_a60.a60 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_a60_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_forg.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#FOG 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_for.f 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_forg_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_forh.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#FOH 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_for.f 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_forh_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_forw.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#FOW 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_for.f 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_forw_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_gcc.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#GCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_cc.c 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_gcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_jcc.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#JCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_cc.c 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_jcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_pas.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#PAS 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_pas.pas 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_pas_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_pli.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#PLI 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_pli.pli 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_pli_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/sine_sim.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SINE#SIM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/sine_sim.sim 4 | //** ##define DDDAT /dev/null 5 | //** ##include ../jcl/job_sim_clg.JESI 6 | -------------------------------------------------------------------------------- /tests/test_plicalr.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TPLICALR 2 | //** ##define REGION 2000K 3 | //** ##define DDSRC test_plicalr.pli 4 | //** ##define DDDAT test_plicalr.dat 5 | //** ##include ../jcl/job_pli_clg.JESI 6 | -------------------------------------------------------------------------------- /codes/hewo_a60.a60: -------------------------------------------------------------------------------- 1 | 'BEGIN' 2 | 'COMMENT' 3 | * SPDX-License-Identifier: GPL-3.0-or-later 4 | * Copyright 2017-2019 by Walter F.J. Mueller 5 | 6 | OUTSTRING (1,'('Hello World !')'); 7 | 'END' 8 | -------------------------------------------------------------------------------- /jobs/mcpi_asm_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#ASM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_asm.asm 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_asm_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_forg_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#FOG 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_for.f 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_forg_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_forh_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#FOH 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_for.f 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_forh_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_forw_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#FOW 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_for.f 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_forw_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_gcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#GCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_cc.c 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_gcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_jcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#JCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_cc.c 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_jcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_pas_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#PAS 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_pas.pas 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_pas_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_pli_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#PLI 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_pli.pli 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_pli_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/mcpi_sim_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#SIM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/mcpi_sim.sim 4 | //** ##define DDDAT ../codes/mcpi_ctst.dat 5 | //** ##include ../jcl/job_sim_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soep_a60_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#A60 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soep_a60.a60 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_a60_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soep_asm_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#ASM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soep_asm.asm 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_asm_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soep_gcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#GCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soep_cc.c 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_gcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soep_jcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#JCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soep_cc.c 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_jcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soep_pli_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#PLI 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soep_pli.pli 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_pli_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soeq_asm_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#ASM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soeq_asm.asm 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_asm_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soeq_gcc_f_10.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SQ10#GCC 2 | //** ##define CLASS A 3 | //** ##define DDSRC ../codes/soeq_cc.c 4 | //** ##define DDDAT ../codes/soep_cher.dat 5 | //** ##include ../jcl/job_gcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soeq_jcc_f_10.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SQ10#JCC 2 | //** ##define CLASS A 3 | //** ##define DDSRC ../codes/soeq_cc.c 4 | //** ##define DDDAT ../codes/soep_cher.dat 5 | //** ##include ../jcl/job_jcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soeq_jcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#JCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soeq_cc.c 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_jcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/soeq_pli_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#PLI 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/soeq_pli.pli 4 | //** ##define DDDAT ../codes/soep_ctst.dat 5 | //** ##include ../jcl/job_pli_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_a60_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#A60 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_a60.a60 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_a60_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_asm_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#ASM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_asm.asm 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_asm_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_forg_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#FOG 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_for.f 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_forg_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_forh_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#FOH 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_for.f 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_forh_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_forw_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#FOW 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_for.f 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_forw_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_gcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#GCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_cc.c 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_gcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_jcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#JCC 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_cc.c 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_jcc_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_pas_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#PAS 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_pas.pas 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_pas_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_pli_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#PLI 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_pli.pli 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_pli_clg.JESI 6 | -------------------------------------------------------------------------------- /jobs/towh_sim_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#SIM 2 | //** ##define CLASS B 3 | //** ##define DDSRC ../codes/towh_sim.sim 4 | //** ##define DDDAT ../codes/towh_ctst.dat 5 | //** ##include ../jcl/job_sim_clg.JESI 6 | -------------------------------------------------------------------------------- /codes/mcpi_cher.dat: -------------------------------------------------------------------------------- 1 | 0 0 0 2 | 100 3 | 200 4 | 700 5 | 2000 6 | 7000 7 | 20000 8 | 70000 9 | 200000 10 | 700000 11 | 2000000 12 | 0 13 | -------------------------------------------------------------------------------- /jobs/soep_gcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#GCC 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_cc.c 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##include ../jcl/job_gcc_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_jcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#JCC 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_cc.c 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##include ../jcl/job_jcc_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soeq_gcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#GCC 2 | //** ##define CLASS C 3 | //** ##define REGION 7000K 4 | //** ##define DDSRC ../codes/soeq_cc.c 5 | //** ##define DDDAT ../codes/soeq_cher.dat 6 | //** ##include ../jcl/job_gcc_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soeq_gcc_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#GCC 2 | //** ##define CLASS A 3 | //** ##define DDSRC ../codes/soeq_cc.c 4 | //** ##define DDDAT ../codes/soep_cprt.dat 5 | //** ##define OUTLIM 100000 6 | //** ##include ../jcl/job_gcc_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soeq_gcc_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#GCC 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soeq_cc.c 5 | //** ##define DDDAT ../codes/soep_ctst.dat 6 | //** ##include ../jcl/job_gcc_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soeq_jcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#JCC 2 | //** ##define CLASS C 3 | //** ##define REGION 7000K 4 | //** ##define DDSRC ../codes/soeq_cc.c 5 | //** ##define DDDAT ../codes/soeq_cher.dat 6 | //** ##include ../jcl/job_jcc_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soeq_jcc_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#JCC 2 | //** ##define CLASS A 3 | //** ##define DDSRC ../codes/soeq_cc.c 4 | //** ##define DDDAT ../codes/soep_cprt.dat 5 | //** ##define OUTLIM 100000 6 | //** ##include ../jcl/job_jcc_clg.JESI 7 | -------------------------------------------------------------------------------- /codes/hewo_sim.sim: -------------------------------------------------------------------------------- 1 | COMMENT 2 | * SPDX-License-Identifier: GPL-3.0-or-later 3 | * Copyright 2017-2019 by Walter F.J. Mueller 4 | *; 5 | 6 | BEGIN 7 | OutText( "Hello World !" ); 8 | OutImage; 9 | OutImage; 10 | END; 11 | -------------------------------------------------------------------------------- /jobs/mcpi_a60_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#A60 2 | //** ##define CLASS B 3 | //** ##define PARMC 'LONG' 4 | //** ##define DDSRC ../codes/mcpi_a60.a60 5 | //** ##define DDDAT ../codes/mcpi_ctst.dat 6 | //** ##include ../jcl/job_a60_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_a60_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#A60 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_a60.a60 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##include ../jcl/job_a60_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_forg_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOG 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##include ../jcl/job_forg_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_forg_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOG 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_ctst.dat 6 | //** ##include ../jcl/job_forg_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_forh_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOH 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##include ../jcl/job_forh_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_forh_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOH 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_ctst.dat 6 | //** ##include ../jcl/job_forh_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_forw_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOW 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##include ../jcl/job_forw_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_pli_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#PLI 2 | //** ##define CLASS C 3 | //** ##define REGION 5500K 4 | //** ##define DDSRC ../codes/soep_pli.pli 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##include ../jcl/job_pli_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_pli_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#PLI 2 | //** ##define CLASS C 3 | //** ##define REGION 5500K 4 | //** ##define DDSRC ../codes/soep_pli.pli 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##include ../jcl/job_pli_clg.JESI 7 | -------------------------------------------------------------------------------- /jobs/soep_sim_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#SIM 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_sim.sim 5 | //** ##define DDDAT ../codes/soep_ctst.dat 6 | //** ##include ../jcl/job_sim_clg.JESI 7 | -------------------------------------------------------------------------------- /codes/hewo_pas.pas: -------------------------------------------------------------------------------- 1 | (* SPDX-License-Identifier: GPL-3.0-or-later *) 2 | (* Copyright 2017-2019 by Walter F.J. Mueller *) 3 | 4 | program hewo(input,output); 5 | begin 6 | writeln(' ','Hello World !'); 7 | end. 8 | -------------------------------------------------------------------------------- /.github/bin/shutdown.jcl: -------------------------------------------------------------------------------- 1 | //SHUTDWN JOB 'S322-0C4','WFJM', 2 | // USER=HERC01,PASSWORD=CUL8TR, 3 | // CLASS=${CLASS:-A},MSGCLASS=A,MSGLEVEL=(1,1),REGION=256K 4 | //STOP EXEC SHUTDOWN 5 | //SYSPRINT DD SYSOUT=A 6 | //SYSIN DD * 7 | -------------------------------------------------------------------------------- /codes/hewo_cob.cob: -------------------------------------------------------------------------------- 1 | 000100 IDENTIFICATION DIVISION. 2 | 000200 PROGRAM-ID. 'HEWO'. 3 | 000300 ENVIRONMENT DIVISION. 4 | 001000 DATA DIVISION. 5 | 100000 PROCEDURE DIVISION. 6 | 100100 00-MAIN. 7 | 100500 DISPLAY 'Hello World !'. 8 | 100600 STOP RUN. 9 | -------------------------------------------------------------------------------- /jobs/mcpi_forg_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#FOG 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_for.f 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##include ../jcl/job_forg_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/mcpi_forh_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#FOH 2 | //** ##define CLASS A 3 | //** ##define TIME (1440) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_for.f 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##include ../jcl/job_forh_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/mcpi_gcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#GCC 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_cc.c 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##include ../jcl/job_gcc_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/mcpi_jcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#JCC 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_cc.c 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##include ../jcl/job_jcc_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/mcpi_pli_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#PLI 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_pli.pli 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##include ../jcl/job_pli_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/towh_a60_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#A60 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_a60.a60 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##include ../jcl/job_a60_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/towh_forg_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#FOG 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_for.f 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##include ../jcl/job_forg_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/towh_forh_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#FOH 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_for.f 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##include ../jcl/job_forh_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/towh_gcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#GCC 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_cc.c 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##include ../jcl/job_gcc_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/towh_jcc_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#JCC 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_cc.c 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##include ../jcl/job_jcc_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/towh_pli_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#PLI 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_pli.pli 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##include ../jcl/job_pli_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soep_a60_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#A60 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_a60.a60 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define OUTLIM 100000 7 | //** ##include ../jcl/job_a60_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soep_forg_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOG 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define OUTLIM 100000 7 | //** ##include ../jcl/job_forg_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soep_forh_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOH 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define OUTLIM 100000 7 | //** ##include ../jcl/job_forh_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soep_forw_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOW 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_ctst.dat 6 | //** ##define PARMC NOCHECK 7 | //** ##include ../jcl/job_forw_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soep_gcc_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#GCC 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_cc.c 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define OUTLIM 100000 7 | //** ##include ../jcl/job_gcc_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soep_jcc_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#JCC 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_cc.c 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define OUTLIM 100000 7 | //** ##include ../jcl/job_jcc_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soep_pas_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#PAS 2 | //** ##define CLASS C 3 | //** ##define REGION 6500K 4 | //** ##define GOSTACK 5500K 5 | //** ##define DDSRC ../codes/soep_pas.pas 6 | //** ##define DDDAT ../codes/soep_ctst.dat 7 | //** ##include ../jcl/job_pas_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soeq_pas_t.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#PAS 2 | //** ##define CLASS C 3 | //** ##define REGION 7500K 4 | //** ##define GOSTACK 6500K 5 | //** ##define DDSRC ../codes/soeq_pas.pas 6 | //** ##define DDDAT ../codes/soep_ctst.dat 7 | //** ##include ../jcl/job_pas_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soeq_pli_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#PLI 2 | //** ##define CLASS A 3 | //** ##define REGION 700K 4 | //** ##define TIME (2,0) 5 | //** ##define DDSRC ../codes/soeq_pli.pli 6 | //** ##define DDDAT ../codes/soep_cprt.dat 7 | //** ##include ../jcl/job_pli_clg.JESI 8 | -------------------------------------------------------------------------------- /codes/hewo_cc.c: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 2 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 3 | 4 | #include 5 | 6 | int main () 7 | { 8 | printf ("Hello World !\n"); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /jobs/soep_sim_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#SIM 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_sim.sim 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##define PARMC NOSUBCHK 7 | //** ##include ../jcl/job_sim_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soeq_pli_f_10.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SQ10#PLI 2 | //** ##define CLASS A 3 | //** ##define REGION 700K 4 | //** ##define TIME (2,0) 5 | //** ##define DDSRC ../codes/soeq_pli.pli 6 | //** ##define DDDAT ../codes/soep_cher.dat 7 | //** ##include ../jcl/job_pli_clg.JESI 8 | -------------------------------------------------------------------------------- /codes/mcpi_cnat.dat: -------------------------------------------------------------------------------- 1 | 0 0 0 2 | 100 3 | 200 4 | 700 5 | 2000 6 | 7000 7 | 20000 8 | 70000 9 | 200000 10 | 700000 11 | 2000000 12 | 7000000 13 | 20000000 14 | 70000000 15 | 200000000 16 | 700000000 17 | 0 18 | -------------------------------------------------------------------------------- /jobs/mcpi_a60_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#A60 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define PARMC 'LONG' 6 | //** ##define DDSRC ../codes/mcpi_a60.a60 7 | //** ##define DDDAT ../codes/mcpi_cher.dat 8 | //** ##include ../jcl/job_a60_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/mcpi_forw_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#FOW 2 | //** ##define CLASS A 3 | //** ##define TIME (20,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_for.f 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##define PARMC NOCHECK 8 | //** ##include ../jcl/job_forw_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/mcpi_pas_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#PAS 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_pas.pas 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##define COOPT 'M+,D-' 8 | //** ##include ../jcl/job_pas_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/mcpi_sim_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#SIM 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_sim.sim 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##define PARMC NOSUBCHK 8 | //** ##include ../jcl/job_sim_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_asm_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#ASM 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_asm.asm 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 7 | //** ##include ../jcl/job_asm_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soeq_asm_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#ASM 2 | //** ##define CLASS C 3 | //** ##define REGION 6500K 4 | //** ##define DDSRC ../codes/soeq_asm.asm 5 | //** ##define DDDAT ../codes/soeq_cher.dat 6 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 7 | //** ##include ../jcl/job_asm_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soeq_asm_f_10.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SQ10#ASM 2 | //** ##define CLASS A 3 | //** ##define REGION 700K 4 | //** ##define DDSRC ../codes/soeq_asm.asm 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 7 | //** ##include ../jcl/job_asm_clg.JESI 8 | -------------------------------------------------------------------------------- /jobs/soeq_pli_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#PLI 2 | //** ##define CLASS C 3 | //** ##define REGION 6500K 4 | //** ##define TIME (10,0) 5 | //** ##define PRTY 2 6 | //** ##define DDSRC ../codes/soeq_pli.pli 7 | //** ##define DDDAT ../codes/soeq_cher.dat 8 | //** ##include ../jcl/job_pli_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/towh_forw_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#FOW 2 | //** ##define CLASS A 3 | //** ##define TIME (20,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_for.f 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##define PARMC NOCHECK 8 | //** ##include ../jcl/job_forw_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/towh_pas_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#PAS 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_pas.pas 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##define COOPT 'M+,D-' 8 | //** ##include ../jcl/job_pas_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/towh_sim_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#SIM 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_sim.sim 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##define PARMC NOSUBCHK 8 | //** ##include ../jcl/job_sim_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_forw_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#FOW 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_for.f 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define PARMC NOCHECK 7 | //** ##define PAGES 2000 8 | //** ##include ../jcl/job_forw_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_pas_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#PAS 2 | //** ##define CLASS C 3 | //** ##define REGION 6500K 4 | //** ##define GOSTACK 5500K 5 | //** ##define DDSRC ../codes/soep_pas.pas 6 | //** ##define DDDAT ../codes/soep_cher.dat 7 | //** ##define COOPT 'M+,D-' 8 | //** ##include ../jcl/job_pas_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_sim_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#SIM 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_sim.sim 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define PARMC NOSUBCHK 7 | //** ##define OUTLIM 100000 8 | //** ##include ../jcl/job_sim_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/mcpi_asm_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB MCPI#ASM 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/mcpi_asm.asm 6 | //** ##define DDDAT ../codes/mcpi_cher.dat 7 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/towh_asm_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB TOWH#ASM 2 | //** ##define CLASS A 3 | //** ##define TIME (10,0) 4 | //** ##define PRTY 2 5 | //** ##define DDSRC ../codes/towh_asm.asm 6 | //** ##define DDDAT ../codes/towh_cher.dat 7 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_asm_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#ASM 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_asm.asm 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define OUTLIM 100000 7 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soeq_asm_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#ASM 2 | //** ##define CLASS A 3 | //** ##define REGION 650K 4 | //** ##define DDSRC ../codes/soeq_asm.asm 5 | //** ##define DDDAT ../codes/soep_cprt.dat 6 | //** ##define OUTLIM 100000 7 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_asm_f_c1.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#AC1 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_asm.asm 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 7 | //** ##define SET_CHOPAT 1 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_asm_f_c2.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#AC2 2 | //** ##define CLASS C 3 | //** ##define REGION 6000K 4 | //** ##define DDSRC ../codes/soep_asm.asm 5 | //** ##define DDDAT ../codes/soep_cher.dat 6 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 7 | //** ##define SET_CHOPAT 2 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soeq_asm_f_c1.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#AC1 2 | //** ##define CLASS C 3 | //** ##define REGION 6500K 4 | //** ##define DDSRC ../codes/soeq_asm.asm 5 | //** ##define DDDAT ../codes/soeq_cher.dat 6 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 7 | //** ##define SET_CHOPAT 1 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soeq_asm_f_c2.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#AC2 2 | //** ##define CLASS C 3 | //** ##define REGION 6500K 4 | //** ##define DDSRC ../codes/soeq_asm.asm 5 | //** ##define DDDAT ../codes/soeq_cher.dat 6 | //** ##define PARMC 'NOLIST,NOXREF,NORLD,NODECK,LOAD' 7 | //** ##define SET_CHOPAT 2 8 | //** ##include ../jcl/job_asm_clg.JESI 9 | -------------------------------------------------------------------------------- /jobs/soep_pas_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEP#PAS 2 | //** ##define CLASS C 3 | //** ##define REGION 6500K 4 | //** ##define GOSTACK 5500K 5 | //** ##define DDSRC ../codes/soep_pas.pas 6 | //** ##define DDDAT ../codes/soep_cprt.dat 7 | //** ##define COOPT 'M+,D-' 8 | //** ##define OUTLIM 100000 9 | //** ##include ../jcl/job_pas_clg.JESI 10 | -------------------------------------------------------------------------------- /jobs/soeq_pas_p.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#PAS 2 | //** ##define CLASS C 3 | //** ##define REGION 7500K 4 | //** ##define GOSTACK 6500K 5 | //** ##define DDSRC ../codes/soeq_pas.pas 6 | //** ##define DDDAT ../codes/soep_cprt.dat 7 | //** ##define OUTLIM 100000 8 | //** ##define COOPT 'M+,D-' 9 | //** ##include ../jcl/job_pas_clg.JESI 10 | -------------------------------------------------------------------------------- /jobs/soeq_pas_f.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SOEQ#PAS 2 | //** ##define CLASS C 3 | //** ##define REGION 7500K 4 | //** ##define GOSTACK 6500K 5 | //** ##define TIME (5,0) 6 | //** ##define PRTY 2 7 | //** ##define DDSRC ../codes/soeq_pas.pas 8 | //** ##define DDDAT ../codes/soeq_cher.dat 9 | //** ##define COOPT 'M+,D-' 10 | //** ##include ../jcl/job_pas_clg.JESI 11 | -------------------------------------------------------------------------------- /jobs/soeq_pas_f_10.JES: -------------------------------------------------------------------------------- 1 | //** ##define JOB SQ10#PAS 2 | //** ##define CLASS C 3 | //** ##define REGION 7500K 4 | //** ##define GOSTACK 6500K 5 | //** ##define TIME (5,0) 6 | //** ##define PRTY 2 7 | //** ##define DDSRC ../codes/soeq_pas.pas 8 | //** ##define DDDAT ../codes/soep_cher.dat 9 | //** ##define COOPT 'M+,D-' 10 | //** ##include ../jcl/job_pas_clg.JESI 11 | -------------------------------------------------------------------------------- /codes/hewo_pli.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 4 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 5 | 6 | HELLO: PROC OPTIONS(MAIN) REORDER; 7 | PUT SKIP LIST('Hello World !'); 8 | END HELLO; 9 | -------------------------------------------------------------------------------- /codes/hewo_for.f: -------------------------------------------------------------------------------- 1 | C 1 2 3 4 5 6 712-------- 2 | C2345*78901234567890123456789012345678901234567890123456789012345678901234567890 3 | C SPDX-License-Identifier: GPL-3.0-or-later 4 | C Copyright 2017-2019 by Walter F.J. Mueller 5 | C 6 | C --- main program --------------------------------------------------- 7 | C PROGRAM HEWO 8 | WRITE(6,9000) 9 | STOP 10 | C 11 | 9000 FORMAT(1X,'Hello World !') 12 | C 13 | END 14 | -------------------------------------------------------------------------------- /jobs/ltlib_del.JES: -------------------------------------------------------------------------------- 1 | //** /* This job creates the PDF xxx.LTLIB with all langtest jobs 2 | //** /* The username/password is configurable via definition of 3 | //** /* USER default HERC03 4 | //** /* PASSWORD default PASS4U 5 | //** /* 6 | //NLTLIB JOB 'S322-0C4','WFJM', 7 | // USER=${USER:=HERC03},PASSWORD=${PASSWORD:-PASS4U}, 8 | // CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), 9 | // REGION=256K,TIME=(1,0),PRTY=8 10 | //DELDS EXEC PGM=IEFBR14 11 | //SYSPRINT DD SYSOUT=* 12 | //SYSUT2 DD DSN=${USER}.LTLIB, 13 | // DISP=(OLD,DELETE,DELETE) 14 | /* 15 | // 16 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | This directory contains test codes and associated jobs 2 | 3 | | Code | Job | Description | 4 | | -----| -------- | ----------- | 5 | | [test_sos.asm](test_sos.asm) | [test_sos](test_sos.JES) | test code for simple output system | 6 | | [test_a60calr.a60](test_a60calr.a60) | [test_a60calr](test_a60calr.JES) | test code for Algol 60 call overhead | 7 | | [test_plicalr.pli](test_plicalr.pli) | [test_plicalr](test_plicalr.JES) | test code for PL/I RECURSIVE call overhead | 8 | | [test_plical.pli](test_plical.pli) | [test_plical](test_plical.JES) | test code for PL/I call overhead (plain non-recursive) | 9 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # mvs38j-langtest installation 2 | 3 | The mvs38j-langtest uses git 4 | [submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) 5 | to embed the projects 6 | [mvs38j-sios](https://github.com/wfjm/mvs38j-sios) and 7 | [herc-tools](https://github.com/wfjm/herc-tools). 8 | 9 | To install use 10 | ```bash 11 | cd 12 | git clone --recurse-submodules https://github.com/wfjm/mvs38j-langtest.git 13 | ``` 14 | 15 | To update use 16 | ```bash 17 | cd /mvs38j-langtest 18 | git pull --recurse-submodules 19 | git submodule update --init --recursive 20 | ``` 21 | 22 | To get proper submodule state after `git checkout` of commit or branch, e.g. 23 | ```bash 24 | cd /mvs38j-langtest 25 | git checkout . 26 | git submodule update --init --recursive 27 | ``` 28 | 29 | To setup the environment use 30 | ```bash 31 | export PATH=/mvs38j-langtest/herc-tools/bin 32 | ``` 33 | -------------------------------------------------------------------------------- /jobs/Makefile: -------------------------------------------------------------------------------- 1 | # $Id: Makefile 1176 2019-06-30 07:16:06Z mueller $ 2 | # SPDX-License-Identifier: GPL-3.0-or-later 3 | # Copyright 2017-2018 by Walter F.J. Mueller 4 | # 5 | JES_all = $(wildcard hewo_*.JES) 6 | JES_all += $(wildcard mcpi_*.JES) 7 | JES_all += $(wildcard sine_*.JES) 8 | JES_all += $(wildcard soep_*.JES) 9 | JES_all += $(wildcard soeq_*.JES) 10 | JES_all += $(wildcard towh_*.JES) 11 | JCL_all = $(JES_all:.JES=.jcl) 12 | DEP_all = $(JES_all:.JES=.dep) 13 | # 14 | JCL_extra = ltlib_new.jcl ltlib_del.jcl 15 | # 16 | all : $(JCL_all) 17 | # 18 | clean : 19 | rm -f $(JCL_all) $(JCL_extra) 20 | # 21 | ltlib_new.jcl : ltlib_new.JES ltlib_index.txt $(JCL_all) 22 | # 23 | # The magic auto-dependency include 24 | # 25 | include $(DEP_all) 26 | # 27 | # build pattern 28 | # 29 | %.jcl : %.JES 30 | hercjis -o $@ $< 31 | %.dep : %.JES 32 | @ echo "hercjis -M ... $<" 33 | @ hercjis -M -o $@ $< | sed 's/\.dep/\.jcl/' > $@ 34 | -------------------------------------------------------------------------------- /.github/bin/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $Id: deploy.sh 1240 2022-05-22 13:57:50Z mueller $ 3 | # SPDX-License-Identifier: GPL-3.0-or-later 4 | # Copyright 2022- by Walter F.J. Mueller 5 | 6 | # deploy from work directory 7 | cd .github/work 8 | 9 | # get environment 10 | printenv | sort | grep "^GITHUB_" > environment.log 11 | 12 | # get hercjsu summary 13 | (cd prt; hercjsu *J????*.prt > ../hercjsu.log) 14 | 15 | # setup list of files to deploy 16 | echo "environment.log" > deploy.lst 17 | echo "hercjsu.log" >> deploy.lst 18 | find -regextype egrep -regex '.*/prt/.*\.prt' |\ 19 | sort >> deploy.lst 20 | 21 | # create tarball 22 | tar -czf deploy.tgz -T deploy.lst 23 | 24 | # upload 25 | curl -w "status: %{http_code} send: %{size_upload} speed: %{speed_upload}\n" \ 26 | -F 'repo=mvs38j-langtest' \ 27 | -F "runnum=$GITHUB_RUN_NUMBER" \ 28 | -F "jobid=$JOBID" \ 29 | -F 'upfile=@deploy.tgz' \ 30 | https://www.retro11.de/cgi-bin/upload_adeploy.cgi > deploy.log 31 | cat deploy.log 32 | -------------------------------------------------------------------------------- /tests/test_a60calr.a60: -------------------------------------------------------------------------------- 1 | 'BEGIN' 2 | 'COMMENT' 3 | * $Id: test_a60calr.a60 1195 2019-07-20 08:05:15Z mueller $ 4 | * SPDX-License-Identifier: GPL-3.0-or-later 5 | * Copyright 2018- by Walter F.J. Mueller 6 | * 7 | * Revision History: 8 | * Date Rev Version Comment 9 | * 2018-01-02 981 1.0 Initial version 10 | *; 11 | 12 | 'INTEGER' MAXCALL,DEPTH; 13 | 'INTEGER' NTOP,NCALL; 14 | 15 | 'PROCEDURE' RECPROC(D); 16 | 'VALUE' D; 17 | 'INTEGER' D; 18 | 'BEGIN' 19 | NCALL := NCALL + 1; 20 | 'IF' D > 1 'THEN' RECPROC(D-1); 21 | 'END'; 22 | 23 | 'COMMENT' set record lenth = 132 and page length = 62; 24 | SYSACT(1,6,132); 25 | SYSACT(1,8,64); 26 | 27 | ININTEGER(0,MAXCALL); 28 | ININTEGER(0,DEPTH); 29 | 30 | NTOP := 0; 31 | NCALL := 0; 32 | LOOP: 33 | NTOP := NTOP + 1; 34 | RECPROC(DEPTH); 35 | 'IF' NCALL < MAXCALL 'THEN' 'GOTO' LOOP; 36 | 37 | OUTSTRING (1,'('TA60CAL maxcall=')'); 38 | OUTINTEGER(1, MAXCALL); 39 | OUTSTRING (1,'(' depth=')'); 40 | OUTINTEGER(1, DEPTH); 41 | OUTSTRING (1,'(' ntop=')'); 42 | OUTINTEGER(1, NTOP); 43 | OUTSTRING (1,'(' ncall=')'); 44 | OUTINTEGER(1, NCALL); 45 | SYSACT(1,14,1); 46 | 47 | 'END' 48 | -------------------------------------------------------------------------------- /tests/test_plical.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* $Id: test_plical.pli 1195 2019-07-20 08:05:15Z mueller $ */ 4 | /* SPDX-License-Identifier: GPL-3.0-or-later 5 | /* Copyright 2018- by Walter F.J. Mueller */ 6 | /* */ 7 | /* Revision History: */ 8 | /* Date Rev Version Comment */ 9 | /* 2018-01-02 981 1.0 Initial version */ 10 | 11 | TPLICAL: PROC OPTIONS(MAIN) REORDER; 12 | DCL (MAXCALL,DEPTH) BIN FIXED(31) INIT(0); 13 | DCL (NTOP,NCALL) BIN FIXED(31) INIT(0); 14 | 15 | DCL SIMPROC ENTRY(BIN FIXED(31)); 16 | 17 | GET EDIT(MAXCALL,DEPTH) (F(10),F(10)); 18 | 19 | DO WHILE(NCALL < MAXCALL); 20 | NTOP = NTOP + 1; 21 | CALL SIMPROC(DEPTH); 22 | END; 23 | 24 | PUT SKIP EDIT('TPLICAL maxcall=',MAXCALL, ' depth=',DEPTH, 25 | ' ntop=',NTOP, ' ncall=',NCALL) (4(A,F(10))); 26 | 27 | /* procedure SIMPROC -------------------------------------------*/ 28 | SIMPROC: PROC(D); 29 | DCL (D) BIN FIXED(31); 30 | NCALL = NCALL + 1; 31 | END SIMPROC; 32 | 33 | END TPLICAL; 34 | -------------------------------------------------------------------------------- /jcl/job_cob_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for COBUFCLG jobs (COBOL compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 2048K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARML} 'MAP,LIST,LET' linker step PARM 17 | //** /* 18 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 19 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 20 | // REGION=${REGION:-2048K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 21 | /*JOBPARM ROOM=${ROOM:-4242} 22 | //CLG EXEC COBUCLG, 23 | // PARM.LKED=${PARML:-'MAP,LIST,LET'} 24 | //COB.SYSIN DD * 25 | //** ##include ${DDSRC} 26 | /* 27 | //GO.SYSIN DD * 28 | //GO.SYSOUT DD SYSOUT=* 29 | //** ##include ${DDDAT} 30 | /* 31 | // 32 | -------------------------------------------------------------------------------- /tests/test_plicalr.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* $Id: test_plicalr.pli 1195 2019-07-20 08:05:15Z mueller $ */ 4 | /* SPDX-License-Identifier: GPL-3.0-or-later 5 | /* Copyright 2018- by Walter F.J. Mueller */ 6 | /* */ 7 | /* Revision History: */ 8 | /* Date Rev Version Comment */ 9 | /* 2018-01-02 981 1.0 Initial version */ 10 | 11 | TPLICAL: PROC OPTIONS(MAIN) REORDER; 12 | DCL (MAXCALL,DEPTH) BIN FIXED(31) INIT(0); 13 | DCL (NTOP,NCALL) BIN FIXED(31) INIT(0); 14 | 15 | DCL RECPROC ENTRY(BIN FIXED(31)); 16 | 17 | GET EDIT(MAXCALL,DEPTH) (F(10),F(10)); 18 | 19 | DO WHILE(NCALL < MAXCALL); 20 | NTOP = NTOP + 1; 21 | CALL RECPROC(DEPTH); 22 | END; 23 | 24 | PUT SKIP EDIT('TPLICALR maxcall=',MAXCALL, ' depth=',DEPTH, 25 | ' ntop=',NTOP, ' ncall=',NCALL) (4(A,F(10))); 26 | 27 | /* procedure RECPROC -------------------------------------------*/ 28 | RECPROC: PROC(D) RECURSIVE; 29 | DCL (D) BIN FIXED(31); 30 | NCALL = NCALL + 1; 31 | IF (D > 1) THEN CALL RECPROC(D-1); 32 | END RECPROC; 33 | 34 | END TPLICAL; 35 | -------------------------------------------------------------------------------- /jcl/job_forw_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for WATFIV jobs (FORTRAN one-step compile-execute) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 256K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} CHECK compile step PARM (for $JOB) 17 | //** /* ${PAGES} 100 go step PAGE limit 18 | //** /* 19 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 20 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 21 | // REGION=${REGION:-256K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 22 | /*JOBPARM ROOM=${ROOM:-4242} 23 | //CLG EXEC WATFIV 24 | //SYSIN DD * 25 | $JOB ${JOB},T=${TIME:-(1,0)},P=${PAGES:-100},${PARMC:-CHECK} 26 | //** ##include ${DDSRC} 27 | $ENTRY 28 | //** ##include ${DDDAT} 29 | $STOP 30 | /* 31 | // 32 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # $Id: ci.yml 1240 2022-05-22 13:57:50Z mueller $ 2 | # SPDX-License-Identifier: GPL-3.0-or-later 3 | # Copyright 2022- by Walter F.J. Mueller 4 | 5 | name: ci 6 | on: [push,workflow_dispatch] 7 | jobs: 8 | ci: 9 | runs-on: ubuntu-20.04 10 | steps: 11 | - name: checkout 12 | uses: actions/checkout@v3 13 | with: 14 | submodules: recursive 15 | - name: install 16 | run: | 17 | pushd .github 18 | mkdir work 19 | cd work 20 | wget -nv --no-check https://wotho.ethz.ch/tk4-/tk4-_v1.00_current.zip 21 | unzip -q tk4-_v1.00_current.zip 22 | rm tk4-_v1.00_current.zip 23 | popd 24 | - name: test 25 | run: | 26 | pushd .github/work 27 | ./mvs & 28 | pidherc=$! 29 | (sleep 1200; kill -9 $pidherc) & 30 | pidtout=$! 31 | sleep 180 32 | popd 33 | export PATH=$PATH:$PWD/bin:$PWD/herc-tools/bin 34 | pushd jobs 35 | hercjis -c C {hewo,sine}_*.JES 36 | hercjis -c C mcpi_{asm,for*,*cc,pas,pli,sim}_t.JES 37 | hercjis -c C {soep,soeq}_*_t.JES 38 | popd 39 | (cd .github/bin && hercjis -c C shutdown.jcl) 40 | wait $pidherc 41 | kill $pidtout || true 42 | pushd .github/work/prt 43 | hercjos -db -dt -i prt00e.txt 44 | hercjsu *J????*.prt || (echo "FAILED steps:" && hercjsu -fail *J????*.prt) 45 | popd 46 | - name: deploy 47 | run: | 48 | export PATH=$PATH:$PWD/bin:$PWD/herc-tools/bin 49 | export JOBID=1 50 | .github/bin/deploy.sh 51 | -------------------------------------------------------------------------------- /codes/sine_cc.c: -------------------------------------------------------------------------------- 1 | /* $Id: sine_cc.c 1195 2019-07-20 08:05:15Z mueller $ */ 2 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 3 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 4 | /* */ 5 | /* Revision History: */ 6 | /* Date Rev Version Comment */ 7 | /* 2017-07-30 931 0.1 Initial version */ 8 | 9 | #include 10 | #include 11 | 12 | int main () 13 | { 14 | char plot[82]; 15 | int i,j,isin,icos; 16 | double x,xrad,fsin,fcos; 17 | char* f1 = " x sin(x) cos(x) " 18 | "-1 -0.5 0" 19 | " +0.5 +1"; 20 | char* f2 = " " 21 | "+-------------------.-------------------:" 22 | "-------------------.-------------------:"; 23 | 24 | plot[81] = 0; 25 | printf ("%s\n",f1); 26 | printf ("%s\n",f2); 27 | 28 | for (i=0; i<=60; i++) { 29 | x = 6. * i; 30 | xrad = x/57.2957795131; 31 | fsin = sin(xrad); 32 | fcos = cos(xrad); 33 | for (j=0; j<81; j++) plot[j] = ' '; 34 | plot[ 0] = '+'; 35 | plot[20] = '.'; 36 | plot[40] = ':'; 37 | plot[60] = '.'; 38 | plot[80] = '+'; 39 | isin = 40.5 + 40. * fsin; 40 | icos = 40.5 + 40. * fcos; 41 | plot[isin] = '*'; 42 | plot[icos] = '#'; 43 | printf("%6.0f %8.5f %8.5f %s\n", x,fsin,fcos,plot); 44 | } 45 | printf ("%s\n",f2); 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /jcl/job_gcc_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for GCCCLG jobs (GCCMVS compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 8192K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} '-O3' compile step PARM 17 | //** /* ${PARML} 'MAP,LIST' linker step PARM 18 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 19 | //** /* 20 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 21 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 22 | // REGION=${REGION:-8192K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 23 | /*JOBPARM ROOM=${ROOM:-4242} 24 | //CLG EXEC GCCCLG,COPTS=${PARMC:-'-O3'}, 25 | // PARM.LKED=${PARML:-'MAP,LIST'} 26 | //COMP.SYSIN DD DATA,DLM='/@' 27 | //** ##include ${DDSRC} 28 | /@ 29 | //GO.SYSPRINT DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 30 | //GO.SYSIN DD * 31 | //** ##include ${DDDAT} 32 | /* 33 | // 34 | -------------------------------------------------------------------------------- /jcl/job_forg_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for FORTGCLG jobs (FORTRAN-G compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 256K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} '' compile step PARM 17 | //** /* ${PARML} 'MAP,LIST,LET' linker step PARM 18 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 19 | //** /* 20 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 21 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 22 | // REGION=${REGION:-256K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 23 | /*JOBPARM ROOM=${ROOM:-4242} 24 | //CLG EXEC FORTGCLG, 25 | // PARM.FORT=${PARMC:-''}, 26 | // PARM.LKED=${PARML:-'MAP,LIST,LET'} 27 | //FORT.SYSIN DD * 28 | //** ##include ${DDSRC} 29 | /* 30 | //GO.FT06F001 DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 31 | //GO.SYSIN DD * 32 | //** ##include ${DDDAT} 33 | /* 34 | // 35 | -------------------------------------------------------------------------------- /jcl/job_pli_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for PL1LFCLG jobs (PLI-F compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 256K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} 'LOAD,NODECK,OPT=2' compile step PARM 17 | //** /* ${PARML} 'MAP,LIST' linker step PARM 18 | //** /* 19 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 20 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 21 | // REGION=${REGION:-256K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 22 | /*JOBPARM ROOM=${ROOM:-4242} 23 | //CLG EXEC PL1LFCLG, 24 | // PARM.PL1L=${PARMC:-'LOAD,NODECK,OPT=2'}, 25 | // PARM.LKED=${PARML:-'MAP,LIST'} 26 | //PL1L.SYSLIN DD UNIT=SYSDA 27 | //PL1L.SYSIN DD * 28 | //** ##include ${DDSRC} 29 | /* 30 | //LKED.SYSLIB DD DSN=SYS1.PL1LIB,DISP=SHR 31 | //GO.STEPLIB DD DSN=SYS1.PL1LIB,DISP=SHR 32 | //GO.SYSIN DD * 33 | //** ##include ${DDDAT} 34 | /* 35 | // 36 | -------------------------------------------------------------------------------- /jcl/job_forh_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for FORTHCLG jobs (FORTRAN-H compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 256K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} 'OPT=2' compile step PARM 17 | //** /* ${PARML} 'MAP,LIST,LET' linker step PARM 18 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 19 | //** /* 20 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 21 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 22 | // REGION=${REGION:-256K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 23 | /*JOBPARM ROOM=${ROOM:-4242} 24 | //CLG EXEC FORTHCLG, 25 | // PARM.FORT=${PARMC:-'OPT=2'}, 26 | // PARM.LKED=${PARML:-'MAP,LIST,LET'} 27 | //FORT.SYSIN DD * 28 | //** ##include ${DDSRC} 29 | /* 30 | //GO.FT06F001 DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 31 | //GO.SYSIN DD * 32 | //** ##include ${DDDAT} 33 | /* 34 | // 35 | -------------------------------------------------------------------------------- /codes/sine_sim.sim: -------------------------------------------------------------------------------- 1 | COMMENT 2 | * SPDX-License-Identifier: GPL-3.0-or-later 3 | * Copyright 2017-2019 by Walter F.J. Mueller 4 | * 5 | * Revision History: 6 | * Date Rev Version Comment 7 | * 2017-09-08 949 1.0 Initial version 8 | *; 9 | 10 | BEGIN 11 | INTEGER i,j,isin,icos; 12 | REAL x,xrad,fsin,fcos; 13 | CHARACTER ARRAY plot(1:81); 14 | 15 | OutText(" x sin(x) cos(x) "); 16 | OutText("-1 -0.5 0"); 17 | OutText(" +0.5 +1"); 18 | OutImage; 19 | OutText(" "); 20 | OutText("+-------------------.-------------------:"); 21 | OutText("-------------------.-------------------+"); 22 | OutImage; 23 | 24 | FOR i := 0 STEP 1 UNTIL 60 DO BEGIN 25 | x := 6.0 * i; 26 | xrad := x/57.2957795131; 27 | fsin := sin(xrad); 28 | fcos := cos(xrad); 29 | FOR j := 1 STEP 1 UNTIL 81 DO plot(j) := ' '; 30 | plot( 1) := '+'; 31 | plot(21) := '.'; 32 | plot(41) := ':'; 33 | plot(61) := '.'; 34 | plot(81) := '+'; 35 | isin := Entier(41.5 + 40.0 * fsin); 36 | icos := Entier(41.5 + 40.0 * fcos); 37 | plot(isin) := '*'; 38 | plot(icos) := '#'; 39 | OutFix(x,0,6); 40 | OutFix(fsin,5,9); 41 | OutFix(fcos,5,9); 42 | OutText(" "); 43 | FOR j := 1 STEP 1 UNTIL 81 DO OutChar(plot(j)); 44 | OutImage; 45 | END; 46 | OutText(" "); 47 | OutText("+-------------------.-------------------:"); 48 | OutText("-------------------.-------------------+"); 49 | OutImage; 50 | OutImage; 51 | END; 52 | -------------------------------------------------------------------------------- /codes/hewo_asm.asm: -------------------------------------------------------------------------------- 1 | * 1 2 3 4 5 6 71 2 | *23456789*12345*789012345678901234*678901234567890123456789012345678901 3 | * SPDX-License-Identifier: GPL-3.0-or-later 4 | * Copyright 2017-2019 by Walter F.J. Mueller 5 | * 6 | PRINT NOGEN don't show macro expansions 7 | HEWO START 0 start main code csect at base 0 8 | SAVE (14,12) Save input registers 9 | LR R12,R15 base register := entry address 10 | USING HEWO,R12 declare base register 11 | ST R13,SAVE+4 set back pointer in current save area 12 | LR R2,R13 remember callers save area 13 | LA R13,SAVE setup current save area 14 | ST R13,8(R2) set forw pointer in callers save area 15 | * 16 | OPEN (SYSPRINT,OUTPUT) open SYSPRINT 17 | LTR R15,R15 test return code 18 | BNE ABND8 abort if open failed 19 | PUT SYSPRINT,MSG write the message 20 | CLOSE SYSPRINT close SYSPRINT 21 | * 22 | L R13,SAVE+4 get old save area back 23 | RETURN (14,12),RC=0 return to OS 24 | * 25 | ABND8 ABEND 8 bail out with abend U008 26 | * 27 | * File and work area definitions 28 | * 29 | SAVE DS 18F local save area 30 | MSG DC CL133' Hello World !' 31 | SYSPRINT DCB DSORG=PS,MACRF=PM,DDNAME=SYSPRINT, X 32 | RECFM=FBA,LRECL=133,BLKSIZE=1330 33 | YREGS , 34 | END HEWO define main entry point 35 | -------------------------------------------------------------------------------- /jcl/job_jcc_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for JCCCLG jobs (JCC compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 8192K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} '-o' compile step PARM 17 | //** /* ${PARML} 'NCAL,MAP,LIST,NORENT' linker step PARM 18 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 19 | //** /* 20 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 21 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 22 | // REGION=${REGION:-8192K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 23 | /*JOBPARM ROOM=${ROOM:-4242} 24 | //CLG EXEC JCCCLG, 25 | // JOPTS=${PARMC:-'-o'}, 26 | // PARM.LKED=${PARML:-'NCAL,MAP,LIST,NORENT'} 27 | //COMPILE.SYSIN DD DATA,DLM='/@' 28 | //** ##include ${DDSRC} 29 | /@ 30 | //GO.STDOUT DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 31 | //GO.STDERR DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 32 | //GO.SYSIN DD * 33 | //** ##include ${DDDAT} 34 | /* 35 | // 36 | -------------------------------------------------------------------------------- /jcl/job_sim_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for SIMCLG jobs (SIMULA compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 1000K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} '' compile step PARM 17 | //** /* ${PARML} 'MAP,LIST,LET' linker step PARM 18 | //** /* ${PARMG} 'LINECNT=64' go step PARM 19 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 20 | //** /* 21 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 22 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 23 | // REGION=${REGION:-1000K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 24 | /*JOBPARM ROOM=${ROOM:-4242} 25 | //CLG EXEC SIMCLG, 26 | // PARM.SIM=${PARMC:-''}, 27 | // PARM.LKED=${PARML:-'MAP,LIST,LET'}, 28 | // PARM.GO=${PARMG:-'LINECNT=64'} 29 | //SIM.SYSIN DD * 30 | //** ##include ${DDSRC} 31 | /* 32 | //GO.SYSOUT DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 33 | //GO.SYSIN DD * 34 | //** ##include ${DDDAT} 35 | /* 36 | // 37 | -------------------------------------------------------------------------------- /jcl/job_a60_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for ALGOFCLG jobs (ALGOL-60 F compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 1024K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${PARMC} '' compile step PARM 17 | //** /* ${PARML} 'MAP,LIST,LET' linker step PARM 18 | //** /* ${PARMG} '' go step PARM 19 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 20 | //** /* 21 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 22 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 23 | // REGION=${REGION:-1024K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 24 | /*JOBPARM ROOM=${ROOM:-4242} 25 | //CLG EXEC ALGOFCLG, 26 | // PARM.ALGOL=${PARMC:-''}, 27 | // PARM.LKED=${PARML:-'MAP,LIST,LET'}, 28 | // PARM.GO=${PARMG:-''} 29 | //ALGOL.SYSIN DD * 30 | //** ##include ${DDSRC} 31 | /* 32 | //GO.ALGLDD01 DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 33 | //GO.SYSIN DD * 34 | //** ##include ${DDDAT} 35 | /* 36 | // 37 | -------------------------------------------------------------------------------- /codes/sine_pas.pas: -------------------------------------------------------------------------------- 1 | (* $Id: sine_pas.pas 1171 2019-06-28 19:02:57Z mueller $ *) 2 | (* SPDX-License-Identifier: GPL-3.0-or-later *) 3 | (* Copyright 2017-2019 by Walter F.J. Mueller *) 4 | (* *) 5 | (* Revision History: *) 6 | (* Date Rev Version Comment *) 7 | (* 2017-09-08 949 1.0 Initial version *) 8 | 9 | program sine(input,output); 10 | var 11 | i,j,isin,icos : integer; 12 | x,xrad,fsin,fcos : real; 13 | plot : ARRAY[1 .. 81] of char; 14 | 15 | begin 16 | 17 | writeln(' ',' x sin(x) cos(x) ', 18 | '-1 -0.5 0', 19 | ' +0.5 +1'); 20 | writeln(' ', ' ', 21 | '+-------------------.-------------------:', 22 | '-------------------.-------------------+'); 23 | 24 | for i := 0 to 60 do begin 25 | x := 6.0 * i; 26 | xrad := x/57.2957795131; 27 | fsin := sin(xrad); 28 | fcos := cos(xrad); 29 | for j := 1 to 81 do plot[j] := ' '; 30 | plot[ 1] := '+'; 31 | plot[21] := '.'; 32 | plot[41] := ':'; 33 | plot[61] := '.'; 34 | plot[81] := '+'; 35 | isin := trunc(41.5 + 40.0 * fsin); 36 | icos := trunc(41.5 + 40.0 * fcos); 37 | plot[isin] := '*'; 38 | plot[icos] := '#'; 39 | write(' ',x:6:1,fsin:9:5,fcos:9:5,' '); 40 | for j := 1 to 81 do write(plot[j]:1); 41 | writeln(' '); 42 | end; 43 | writeln(' ', ' ', 44 | '+-------------------.-------------------:', 45 | '-------------------.-------------------+'); 46 | end. 47 | -------------------------------------------------------------------------------- /jcl/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the compiler job templates. 2 | 3 | These templates, file type `.JESI`, are used by 4 | [hercjis](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md) 5 | to generate 6 | from a meta-jcl `.JES` file a ready to run jcl job. The templates provide 7 | a standardized interface to the stored procedures in `SYSx.PROCLIB` and 8 | define variables which can be overridden from the `.JES` file. The 9 | set of variables is compiler specific, the common ones are 10 | 11 | | Variable | Function | 12 | | -------- | -------- | 13 | | JOB | job name | 14 | | JOBPOS | job card positional parameters | 15 | | JOBEXT | job extra parameters | 16 | | CLASS | job class | 17 | | MSGCLASS | message class | 18 | | MSGLEVEL | message level | 19 | | REGION | job memory | 20 | | TIME | job time limit | 21 | | PRTY | job priority | 22 | | DDSRC | source file | 23 | | DDDAT | data file | 24 | | PARMC | compile step PARM | 25 | | PARML | linker step PARM | 26 | | OUTLIM | go step SYSPRINT limit | 27 | 28 | The following compilers are supported 29 | 30 | | [Compiler ID](../README_comp.md) | JESI | called PROC | Comment | 31 | | :---: | ---------| -------| ------- | 32 | | a60 | [job_a60_clg](job_a60_clg.JESI) | ALGOFCLG | | 33 | | asm | [job_asm_clg](job_asm_clg.JESI) | ASMFCLG | | 34 | | cob | [job_cob_clg](job_cob_clg.JESI) | COBUCLG | | 35 | | forg | [job_forg_clg](job_forg_clg.JESI) | FORTGCLG | | 36 | | forh | [job_forh_clg](job_forh_clg.JESI) | FORTHCLG | OPT=2 | 37 | | forw | [job_forw_clg](job_forw_clg.JESI) | WATFIV | | 38 | | gcc | [job_gcc_clg](job_gcc_clg.JESI) | GCCCLG | -O3 | 39 | | jcc | [job_jcc_clg](job_jcc_clg.JESI) | JCCCLG | | 40 | | pas | [job_pas_clg](job_pas_clg.JESI) | PASCLG | | 41 | | pli | [job_pli_clg](job_pli_clg.JESI) | PL1LFCLG | OPT=2 | 42 | | sim | [job_sim_clg](job_sim_clg.JESI) | SIMCLG | | 43 | -------------------------------------------------------------------------------- /jcl/job_pas_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for PASCLG jobs (PASCAL compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 1024K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${COOPT} 'M+' compile step options 17 | //** /* ${GOTIME} 3600 go step time limit 18 | //** /* ${GOSTACK} 512k go step stack size 19 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 20 | //** /* 21 | //** /* Notes: 22 | //** /* 1. execution time normally controller via TIME, only if more 23 | //** /* than one hour wanted GOTIME must be increasted too. 24 | //** /* 25 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 26 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 27 | // REGION=${REGION:-1024K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 28 | /*JOBPARM ROOM=${ROOM:-4242} 29 | //CLG EXEC PASCLG,GOTIME=${GOTIME:-3600},GOREG=${REGION:-1024K}, 30 | // OPT=${COOPT:-'M+'}, 31 | // GOPARM='/STACK=${GOSTACK:-512k}' 32 | //COMPILE.SYSIN DD * 33 | //** ##include ${DDSRC} 34 | /* 35 | //GO.OUTPUT DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 36 | //GO.SYSIN DD * 37 | //** ##include ${DDDAT} 38 | /* 39 | // 40 | -------------------------------------------------------------------------------- /codes/sine_for.f: -------------------------------------------------------------------------------- 1 | C 1 2 3 4 5 6 712-------- 2 | C2345*78901234567890123456789012345678901234567890123456789012345678901234567890 3 | C $Id: sine_for.f 1171 2019-06-28 19:02:57Z mueller $ 4 | C SPDX-License-Identifier: GPL-3.0-or-later 5 | C Copyright 2017-2019 by Walter F.J. Mueller 6 | C 7 | C Revision History: 8 | C Date Rev Version Comment 9 | C 2017-08-09 934 1.0 Initial version 10 | C 2017-07-30 931 0.1 First draft 11 | C 12 | C --- main program --------------------------------------------------- 13 | C PROGRAM SINE 14 | INTEGER PLOT(81) 15 | INTEGER I,J,ISIN,ICOS 16 | REAL*4 X,XRAD,FSIN,FCOS 17 | INTEGER CBL,CPL,CDO,CCO,CST,CHA 18 | DATA CBL/1H /,CPL/1H+/,CDO/1H./,CCO/1H:/,CST/1H*/,CHA/1H#/ 19 | C 20 | WRITE(6,9000) 21 | WRITE(6,9010) 22 | C 23 | C Fortran IV(1966): DO limits must all to be > 0 -- FORTRAN-G enforces this 24 | DO 100 I=1,61 25 | X = 6. * (I-1) 26 | XRAD = X/57.2957795131 27 | FSIN = SIN(XRAD) 28 | FCOS = COS(XRAD) 29 | DO 200 J=1,81 30 | PLOT(J) = CBL 31 | 200 CONTINUE 32 | PLOT( 1) = CPL 33 | PLOT(21) = CDO 34 | PLOT(41) = CCO 35 | PLOT(61) = CDO 36 | PLOT(81) = CPL 37 | ISIN = 41.5 + 40. * FSIN 38 | ICOS = 41.5 + 40. * FCOS 39 | PLOT(ISIN) = CST 40 | PLOT(ICOS) = CHA 41 | WRITE(6,9020) X,FSIN,FCOS,PLOT 42 | 100 CONTINUE 43 | WRITE(6,9010) 44 | STOP 45 | C 46 | 9000 FORMAT(1X,' x sin(x) cos(x) ', 47 | * '-1 -0.5 0', 48 | * ' +0.5 +1') 49 | 9010 FORMAT(1X,' ', 50 | * '+-------------------.-------------------:', 51 | * '-------------------.-------------------:') 52 | 9020 FORMAT(1X,F6.0,1X,F8.5,1X,F8.5,3X,81A1) 53 | C 54 | END 55 | -------------------------------------------------------------------------------- /codes/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the source codes and input parameter files. 2 | The available Language-Case combinations are 3 | 4 | | Language | [hewo](README_hewo.md) | [sine](README_sine.md) | [soep](README_soep.md) | [soeq](README_soeq.md) | [towh](README_towh.md) | [mcpi](README_mcpi.md) | 5 | | ------- | :--: | :--: | :--: | :--: | :--: | :--: | 6 | | Algol 60 | [a60](hewo_a60.a60) | [a60](sine_a60.a60) | [a60](soep_a60.a60) | -- | [a60](towh_a60.a60) | [a60](mcpi_a60.a60) | 7 | | Assembler | [asm](hewo_asm.asm) | todo | [asm](soep_asm.asm) | [asm](soeq_asm.asm) | [asm](towh_asm.asm) | [asm](mcpi_asm.asm) | 8 | | C | [cc](hewo_cc.c) | [cc](sine_cc.c) | [cc](soep_cc.c) | [cc](soeq_cc.c) | [cc](towh_cc.c) | [cc](mcpi_cc.c) | 9 | | COBOL | [cob](hewo_cob.cob) | todo | todo | -- | todo | todo | 10 | | FORTRAN-4 | [for](hewo_for.f) | [for](sine_for.f) | [for](soep_for.f) | -- | [for](towh_for.f) | [for](mcpi_for.f) | 11 | | Pascal | [pas](hewo_pas.pas) | [pas](sine_pas.pas) | [pas](soep_pas.pas) | [pas](soeq_pas.pas) | [pas](towh_pas.pas) | [pas](mcpi_pas.pas) | 12 | | PL/I | [pli](hewo_pli.pli) | [pli](sine_pli.pli) | [pli](soep_pli.pli) | [pli](soeq_pli.pli) | [pli](towh_pli.pli) | [pli](mcpi_pli.pli) | 13 | | Simula | [sim](hewo_sim.sim) | [sim](sine_sim.sim) | [sim](soep_sim.sim) | -- | [sim](towh_sim.sim) | [sim](mcpi_sim.sim) | 14 | 15 | The links in the header row point to the description of the test case, 16 | the links in the table body to the individual source codes. 17 | 18 | The jobs are in the [jobs](../jobs) directory, see 19 | [README](../jobs/README.md) for the 20 | [Case - Job Type table](../jobs/README.md#user-content-types) 21 | and the 22 | [Compiler - Case maxtrix](../jobs/README.md#user-content-jobs) 23 | which also a includes a list of 24 | [known issues](../jobs/README.md#user-content-issues). 25 | 26 | 27 | -------------------------------------------------------------------------------- /README_comp.md: -------------------------------------------------------------------------------- 1 | ## Available Compilers for MVS 3.8J 2 | 3 | ### Overview 4 | The [tk4-](http://wotho.ethz.ch/tk4-/) system kindly provided by Juergen 5 | Winkelmann contains a nice selection of compilers. 6 | For further reference each compiler is identified by a 3 or 4 character 7 | compiler ID. 8 | 9 | | Language | Compiler ID | Description | Default Options | Benchmark Options | 10 | | --------- | :---------: |------------ | --------------- | ----------------- | 11 | | Algol 60 | [a60](jcl/job_a60_clg.JESI) | IBM Algol 60: 360S-AL-531 LEVEL 2.1 | | | 12 | | Assembler | [asm](jcl/job_asm_clg.JESI) | IBM Assembler Level F (370) | | | 13 | | C | [gcc](jcl/job_gcc_clg.JESI) | MVSGCC, a 370 port of gcc | -O3 | -O3 | 14 | | C | [jcc](jcl/job_jcc_clg.JESI) | early version of Dignus System/C | | | 15 | | COBOL | [cob](jcl/job_cob_clg.JESI) | IBM Cobol CB545 V2 LVL78 01MAY72 | | | 16 | | FORTRAN-4 | [forg](jcl/job_forg_clg.JESI) | IBM FORTRAN IV G LEVEL 21 | | | 17 | | FORTRAN-4 | [forh](jcl/job_forh_clg.JESI) | IBM FORTRAN H LEVEL 21.8 | OPT=2 | OPT=2 | 18 | | FORTRAN-4 | [forw](jcl/job_forw_clg.JESI) | WATFIV Compiler JAN 1976 V1L5 | CHECK | NOCHECK | 19 | | Pascal | [pas](jcl/job_pas_clg.JESI) | Stanford PASCAL, Version of Oct.-79 | D+ | D- | 20 | | PL/I | [pli](jcl/job_pli_clg.JESI) | IBM PL/I COMPILER (F) VERSION 5.5 | OPT=2 | OPT=2 | 21 | | Simula | [sim](jcl/job_sim_clg.JESI) | SIMULA 67 (VERS 12.00) | SUBCHK | NOSUBCHK | 22 | 23 | The links in the table point to the 'compile-link-go' JCL templates in 24 | the [jcl](jcl) directory. 25 | 26 | ### General Notes 27 | - for all optimizing compilers (gcc, forh, pli) the highest optimization 28 | level is used as default. 29 | - if a compiler offers configurable run-time checks (forw, pas, sim), 30 | these tests are 31 | - enabled for test jobs (`_t`) 32 | - disabled for benchmark jobs (`_f`) 33 | -------------------------------------------------------------------------------- /codes/sine_a60.a60: -------------------------------------------------------------------------------- 1 | 'BEGIN' 2 | 'COMMENT' 3 | * $Id: sine_a60.a60 1171 2019-06-28 19:02:57Z mueller $ 4 | * SPDX-License-Identifier: GPL-3.0-or-later 5 | * Copyright 2017-2019 by Walter F.J. Mueller 6 | * 7 | * Revision History: 8 | * Date Rev Version Comment 9 | * 2017-12-27 978 1.1 use outsymbol 10 | * 2017-09-05 946 1.0 Initial version 11 | *; 12 | 13 | 'INTEGER' I,J,ISIN,ICOS; 14 | 'REAL' X,XRAD,FSIN,FCOS; 15 | 'INTEGER' 'ARRAY' PLOT[1:81]; 16 | 17 | 'COMMENT' set record lenth = 132 and page length = 64; 18 | SYSACT(1,6,132); 19 | SYSACT(1,8,64); 20 | 21 | OUTSTRING (1,'(' x sin(x) cos(x) ')'); 22 | OUTSTRING (1,'('-1 -0.5 0')'); 23 | OUTSTRING (1,'(' +0.5 +1')'); 24 | SYSACT(1,14,1); 25 | OUTSTRING (1,'(' ')'); 26 | OUTSTRING (1,'('+-------------------.-------------------:')'); 27 | OUTSTRING (1,'('-------------------.-------------------+')'); 28 | SYSACT(1,14,1); 29 | 30 | 'FOR' I := 0 'STEP' 1 'UNTIL' 60 'DO' 'BEGIN' 31 | X := 6.0 * I; 32 | XRAD := X/57.2957; 33 | FSIN := SIN(XRAD); 34 | FCOS := COS(XRAD); 35 | OUTINTEGER(1,6*I); 36 | OUTREAL(1,FSIN); 37 | OUTREAL(1,FCOS); 38 | 39 | 'COMMENT' printer plot symbols: 1=+ 2=. 3=: 4=* 5=# 6=blank; 40 | 'FOR' J := 1 'STEP' 1 'UNTIL' 81 'DO' PLOT[J] := 6; 41 | PLOT[ 1] := 1; 42 | PLOT[21] := 2; 43 | PLOT[41] := 3; 44 | PLOT[61] := 2; 45 | PLOT[81] := 1; 46 | ISIN := ENTIER(41.5 + 40.0 * FSIN); 47 | ICOS := ENTIER(41.5 + 40.0 * FCOS); 48 | PLOT[ISIN] := 4; 49 | PLOT[ICOS] := 5; 50 | 'FOR' J := 1 'STEP' 1 'UNTIL' 81 'DO' 51 | OUTSYMBOL (1,'('+.:*# ')',PLOT[J]); 52 | SYSACT(1,14,1); 53 | 'END'; 54 | 55 | OUTSTRING (1,'(' ')'); 56 | OUTSTRING (1,'('+-------------------.-------------------:')'); 57 | OUTSTRING (1,'('-------------------.-------------------+')'); 58 | SYSACT(1,14,1); 59 | 60 | 'END' 61 | -------------------------------------------------------------------------------- /codes/README_hewo.md: -------------------------------------------------------------------------------- 1 | ## hewo - The classical 'Hello Word' 2 | 3 | ### Table of content 4 | 5 | - [Description](#user-content-description) 6 | - [Language and Compiler Notes](#user-content-langcomp) 7 | - [Jobs](#user-content-jobs) 8 | 9 | ### Description 10 | The task is simply to print the single line 11 | 12 | Hello World ! 13 | 14 | In principle not much to say on this topic which is covered exhaustively 15 | in many places, like in the very comprehensive 16 | [Hello World Collection](https://helloworldcollection.github.io/) 17 | , or in 18 | [Assembler Hello World Programs](http://leto.net/code/asm/hw_assembler.php). 19 | In these, as in some other examples on the Web, the codes output to the 20 | _easiest to program output channel_, which in some Assembler or 21 | COBOL examples is the operator console. 22 | 23 | Here the task is more strictly defined as _print a line to `SYSPRINT`_ 24 | via normal file I/O. 25 | 26 | ### Language and Compiler Notes 27 | 28 | #### Assembler - [hewo_asm.asm](hewo_asm.asm) 29 | The 'Hello, world' example shown in 30 | [this page](http://www2.latech.edu/~acm/helloworld/asm370.html) 31 | is faulty, the `HELLOMSG` string must have `LRECL` size because 32 | `PUT` will copy that many bytes. 33 | The 'Hello, world' example shown in 34 | [this page](http://leto.net/code/asm/hw_assembler.php) uses `WTO`, 35 | thus generates a message on the operator console. 36 | 37 | The code from this collection prints to `SYSPRINT`, with explicit 38 | `OPEN` and `CLOSE` calls, and a correctly size message. 39 | 40 | #### COBOL - [hewo_cob.cob](hewo_cob.cob) 41 | The 'Hello, world' example shown in the 42 | [COBOL page on Wikipedia](https://en.wikipedia.org/wiki/COBOL#Hello,_world) 43 | prints to operator console, as the job output shows. 44 | 45 | The code from this collection prints to `SYSPRINT`. 46 | 47 | ### Jobs 48 | The [jobs](../jobs) directory contains only one type of jobs for `hewo` named 49 | 50 | hewo_*.JES 51 | 52 | which run the code and produce the famous single line. 53 | Not much to benchmark here. 54 | -------------------------------------------------------------------------------- /codes/towh_pas.pas: -------------------------------------------------------------------------------- 1 | (* $Id: towh_pas.pas 1171 2019-06-28 19:02:57Z mueller $ *) 2 | (* SPDX-License-Identifier: GPL-3.0-or-later *) 3 | (* Copyright 2017-2019 by Walter F.J. Mueller *) 4 | (* *) 5 | (* Revision History: *) 6 | (* Date Rev Version Comment *) 7 | (* 2017-09-07 948 0.1 Initial version *) 8 | 9 | program towh(input,output); 10 | var 11 | ncall,nmove : integer; 12 | curstk,maxstk : integer; 13 | maxdsk,trace : integer; 14 | ndsk : integer; 15 | tow : ARRAY[1 .. 3] of integer; 16 | 17 | procedure mov(n,f,t: integer); 18 | var 19 | o : integer; 20 | begin 21 | o := 6-(f+t); 22 | curstk := curstk + 1; 23 | ncall := ncall + 1; 24 | if maxstk < curstk then maxstk := curstk; 25 | if n = 1 then begin 26 | nmove := nmove + 1; 27 | tow[f] := tow[f] - 1; 28 | tow[t] := tow[t] + 1; 29 | if trace > 0 then writeln(' ','mov-do: ',curstk:2, 30 | ' :',n:3,f:3,t:3, 31 | ' :',tow[1]:3,tow[2]:3,tow[3]:3); 32 | end else begin 33 | if trace > 0 then writeln(' ','mov-go: ',curstk:2, 34 | ' :',n:3,f:3,t:3, 35 | ' :',tow[1]:3,tow[2]:3,tow[3]:3); 36 | mov(n-1,f,o); 37 | mov(1,f,t); 38 | mov(n-1,o,t); 39 | end; 40 | curstk := curstk - 1; 41 | end; 42 | 43 | begin 44 | 45 | read(maxdsk); 46 | read(trace); 47 | 48 | for ndsk := 2 to maxdsk do begin 49 | ncall := 0; 50 | nmove := 0; 51 | maxstk := 0; 52 | curstk := 0; 53 | tow[1] := ndsk; 54 | tow[2] := 0; 55 | tow[3] := 0; 56 | if trace > 0 then writeln(' ','STRT ndsk=',ndsk:2); 57 | mov(ndsk,1,3); 58 | writeln(' ','DONE ndsk=',ndsk:2,': maxstk=',maxstk:2, 59 | ' ncall=',ncall:10,' nmove=',nmove:10); 60 | end; 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /codes/towh_sim.sim: -------------------------------------------------------------------------------- 1 | COMMENT 2 | * SPDX-License-Identifier: GPL-3.0-or-later 3 | * Copyright 2017-2019 by Walter F.J. Mueller 4 | * 5 | * Revision History: 6 | * Date Rev Version Comment 7 | * 2017-09-08 950 1.0 Initial version 8 | *; 9 | 10 | BEGIN 11 | INTEGER ncall,nmove; 12 | INTEGER curstk,maxstk; 13 | INTEGER maxdsk,trace; 14 | INTEGER ndsk; 15 | INTEGER ARRAY tow(1:4); 16 | 17 | PROCEDURE trc(txt,n,f,t); 18 | VALUE txt; 19 | TEXT txt; 20 | INTEGER n,f,t; 21 | BEGIN 22 | OutText(txt); 23 | OutInt(curstk,2); 24 | OutText(" :"); 25 | OutInt(n,3); 26 | OutInt(f,3); 27 | OutInt(t,3); 28 | OutText(" :"); 29 | OutInt(tow(1),3); 30 | OutInt(tow(2),3); 31 | OutInt(tow(3),3); 32 | OutImage; 33 | END; 34 | 35 | PROCEDURE mov(n,f,t); 36 | INTEGER n,f,t; 37 | BEGIN 38 | INTEGER o; 39 | o := 6-(f+t); 40 | curstk := curstk + 1; 41 | ncall := ncall + 1; 42 | IF maxstk < curstk THEN maxstk := curstk; 43 | IF n = 1 THEN BEGIN 44 | nmove := nmove + 1; 45 | tow(f) := tow(f) - 1; 46 | tow(t) := tow(t) + 1; 47 | IF trace > 0 THEN trc("mov-do: ",n,f,t); 48 | END ELSE BEGIN; 49 | IF trace > 0 THEN trc("mov-go: ",n,f,t); 50 | mov(n-1,f,o); 51 | mov(1,f,t); 52 | mov(n-1,o,t); 53 | END; 54 | curstk := curstk - 1; 55 | END; 56 | 57 | maxdsk := InInt; 58 | trace := InInt; 59 | 60 | FOR ndsk := 2 STEP 1 UNTIL maxdsk DO BEGIN 61 | ncall := 0; 62 | nmove := 0; 63 | maxstk := 0; 64 | curstk := 0; 65 | tow(1) := ndsk; 66 | tow(2) := 0; 67 | tow(3) := 0; 68 | IF trace > 0 THEN BEGIN 69 | OutText("STRT ndsk="); 70 | OutInt(ndsk,2); 71 | OutImage; 72 | END; 73 | mov(ndsk,1,3); 74 | OutText("DONE ndsk="); 75 | OutInt(ndsk,2); 76 | OutText(": maxstk="); 77 | OutInt(ndsk,2); 78 | OutText(" ncall="); 79 | OutInt(ncall,10); 80 | OutText(" nmove="); 81 | OutInt(nmove,10); 82 | OutImage; 83 | END; 84 | END; 85 | -------------------------------------------------------------------------------- /codes/sine_pli.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* $Id: sine_pli.pli 1195 2019-07-20 08:05:15Z mueller $ */ 4 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 5 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 6 | /* */ 7 | /* Revision History: */ 8 | /* Date Rev Version Comment */ 9 | /* 2017-09-07 947 1.0 Initial version */ 10 | /* 2017-07-30 931 0.1 First draft */ 11 | 12 | SINE: PROC OPTIONS(MAIN) REORDER; 13 | DCL (I,ISIN,ICOS) BIN FIXED(31); 14 | DCL (X,XRAD,FSIN,FCOS) DEC FLOAT(6); 15 | DCL PLOT CHAR(81); 16 | 17 | PUT SKIP EDIT(' x sin(x) cos(x) ', 18 | '-1 -0.5 0', 19 | ' +0.5 +1') 20 | (A,A,A); 21 | PUT SKIP EDIT(' ', 22 | '+-------------------.-------------------:', 23 | '-------------------.-------------------+') 24 | (A,A,A); 25 | 26 | DO I=0 TO 60; 27 | X = 6. * I; 28 | XRAD = X/57.2957795131; 29 | FSIN = SIN(XRAD); 30 | FCOS = COS(XRAD); 31 | PLOT = ' '; 32 | SUBSTR(PLOT, 1,1) = '+'; 33 | SUBSTR(PLOT,21,1) = '.'; 34 | SUBSTR(PLOT,41,1) = ':'; 35 | SUBSTR(PLOT,61,1) = '.'; 36 | SUBSTR(PLOT,81,1) = '+'; 37 | ISIN = 41.5 + 40. * FSIN; 38 | ICOS = 41.5 + 40. * FCOS; 39 | SUBSTR(PLOT,ISIN,1) = '*'; 40 | SUBSTR(PLOT,ICOS,1) = '#'; 41 | PUT SKIP EDIT (X,FSIN,FCOS,PLOT) 42 | (F(6,0),X(1),F(8,5),X(1),F(8,5),X(3),A); 43 | END; 44 | 45 | PUT SKIP EDIT(' ', 46 | '+-------------------.-------------------:', 47 | '-------------------.-------------------+') 48 | (A,A,A); 49 | 50 | END SINE; 51 | -------------------------------------------------------------------------------- /codes/soep_cc.c: -------------------------------------------------------------------------------- 1 | /* $Id: soep_cc.c 1171 2019-06-28 19:02:57Z mueller $ */ 2 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 3 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 4 | /* */ 5 | /* Revision History: */ 6 | /* Date Rev Version Comment */ 7 | /* 2017-12-23 972 1.0.1 change (n-1)/2 --> n/2 */ 8 | /* 2017-10-15 956 1.0 Initial version */ 9 | /* 2017-08-17 941 0.1 First draft */ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | int main() 16 | { 17 | int nmax; 18 | int nmsqrt; 19 | int prnt; 20 | int imax; 21 | int i,n; 22 | int np,il,nl; 23 | char *prime; 24 | char *p,*pmax; 25 | 26 | /* JCC on MVS doesn't skip initial white space, add leading ' ' to force */ 27 | if (scanf(" %d %d", &nmax, &prnt) != 2) { 28 | printf("conversion error, abort\n"); 29 | return 1; 30 | } 31 | if (nmax < 10) { 32 | printf("nmax must be >= 10, abort\n"); 33 | return 1; 34 | } 35 | 36 | /* prime: i=(n-1)/2 --> 3->[1], 5->[2]; ... 99-> [49]; ... */ 37 | nmsqrt = sqrt((double)nmax); 38 | imax = (nmax-1)/2; 39 | prime = malloc(imax+1); /* need [1,...,imax] */ 40 | pmax = &prime[imax]; 41 | 42 | for (p=prime; p<=pmax;) *p++ = 1; 43 | 44 | for (n=3; n<=nmsqrt; n+=2) { 45 | if (prime[n/2] == 0) continue; 46 | for (p=&prime[(n*n)/2]; p<=pmax; p+=n) *p = 0; 47 | } 48 | 49 | if (prnt) { 50 | printf("List of Primes up to %d\n",nmax); 51 | printf(" %7d",2); 52 | np = 1; 53 | for (i=1;i<=imax;i++) { 54 | if (! prime[i]) continue; 55 | printf(" %7d",1+2*i); 56 | np += 1; 57 | if (np != 10) continue; 58 | printf("\n"); 59 | np= 0; 60 | } 61 | if (np != 0) printf("\n"); 62 | } 63 | 64 | il = 4; 65 | nl = 10; 66 | np = 1; 67 | for (i=1;i<=imax;i++) { 68 | if (prime[i]) np += 1; 69 | if (i != il) continue; 70 | nl = 2*il+2; 71 | printf("pi(%10d): %10d\n",nl,np); 72 | il = 10*(il+1)-1; 73 | } 74 | if (nl != nmax) printf("pi(%10d): %10d\n",nmax,np); 75 | 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /codes/towh_cc.c: -------------------------------------------------------------------------------- 1 | /* $Id: towh_cc.c 1171 2019-06-28 19:02:57Z mueller $ */ 2 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 3 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 4 | /* */ 5 | /* Revision History: */ 6 | /* Date Rev Version Comment */ 7 | /* 2017-08-09 934 1.0 Initial version */ 8 | /* 2017-07-30 931 0.1 First draft */ 9 | 10 | #include 11 | 12 | void mov(int n, int f, int t); 13 | 14 | int ncall = 0; 15 | int nmove = 0; 16 | int curstk = 0; 17 | int maxstk = 0; 18 | int maxdsk = 0; 19 | int trace = 0; 20 | int tow[4]; 21 | 22 | int main(argc, argv) 23 | int argc; 24 | char *argv[]; 25 | { 26 | int ndsk; 27 | 28 | /* JCC on MVS doesn't skip initial white space, add leading ' ' to force */ 29 | if (scanf(" %d %d", &maxdsk, &trace) != 2) { 30 | printf("conversion error, abort\n"); 31 | return 1; 32 | } 33 | 34 | /* avoid | here, lots of fun with ASCII -> EBCDIC mapping */ 35 | /* if (maxdsk < 2 || maxdsk > 32) { */ 36 | if ((maxdsk < 2) + (maxdsk > 32)) { 37 | printf("maxdsk out of range (2...32), abort\n"); 38 | return 1; 39 | } 40 | 41 | for (ndsk=2; ndsk<=maxdsk; ndsk++) { 42 | ncall = 0; 43 | nmove = 0; 44 | maxstk = 0; 45 | curstk = 0; 46 | tow[1] = ndsk; 47 | tow[2] = 0; 48 | tow[3] = 0; 49 | 50 | if (trace) printf("STRT ndsk=%2d\n", ndsk); 51 | mov(ndsk,1,3); 52 | printf("DONE ndsk=%2d: maxstk=%2d ncall=%10d nmove=%10d\n", 53 | ndsk,maxstk,ncall,nmove); 54 | } 55 | return 0; 56 | } 57 | 58 | void mov(int n, int f, int t) 59 | { 60 | int o = 6-(f+t); 61 | curstk++; 62 | ncall++; 63 | if (curstk > maxstk) maxstk = curstk; 64 | if(n == 1) { 65 | nmove++; 66 | tow[f]--; 67 | tow[t]++; 68 | if (trace) printf("mov-do: %2d : %2d %2d %2d : %2d %2d %2d\n", 69 | curstk,n,f,t,tow[1],tow[2],tow[3]); 70 | } else { 71 | if (trace) printf("mov-go: %2d : %2d %2d %2d : %2d %2d %2d\n", 72 | curstk,n,f,t,tow[1],tow[2],tow[3]); 73 | mov(n-1,f,o); 74 | mov(1,f,t); 75 | mov(n-1,o,t); 76 | } 77 | curstk--; 78 | return; 79 | } 80 | -------------------------------------------------------------------------------- /codes/towh_a60.a60: -------------------------------------------------------------------------------- 1 | 'BEGIN' 2 | 'COMMENT' 3 | * $Id: towh_a60.a60 1171 2019-06-28 19:02:57Z mueller $ 4 | * SPDX-License-Identifier: GPL-3.0-or-later 5 | * Copyright 2017-2019 by Walter F.J. Mueller 6 | * 7 | * Revision History: 8 | * Date Rev Version Comment 9 | * 2017-09-05 946 1.0 Initial version 10 | *; 11 | 12 | 'INTEGER' NCALL,NMOVE; 13 | 'INTEGER' CURSTK,MAXSTK; 14 | 'INTEGER' MAXDSK,TRACE; 15 | 'INTEGER' 'ARRAY' TOW[1:3]; 16 | 'INTEGER' NDSK; 17 | 18 | 'PROCEDURE' TRC(TXT,N,F,T); 19 | 'STRING' TXT; 20 | 'VALUE' N,F,T; 21 | 'INTEGER' N,F,T; 22 | 'BEGIN' 23 | OUTSTRING (1, TXT); 24 | OUTINTEGER(1, NDSK); 25 | OUTSTRING (1,'(' :')'); 26 | OUTINTEGER(1, N); 27 | OUTINTEGER(1, F); 28 | OUTINTEGER(1, T); 29 | OUTSTRING (1,'(' :')'); 30 | OUTTARRAY (1, TOW); 31 | SYSACT(1,14,1); 32 | 'END'; 33 | 34 | 'PROCEDURE' MOV(N,F,T); 35 | 'VALUE' N,F,T; 36 | 'INTEGER' N,F,T; 37 | 'BEGIN' 38 | 'INTEGER' O; 39 | O := 6-(F+T); 40 | CURSTK := CURSTK + 1; 41 | NCALL := NCALL + 1; 42 | 'IF' CURSTK > MAXSTK 'THEN' MAXSTK := CURSTK; 43 | 44 | 'IF' N = 1 'THEN' 'BEGIN' 45 | NMOVE := NMOVE + 1; 46 | TOW[F] := TOW[F] - 1; 47 | TOW[T] := TOW[T] + 1; 48 | 'IF' TRACE > 0 'THEN' TRC('('mov-do: ')',N,F,T); 49 | 'END' 50 | 'ELSE' 'BEGIN' 51 | 'IF' TRACE > 0 'THEN' TRC('('mov-go: ')',N,F,T); 52 | MOV(N-1,F,O); 53 | MOV(1,F,T); 54 | MOV(N-1,O,T); 55 | 'END'; 56 | 57 | CURSTK := CURSTK - 1; 58 | 'END'; 59 | 60 | 'COMMENT' set record lenth = 132 and page length = 62; 61 | SYSACT(1,6,132); 62 | SYSACT(1,8,64); 63 | 64 | ININTEGER(0,MAXDSK); 65 | ININTEGER(0,TRACE); 66 | 67 | 'FOR' NDSK := 2 'STEP' 1 'UNTIL' MAXDSK 'DO' 'BEGIN' 68 | NCALL := 0; 69 | NMOVE := 0; 70 | MAXSTK := 0; 71 | CURSTK := 0; 72 | TOW[1] := NDSK; 73 | TOW[2] := 0; 74 | TOW[3] := 0; 75 | 'IF' TRACE > 0 'THEN' 'BEGIN' 76 | OUTSTRING (1,'('STRT ndsk=')'); 77 | OUTINTEGER(1, NDSK); 78 | SYSACT(1,14,1); 79 | 'END'; 80 | MOV(NDSK,1,3); 81 | OUTSTRING (1,'('DONE ndsk=')'); 82 | OUTINTEGER(1, NDSK); 83 | OUTSTRING (1,'(': maxstk=')'); 84 | OUTINTEGER(1, MAXSTK); 85 | OUTSTRING (1,'(' ncall=')'); 86 | OUTINTEGER(1, NCALL); 87 | OUTSTRING (1,'(' nmove=')'); 88 | OUTINTEGER(1, NMOVE); 89 | SYSACT(1,14,1); 90 | 'END'; 91 | 92 | 'END' 93 | -------------------------------------------------------------------------------- /codes/soep_for.f: -------------------------------------------------------------------------------- 1 | C 1 2 3 4 5 6 712-------- 2 | C2345*78901234567890123456789012345678901234567890123456789012345678901234567890 3 | C $Id: soep_for.f 1171 2019-06-28 19:02:57Z mueller $ 4 | C SPDX-License-Identifier: GPL-3.0-or-later 5 | C Copyright 2017-2019 by Walter F.J. Mueller 6 | C 7 | C Revision History: 8 | C Date Rev Version Comment 9 | C 2017-12-25 975 1.1 use sqrt(nmax) as outer loop end 10 | C 2017-12-23 972 1.0.1 change (n-1)/2 --> n/2 11 | C 2017-09-17 951 1.0 Initial version 12 | C 2017-08-26 942 0.1 First draft 13 | C 14 | C --- main program --------------------------------------------------- 15 | C PROGRAM SOEP 16 | INTEGER NMAX,PRNT,IMAX,NMSQRT 17 | INTEGER I,N,IMIN 18 | INTEGER NP,IL,NL 19 | INTEGER PLIST(10) 20 | LOGICAL*1 PRIME(5000000) 21 | C 22 | READ(5,9000,ERR=910,END=900) NMAX,PRNT 23 | IF (NMAX .LT. 10 .OR. NMAX .GT. 10000000) GOTO 920 24 | C 25 | NMSQRT = IFIX(SQRT(FLOAT(NMAX))) 26 | IMAX = (NMAX-1)/2 27 | DO 100 I=1,IMAX 28 | PRIME(I) = .TRUE. 29 | 100 CONTINUE 30 | C 31 | DO 300 N=3,NMSQRT,2 32 | IF (.NOT. PRIME(N/2)) GOTO 300 33 | IMIN = (N*N)/2 34 | DO 200 I=IMIN,IMAX,N 35 | PRIME(I) = .FALSE. 36 | 200 CONTINUE 37 | 300 CONTINUE 38 | C 39 | IF (PRNT .EQ. 0) GOTO 500 40 | WRITE(6,9010) NMAX 41 | PLIST(1) = 2 42 | NP = 1 43 | DO 400 I=1,IMAX 44 | IF (.NOT. PRIME(I)) GOTO 400 45 | NP = NP + 1 46 | PLIST(NP) = 1+2*I 47 | IF (NP .LT. 10) GOTO 400 48 | WRITE(6,9020) PLIST 49 | NP = 0 50 | 400 CONTINUE 51 | IF (NP .NE. 0) WRITE(6,9020) (PLIST(I),I=1,NP) 52 | 500 CONTINUE 53 | C 54 | IL = 4 55 | NL = 10 56 | NP = 1 57 | DO 600 I=1,IMAX 58 | IF (PRIME(I)) NP = NP + 1 59 | IF (I .NE. IL) GOTO 650 60 | NL = 2*IL+2 61 | WRITE(6,9030) NL,NP 62 | IL = 10*(IL+1)-1 63 | 650 CONTINUE 64 | 600 CONTINUE 65 | IF (NL .NE. NMAX) WRITE(6,9030) NMAX,NP 66 | C 67 | 900 CONTINUE 68 | STOP 69 | 910 WRITE(6,9040) 70 | STOP 71 | 920 WRITE(6,9050) 72 | STOP 73 | C 74 | 9000 FORMAT(2I10) 75 | 9010 FORMAT(1X,'List of Primes up to',I8) 76 | 9020 FORMAT(10(1X,I7)) 77 | 9030 FORMAT(1X,'pi(',I8,'): ',I8) 78 | 9040 FORMAT(1X,'conversion error, abort') 79 | 9050 FORMAT(1X,'nmax out of range (10...10000000), abort') 80 | C 81 | END 82 | -------------------------------------------------------------------------------- /codes/soep_pas.pas: -------------------------------------------------------------------------------- 1 | (* $Id: soep_pas.pas 1171 2019-06-28 19:02:57Z mueller $ *) 2 | (* SPDX-License-Identifier: GPL-3.0-or-later *) 3 | (* Copyright 2017-2019 by Walter F.J. Mueller *) 4 | (* *) 5 | (* Revision History: *) 6 | (* Date Rev Version Comment *) 7 | (* 2017-12-25 975 1.2 use sqrt(nmax) as outer loop end *) 8 | (* 2017-12-25 974 1.1 5M sieve array *) 9 | (* 2017-12-23 972 1.0.1 change (n-1)/2 --> n/2 *) 10 | (* 2017-09-07 948 1.0 Initial version *) 11 | 12 | program soep(input,output); 13 | var 14 | nmax,prnt,imax : integer; 15 | nmsqrt : integer; 16 | i,n,imin : integer; 17 | np,il,nl : integer; 18 | rnmax : real; 19 | sieve : ARRAY[1 .. 5000000] of boolean; 20 | 21 | begin 22 | 23 | read(nmax); 24 | read(prnt); 25 | 26 | if (nmax < 10) or (nmax > 10000000) then begin 27 | writeln(' ', 'nmax out of range (10...10000000), abort'); 28 | exit(8); 29 | end; 30 | 31 | rnmax := nmax; 32 | nmsqrt := trunc(sqrt(nmax)); 33 | imax := (nmax-1) div 2; 34 | for i := 1 to imax do sieve[i] := TRUE; 35 | 36 | n := 3; 37 | while n <= nmsqrt do begin 38 | if sieve[n div 2] then begin 39 | i := (n*n) div 2; 40 | while i <= imax do begin 41 | sieve[i] := FALSE; 42 | i := i + n; 43 | end; 44 | end; 45 | n := n + 2; 46 | end; 47 | 48 | if prnt > 0 then begin 49 | writeln(' ', 'List of Primes up to ', nmax:8); 50 | write(2:8); 51 | np := 1; 52 | for i := 1 to imax do begin 53 | if sieve[i] then begin 54 | write(1+2*i:8); 55 | np := np + 1; 56 | if np = 10 then begin 57 | writeln(' '); 58 | np := 0; 59 | end; 60 | end; 61 | end; 62 | if np > 0 then writeln(); 63 | end; 64 | 65 | il := 4; 66 | nl := 10; 67 | np := 1; 68 | for i := 1 to imax do begin 69 | if sieve[i] then np := np + 1; 70 | if i = il then begin 71 | nl := 2*il + 2; 72 | writeln(' ', 'pi(', nl:8, '): ', np:8); 73 | il := 10*(il+1)-1; 74 | end; 75 | end; 76 | 77 | if nl < nmax then writeln(' ', 'pi(', nmax:8, '): ', np:8); 78 | 79 | end. 80 | -------------------------------------------------------------------------------- /codes/soep_sim.sim: -------------------------------------------------------------------------------- 1 | COMMENT 2 | * SPDX-License-Identifier: GPL-3.0-or-later 3 | * Copyright 2017- by Walter F.J. Mueller 4 | * 5 | * Revision History: 6 | * Date Rev Version Comment 7 | * 2017-12-25 975 1.2 use sqrt(nmax) as outer loop end 8 | * 2017-12-24 973 1.1 use WHILE not FOR to avoid compiler bug 9 | * 2017-12-23 972 1.0.1 change (n-1)/2 --> n/2 10 | * 2017-09-17 951 1.0 Initial version 11 | * 2017-09-08 949 0.1 First draft 12 | * 13 | * Note on SIMULA 67 (VERS 12.00) complier bug workaround 14 | * - an inner loop codes as 15 | * FOR i:= n2 // 2 STEP n UNTIL imax DO prime(i) := FALSE 16 | * fails with 'FIXED POINT OVFL at line' of the FOR loop. 17 | * - The equivalent WHILE loop used below works. 18 | *; 19 | 20 | BEGIN 21 | INTEGER nmax,prnt,imax,nmsqrt; 22 | INTEGER i,n,imin; 23 | INTEGER np,il,nl; 24 | BOOLEAN ARRAY prime(1:5000000); 25 | 26 | nmax := InInt; 27 | prnt := InInt; 28 | 29 | IF nmax < 10 OR nmax > 10000000 THEN BEGIN 30 | OutText("nmax out of range (10...10000000), abort"); 31 | GOTO done; 32 | END; 33 | 34 | nmsqrt := Entier(Sqrt(nmax)); 35 | imax := (nmax-1) // 2; 36 | FOR i := 1 STEP 1 UNTIL imax DO prime(i) := TRUE; 37 | 38 | FOR n := 3 STEP 2 UNTIL nmsqrt DO BEGIN 39 | IF prime(n//2) THEN BEGIN 40 | i := (n*n) // 2; 41 | WHILE i <= imax DO BEGIN 42 | prime(i) := FALSE; 43 | i:= i + n; 44 | END; 45 | END; 46 | END; 47 | 48 | IF prnt > 0 THEN BEGIN 49 | OutText("List of Primes up to "); 50 | OutInt(nmax,8); 51 | OutImage; 52 | OutInt(2,8); 53 | np := 1; 54 | FOR i := 1 STEP 1 UNTIL imax DO BEGIN 55 | IF prime(i) THEN BEGIN 56 | OutInt(1+2*i,8); 57 | np := np + 1; 58 | IF np = 10 THEN BEGIN 59 | OutImage; 60 | np := 0; 61 | END; 62 | END; 63 | END; 64 | IF np > 0 THEN OutImage; 65 | END; 66 | 67 | il := 4; 68 | nl := 10; 69 | np := 1; 70 | 71 | FOR i := 1 STEP 1 UNTIL imax DO BEGIN 72 | IF prime(i) THEN np := np + 1; 73 | IF i = il THEN BEGIN 74 | nl := 2*il + 2; 75 | OutText("pi("); 76 | OutInt(nl,8); 77 | OutText(")="); 78 | OutInt(np,8); 79 | OutImage; 80 | il := 10*(il+1)-1; 81 | END; 82 | END; 83 | 84 | IF nl < nmax THEN BEGIN 85 | OutText("pi("); 86 | OutInt(nmax,8); 87 | OutText(")="); 88 | OutInt(np,8); 89 | OutImage; 90 | END; 91 | 92 | done: 93 | OutImage; 94 | END; 95 | -------------------------------------------------------------------------------- /codes/soep_a60.a60: -------------------------------------------------------------------------------- 1 | 'BEGIN' 2 | 'COMMENT' 3 | * $Id: soep_a60.a60 1195 2019-07-20 08:05:15Z mueller $ 4 | * SPDX-License-Identifier: GPL-3.0-or-later 5 | * Copyright 2017-2019 by Walter F.J. Mueller 6 | * 7 | * Revision History: 8 | * Date Rev Version Comment 9 | * 2017-12-25 975 1.2 use sqrt(nmax) as outer loop end 10 | * 2017-12-23 972 1.1 change (n-1)/2 --> n'/'2 11 | * use integer '/' divide 12 | * 2017-09-17 951 1.0 Initial version 13 | * 2017-09-05 946 0.1 First draft 14 | *; 15 | 16 | 'INTEGER' NMAX,PRNT,IMAX,NMSQRT; 17 | 'INTEGER' I,N,IMIN; 18 | 'INTEGER' NP,IL,NL; 19 | 20 | 'COMMENT' set record lenth = 132 and page length = 64; 21 | SYSACT(1,6,132); 22 | SYSACT(1,8,64); 23 | 24 | ININTEGER(0,NMAX); 25 | ININTEGER(0,PRNT); 26 | 27 | 'IF' NMAX <= 10 'THEN' 'BEGIN' 28 | OUTSTRING (1,'('nmax must be >= 10, abort')'); 29 | 'GOTO' DONE; 30 | 'END'; 31 | 32 | NMSQRT := ENTIER(SQRT(NMAX)); 33 | IMAX := (NMAX-1)'/'2; 34 | 35 | 'BEGIN' 36 | 'BOOLEAN' 'ARRAY' PRIME[0:IMAX]; 37 | 'FOR' I := 0 'STEP' 1 'UNTIL' IMAX 'DO' PRIME[I] := 'TRUE'; 38 | 39 | 'FOR' N := 3 'STEP' 2 'UNTIL' NMSQRT 'DO' 'BEGIN' 40 | 'IF' PRIME[N'/'2] 'THEN' 'BEGIN' 41 | IMIN := (N*N) '/' 2; 42 | 'FOR' I := IMIN 'STEP' N 'UNTIL' IMAX 'DO' PRIME[I] := 'FALSE'; 43 | 'END'; 44 | 'END'; 45 | 46 | 'IF' PRNT > 0 'THEN' 'BEGIN' 47 | OUTSTRING (1,'('List of Primes up to ')'); 48 | OUTINTEGER(1, NMAX); 49 | SYSACT(1,14,1); 50 | OUTINTEGER(1, 2); 51 | NP := 1; 52 | 'FOR' I := 1 'STEP' 1 'UNTIL' IMAX 'DO' 'BEGIN' 53 | 'IF' PRIME[I] 'THEN' 'BEGIN' 54 | OUTINTEGER(1, 1+2*I); 55 | NP := NP + 1; 56 | 'IF' NP = 10 'THEN' 'BEGIN' 57 | SYSACT(1,14,1); 58 | NP := 0; 59 | 'END'; 60 | 'END'; 61 | 'END'; 62 | 'IF' NP > 0 'THEN' SYSACT(1,14,1); 63 | 'END'; 64 | 65 | IL := 4; 66 | NL := 10; 67 | NP := 1; 68 | 'FOR' I := 1 'STEP' 1 'UNTIL' IMAX 'DO' 'BEGIN' 69 | 'IF' PRIME[I] 'THEN' NP := NP+ 1; 70 | 'IF' I = IL 'THEN' 'BEGIN' 71 | NL := 2*IL + 2; 72 | OUTSTRING (1,'('pi(')'); 73 | OUTINTEGER(1, NL); 74 | OUTSTRING (1,'('):')'); 75 | OUTINTEGER(1, NP); 76 | SYSACT(1,14,1); 77 | IL := 10*(IL+1)-1; 78 | 'END'; 79 | 'END'; 80 | 81 | 'IF' NL < NMAX 'THEN' 'BEGIN' 82 | OUTSTRING (1,'('pi(')'); 83 | OUTINTEGER(1, NMAX); 84 | OUTSTRING (1,'('):')'); 85 | OUTINTEGER(1, NP); 86 | SYSACT(1,14,1); 87 | 'END'; 88 | 89 | 'END'; 90 | 91 | DONE: 92 | 'END' 93 | -------------------------------------------------------------------------------- /codes/README_sine.md: -------------------------------------------------------------------------------- 1 | ## sine - Line printer plot of sine and cosine 2 | 3 | ### Table of content 4 | 5 | - [Description](#user-content-description) 6 | - [Language and Compiler Notes](#user-content-langcomp) 7 | - [Jobs](#user-content-jobs) 8 | - [Author's Note](#user-content-anote) 9 | 10 | ### Description 11 | In the age of _plain character_ line printers it was customary to create 12 | simple graphs and even graphics by just using the basic printable characters 13 | in some intelligent form. The _sine_ codes plot a graph showing sin(x) and 14 | cos(x) for the angles from 0 to 360 degree in steps of 5 degrees. 15 | 16 | In the early 70's not all languages had decent support for handling text. 17 | FORTRAN 4 or Algol 60 were targeted for handling numeric problems, and 18 | doing text handling with them was a bit tricky. 19 | 20 | ### Language and Compiler Notes 21 | 22 | #### C - [sine_cc.c](sine_cc.c) 23 | `GCCMVS` in the version coming with [tk4-](http://wotho.ethz.ch/tk4-/) 24 | update 08 has a bug in `printf`. 25 | Printing a very small number with `%8.5f` can produce output like 26 | `0.0000000000004`, thus more than 5 after digit characters. This 27 | disrupts the nice formatting. `JCC` works correctly. 28 | 29 | #### FORTRAN 4 - [sine_for.f](sine_for.f) 30 | FORTRAN 4 has only very rudimentary support for handling of characters. 31 | That's what the code tricks around with `'A'` formats and Hollerith constants 32 | like `/1H*/` in `DATA` statements, ancient features not needed in Fortran 77 33 | and later. 34 | 35 | ### Jobs 36 | The [jobs](../jobs) directory contains only one type of jobs for `sine` named 37 | 38 | sine_*.JES 39 | 40 | which run the code and produce a nice plot. 41 | Not much to benchmark here. 42 | 43 | ### Author's Note 44 | Before laser printers allowed to easily combine text and graphical output 45 | in the mid 80's the only way to produce high quality graphics was the usage 46 | _plotters_. In general as slow as cumbersome. To get quick, low quality 47 | graphics it was customary to create '_line printer plots_'. I got exposed 48 | to this in the early 80's when analyzing scientific data with the 49 | [CERN](https://en.wikipedia.org/wiki/CERN) software package 50 | [HBOOK](https://cds.cern.ch/record/118642?ln=en). HBOOK was a framework, 51 | written in Fortran, which allowed to handle one- and two-dimensional 52 | [histograms](https://en.wikipedia.org/wiki/Histogram). Creating line printer 53 | plots of these histograms was a key functionality, and setting the 54 | histograms up such that the output fitted reasonably on printer pages 55 | was one of usual concerns when using this package. 56 | 57 | Remembering these days lead to adding such a line printer plot as test case, 58 | and a graph with two functions is about as simple as one can get it. 59 | -------------------------------------------------------------------------------- /README_bench.md: -------------------------------------------------------------------------------- 1 | ## Benchmark Summary 2 | 3 | ### Initial benchmarks 4 | 5 | The benchmark results for 6 | - [soep](codes/README_soep.md#user-content-benchmarks) - 7 | Sieve of Eratosthenes prime search (byte) 8 | - [soeq](codes/README_soeq.md#user-content-benchmarks) - 9 | Sieve of Eratosthenes prime search (bit) 10 | - [towh](codes/README_towh.md#user-content-benchmarks) - 11 | Tower of Hanoi solver 12 | - [mcpi](codes/README_mcpi.md#user-content-benchmarks) - 13 | Monte Carlo estimate of pi 14 | 15 | can be summarized in a single ranking table, each case is sorted 16 | by CPU time relative to the Assembler implementation: 17 | 18 | | soep | | soeq | | towh | | mcpi | | 19 | | :--: | -----: | :--: | -----: | :--: | -----: | :--: | -----: | 20 | | asm | 1.00 | asm | 1.00 | asm | 1.00 | asm | 1.00 | 21 | | forh | 1.47 | | | pas | 1.41 | gcc | 1.84 | 22 | | gcc | 1.67 | gcc | 1.70 | gcc | 1.64 | pas | 2.47 | 23 | | jcc | 2.27 | jcc | 2.55 | jcc | 1.76 | forh | 2.70 | 24 | | pas | 4.71 | pas | 5.17 | forh | 1.76 | forg | 3.25 | 25 | | forg | 5.09 | | | forg | 3.10 | pli | 4.89 | 26 | | pli | 6.67 | pli | 19.62 | sim | 6.49 | sim | 9.16 | 27 | | sim | 7.62 | | | pli | 10.62 | forw | 10.29 | 28 | | a60 | 10.15 | | | forw | 17.17 | a60 | 53.15 | 29 | | forw | 21.27 | | | a60 | 49.48 | | | 30 | 31 | Some findings: 32 | - **FORTRAN H** performs very well, it was certainly the best optimizing 33 | compiler available at the time. 34 | - **GCC** gives good results, but this compiler is based on decades of 35 | additional compiler development, and has also a much larger memory 36 | footprint. 37 | - **Pascal**, again a 1979 vintage compiler, does very well, especially in 38 | the `towh` and `mcpi` cases which are very call intensive. Procedure calls 39 | are apparently done very efficiently. 40 | - **Algol 60** on the other side performs extremely poorly for `towh` and 41 | `mcpi`. The reason is that each call uses a `GETMAIN`/`FREEMAIN` pair to 42 | allocate the new stack frame. Pascal, PL/I, and Simula show that 43 | vintage 197x compilers could do much better. 44 | - **PL/I** features an optimizer (`OPT=2` used), but the performance 45 | in `soep`, which is essentially a simple integer array benchmark, 46 | is quite modest compared to FORTRAN H or even G. 47 | The poor performance in `soeq` is caused by the implementation of 48 | `BIT` array access, run-time library calls are used rather than inline 49 | code. 50 | - **WATFIV** as a non-optimizing fast check-out compiler shouldn't be 51 | directly compared, but clearly beats Algol 60 in call intensive 52 | benchmarks like `mcpi`. 53 | - the `towh` results for all FORTRANs should be taken with a grain of salt, 54 | the implementation emulates recursive calls with a lot of array arithmetic. 55 | -------------------------------------------------------------------------------- /codes/towh_pli.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* $Id: towh_pli.pli 1171 2019-06-28 19:02:57Z mueller $ */ 4 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 5 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 6 | /* */ 7 | /* Revision History: */ 8 | /* Date Rev Version Comment */ 9 | /* 2018-01-02 981 1.0 add ON units for ENDFILE and CONVERSION */ 10 | /* 2017-09-07 947 1.0 Initial version */ 11 | /* 2017-07-30 931 0.1 First draft */ 12 | 13 | TOWH: PROC OPTIONS(MAIN) REORDER; 14 | DCL (NCALL,NMOVE) BIN FIXED(31) INIT(0); 15 | DCL (CURSTK,MAXSTK) BIN FIXED(31) INIT(0); 16 | DCL (MAXDSK,TRACE) BIN FIXED(31) INIT(0); 17 | DCL TOW(3) BIN FIXED(31) INIT((3)0); 18 | DCL NDSK BIN FIXED(31); 19 | 20 | DCL MOV ENTRY(BIN FIXED(31),BIN FIXED(31),BIN FIXED(31)); 21 | 22 | ON ENDFILE(SYSIN) BEGIN; 23 | PUT SKIP EDIT('Unexpected EOF, abort')(A); 24 | GOTO DONE; 25 | END; 26 | ON CONVERSION BEGIN; 27 | PUT SKIP EDIT('Conversion error, abort')(A); 28 | GOTO DONE; 29 | END; 30 | 31 | GET EDIT(MAXDSK,TRACE) (F(5),F(5)); 32 | 33 | DO NDSK=2 TO MAXDSK; 34 | NCALL = 0; 35 | NMOVE = 0; 36 | MAXSTK = 0; 37 | CURSTK = 0; 38 | TOW(1) = NDSK; 39 | TOW(2) = 0; 40 | TOW(3) = 0; 41 | IF TRACE > 0 THEN PUT SKIP EDIT('STRT ndsk=',NDSK) (A,F(2)); 42 | CALL MOV(NDSK,1,3); 43 | PUT SKIP EDIT('DONE ndsk=',NDSK, ': maxstk=',MAXSTK, 44 | ' ncall=',NCALL, ' nmove=',NMOVE) 45 | (2(A,F(2)),2(A,F(10))); 46 | END; 47 | DONE:; 48 | 49 | /* procedure MOV -----------------------------------------------*/ 50 | MOV: PROC(N,F,T) RECURSIVE; 51 | DCL (N,F,T) BIN FIXED(31); 52 | DCL O BIN FIXED(31); 53 | O = 6-(F+T); 54 | CURSTK = CURSTK + 1; 55 | NCALL = NCALL + 1; 56 | MAXSTK = MAX(MAXSTK,CURSTK); 57 | IF N = 1 THEN DO; 58 | NMOVE = NMOVE + 1; 59 | TOW(F) = TOW(F) - 1; 60 | TOW(T) = TOW(T) + 1; 61 | IF TRACE > 0 THEN PUT SKIP EDIT('mov-do: ',CURSTK, 62 | ' :',N,F,T, ' :',TOW) 63 | (A,F(2),2(A,3(X(1),F(2)))); 64 | END; 65 | ELSE DO; 66 | IF TRACE > 0 THEN PUT SKIP EDIT('mov-go: ',CURSTK, 67 | ' :',N,F,T, ' :',TOW) 68 | (A,F(2),2(A,3(X(1),F(2)))); 69 | CALL MOV(N-1,F,O); 70 | CALL MOV(1,F,T); 71 | CALL MOV(N-1,O,T); 72 | END; 73 | CURSTK = CURSTK - 1; 74 | END MOV; 75 | 76 | END TOWH; 77 | -------------------------------------------------------------------------------- /codes/mcpi_pas.pas: -------------------------------------------------------------------------------- 1 | (* $Id: mcpi_pas.pas 1171 2019-06-28 19:02:57Z mueller $ *) 2 | (* SPDX-License-Identifier: GPL-3.0-or-later *) 3 | (* Copyright 2017-2019 by Walter F.J. Mueller *) 4 | (* *) 5 | (* Revision History: *) 6 | (* Date Rev Version Comment *) 7 | (* 2017-12-28 978 1.1 use inverse to avoid divide by constant *) 8 | (* 2017-09-17 951 1.0 Initial version *) 9 | (* 2017-09-07 948 0.1 First draft *) 10 | 11 | program mcpi(input,output); 12 | const 13 | rr32 = 4294967296.0; 14 | rdiv = 33554432.0; 15 | pi = 3.141592653589793; 16 | var 17 | rseed,rlast : real; 18 | ranini : boolean; 19 | idbgrr,idbgrn,idbgmc : integer; 20 | i,ntry,nhit,ngo : integer; 21 | piest,pierr : real; 22 | rhit,rtry : real; 23 | x,y,r : real; 24 | rr32i,rdivi : real; 25 | rshuf : ARRAY[0 .. 127] of real; 26 | 27 | function ranraw(dummy :real) : real; 28 | var 29 | rfac,rnew : real; 30 | begin 31 | rnew := rseed * 69069.0; 32 | rfac := rnew * rr32i; 33 | rfac := trunc(rfac); 34 | rnew := rnew - rfac * rr32; 35 | if idbgrr > 0 then writeln(' ','RR: ',rseed:14:1,rnew:14:1); 36 | rseed := rnew; 37 | ranraw := rnew; 38 | end; 39 | 40 | function rannum(dummy :real) : real; 41 | var 42 | rnew : real; 43 | i : integer; 44 | begin 45 | if not ranini then begin 46 | for i := 0 to 127 do rshuf[i] := ranraw(0.0); 47 | ranini := TRUE; 48 | end; 49 | 50 | i := trunc(rlast*rdivi); 51 | rlast := rshuf[i]; 52 | rshuf[i] := ranraw(0.0); 53 | rnew := rlast * rr32i; 54 | if idbgrn > 0 then writeln(' ','RN: ',i:12,rlast:14:1,rnew:14:8); 55 | rannum := rnew; 56 | end; 57 | 58 | begin 59 | rseed := 12345.0; 60 | ranini := FALSE; 61 | 62 | rr32i := 1.0/rr32; 63 | rdivi := 1.0/rdiv; 64 | 65 | read(idbgrr); 66 | read(idbgrn); 67 | read(idbgmc); 68 | 69 | if (idbgrr=0) and (idbgrn=0) and (idbgmc=0) then 70 | writeln(' ',' ntry nhit pi-est', 71 | ' pi-err seed'); 72 | 73 | while TRUE do begin 74 | read(ngo); 75 | if ngo = 0 then exit(0); 76 | for i := 1 to ngo do begin 77 | x := 2.0 * rannum(0.0) - 1.0; 78 | y := 2.0 * rannum(0.0) - 1.0; 79 | r := x*x + y*y; 80 | ntry := ntry + 1; 81 | if r <= 1.0 then nhit := nhit + 1; 82 | if idbgmc > 0 then writeln(' ','MC: ', 83 | x:12:8,y:12:8,r:12:8,nhit:12); 84 | end; 85 | 86 | rtry := ntry; 87 | rhit := nhit; 88 | 89 | piest := 4.0 * (rhit / rtry); 90 | pierr := piest - pi; 91 | writeln(' ','PI: ',ntry:12,nhit:12,piest:12:8,pierr:12:8, 92 | rlast:14:1); 93 | end; 94 | 95 | end. 96 | -------------------------------------------------------------------------------- /jcl/job_asm_clg.JESI: -------------------------------------------------------------------------------- 1 | //** /* master for ASM jobs (Assembler compile-load-go) 2 | //** /* parameters: 3 | //** /* Name Default Comment 4 | //** /* ${JOB} n/a job name 5 | //** /* ${JOBPOS} 'S322-0C4','WFJM' job positional parms 6 | //** /* ${JOBEXT} job extra parms (must end in ,!) 7 | //** /* ${CLASS} A job class 8 | //** /* ${MSGCLASS} A message class 9 | //** /* ${MSGLEVEL} (1,1) message level 10 | //** /* ${REGION} 128K job memory 11 | //** /* ${TIME} (1,0) job time limit 12 | //** /* ${PRTY} 8 job priority 13 | //** /* ${ROOM} 4242 room number for banner (4 char) 14 | //** /* ${DDSRC} n/a source file 15 | //** /* ${DDDAT} n/a data file 16 | //** /* ${MAC1} 'SYS2.MACLIB' 1st extra lib SYS2.MACLIB 17 | //** /* ${MAC2} 'SYS1.AMODGEN' 2nd extra lib SYS1.AMODGEN 18 | //** /* ${MAC3} 'SYS1.MACLIB' 3rd extra lib (dummy) 19 | //** /* ${SYSUT1SPA} (1700,(600,100)) SYSUT1 SPACE 20 | //** /* ${SYSUT2SPA} (1700,(300,50)) SYSUT2/3 SPACE 21 | //** /* ${SYSGOSPA} (80,(2000,500)) SYSGO SPACE 22 | //** /* ${PARMC} 'NODECK,LOAD' compile step PARM 23 | //** /* ${PARML} 'MAP,LIST,LET,NCAL' linker step PARM 24 | //** /* ${PARMG} '' go step PARM 25 | //** /* ${DMPLIM} '2000' go step SYSUDUMP limit 26 | //** /* ${OUTLIM} '5000' go step SYSPRINT limit 27 | //** /* 28 | //** /* Notes: 29 | //** /* 1. COND is overridden such that jobs abort when ASM end with RC >= 8. 30 | //** /* Assembler codes with RC>=8 are faulty and usually ABEND anyway. 31 | //** /* 2. the SYSUT* must be increased via ${SYSUT*SPA} for very large 32 | //** /* modules (>=15000 lines of code (including macro generated)). 33 | //** /* 34 | //${JOB} JOB ${JOBPOS:-'S322-0C4','WFJM'},${JOBEXT:-} 35 | // CLASS=${CLASS:-A},MSGCLASS=${MSGCLASS:-A},MSGLEVEL=${MSGLEVEL:-(1,1)}, 36 | // REGION=${REGION:-128K},TIME=${TIME:-(1,0)},PRTY=${PRTY:-8} 37 | /*JOBPARM ROOM=${ROOM:-4242} 38 | //CLG EXEC ASMFCLG, 39 | // MAC1=${MAC1:-'SYS2.MACLIB'}, 40 | // MAC2=${MAC2:-'SYS1.AMODGEN'}, 41 | // MAC3=${MAC3:-'SYS1.MACLIB'}, 42 | // PARM.ASM=${PARMC:-'NODECK,LOAD'}, 43 | // PARM.LKED=${PARML:-'MAP,LIST,LET,NCAL'}, 44 | // COND.LKED=(8,LE,ASM), 45 | // PARM.GO=${PARMG:-''}, 46 | // COND.GO=((8,LE,ASM),(4,LT,LKED)) 47 | //ASM.SYSUT1 DD DSN=&&SYSUT1,UNIT=SYSDA,SPACE=${SYSUT1SPA:-(1700,(600,100))} 48 | //ASM.SYSUT2 DD DSN=&&SYSUT2,UNIT=SYSDA,SPACE=${SYSUT2SPA:-(1700,(300,50))} 49 | //ASM.SYSUT3 DD DSN=&&SYSUT3,UNIT=SYSDA,SPACE=${SYSUT2SPA:-(1700,(300,50))} 50 | //ASM.SYSGO DD DSN=&&OBJSET,UNIT=SYSDA,SPACE=${SYSGOSPA:-(80,(2000,500))} 51 | //ASM.SYSIN DD * 52 | //** ##include ${DDSRC} 53 | /* 54 | //GO.SYSUDUMP DD SYSOUT=*,OUTLIM=${DMPLIM:-2000} 55 | //GO.SYSPRINT DD SYSOUT=*,OUTLIM=${OUTLIM:-5000} 56 | //GO.SYSIN DD * 57 | //** ##include ${DDDAT} 58 | /* 59 | // 60 | -------------------------------------------------------------------------------- /codes/mcpi_cc.c: -------------------------------------------------------------------------------- 1 | /* $Id: mcpi_cc.c 1171 2019-06-28 19:02:57Z mueller $ */ 2 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 3 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 4 | /* */ 5 | /* Revision History: */ 6 | /* Date Rev Version Comment */ 7 | /* 2017-12-28 978 1.1 use inverse to avoid divide by constant */ 8 | /* 2017-08-12 938 1.0 Initial version */ 9 | /* 2017-07-30 931 0.1 First draft */ 10 | 11 | #include 12 | #include 13 | 14 | double rseed = 12345.; 15 | double rlast = 0.; 16 | double rshuf[128]; 17 | double rr32 = 4294967296.; /* 4*1024*1024*1024 */ 18 | double rdiv = 33554432.; /* rr32 / 128 */ 19 | double rr32i; /* setup in main() */ 20 | double rdivi; /* setup in main() */ 21 | int ranini = 0; 22 | int idbgrr = 0; 23 | int idbgrn = 0; 24 | int idbgmc = 0; 25 | 26 | double ranraw() 27 | { 28 | double rnew,rnew1; 29 | double rfac; 30 | int ifac; 31 | 32 | rnew1 = rseed * 69069.; 33 | rfac = rnew1 * rr32i; 34 | ifac = rfac; 35 | rfac = ifac; 36 | rnew = rnew1 - rfac * rr32; 37 | if (idbgrr) printf("RR: %12.0f %12.0f : %16.0f %9d\n", 38 | rseed,rnew, rnew1,ifac); 39 | rseed = rnew; 40 | return rnew; 41 | } 42 | 43 | double rannum() 44 | { 45 | int i; 46 | double rnew; 47 | 48 | if (ranini == 0) { 49 | for (i=0; i<128; i++) rshuf[i] = ranraw(); 50 | ranini = 1; 51 | } 52 | 53 | i = rlast * rdivi; 54 | rlast = rshuf[i]; 55 | rshuf[i] = ranraw(); 56 | rnew = rlast * rr32i; 57 | if (idbgrn) printf("RN: %12d %12.0f %12.8f\n", i,rlast,rnew); 58 | return rnew; 59 | } 60 | 61 | int main() 62 | { 63 | int i; 64 | int ntry = 0; 65 | int nhit = 0; 66 | int ngo; 67 | double pi = 3.141592653589793; 68 | double piest; 69 | double pierr; 70 | 71 | /* setup global constants */ 72 | rr32i = 1./rr32; 73 | rdivi = 1./rdiv; 74 | 75 | /* JCC on MVS doesn't skip initial white space, add leading ' ' to force */ 76 | if (scanf(" %d %d %d", &idbgrr, &idbgrn, &idbgmc) != 3) { 77 | printf("conversion error, abort\n"); 78 | return 1; 79 | } 80 | 81 | if (idbgrr == 0 && idbgrn == 0 && idbgmc == 0) 82 | printf(" ntry nhit pi-est" 83 | " pi-err seed\n"); 84 | 85 | while (scanf(" %d", &ngo) == 1 && ngo > 0) { 86 | for (i=0; i 4 | * 5 | * Revision History: 6 | * Date Rev Version Comment 7 | * 2017-12-28 978 1.1 use inverse to avoid divide by constant 8 | * 2017-09-17 951 1.0 Initial version 9 | * 2017-09-08 949 0.1 First draft 10 | *; 11 | 12 | BEGIN 13 | LONG REAL rr32,rr32i; 14 | LONG REAL rdiv,rdivi; 15 | LONG REAL pi; 16 | LONG REAL rseed,rlast; 17 | BOOLEAN ranini; 18 | INTEGER idbgrr,idbgrn,idbgmc; 19 | INTEGER i,ntry,nhit,ngo; 20 | LONG REAL piest,pierr; 21 | LONG REAL rhit,rtry; 22 | LONG REAL x,y,r; 23 | LONG REAL ARRAY rshuf(0:127); 24 | 25 | LONG REAL PROCEDURE ranraw; 26 | BEGIN 27 | LONG REAL rfac,rnew; 28 | rnew := rseed * 69069.0; 29 | rfac := rnew * rr32i; 30 | rfac := Entier(rfac); 31 | rnew := rnew - rfac * rr32; 32 | IF idbgrr > 0 THEN BEGIN 33 | OutText("RR: "); 34 | OutFix(rseed,1,14); 35 | OutFix(rnew,1,14); 36 | OutImage; 37 | END; 38 | rseed := rnew; 39 | ranraw := rnew; 40 | END ** ranraw **; 41 | 42 | LONG REAL PROCEDURE rannum; 43 | BEGIN 44 | LONG REAL rnew; 45 | INTEGER i; 46 | IF NOT ranini THEN BEGIN 47 | FOR i := 0 STEP 1 UNTIL 127 DO rshuf(i) := ranraw; 48 | ranini := TRUE; 49 | END; 50 | i := Entier(rlast*rdivi); 51 | rlast := rshuf(i); 52 | rshuf(i) := ranraw; 53 | rnew := rlast * rr32i; 54 | IF idbgrn > 0 THEN BEGIN 55 | OutText("RN: "); 56 | OutInt(I,12); 57 | OutFix(rlast,1,14); 58 | OutFix(rnew,8,14); 59 | OutImage; 60 | END; 61 | rannum := rnew; 62 | END ** rannum **; 63 | 64 | rr32 := 4294967296.0; 65 | rr32i := 1.0/rr32; 66 | rdiv := 33554432.0; 67 | rdivi := 1.0/rdiv; 68 | pi := 3.141592653589793; 69 | rseed := 12345.0; 70 | ranini := FALSE; 71 | 72 | idbgrr := InInt; 73 | idbgrn := InInt; 74 | idbgmc := InInt; 75 | 76 | IF idbgrr=0 AND idbgrn=0 AND idbgmc=0 THEN BEGIN 77 | OutText(" ntry nhit pi-est"); 78 | OutText(" pi-err seed"); 79 | OutImage; 80 | END; 81 | 82 | WHILE TRUE DO BEGIN 83 | ngo := InInt; 84 | IF ngo = 0 THEN GOTO done; 85 | FOR i := 1 STEP 1 UNTIL ngo DO BEGIN 86 | x := 2.0 * rannum - 1.0; 87 | y := 2.0 * rannum - 1.0; 88 | r := x*x + y*y; 89 | ntry := ntry + 1; 90 | IF r <= 1.0 THEN nhit := nhit + 1; 91 | IF idbgrr > 0 THEN BEGIN 92 | OutText("MC: "); 93 | OutFix(x,8,12); 94 | OutFix(y,8,12); 95 | OutFix(r,8,12); 96 | OutInt(nhit,12); 97 | OutImage; 98 | END; 99 | END; 100 | rtry := ntry; 101 | rhit := nhit; 102 | 103 | piest := 4.0 * (rhit / rtry); 104 | pierr := piest - pi; 105 | 106 | OutText("PI: "); 107 | OutInt(ntry,12); 108 | OutInt(nhit,12); 109 | OutFix(piest,8,12); 110 | OutFix(pierr,8,12); 111 | OutFix(rlast,1,14); 112 | OutImage; 113 | END; 114 | 115 | done: 116 | END; 117 | -------------------------------------------------------------------------------- /codes/mcpi_a60.a60: -------------------------------------------------------------------------------- 1 | 'BEGIN' 2 | 'COMMENT' 3 | * $Id: mcpi_a60.a60 1171 2019-06-28 19:02:57Z mueller $ 4 | * SPDX-License-Identifier: GPL-3.0-or-later 5 | * Copyright 2017-2019 by Walter F.J. Mueller 6 | * 7 | * Revision History: 8 | * Date Rev Version Comment 9 | * 2017-12-28 978 1.1 use inverse to avoid divide by constant 10 | * 2017-09-17 951 1.0 Initial version 11 | *; 12 | 13 | 'REAL' RR32,RDIV,PI,RR32I,RDIVI; 14 | 'REAL' RSEED,RLAST; 15 | 'BOOLEAN' RANINI; 16 | 'INTEGER' IDBGRR,IDBGRN,IDBGMC; 17 | 'INTEGER' I,NTRY,NHIT,NGO; 18 | 'REAL' PIEST,PIERR; 19 | 'REAL' RHIT,RTRY; 20 | 'REAL' X,Y,R; 21 | 'REAL' 'ARRAY' RSHUF[0:127]; 22 | 23 | 'REAL' 'PROCEDURE' RANRAW; 24 | 'BEGIN' 25 | 'REAL' RFAC,RNEW; 26 | RNEW := RSEED * 69069.0; 27 | RFAC := RNEW * RR32I; 28 | RFAC := ENTIER(RFAC); 29 | RNEW := RNEW - RFAC * RR32; 30 | 'IF' IDBGRR > 0 'THEN' 'BEGIN' 31 | OUTSTRING (1,'('RR:')'); 32 | OUTREAL(1, RSEED); 33 | OUTREAL(1, RNEW); 34 | SYSACT(1,14,1); 35 | 'END'; 36 | RSEED := RNEW; 37 | RANRAW := RNEW; 38 | 'END'; 39 | 40 | 'REAL' 'PROCEDURE' RANNUM; 41 | 'BEGIN' 42 | 'REAL' RNEW; 43 | 'INTEGER' I; 44 | 'IF' 'NOT' RANINI 'THEN' 'BEGIN' 45 | 'FOR' I := 0 'STEP' 1 'UNTIL' 127 'DO' RSHUF[I] := RANRAW; 46 | RANINI := 'TRUE'; 47 | 'END'; 48 | 49 | I := ENTIER(RLAST*RDIVI); 50 | RLAST := RSHUF[I]; 51 | RSHUF[I] := RANRAW; 52 | RNEW := RLAST * RR32I; 53 | 'IF' IDBGRN > 0 'THEN' 'BEGIN' 54 | OUTSTRING (1,'('RN:')'); 55 | OUTINTEGER(1, I); 56 | OUTREAL(1, RLAST); 57 | OUTREAL(1, RNEW); 58 | SYSACT(1,14,1); 59 | 'END'; 60 | RANNUM := RNEW; 61 | 'END'; 62 | 63 | 'COMMENT' setup constants; 64 | RR32 := 4294967296.0; 65 | RDIV := 33554432.0; 66 | PI := 3.141592653589793; 67 | RR32I := 1.0/RR32; 68 | RDIVI := 1.0/RDIV; 69 | RSEED := 12345.0; 70 | RANINI := 'FALSE'; 71 | 72 | 'COMMENT' set record lenth = 132 and page length = 64; 73 | SYSACT(1,6,132); 74 | SYSACT(1,8,64); 75 | 76 | ININTEGER(0,IDBGRR); 77 | ININTEGER(0,IDBGRN); 78 | ININTEGER(0,IDBGMC); 79 | 80 | 'IF' IDBGRR = 0 'AND' IDBGRN = 0 'AND' IDBGMC = 0 'THEN' 'BEGIN' 81 | OUTSTRING (1,'(' ntry nhit')'); 82 | OUTSTRING (1,'(' pi-est pi-err')'); 83 | OUTSTRING (1,'(' seed')'); 84 | SYSACT(1,14,1); 85 | 'END'; 86 | 87 | LOOP: 88 | ININTEGER(0,NGO); 89 | 'IF' NGO = 0 'THEN' 'GOTO' DONE; 90 | 'FOR' I := 1 'STEP' 1 'UNTIL' NGO 'DO' 'BEGIN' 91 | X := 2.0 * RANNUM - 1.0; 92 | Y := 2.0 * RANNUM - 1.0; 93 | R := X*X + Y*Y; 94 | NTRY := NTRY + 1; 95 | 'IF' R <= 1.0 'THEN' NHIT := NHIT + 1; 96 | 'IF' IDBGMC > 0 'THEN' 'BEGIN' 97 | OUTSTRING (1,'('MC:')'); 98 | OUTREAL(1, X); 99 | OUTREAL(1, Y); 100 | OUTREAL(1, R); 101 | OUTINTEGER(1, NHIT); 102 | SYSACT(1,14,1); 103 | 'END'; 104 | 'END'; 105 | 106 | RTRY := NTRY; 107 | RHIT := NHIT; 108 | PIEST := 4.0 * (RHIT / RTRY); 109 | PIERR := PIEST - PI; 110 | OUTSTRING (1,'('PI:')'); 111 | OUTINTEGER(1, NTRY); 112 | OUTINTEGER(1, NHIT); 113 | OUTREAL(1, PIEST); 114 | OUTREAL(1, PIERR); 115 | OUTREAL(1, RLAST); 116 | SYSACT(1,14,1); 117 | 'GOTO' LOOP; 118 | 119 | DONE: 120 | 'END'; 121 | 122 | -------------------------------------------------------------------------------- /codes/soeq_cc.c: -------------------------------------------------------------------------------- 1 | /* $Id: soeq_cc.c 1171 2019-06-28 19:02:57Z mueller $ */ 2 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 3 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 4 | /* */ 5 | /* Revision History: */ 6 | /* Date Rev Version Comment */ 7 | /* 2017-12-23 972 1.1.1 change (n-1)/2 --> n/2 */ 8 | /* 2017-11-20 966 1.1 add LOOKUP,STATISTICS ifdefs */ 9 | /* 2017-11-17 962 1.0 Initial version */ 10 | /* 2017-10-15 956 0.1 First draft */ 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | /* #define LOOKUP */ 17 | /* #define STATISTICS */ 18 | 19 | #ifdef LOOKUP 20 | #define TSTMASK(ind) tstmask[ind] 21 | #define CLRMASK(ind) clrmask[ind] 22 | const unsigned char tstmask[] = {0x01,0x02,0x04,0x08, 23 | 0x10,0x20,0x40,0x80}; 24 | const unsigned char clrmask[] = {0xfe,0xfd,0xfb,0xf7, 25 | 0xef,0xdf,0xbf,0x7f}; 26 | 27 | #else 28 | #define TSTMASK(ind) (1<<(ind)) 29 | #define CLRMASK(ind) ~(1<<(ind)) 30 | #endif 31 | 32 | #ifdef STATISTICS 33 | #define SCOUNT(var) var += 1; 34 | double StatOloop = 0.; 35 | double StatIloop = 0.; 36 | #else 37 | #define SCOUNT(var) 38 | #endif 39 | 40 | 41 | int main() 42 | { 43 | int nmax; 44 | int nmsqrt; 45 | int prnt; 46 | int bimax; 47 | int wimax; 48 | int i,n; 49 | int np,il,nl; 50 | unsigned char *prime; 51 | unsigned char *p,*pmax; 52 | 53 | /* JCC on MVS doesn't skip initial white space, add leading ' ' to force */ 54 | if (scanf(" %d %d", &nmax, &prnt) != 2) { 55 | printf("conversion error, abort\n"); 56 | return 1; 57 | } 58 | if (nmax < 10) { 59 | printf("nmax must be >= 10, abort\n"); 60 | return 1; 61 | } 62 | 63 | /* prime: i=(n-1)/2 --> 3->[1], 5->[2]; ... 99-> [49]; ... */ 64 | nmsqrt = sqrt((double)nmax); 65 | bimax = (nmax-1)/2; 66 | wimax = (bimax+7)/8; 67 | prime = malloc(sizeof(char)*(wimax+1)); /* need [1,...,wimax] */ 68 | pmax = &prime[wimax]; 69 | 70 | for (p=prime; p<=pmax;) *p++ = 0xff; 71 | 72 | for (n=3; n<=nmsqrt; n+=2) { 73 | i = n/2; 74 | if ((prime[i>>3] & TSTMASK(i&0x7)) == 0) continue; 75 | SCOUNT(StatOloop); 76 | for (i=(n*n)/2; i<=bimax ; i+=n) { 77 | prime[i>>3] &= CLRMASK(i&0x7); 78 | SCOUNT(StatIloop); 79 | } 80 | } 81 | 82 | if (prnt) { 83 | printf("List of Primes up to %d\n",nmax); 84 | printf(" %7d",2); 85 | np = 1; 86 | for (i=1;i<=bimax;i++) { 87 | if ((prime[i>>3] & TSTMASK(i&0x7)) == 0) continue; 88 | printf(" %7d",1+2*i); 89 | np += 1; 90 | if (np != 10) continue; 91 | printf("\n"); 92 | np= 0; 93 | } 94 | if (np != 0) printf("\n"); 95 | } 96 | 97 | il = 4; 98 | nl = 10; 99 | np = 1; 100 | for (i=1;i<=bimax;i++) { 101 | if ((prime[i>>3] & TSTMASK(i&0x7))) np += 1; 102 | if (i != il) continue; 103 | nl = 2*il+2; 104 | printf("pi(%10d): %10d\n",nl,np); 105 | il = 10*(il+1)-1; 106 | } 107 | if (nl != nmax) printf("pi(%10d): %10d\n",nmax,np); 108 | 109 | #ifdef STATISTICS 110 | printf("StatOloop: %20.0f\n",StatOloop); 111 | printf("StatIloop: %20.0f\n",StatIloop); 112 | #endif 113 | 114 | return 0; 115 | } 116 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog: V0.50 -> HEAD 2 | 3 | ### Table of contents 4 | - Current [HEAD](#user-content-head) 5 | - Release [V1.00](#user-content-v1.00) 6 | - Release [V0.70](#user-content-v0.70) 7 | - Release [V0.50](#user-content-v0.50) 8 | 9 | 10 | --- 11 | ## HEAD 12 | ### General Proviso 13 | The HEAD version shows the current development. No guarantees that software or 14 | the documentation is consistent. 15 | 16 | ### Summary 17 | 18 | 19 | --- 20 | ## 2022-06-12: [V1.00](https://github.com/wfjm/mvs38j-langtest/releases/tag/V1.00) - rev 1247(wfjm) 21 | ### Summary 22 | - use SPDX style disclaimers (see [w11 blog entry](https://wfjm.github.io/blogs/w11/2019-07-21-spdx.html), same basic arguments here) 23 | - .gitmodules: use https: instead of not longer supported git: 24 | - remove now defunct Travis support 25 | - add GitHub Action based CI workflow 26 | - CHANGELOG: fix user-content label case issue (must be lower case) 27 | - project mature, a good point to release V1.00 28 | 29 | 30 | --- 31 | ## 2019-01-05: [V0.70](https://github.com/wfjm/mvs38j-langtest/releases/tag/V0.70) - rev 1103(wfjm) 32 | 33 | ### Summary 34 | 35 | - add Travis CI integration 36 | - add INSTALL.md 37 | - updates on codes: 38 | - soe[pq]_asm.asm: at CHOPAT quit points 39 | - soep_pli.pli: use stack allocated PRIME array; now 10M search OK 40 | - soeq_pli.pli: use stack allocated PRIME array; now 100M search OK 41 | - soep_{c04m,cp4m}.dat,soeq_c32m.dat removed, now obsolete 42 | - updates on jobs: 43 | - job_asm_clg: MAC[1-3] parametrizable, `SYS1.AMODGEN` default for `MAC2` 44 | - jobs/*.JES: 45 | - now job class always explicitly defined via parameter `CLASS` 46 | - use `CLASS B` for fast runners: hewo*,sine*,*_t 47 | - use `CLASS A` for rest: *_f,*_p 48 | - use `CLASS C` for jobs with REGIONS >= 5000K 49 | - jobs/ltlib_*.JES: 50 | - use `SYSOUT=*` 51 | - add `USER`,`PASSWORD` substitution 52 | - the default user is now `HERC03/PASS4U` 53 | - jcl/*.JESI 54 | - new parameters `JOBPOS`,`JOBEXT` added 55 | - the job header is now fully configurable via hercjis -D 56 | - `JOBEXT` can be used to setup `USER=` and `PASSWORD=`. 57 | - jobs/ltlib_{del,new}.JES added, two jobs to delete and re-create the full 58 | set of test jobs as `HERC01.LTLIB` PDS. 59 | - re-organize code base 60 | - remove the instruction timing tested perf_asm from this project, it is now a 61 | GitHub project of its own right under 62 | [wfjm/s370-perf](https://github.com/wfjm/s370-perf). 63 | - drop sios code; add mvs38j-sios as submodule 64 | - remove bin; add instead whole herc-tools project as submodule 65 | - changes done before code was moved to submodule 66 | - bin/hercjis: 67 | - add -d and -D; change/docu substitution precedence 68 | - add -r option; redo close timeout handling 69 | - rename clib -> sios 70 | - clib 71 | - sos_base.asm: fix `OLCNT` reset, enable auto form feed 72 | - sis_base.asm: add `IEOFEXIT` to define `EOS` user exit 73 | 74 | 75 | --- 76 | ## 2017-12-30: [V0.50](https://github.com/wfjm/mvs38j-langtest/releases/tag/V0.50) - rev 980(wfjm) 77 | 78 | ### Summary 79 | - first release 80 | - announced in Yahoo! Group turnkey-MVS, 81 | see [mvs blog entry](https://wfjm.github.io/blogs/mvs/2017-12-30-GitHub-project-mvs38j-langtest.html). 82 | -------------------------------------------------------------------------------- /codes/towh_for.f: -------------------------------------------------------------------------------- 1 | C 1 2 3 4 5 6 712-------- 2 | C2345*78901234567890123456789012345678901234567890123456789012345678901234567890 3 | C $Id: towh_for.f 1171 2019-06-28 19:02:57Z mueller $ 4 | C SPDX-License-Identifier: GPL-3.0-or-later 5 | C Copyright 2017-2019 by Walter F.J. Mueller 6 | C 7 | C Revision History: 8 | C Date Rev Version Comment 9 | C 2017-08-09 934 1.0 Initial version 10 | C 2017-07-30 931 0.1 First draft 11 | C 12 | C --- main program --------------------------------------------------- 13 | C PROGRAM TOWH 14 | C 15 | IMPLICIT LOGICAL (A-Z) 16 | COMMON /DAT1/NCALL,NMOVE,MAXSTK,MAXDSK,TRACE,TOW(3) 17 | INTEGER NCALL,NMOVE,MAXDSK,MAXSTK,TRACE,TOW 18 | COMMON /DAT2/L,LN(32),LF(32),LT(32),LS(32) 19 | INTEGER L,LN,LF,LT,LS 20 | C 21 | INTEGER NDSK 22 | C 23 | READ(5,9000,ERR=910,END=900) MAXDSK,TRACE 24 | C 25 | DO 100 NDSK=2,MAXDSK 26 | NCALL = 0 27 | NMOVE = 0 28 | MAXSTK = 0 29 | TOW(1) = NDSK 30 | TOW(2) = 0 31 | TOW(3) = 0 32 | IF (TRACE .NE. 0) WRITE(6,9010) NDSK 33 | CALL MOV(NDSK,1,3) 34 | WRITE(6,9020) NDSK,MAXSTK,NCALL,NMOVE 35 | 100 CONTINUE 36 | C 37 | 900 CONTINUE 38 | STOP 39 | 910 WRITE(6,9030) 40 | STOP 41 | C 42 | 9000 FORMAT(2I5) 43 | 9010 FORMAT(1X,'STRT ndsk=',I2) 44 | 9020 FORMAT(1X,'DONE ndsk=',I2,': maxstk=',I2,' ncall=',I10, 45 | * ' nmove=',I10) 46 | 9030 FORMAT(1X,'conversion error, abort') 47 | END 48 | C 49 | C --- subroutine mov ------------------------------------------------- 50 | C 51 | SUBROUTINE MOV(N,F,T) 52 | IMPLICIT LOGICAL (A-Z) 53 | INTEGER N,F,T 54 | INTEGER O,L1,S 55 | C 56 | COMMON /DAT1/NCALL,NMOVE,MAXSTK,MAXDSK,TRACE,TOW(3) 57 | INTEGER NCALL,NMOVE,MAXDSK,MAXSTK,TRACE,TOW 58 | COMMON /DAT2/L,LN(32),LF(32),LT(32),LS(32) 59 | INTEGER L,LN,LF,LT,LS 60 | C 61 | L = 1 62 | LN(1) = N 63 | LF(1) = F 64 | LT(1) = T 65 | C 66 | 1000 CONTINUE 67 | NCALL = NCALL + 1 68 | IF (L .GT. MAXSTK) MAXSTK = L 69 | LS(L) = 1 70 | C 71 | IF (LN(L) .NE. 1) GOTO 1900 72 | NMOVE = NMOVE + 1 73 | TOW(LF(L)) = TOW(LF(L)) - 1 74 | TOW(LT(L)) = TOW(LT(L)) + 1 75 | IF (TRACE .NE. 0) WRITE(6,9000) L,LN(L),LF(L),LT(L),TOW 76 | L = L - 1 77 | IF (L .EQ. 0) RETURN 78 | GOTO 2000 79 | C 80 | 1900 IF (TRACE .NE. 0) WRITE(6,9010) L,LN(L),LF(L),LT(L),TOW 81 | C 82 | 2000 CONTINUE 83 | IF (TRACE .GT. 1) WRITE(6,9020) L,LN(L),LF(L),LT(L),TOW,L,LS(L) 84 | O = 6-(LF(L)+LT(L)) 85 | L1 = L + 1 86 | C Fortran IV(1966): computed GOTO selectors must be un-subscripted integers 87 | S = LS(L) 88 | GOTO (2100,2200,2300,2400), S 89 | C 90 | 2100 LN(L1) = LN(L)-1 91 | LF(L1) = LF(L) 92 | LT(L1) = O 93 | LS(L) = 2 94 | L = L1 95 | GOTO 1000 96 | C 97 | 2200 LN(L1) = 1 98 | LF(L1) = LF(L) 99 | LT(L1) = LT(L) 100 | LS(L) = 3 101 | L = L1 102 | GOTO 1000 103 | C 104 | 2300 LN(L1) = LN(L)-1 105 | LF(L1) = O 106 | LT(L1) = LT(L) 107 | LS(L) = 4 108 | L = L1 109 | GOTO 1000 110 | C 111 | 2400 L = L - 1 112 | IF (L .EQ. 0) RETURN 113 | GOTO 2000 114 | C 115 | 9000 FORMAT(1X,'mov-do: ',I2,' :',3(1X,I2),' :',3(1X,I2)) 116 | 9010 FORMAT(1X,'mov-go: ',I2,' :',3(1X,I2),' :',3(1X,I2)) 117 | 9020 FORMAT(1X,'step: ',I2,' :',3(1X,I2),' :',3(1X,I2), 118 | * ' :',I2,'-',I2) 119 | C 120 | END 121 | -------------------------------------------------------------------------------- /codes/soep_pli.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* $Id: soep_pli.pli 1195 2019-07-20 08:05:15Z mueller $ */ 4 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 5 | /* Copyright 2017-2018 by Walter F.J. Mueller */ 6 | /* */ 7 | /* Revision History: */ 8 | /* Date Rev Version Comment */ 9 | /* 2018-07-11 1034 1.4 use stack allocated PRIME array; 10M OK */ 10 | /* 2017-12-26 976 1.3 use CHAR(1) array; go for max PRIME size*/ 11 | /* 2017-12-25 975 1.2 use sqrt(nmax) as outer loop end */ 12 | /* 2017-12-25 974 1.1 use 2-dim PRIME array */ 13 | /* 2017-12-23 972 1.0.1 change (n-1)/2 --> n/2 */ 14 | /* 2017-09-17 951 1.0 Initial version */ 15 | /* 2017-09-01 945 0.1 First draft */ 16 | 17 | SOEP: PROC OPTIONS(MAIN) REORDER; 18 | DCL (NMAX,PRNT,IMAX) BIN FIXED(31) INIT(0); 19 | DCL (NMSQRT,JMAX) BIN FIXED(31) INIT(0); 20 | 21 | ON ENDFILE(SYSIN) BEGIN; 22 | PUT SKIP EDIT('Unexpected EOF, abort')(A); 23 | GOTO DONE; 24 | END; 25 | ON CONVERSION BEGIN; 26 | PUT SKIP EDIT('Conversion error, abort')(A); 27 | GOTO DONE; 28 | END; 29 | 30 | GET EDIT(NMAX,PRNT) (F(10),F(10)); 31 | 32 | /*IF NMAX < 10 | NMAX > 10000000 THEN DO;*/ 33 | IF NMAX > 10000000 THEN DO; 34 | PUT SKIP EDIT('nmax out of range (10...10000000), abort') (A); 35 | GOTO DONE; 36 | END; 37 | 38 | NMSQRT = FLOOR(SQRT(NMAX)); 39 | IMAX = (NMAX-1)/2; 40 | JMAX = IMAX/1024; 41 | 42 | CALL DOIT; 43 | DONE:; 44 | 45 | DOIT: PROC; 46 | DCL (I,J,N,IMIN) BIN FIXED(31) INIT(0); 47 | DCL (NP,IL,NL) BIN FIXED(31) INIT(0); 48 | /* In PL/I(F) V5.5 array bounds are BIN(15) ! limited to 32k !! */ 49 | /* For static allocation is maximal aggregate size 2 MByte !! */ 50 | /* Use stack allocated array in helper proc to work around this */ 51 | /* Go for a 2-dimensional array to work around index limit. */ 52 | /* Use 0 as lower bound to make index calculations easy: */ 53 | /* PRIME(I) turns into PRIME(I/1024,MOD(I,1024)) */ 54 | DCL PRIME(0:JMAX,0:1023) CHAR(1); 55 | 56 | DO J=0 TO JMAX; 57 | DO I=0 TO 1023; 58 | PRIME(J,I) = '1'; 59 | END; 60 | END; 61 | 62 | DO N=3 TO NMSQRT BY 2; 63 | I = N/2; 64 | IF PRIME(I/1024,MOD(I,1024)) = '1' THEN DO; 65 | IMIN = N*N/2; 66 | DO I=IMIN TO IMAX BY N; 67 | PRIME(I/1024,MOD(I,1024)) = '0'; 68 | END; 69 | END; 70 | END; 71 | 72 | IF PRNT > 0 THEN DO; 73 | PUT SKIP EDIT('List of Primes up to ',NMAX) (A,F(8)); 74 | PUT SKIP EDIT(' ',2) (A,F(7)); 75 | NP = 1; 76 | DO I=1 TO IMAX; 77 | IF PRIME(I/1024,MOD(I,1024)) = '1' THEN DO; 78 | PUT EDIT(' ',1+2*I) (A,F(7)); 79 | NP = NP + 1; 80 | IF NP = 10 THEN DO; 81 | PUT SKIP; 82 | NP = 0; 83 | END; 84 | END; 85 | END; 86 | IF NP > 0 THEN PUT SKIP; 87 | END; 88 | 89 | IL = 4; 90 | NL = 10; 91 | NP = 1; 92 | DO I=1 TO IMAX; 93 | IF PRIME(I/1024,MOD(I,1024)) = '1' THEN NP = NP + 1; 94 | IF I = IL THEN DO; 95 | NL = 2*IL + 2; 96 | PUT SKIP EDIT('pi(',NL,'): ',NP) (A,F(9),A,F(8)); 97 | IL = 10*(IL+1)-1; 98 | END; 99 | END; 100 | 101 | IF NL < NMAX THEN PUT SKIP EDIT('pi(',NMAX,'): ',NP) 102 | (A,F(9),A,F(8)); 103 | 104 | END DOIT; 105 | END SOEP; 106 | -------------------------------------------------------------------------------- /codes/soeq_pli.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* $Id: soeq_pli.pli 1195 2019-07-20 08:05:15Z mueller $ */ 4 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 5 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 6 | /* */ 7 | /* Revision History: */ 8 | /* Date Rev Version Comment */ 9 | /* 2018-07-11 1034 1.4 use stack allocated PRIME array; 100M OK*/ 10 | /* 2017-12-26 976 1.3 rename to SOEQ; go for max PRIME size */ 11 | /* 2017-12-25 975 1.2 use sqrt(nmax) as outer loop end */ 12 | /* 2017-12-25 974 1.1 use 2-dim PRIME array */ 13 | /* 2017-12-23 972 1.0.1 change (n-1)/2 --> n/2 */ 14 | /* 2017-09-17 951 1.0 Initial version */ 15 | /* 2017-09-01 945 0.1 First draft */ 16 | 17 | SOEQ: PROC OPTIONS(MAIN) REORDER; 18 | DCL (NMAX,PRNT,IMAX) BIN FIXED(31) INIT(0); 19 | DCL (NMSQRT,JMAX) BIN FIXED(31) INIT(0); 20 | 21 | ON ENDFILE(SYSIN) BEGIN; 22 | PUT SKIP EDIT('Unexpected EOF, abort')(A); 23 | GOTO DONE; 24 | END; 25 | ON CONVERSION BEGIN; 26 | PUT SKIP EDIT('Conversion error, abort')(A); 27 | GOTO DONE; 28 | END; 29 | 30 | GET EDIT(NMAX,PRNT) (F(10),F(10)); 31 | 32 | /*IF NMAX < 10 | NMAX > 32000000 THEN DO;*/ 33 | IF NMAX > 100000000 THEN DO; 34 | PUT SKIP EDIT('nmax out of range (10...100000000), abort') (A); 35 | GOTO DONE; 36 | END; 37 | 38 | NMSQRT = FLOOR(SQRT(NMAX)); 39 | IMAX = (NMAX-1)/2; 40 | JMAX = IMAX/8192; 41 | CALL DOIT; 42 | DONE:; 43 | 44 | DOIT: PROC; 45 | DCL (I,J,N,IMIN) BIN FIXED(31) INIT(0); 46 | DCL (NP,IL,NL) BIN FIXED(31) INIT(0); 47 | /* In PL/I(F) V5.5 array bounds are BIN(15) ! limited to 32k !! */ 48 | /* For static allocation is maximal aggregate size 2 MByte !! */ 49 | /* Use stack allocated array in helper proc to work around this */ 50 | /* Go for a 2-dimensional array to work around index limit. */ 51 | /* Use 0 as lower bound to make index calculations easy: */ 52 | /* PRIME(I) turns into PRIME(I/8192,MOD(I,8192)) */ 53 | /* BIT arrays are bit packed -> PL/I supports direct bit access.*/ 54 | DCL PRIME(0:JMAX,0:8191) BIT(1); 55 | 56 | DO J=0 TO JMAX; 57 | DO I=0 TO 8191; 58 | PRIME(J,I) = '1'; 59 | END; 60 | END; 61 | 62 | DO N=3 TO NMSQRT BY 2; 63 | I = N/2; 64 | IF PRIME(I/8192,MOD(I,8192)) THEN DO; 65 | IMIN = N*N/2; 66 | DO I=IMIN TO IMAX BY N; 67 | PRIME(I/8192,MOD(I,8192)) = '0'B; 68 | END; 69 | END; 70 | END; 71 | 72 | IF PRNT > 0 THEN DO; 73 | PUT SKIP EDIT('List of Primes up to ',NMAX) (A,F(8)); 74 | PUT SKIP EDIT(' ',2) (A,F(7)); 75 | NP = 1; 76 | DO I=1 TO IMAX; 77 | IF PRIME(I/8192,MOD(I,8192)) THEN DO; 78 | PUT EDIT(' ',1+2*I) (A,F(7)); 79 | NP = NP + 1; 80 | IF NP = 10 THEN DO; 81 | PUT SKIP; 82 | NP = 0; 83 | END; 84 | END; 85 | END; 86 | IF NP > 0 THEN PUT SKIP; 87 | END; 88 | 89 | IL = 4; 90 | NL = 10; 91 | NP = 1; 92 | DO I=1 TO IMAX; 93 | IF PRIME(I/8192,MOD(I,8192)) THEN NP = NP + 1; 94 | IF I = IL THEN DO; 95 | NL = 2*IL + 2; 96 | PUT SKIP EDIT('pi(',NL,'): ',NP) (A,F(9),A,F(8)); 97 | IL = 10*(IL+1)-1; 98 | END; 99 | END; 100 | 101 | IF NL < NMAX THEN PUT SKIP EDIT('pi(',NMAX,'): ',NP) 102 | (A,F(9),A,F(8)); 103 | 104 | END DOIT; 105 | END SOEQ; 106 | -------------------------------------------------------------------------------- /codes/soeq_pas.pas: -------------------------------------------------------------------------------- 1 | (* $Id: soeq_pas.pas 1195 2019-07-20 08:05:15Z mueller $ *) 2 | (* SPDX-License-Identifier: GPL-3.0-or-later *) 3 | (* Copyright 2017-2019 by Walter F.J. Mueller *) 4 | (* *) 5 | (* Remarks: *) 6 | (* - The MVS Compiler uses 8 bytes to represent a set, sets are *) 7 | (* limited to 64 members. seoq uses therefore sets with 64 members.*) 8 | (* - the '<=' operator is slightly faster than the 'in' operator. *) 9 | (* - the set '*' operator is slightly faster than the '-' operator. *) 10 | (* - all this leads to a slightly different implementation than the *) 11 | (* one scetched in 'Pascal User Manual and Report. 2nd Edition', *) 12 | (* published 1975 by Springer. *) 13 | (* *) 14 | (* Revision History: *) 15 | (* Date Rev Version Comment *) 16 | (* 2017-12-27 977 1.1 use '<=' and '*' instead of 'in' and '-'*) 17 | (* 2017-12-26 976 1.0 Initial version (derived from soeq_pas) *) 18 | 19 | program soep(input,output); 20 | type 21 | bits = (b00,b01,b02,b03,b04,b05,b06,b07, 22 | b08,b09,b10,b11,b12,b13,b14,b15, 23 | b16,b17,b18,b19,b20,b21,b22,b23, 24 | b24,b25,b26,b27,b28,b29,b30,b31, 25 | b32,b33,b34,b35,b36,b37,b38,b39, 26 | b40,b41,b42,b43,b44,b45,b46,b47, 27 | b48,b49,b50,b51,b52,b53,b54,b55, 28 | b56,b57,b58,b59,b60,b61,b62,b63); 29 | bset = set of bits; 30 | var 31 | nmax,prnt,imax : integer; 32 | nmsqrt : integer; 33 | wimax,iw : integer; 34 | i,n,imin : integer; 35 | np,il,nl : integer; 36 | rnmax : real; 37 | sieve : ARRAY[0 .. 781250] of bset; 38 | btst : ARRAY[0 .. 63 ] of bset; 39 | bclr : ARRAY[0 .. 63 ] of bset; 40 | b : bits; 41 | ball : bset; 42 | begin 43 | 44 | ball := [b00 .. b63]; 45 | b := b00; 46 | btst[0] := [b]; 47 | bclr[0] := ball - [b]; 48 | for i := 1 to 63 do begin 49 | b := succ(b); 50 | btst[i] := [b]; 51 | bclr[i] := ball - [b]; 52 | end; 53 | 54 | read(nmax); 55 | read(prnt); 56 | 57 | if (nmax < 10) or (nmax > 100000000) then begin 58 | writeln(' ', 'nmax out of range (10...100000000), abort'); 59 | exit(8); 60 | end; 61 | 62 | rnmax := nmax; 63 | nmsqrt := trunc(sqrt(nmax)); 64 | imax := (nmax-1) div 2; 65 | wimax := (imax+63) div 64; 66 | for i := 0 to wimax do sieve[i] := ball; 67 | 68 | n := 3; 69 | while n <= nmsqrt do begin 70 | i := n div 2; 71 | if btst[i mod 64] <= sieve[i div 64] then begin 72 | i := (n*n) div 2; 73 | while i <= imax do begin 74 | iw := i div 64; 75 | sieve[iw] := sieve[iw] * bclr[i mod 64]; 76 | i := i + n; 77 | end; 78 | end; 79 | n := n + 2; 80 | end; 81 | 82 | if prnt > 0 then begin 83 | writeln(' ', 'List of Primes up to ', nmax:9); 84 | write(2:8); 85 | np := 1; 86 | for i := 1 to imax do begin 87 | if btst[i mod 64] <= sieve[i div 64] then begin 88 | write(1+2*i:8); 89 | np := np + 1; 90 | if np = 10 then begin 91 | writeln(' '); 92 | np := 0; 93 | end; 94 | end; 95 | end; 96 | if np > 0 then writeln(); 97 | end; 98 | 99 | il := 4; 100 | nl := 10; 101 | np := 1; 102 | for i := 1 to imax do begin 103 | if btst[i mod 64] <= sieve[i div 64] then np := np + 1; 104 | if i = il then begin 105 | nl := 2*il + 2; 106 | writeln(' ', 'pi(', nl:9, '): ', np:9); 107 | il := 10*(il+1)-1; 108 | end; 109 | end; 110 | 111 | if nl < nmax then writeln(' ', 'pi(', nmax:9, '): ', np:9); 112 | 113 | end. 114 | -------------------------------------------------------------------------------- /codes/mcpi_pli.pli: -------------------------------------------------------------------------------- 1 | /* 1 2 3 4 5 6 7*/-------- 2 | /*4567890123456789012345678901234567890123456789012345678901234567890*/-------- 3 | /* $Id: mcpi_pli.pli 1171 2019-06-28 19:02:57Z mueller $ */ 4 | /* SPDX-License-Identifier: GPL-3.0-or-later */ 5 | /* Copyright 2017-2019 by Walter F.J. Mueller */ 6 | /* */ 7 | /* Revision History: */ 8 | /* Date Rev Version Comment */ 9 | /* 2017-12-28 978 1.1 use inverse to avoid divide by constant */ 10 | /* 2017-09-07 947 1.0 Initial version */ 11 | /* 2017-07-30 931 0.1 First draft */ 12 | 13 | MCPI: PROC OPTIONS(MAIN) REORDER; 14 | DCL RSEED DEC FLOAT(16) INIT(12345.); 15 | DCL RLAST DEC FLOAT(16) INIT(0.); 16 | DCL RSHUF(0:127) DEC FLOAT(16) INIT((128)0.); 17 | DCL RR32 DEC FLOAT(16) INIT(4294967296.); 18 | DCL RDIV DEC FLOAT(16) INIT(33554432.); 19 | DCL RANINI BIN FIXED(31) INIT(0); 20 | DCL (IDBGRR,IDBGRN,IDBGMC) BIN FIXED(31) INIT(0); 21 | 22 | DCL RANRAW ENTRY RETURNS(DEC FLOAT(16)); 23 | DCL RANNUM ENTRY RETURNS(DEC FLOAT(16)); 24 | 25 | DCL (I,NTRY,NHIT,NGO) BIN FIXED(31) INIT(0); 26 | DCL (PIEST,PIERR) DEC FLOAT(16); 27 | DCL (RHIT,RTRY) DEC FLOAT(16); 28 | DCL (RR32I,RDIVI) DEC FLOAT(16); 29 | DCL (X,Y,R) DEC FLOAT(16); 30 | DCL PI DEC FLOAT(16) INIT(3.141592653589793E0); 31 | 32 | ON ENDFILE(SYSIN) GOTO DONE; 33 | ON CONVERSION GOTO ABORT; 34 | 35 | RR32I = 1./RR32; 36 | RDIVI = 1./RDIV; 37 | 38 | GET EDIT(IDBGRR,IDBGRN,IDBGMC) (3(F(10))); 39 | 40 | IF IDBGRR=0 & IDBGRN=0 & IDBGMC=0 THEN 41 | PUT SKIP EDIT(' ntry nhit pi-est', 42 | ' pi-err seed')(A,A); 43 | 44 | DO WHILE('1'B); 45 | GET SKIP EDIT(NGO) (F(10)); 46 | IF NGO = 0 THEN GOTO DONE; 47 | 48 | DO I=1 TO NGO; 49 | X = 2.*RANNUM - 1.; 50 | Y = 2.*RANNUM - 1.; 51 | R = X*X + Y*Y; 52 | NTRY = NTRY + 1; 53 | IF R <= 1. THEN NHIT = NHIT + 1; 54 | IF IDBGMC > 0 THEN PUT SKIP EDIT('MC: ',X,Y,R,NHIT) 55 | (A,3(F(12,8),X(1)),F(12)); 56 | END; 57 | 58 | RTRY = NTRY; 59 | RHIT = NHIT; 60 | 61 | PIEST = 4.E0 * (RHIT / RTRY); 62 | PIERR = PIEST - PI; 63 | IF PIERR < 0. THEN PIERR = -PIERR; 64 | PUT SKIP EDIT('PI: ',NTRY,NHIT,PIEST,PIERR,RLAST) 65 | (A,2(F(12),X(1)),2(F(12,8),X(1)),F(12)); 66 | END; 67 | GOTO DONE; 68 | 69 | ABORT: PUT SKIP EDIT('Conversion error, abort')(A); 70 | DONE:; 71 | 72 | /* procedure RANRAW --------------------------------------------*/ 73 | RANRAW: PROC RETURNS(DEC FLOAT(16)); 74 | 75 | DCL (RFAC,RNEW) DEC FLOAT(16); 76 | DCL IFAC BIN FIXED(31); 77 | 78 | RNEW = RSEED * 69069.; 79 | RFAC = RNEW * RR32I; 80 | IFAC = RFAC; 81 | RFAC = IFAC; 82 | RNEW = RNEW - RFAC * RR32; 83 | IF IDBGRR > 0 THEN PUT SKIP EDIT('RR: ',RSEED,RNEW) 84 | (A,F(12,0),X(1),F(12,0)); 85 | RSEED = RNEW; 86 | RETURN(RNEW); 87 | END RANRAW; 88 | 89 | /* procedure RANNUM --------------------------------------------*/ 90 | RANNUM: PROC RETURNS(DEC FLOAT(16)); 91 | DCL I BIN FIXED(31); 92 | DCL RNEW DEC FLOAT(16); 93 | 94 | IF RANINI = 0 THEN DO; 95 | DO I=0 TO 127; 96 | RSHUF(I) = RANRAW; 97 | END; 98 | RANINI = 1; 99 | END; 100 | 101 | I = RLAST * RDIVI; 102 | RLAST = RSHUF(I); 103 | RSHUF(I) = RANRAW; 104 | RNEW = RLAST * RR32I; 105 | IF IDBGRN > 0 THEN PUT SKIP EDIT('RN: ',I,RLAST,RNEW) 106 | (A,F(12),X(1),F(12,0),X(1),F(12,8)); 107 | RETURN(RNEW); 108 | END RANNUM; 109 | END MCPI; 110 | -------------------------------------------------------------------------------- /codes/mcpi_for.f: -------------------------------------------------------------------------------- 1 | C 1 2 3 4 5 6 712-------- 2 | C2345*78901234567890123456789012345678901234567890123456789012345678901234567890 3 | C $Id: mcpi_for.f 1171 2019-06-28 19:02:57Z mueller $ 4 | C SPDX-License-Identifier: GPL-3.0-or-later 5 | C Copyright 2017-2019 by Walter F.J. Mueller 6 | C 7 | C Revision History: 8 | C Date Rev Version Comment 9 | C 2017-12-28 978 1.1 use inverse to avoid divide by constant 10 | C 2017-08-12 938 1.0 Initial version 11 | C 2017-07-30 931 0.1 First draft 12 | C 13 | C --- function ranraw ------------------------------------------------ 14 | C 15 | C Fortran IV(1966): function syntax is: 'type FUNCTION name*precision (args) 16 | C however gfortran -std=legacy wants: 'type*precision FUNCTION name (args) 17 | REAL FUNCTION RANRAW*8 (DUMMY) 18 | C 19 | COMMON /DBG/IDBGRR,IDBGRN,IDBGMC 20 | COMMON /RANFAC/RR32,RR32I,RDIV,RDIVI 21 | COMMON /RAN/RLAST,RSEED,RSHUF(128),RANINI 22 | REAL*8 RR32,RR32I,RDIV,RDIVI 23 | REAL*8 RLAST,RSEED,RSHUF 24 | LOGICAL RANINI 25 | C 26 | REAL*8 DUMMY 27 | REAL*8 RFAC,RNEW 28 | INTEGER IFAC 29 | C 30 | RNEW = RSEED * 69069.D0 31 | RFAC = RNEW * RR32I 32 | IFAC = RFAC 33 | RFAC = IFAC 34 | RNEW = RNEW - RFAC * RR32 35 | IF (IDBGRR .NE. 0) WRITE(6,9000) RSEED,RNEW 36 | RSEED = RNEW 37 | RANRAW = RNEW 38 | RETURN 39 | C 40 | 9000 FORMAT(1X,'RR: ',F12.0,1X,F12.0) 41 | END 42 | C 43 | C --- function rannum ------------------------------------------------ 44 | C 45 | REAL FUNCTION RANNUM*8 (DUMMY) 46 | C 47 | COMMON /DBG/IDBGRR,IDBGRN,IDBGMC 48 | COMMON /RANFAC/RR32,RR32I,RDIV,RDIVI 49 | COMMON /RAN/RLAST,RSEED,RSHUF(128),RANINI 50 | REAL*8 RR32,RR32I,RDIV,RDIVI 51 | REAL*8 RLAST,RSEED,RSHUF 52 | LOGICAL RANINI 53 | C 54 | REAL*8 DUMMY 55 | REAL*8 RANRAW 56 | INTEGER I 57 | C 58 | IF (RANINI) GOTO 1000 59 | DO 100 I=1,128 60 | RSHUF(I) = RANRAW(DUMMY) 61 | 100 CONTINUE 62 | RANINI = .TRUE. 63 | 1000 CONTINUE 64 | C 65 | I = RLAST * RDIVI 66 | RLAST = RSHUF(I+1) 67 | RSHUF(I+1) = RANRAW(DUMMY) 68 | RANNUM = RLAST * RR32I 69 | IF (IDBGRN .NE. 0) WRITE(6,9000) I,RLAST,RANNUM 70 | RETURN 71 | C 72 | 9000 FORMAT(1X,'RN: ',I12,1X,F12.0,1X,F12.8) 73 | END 74 | C 75 | C --- main program --------------------------------------------------- 76 | C PROGRAM MCPI 77 | COMMON /DBG/IDBGRR,IDBGRN,IDBGMC 78 | COMMON /RANFAC/RR32,RR32I,RDIV,RDIVI 79 | COMMON /RAN/RLAST,RSEED,RSHUF(128),RANINI 80 | REAL*8 RR32,RR32I,RDIV,RDIVI 81 | REAL*8 RLAST,RSEED,RSHUF 82 | LOGICAL RANINI 83 | C 84 | INTEGER I 85 | INTEGER NTRY,NHIT,NGO 86 | REAL*8 PI,PIEST,PIERR 87 | REAL*8 X,Y,R 88 | REAL*8 DUMMY 89 | REAL*8 RANNUM 90 | REAL*8 RTRY,RHIT 91 | DATA PI /3.141592653589793D0/ 92 | DATA NTRY /0/ 93 | DATA NHIT /0/ 94 | C 95 | RR32 = 4294967296.D0 96 | RR32I = 1./RR32 97 | RDIV = 33554432.D0 98 | RDIVI = 1./RDIV 99 | C 100 | RSEED = 12345.D0 101 | RLAST = 0.D0 102 | RANINI = .FALSE. 103 | C 104 | READ(5,9000,ERR=910,END=900) IDBGRR,IDBGRN,IDBGMC 105 | C 106 | IF (IDBGRR.EQ.0 .AND. IDBGRN.EQ.0 .AND. IDBGMC.EQ.0) 107 | X WRITE(6,9005) 108 | C 109 | 100 READ(5,9010,ERR=910,END=900) NGO 110 | IF (NGO .LE. 0) GOTO 900 111 | C 112 | DO 200 I=1,NGO 113 | X = 2.*RANNUM(DUMMY) - 1. 114 | Y = 2.*RANNUM(DUMMY) - 1. 115 | R = X*X + Y*Y 116 | NTRY = NTRY + 1 117 | IF (R .LE. 1.) NHIT = NHIT + 1 118 | IF (IDBGMC .NE. 0) WRITE(6,9030) X,Y,R,NHIT 119 | 200 CONTINUE 120 | C 121 | RTRY = NTRY 122 | RHIT = NHIT 123 | PIEST = 4.* RHIT / RTRY 124 | PIERR = PIEST - PI 125 | IF (PIERR .LT. 0.) PIERR = -PIERR 126 | WRITE(6,9020) NTRY, NHIT,PIEST,PIERR,RLAST 127 | GOTO 100 128 | C 129 | 900 CONTINUE 130 | C 131 | STOP 132 | C 133 | 910 WRITE(6,9040) 134 | STOP 135 | C 136 | 9000 FORMAT(3I10) 137 | 9005 FORMAT(1X,' ntry nhit pi-est', 138 | X ' pi-err seed') 139 | 9010 FORMAT(I10) 140 | 9020 FORMAT(1X,'PI: ',I12,1X,I12,1X,F12.8,1X,F12.8,1X,F12.0) 141 | 9030 FORMAT(1X,'MC: ',F12.8,1X,F12.8,1X,F12.8,1X,I12) 142 | 9040 FORMAT(1X,'conversion error, abort') 143 | C 144 | END 145 | -------------------------------------------------------------------------------- /jobs/ltlib_index.txt: -------------------------------------------------------------------------------- 1 | //******************************************************************** 2 | //* 3 | //* Name: HERC01.LTLIB($$$INDEX) 4 | //* 5 | //* Desc: Short index of PDS with MVS 3.8j language test jobs 6 | //* 7 | //* For full information consult GitHub project wfjm/mvs38j-langtest 8 | //* https://github.com/wfjm/mvs38j-langtest/blob/master/README.md 9 | //* 10 | //* The index simply gives the relation between the 7 character 11 | //* PDS member names and the jcl file names of the project. 12 | //* Member names as well as file name are composed of 13 | //* Case ID - test case identifier (hewo,sine,....) 14 | //* Compiler ID - compiler identifier (a60,asm,....) 15 | //* Job type - t --> test jobs 16 | //* f --> benchmark jobs 17 | //* p --> print benchmark jobs (for soep/soeq) 18 | //* 19 | //******************************************************************** 20 | Membername Short description x 21 | ---------- ------------------------------------------------------------ 22 | HEWO --- section --- The classical 'Hello Word' 23 | HEWOA60 hewo_a60.jcl 24 | HEWOASM hewo_asm.jcl 25 | HEWOCOB hewo_cob.jcl 26 | HEWOFOG hewo_forg.jcl 27 | HEWOFOH hewo_forh.jcl 28 | HEWOFOW hewo_forw.jcl 29 | HEWOGCC hewo_gcc.jcl 30 | HEWOJCC hewo_jcc.jcl 31 | HEWOPAS hewo_pas.jcl 32 | HEWOPLI hewo_pli.jcl 33 | HEWOSIM hewo_sim.jcl 34 | SINE --- section --- Line printer plot of sine and cosine 35 | SINEA60 sine_a60.jcl 36 | SINEFOG sine_forg.jcl 37 | SINEFOH sine_forh.jcl 38 | SINEFOW sine_forw.jcl 39 | SINEGCC sine_gcc.jcl 40 | SINEJCC sine_jcc.jcl 41 | SINEPAS sine_pas.jcl 42 | SINEPLI sine_pli.jcl 43 | SINESIM sine_sim.jcl 44 | SOEP --- section --- Sieve of Eratosthenes prime search (byte) 45 | SOEPA60 soep_a60_f.jcl 46 | SOEPA60 soep_a60_p.jcl 47 | SOEPA60 soep_a60_t.jcl 48 | SOEPASM soep_asm_f.jcl 49 | SOEPASM soep_asm_p.jcl 50 | SOEPASM soep_asm_t.jcl 51 | SOEPGCC soep_gcc_f.jcl 52 | SOEPGCC soep_gcc_p.jcl 53 | SOEPGCC soep_gcc_t.jcl 54 | SOEPJCC soep_jcc_f.jcl 55 | SOEPJCC soep_jcc_p.jcl 56 | SOEPJCC soep_jcc_t.jcl 57 | SOEPFOG soep_forg_f.jcl 58 | SOEPFOG soep_forg_p.jcl 59 | SOEPFOG soep_forg_t.jcl 60 | SOEPFOH soep_forh_f.jcl 61 | SOEPFOH soep_forh_p.jcl 62 | SOEPFOH soep_forh_t.jcl 63 | SOEPFOW soep_forw_f.jcl 64 | SOEPFOW soep_forw_p.jcl 65 | SOEPFOW soep_forw_t.jcl 66 | SOEPPAS soep_pas_f.jcl 67 | SOEPPAS soep_pas_p.jcl 68 | SOEPPAS soep_pas_t.jcl 69 | SOEPPLI soep_pli_f.jcl 70 | SOEPPLI soep_pli_p.jcl 71 | SOEPPLI soep_pli_t.jcl 72 | SOEPSIM soep_sim_f.jcl 73 | SOEPSIM soep_sim_p.jcl 74 | SOEPSIM soep_sim_t.jcl 75 | SOEQ --- section --- Sieve of Eratosthenes prime search (bit) 76 | SOEQASM soeq_asm_f.jcl 77 | SOEQASM soeq_asm_p.jcl 78 | SOEQASM soeq_asm_t.jcl 79 | SOEQGCC soeq_gcc_f.jcl 80 | SOEQGCC soeq_gcc_p.jcl 81 | SOEQGCC soeq_gcc_t.jcl 82 | SOEQJCC soeq_jcc_f.jcl 83 | SOEQJCC soeq_jcc_p.jcl 84 | SOEQJCC soeq_jcc_t.jcl 85 | SOEQPAS soeq_pas_f.jcl 86 | SOEQPAS soeq_pas_p.jcl 87 | SOEQPAS soeq_pas_t.jcl 88 | SOEQPLI soeq_pli_f.jcl 89 | SOEQPLI soeq_pli_p.jcl 90 | SOEQPLI soeq_pli_t.jcl 91 | TOWH --- section --- Tower of Hanoi solver 92 | TOWHA60 towh_a60_f.jcl 93 | TOWHA60 towh_a60_t.jcl 94 | TOWHASM towh_asm_f.jcl 95 | TOWHASM towh_asm_t.jcl 96 | TOWHGCC towh_gcc_f.jcl 97 | TOWHGCC towh_gcc_t.jcl 98 | TOWHJCC towh_jcc_f.jcl 99 | TOWHJCC towh_jcc_t.jcl 100 | TOWHFOG towh_forg_f.jcl 101 | TOWHFOG towh_forg_t.jcl 102 | TOWHFOH towh_forh_f.jcl 103 | TOWHFOH towh_forh_t.jcl 104 | TOWHFOW towh_forw_f.jcl 105 | TOWHFOW towh_forw_t.jcl 106 | TOWHPAS towh_pas_f.jcl 107 | TOWHPAS towh_pas_t.jcl 108 | TOWHPLI towh_pli_f.jcl 109 | TOWHPLI towh_pli_t.jcl 110 | TOWHSIM towh_sim_f.jcl 111 | TOWHSIM towh_sim_t.jcl 112 | MCPI --- section --- Monte Carlo estimate of pi 113 | MCPIA60 mcpi_a60_f.jcl 114 | MCPIA60 mcpi_a60_t.jcl 115 | MCPIASM mcpi_asm_f.jcl 116 | MCPIASM mcpi_asm_t.jcl 117 | MCPIGCC mcpi_gcc_f.jcl 118 | MCPIGCC mcpi_gcc_t.jcl 119 | MCPIJCC mcpi_jcc_f.jcl 120 | MCPIJCC mcpi_jcc_t.jcl 121 | MCPIFOG mcpi_forg_f.jcl 122 | MCPIFOG mcpi_forg_t.jcl 123 | MCPIFOH mcpi_forh_f.jcl 124 | MCPIFOH mcpi_forh_t.jcl 125 | MCPIFOW mcpi_forw_f.jcl 126 | MCPIFOW mcpi_forw_t.jcl 127 | MCPIPAS mcpi_pas_f.jcl 128 | MCPIPAS mcpi_pas_t.jcl 129 | MCPIPLI mcpi_pli_f.jcl 130 | MCPIPLI mcpi_pli_t.jcl 131 | MCPISIM mcpi_sim_f.jcl 132 | MCPISIM mcpi_sim_t.jcl 133 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mvs38j-langtest: MVS 3.8J Compiler and Language Tests 2 | 3 | [![Build Status](https://travis-ci.org/wfjm/mvs38j-langtest.svg?branch=master)](https://travis-ci.org/wfjm/mvs38j-langtest) 4 | 5 | ### Overview 6 | The project contains example codes for many of the languages available 7 | on the MVS 3.8J turnkey systems. Several test cases have been implemented 8 | with equivalent logic in the available languages. 9 | JES2 jobs are provided to 'compile-link-go' the codes with the available 10 | compilers (in some cases several for one language). Test jobs, which 11 | generate detailed output for verification, as well as benchmark jobs, 12 | which consume a significant amount of CPU time, are provided. 13 | 14 | ### The Cases 15 | The test cases are chosen to test different aspects of languages and 16 | are identified by a 4 character case ID: 17 | 18 | | Case ID | Description | Objective | 19 | | :-----: | ----------- | --------- | 20 | | [hewo](codes/README_hewo.md) | The classical **'Hello Word'** | Get **minimal program** producing output | 21 | | [sine](codes/README_sine.md) | Line **printer plot** of sine and cosine | Test **basic text & character handling** | 22 | | [soep](codes/README_soep.md) | Sieve of Eratosthenes **prime search** (byte) | Test **integer array handling** and **formatted output** | 23 | | [soeq](codes/README_soeq.md) | Sieve of Eratosthenes **prime search (bit)** | Test **bit handling** | 24 | | [towh](codes/README_towh.md) | **Tower of Hanoi** solver | Test **recursive function calls** | 25 | | [mcpi](codes/README_mcpi.md) | **Monte Carlo** estimate of pi | Test **floating point arithmetic** | 26 | 27 | The cases were implemented with essentially the same basic logic in all 28 | languages so that one can compare the code quality of the compilers. 29 | The algorithms should also be short and simple, so that an assembler 30 | implementation is feasible. The links in the Case-Id column point to a 31 | description of the test case. 32 | The pick of cases is highly biased by the background of the author, 33 | see '_Author's Note_' section in each of the READMEs. 34 | 35 | ### The Compilers and Languages 36 | The [tk4-](http://wotho.ethz.ch/tk4-/) system contains a nice selection of 37 | languages and compilers which are for further reference identified by 38 | a 3 or 4 character compiler ID. 39 | 40 | | Language | Compiler IDs | 41 | | --------- | ------------ | 42 | | Algol 60 | a60 | 43 | | Assembler | asm | 44 | | C | gcc, jcc | 45 | | COBOL | cob | 46 | | FORTRAN-4 | forg, forh, forw | 47 | | Pascal | pas | 48 | | PL/I | pli | 49 | | Simula | sim | 50 | 51 | Consult the [Compiler README](README_comp.md) for more information on the 52 | compilers and the options used, and the 53 | [benchmark summary](README_bench.md) for an overview of some 54 | benchmark runs and a compiler ranking. 55 | 56 | ### The Codes 57 | The test cases were, if possible, implemented in these languages. 58 | The [Language-Case matrix](codes/README.md) with all Language - Case 59 | combinations is shown in the README of the [codes](codes) directory. 60 | 61 | ### The Jobs 62 | For each Language-Case combination one or several batch jobs are provided 63 | in the [jobs](jobs) directory. See 64 | [README](jobs/README.md) for the 65 | [Case - Job Type table](jobs/README.md#user-content-types) explaining 66 | all available jobs types and the 67 | [Compiler-Case matrix](jobs/README.md#user-content-jobs) listing all 68 | available jobs. The later also includes a list of 69 | [known issues](jobs/README.md#user-content-issues). 70 | 71 | ### Reception 72 | Moshe Bar covered the langtest and herc-tools suites in tutorials entitled 73 | >> Test your IBM MVS 3.8 compilers and benchmark your Hercules 74 | >> https://www.youtube.com/watch?v=hH0dlylJVCY 75 | >> Building an MVS printout distribution system 76 | >> https://www.youtube.com/watch?v=GF677Z3Zidw 77 | 78 | This is part of the [moshix suite](https://www.youtube.com/user/moshe5760/videos) 79 | of mainframe (mostly MVS) related tutorials. 80 | 81 | ### Directory organization 82 | The project files are organized in directories as 83 | 84 | | Directory | Content | 85 | | --------- | ------- | 86 | | [codes](codes) | the codes | 87 | | herc-tools | the [herc-tools](https://github.com/wfjm/herc-tools) project as submodule, mainly for access to `hercjis`| 88 | | [jcl](jcl) | JCL job templates | 89 | | [jobs](jobs) | the jobs | 90 | | sios | the [mvs38j-sios](https://github.com/wfjm/mvs38j-sios) project as submodule, simple I/O system asm code | 91 | | [tests](tests) | some test programs | 92 | 93 | ### License 94 | This project is released under the 95 | [GPL V3 license](https://www.gnu.org/licenses/gpl-3.0.html), 96 | all files contain a [SPDX](https://spdx.org/)-style disclaimer: 97 | 98 | SPDX-License-Identifier: GPL-3.0-or-later 99 | 100 | The full text of the GPL license is in this directory as 101 | [License.txt](License.txt). 102 | 103 | ### Installation 104 | This project uses submodules, therefore use 105 | ``` 106 | git clone --recurse-submodules git@github.com:wfjm/mvs38j-langtest.git 107 | ``` 108 | -------------------------------------------------------------------------------- /codes/README_towh.md: -------------------------------------------------------------------------------- 1 | ## towh - Tower of Hanoi solver 2 | 3 | ### Table of content 4 | 5 | - [Description](#user-content-description) 6 | - [Algorithm](#user-content-algorithm) 7 | - [Input File](#user-content-ifile) 8 | - [Language and Compiler Notes](#user-content-langcomp) 9 | - [Jobs](#user-content-jobs) 10 | - [Benchmarks](#user-content-benchmarks) 11 | - [Author's Note](#user-content-anote) 12 | 13 | ### Description 14 | The [Tower of Hanoi](https://en.wikipedia.org/wiki/Tower_of_Hanoi) is a 15 | is a mathematical game or puzzle. It can be implemented with a few lines 16 | of code, using only simplest integer arithmetic and a recursively called 17 | procedure. It's nice as a simple integer benchmark, and was part of the 18 | **UNIX BENCH V4.1** benchmark suite published by the 19 | [**Byte Magazine**](https://en.wikipedia.org/wiki/Byte_(magazine)) ages ago. 20 | 21 | ### Algorithm 22 | The `towh` codes follow closely the algorithm of the `hanoi` code of 23 | UNIX BENCH V4.1, see source on 24 | [GitHub meteorfox/byte-unixbench](https://github.com/meteorfox/byte-unixbench/blob/master/UnixBench/src/hanoi.c). 25 | Maybe it's possible to write it nicer or more compact. 26 | The key point is that all langauges follow the same logic, this 27 | way we get a good comparision of the compiler quality. 28 | 29 | The core of the algorithm is a recursive procedure working on the 30 | array `tow` in a common scope, which in C looks like 31 | ``` c 32 | void mov(int n, int f, int t) 33 | { 34 | int o; 35 | if(n == 1) { 36 | tow[f]--; 37 | tow[t]++; 38 | return; 39 | } 40 | o = 6-(f+t); 41 | mov(n-1,f,o); 42 | mov(1,f,t); 43 | mov(n-1,o,t); 44 | return; 45 | } 46 | ``` 47 | 48 | ### Input File 49 | The codes are controlled by an input file with a single line in `2I5` format 50 | ``` 51 | NDSK TRCE 52 | ``` 53 | 54 | where `NDSK` gives largest tower size to be investigated and `TRCE` 55 | enables (1) or disables (0) the debug printout of all moves. 56 | The code will iterate of all tower sizes from 2 to `NDSK`. 57 | Keep in mind that the CPU time grows exponentially as 2**NDSK. 58 | See typical [test run](towh_ctst.dat) or 59 | [benchmark run](towh_cnat.dat) input files. 60 | 61 | 62 | ### Language and Compiler Notes 63 | 64 | #### FORTRAN 4 - [towh_for.f](towh_for.f) 65 | Fortran introduced recursive calls only with 66 | [Fortran 90](https://en.wikipedia.org/wiki/Fortran#Fortran_90), 67 | so the Fortran implementation simulates the call nexting with a set 68 | of arrays which contain what is otherwise in argument lists and stack 69 | allocated variables. That adds more array accesses, but eliminates all 70 | call overheads, so the Fortran implementation is in terms of speed 71 | quite competitive. But certainly not in terms of readability. 72 | 73 | ### Jobs 74 | The [jobs](../jobs) directory contains three types of jobs for `towh` named 75 | 76 | towh_*_t.JES --> trace all steps for small tower sizes (verification) 77 | towh_*_f.JES --> print summaries (benchmarking) 78 | 79 | Usually `towh_*_t.JES` is used for a verification check and should produce 80 | 81 | STRT ndsk= 2 82 | mov-go: 1 : 2 1 3 : 2 0 0 83 | mov-do: 2 : 1 1 2 : 1 1 0 84 | mov-do: 2 : 1 1 3 : 0 1 1 85 | mov-do: 2 : 1 2 3 : 0 0 2 86 | DONE ndsk= 2: maxstk= 2 ncall= 4 nmove= 3 87 | ... snip ... 88 | STRT ndsk= 4 89 | mov-go: 1 : 4 1 3 : 4 0 0 90 | mov-go: 2 : 3 1 2 : 4 0 0 91 | ... snip ... 92 | mov-do: 4 : 1 1 3 : 0 1 3 93 | mov-do: 4 : 1 2 3 : 0 0 4 94 | DONE ndsk= 4: maxstk= 4 ncall= 22 nmove= 15 95 | 96 | `towh_*_f.JES` should in general output the equivalent of 97 | 98 | DONE ndsk= 2: maxstk= 2 ncall= 4 nmove= 3 99 | DONE ndsk= 3: maxstk= 3 ncall= 10 nmove= 7 100 | DONE ndsk= 4: maxstk= 4 ncall= 22 nmove= 15 101 | DONE ndsk= 5: maxstk= 5 ncall= 46 nmove= 31 102 | DONE ndsk= 6: maxstk= 6 ncall= 94 nmove= 63 103 | DONE ndsk= 7: maxstk= 7 ncall= 190 nmove= 127 104 | DONE ndsk= 8: maxstk= 8 ncall= 382 nmove= 255 105 | DONE ndsk= 9: maxstk= 9 ncall= 766 nmove= 511 106 | DONE ndsk= 10: maxstk= 10 ncall= 1534 nmove= 1023 107 | DONE ndsk= 11: maxstk= 11 ncall= 3070 nmove= 2047 108 | DONE ndsk= 12: maxstk= 12 ncall= 6142 nmove= 4095 109 | DONE ndsk= 13: maxstk= 13 ncall= 12286 nmove= 8191 110 | DONE ndsk= 14: maxstk= 14 ncall= 24574 nmove= 16383 111 | DONE ndsk= 15: maxstk= 15 ncall= 49150 nmove= 32767 112 | DONE ndsk= 16: maxstk= 16 ncall= 98302 nmove= 65535 113 | DONE ndsk= 17: maxstk= 17 ncall= 196606 nmove= 131071 114 | DONE ndsk= 18: maxstk= 18 ncall= 393214 nmove= 262143 115 | DONE ndsk= 19: maxstk= 19 ncall= 786430 nmove= 524287 116 | DONE ndsk= 20: maxstk= 20 ncall= 1572862 nmove= 1048575 117 | DONE ndsk= 21: maxstk= 21 ncall= 3145726 nmove= 2097151 118 | DONE ndsk= 22: maxstk= 22 ncall= 6291454 nmove= 4194303 119 | 120 | ### Benchmarks 121 | An initial round of benchmark tests was done in December 2017 122 | - on an Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz (Quad-Core with HT) 123 | - using [tk4-](http://wotho.ethz.ch/tk4-/) update 08 124 | - staring hercules with `NUMCPU=2 MAXCPU=2 ./mvs` 125 | - using `CLASS=C` jobs, thus only one test job running at a time 126 | 127 | The key result is the GO-step time of the `towh_*_f` type jobs for different 128 | compilers. The table is sorted from fastest to slowest results and shows 129 | in the last column the time normalized to the fastest case (asm): 130 | 131 | | [Compiler ID](../README_comp.md) | job time | */asm | 132 | | :--: | -----: | ----: | 133 | | asm | 5.28 | 1.00 | 134 | | pas | 7.43 | 1.41 | 135 | | gcc | 8.69 | 1.64 | 136 | | jcc | 9.28 | 1.76 | 137 | | forh | 9.30 | 1.76 | 138 | | forg | 16.38 | 3.10 | 139 | | sim | 34.29 | 6.49 | 140 | | pli | 56.07 | 10.62 | 141 | | forw | 90.67 | 17.17 | 142 | | a60 | 261.28 | 49.48 | 143 | 144 | See also the [benchmark summary](../README_bench.md) for an overview 145 | table and a compiler ranking. 146 | 147 | ### Author's Note 148 | 149 | I worked in the late 70's and early 80's a lot with mainframes, mainly 150 | [IBM System/370](https://en.wikipedia.org/wiki/IBM_System/370) and 151 | [Cray 7600](https://en.wikipedia.org/wiki/CDC_7600), and minicomputers, 152 | mainly [DEC PDP-11](https://en.wikipedia.org/wiki/PDP-11). Since we used 153 | PDP-11 systems as 154 | [data acquisition](https://en.wikipedia.org/wiki/Data_acquisition) 155 | computers I had a lot of very direct hands-on interaction with them. 156 | 157 | Based on that background I created, as leisure time project, a 158 | [FPGA](https://en.wikipedia.org/wiki/Field-programmable_gate_array) 159 | based implementation of a PDP-11/70. See GitHub 160 | [wfjm/w11](https://github.com/wfjm/w11/) project and the associated 161 | [w11 home page](https://wfjm.github.io/home/w11/). When 162 | [2.11BSD UNIX](https://en.wikipedia.org/wiki/Berkeley_Software_Distribution) 163 | finally booted in 2009 it was time to do a few 164 | [benchmarks](https://en.wikipedia.org/wiki/Benchmarking). 165 | The UNIX BENCH V4.1 was an obvious candidate, and the `hanoi` 166 | code is, besides [Dhrystone](https://en.wikipedia.org/wiki/Dhrystone), 167 | a key part of my still quite simple performance studies, see 168 | [comparison of w11 performance on different FPGAs](https://wfjm.github.io/home/w11/impl/performance.html#h_benchmarks). 169 | 170 | Since the core of the algorithm is very simple and tests with 171 | _recursive function calls_ a feature not covered by the other cases 172 | I added `towh`. Also because I was curious how the compilers would 173 | handle this on the 174 | System/370 architecture which does not offer a build-in 175 | [stack](https://en.wikipedia.org/wiki/Stack_(abstract_data_type)) 176 | support. 177 | -------------------------------------------------------------------------------- /jobs/README.md: -------------------------------------------------------------------------------- 1 | ### Table of content 2 | 3 | - [Overview](#user-content-overview) 4 | - [Available Job Types](#user-content-types) 5 | - [Available Jobs](#user-content-jobs) 6 | - [Job CLASS Usage](#user-content-class) 7 | - [Known Issues](#user-content-issues) 8 | - [Howto create JCL](#user-content-getjcl) 9 | - [Howto submit directly](#user-content-submit) 10 | 11 | ### Overview 12 | 13 | Each case in implemented in different languages, and for some cases 14 | several job types (like test job, benchmark job) are provided. 15 | This leads to a fairly large number of case-language-type combinations where 16 | - same code is used for compilers of the same language 17 | - same data input files are used across languages 18 | - the basic [JCL](https://en.wikipedia.org/wiki/Job_Control_Language) structure 19 | is only language, but not case or type specific 20 | 21 | The final jcl for a job is therefore dynamically created by the tool 22 | [hercjis](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md) 23 | (in `herc-tools/bin` directory) 24 | based on descriptor files with the file type `.JES` stored this directory. 25 | The `.JES` are short and contain 26 | - name of source code (from [codes](../codes) directory) 27 | - name of input data file (from [codes](../codes) directory) 28 | - name of jcl template file (type `.JESI`, from [jcl](../jcl) directory) 29 | - if required, special job parameters used by the template 30 | 31 | ### Available Job Types 32 | For most test cases several job types are provided 33 | 34 | | Case ID | Job Type | Decription | 35 | | :-----: | -------- | --------- | 36 | | [hewo](../codes/README_hewo.md) | hewo_*.JES | print Hello World| 37 | | [sine](../codes/README_sine.md) | sine_*.JES | print printer plot| 38 | | [soep](../codes/README_soep.md) | soep_*_t.JES | test job (verification) | 39 | | | soep_*_f.JES | benchmark job (algorithm) | 40 | | | soep_*_p.JES | benchmark job (formatted output)| 41 | | [soeq](../codes/README_soeq.md) | soeq_*_t.JES | test job (verification) | 42 | | | soeq_*_f_10.JES | benchmark job (algorithm, 10M sieve for `soep` comparison) | 43 | | | soeq_*_f.JES | benchmark job (algorithm, full 100M sieve) | 44 | | | soeq_*_p.JES | benchmark job (formatted output)| 45 | | [towh](../codes/README_towh.md) | towh_*_t.JES | test job (verification) | 46 | | | towh_*_f.JES | benchmark job | 47 | | [mcpi](../codes/README_mcpi.md) | mcpi_*_t.JES | test job (verification) | 48 | | | mcpi_*_f.JES | benchmark job | 49 | 50 | For details follow the link in the Case ID column and consult the 51 | [available jobs](#user-content-jobs) section. See also the 52 | [benchmark summary](../README_bench.md) for an overview table of benchmark 53 | results and a compiler ranking. 54 | 55 | ### Available Jobs 56 | The available Compiler-Case combinations are 57 | 58 | | Language | Compiler ID | [hewo](../codes/README_hewo.md) | [sine](../codes/README_sine.md) | [soep](../codes/README_soep.md) | [soeq](../codes/README_soeq.md) | [towh](../codes/README_towh.md) | [mcpi](../codes/README_mcpi.md) | 59 | | --------- | :---------: | :--- | :--- | :--- | :--- | :--- | :--- | 60 | | Algol 60 | [a60](../jcl/job_a60_clg.JESI) | yes | yes | _t, _f, _p | -- | _t, _f | _t, _f **N02** | 61 | | Assembler | [asm](../jcl/job_asm_clg.JESI) | yes | -- | _t, _f, _p | _t, _f, _p | _t, _f | _t, _f | 62 | | C | [gcc](../jcl/job_gcc_clg.JESI) | yes | yes | _t, _f, _p | _t, _f, _p | _t, _f | _t, _f | 63 | | C | [jcc](../jcl/job_jcc_clg.JESI) | yes | yes | _t, _f, _p | _t, _f, _p | _t, _f | _t, _f **N01** | 64 | | COBOL | [cob](../jcl/job_cob_clg.JESI) | yes | -- | -- | -- | -- | -- | 65 | | FORTRAN-4 | [forg](../jcl/job_forg_clg.JESI) | yes | yes | _t, _f, _p | -- | _t, _f | _t, _f | 66 | | FORTRAN-4 | [forh](../jcl/job_forh_clg.JESI) | yes | yes | _t, _f, _p | -- | _t, _f | _t, _f | 67 | | FORTRAN-4 | [forw](../jcl/job_forw_clg.JESI) | yes | yes | _t, _f, _p | -- | _t, _f | _t, _f | 68 | | Pascal | [pas](../jcl/job_pas_clg.JESI) | yes | yes | _t, _f, _p | _t, _f, _p | _t, _f | _t, _f | 69 | | PL/I | [pli](../jcl/job_pli_clg.JESI) | yes | yes | _t, _f, _p | _t, _f, _p | _t, _f | _t, _f | 70 | | Simula | [sim](../jcl/job_sim_clg.JESI) | yes | yes | _t, _f, _p | -- | _t, _f | _t, _f | 71 | 72 | #### Job CLASS Usage 73 | The job `CLASS` is chosen to give best response on 74 | [tk4-](http://wotho.ethz.ch/tk4-/) systems and set to B,C or A 75 | depending on expected CPU time and memory consumption 76 | - `CLASS B` for fast runners: hewo*,sine*,*_t 77 | - `CLASS C` for jobs with `REGION` >= 5000K 78 | - `CLASS A` for rest: _f,_p 79 | 80 | The predefined job `CLASS` can be overridden with the `hercjis` 81 | [-c option](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md#user-content-opt-c). For benchmarking it is highly advisable to use `CLASS C` via 82 | a `-c C` option, see 83 | [Howto submit directly](#user-content-submit) section. 84 | 85 | #### Known Issues 86 | - **N01:** `mcpi_jcc_*.JES` fails on [tk4-](http://wotho.ethz.ch/tk4-/) 87 | update 08 due to a compiler bug. 88 | JCC generates a wrong constant, which screws up the random number sequence. 89 | The code compiles and executes, but the results are wrong. 90 | The bug is reported to the maintainer. 91 | - **N02:** `mcpi_a60_*.JES` fails on [tk4-](http://wotho.ethz.ch/tk4-/) 92 | update 08 due to a compiler bug. 93 | The code requires double precision floating point, which in IBM Algol 60 94 | must be selected with the compiler option `LONG`. Due to a bug in the 95 | compiler this option is not recognized, single precision code is generated, 96 | which is does not give proper results. 97 | The bug is reported, see 98 | [turnkey-mvs posting](https://groups.yahoo.com/neo/groups/turnkey-mvs/conversations/topics/10401). 99 | A fix of the compiler is available from the maintainer, Tom Armstrong, see 100 | [turnkey-mvs/files/IEX10.zip](https://groups.yahoo.com/neo/groups/turnkey-mvs/files/IEX10.zip), and **must be installed** before running `mpci_a60*` jobs. 101 | This fix will be included in tk4- update 09. 102 | 103 | ### Howto create JCL 104 | When [hercjis](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md) 105 | is called with the 106 | [-o option](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md#user-content-opt-o) 107 | it will write the generated job to the file given after the `-o` option, like 108 | ``` 109 | hercjis -o hewo_asm.jcl hewo_asm.JES 110 | ``` 111 | The generated `.jcl` file can now be submitted with any available tool. 112 | Converting all `.JES` files is easiest done with `make`. 113 | A [Makefile](Makefile) is provided which allows to convert a single 114 | file or all files if `make` is called with no target or `all` as target. 115 | To convert all `.JES` into `.jcl` simply 116 | - ensure that `herc-tools/bin/hercjis` is in the search path 117 | (e.g. set `$PATH` properly) 118 | - type `make` 119 | 120 | ### Howto submit directly 121 | When 122 | [hercjis](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md) 123 | is called without `-o` option it will send the job to a 124 | `sockdev` reader on port 3505. To use this most direct way to submit a job 125 | - setup hercules with `devinit 00c 3505 sockdev ascii trunc eof` 126 | - ensure that `herc-tools/bin/hercjis` is in the search path 127 | (e.g. set `$PATH` properly) 128 | - submit with `hercjis .JES` 129 | 130 | Since 131 | [hercjis](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md) 132 | accepts multiple input files whole job trains can be submitted, 133 | for example all simple and test jobs with 134 | ``` 135 | hercjis hewo*.JES sine*.JES *_t.JES 136 | ``` 137 | 138 | For benchmarking it is often better to ensure that only one job is active 139 | at a time. On a [tk4-](http://wotho.ethz.ch/tk4-/) 140 | system `CLASS=C` jobs have only a single initiator. The 141 | [-c option](https://github.com/wfjm/herc-tools/blob/master/doc/hercjis.md#user-content-opt-c) allows to override the `CLASS`, so a 142 | ``` 143 | hercjis -c C *_f.JES 144 | ``` 145 | will submit all benchmark jobs and run them sequentially. 146 | -------------------------------------------------------------------------------- /codes/README_soep.md: -------------------------------------------------------------------------------- 1 | ## soep - Sieve of Eratosthenes prime search (byte) 2 | 3 | ### Table of content 4 | 5 | - [Description](#user-content-description) 6 | - [Algorithm](#user-content-algorithm) 7 | - [Input File](#user-content-ifile) 8 | - [Language and Compiler Notes](#user-content-langcomp) 9 | - [Jobs](#user-content-jobs) 10 | - [Benchmarks](#user-content-benchmarks) 11 | - [Author's Note](#user-content-anote) 12 | 13 | ### Description 14 | The [sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) 15 | algorithm is used to determine the 16 | [prime numbers](https://en.wikipedia.org/wiki/Prime_number) up to a given 17 | maximum, and either print all found primes or only short summary with counts 18 | of primes for each decade. The sieve is implemented using one byte per odd 19 | number, using the data types 20 | - `BOOLEAN` in Algol 60 21 | - `char` in C 22 | - `LOGICAL*1` in FORTRAN 23 | - `boolean` in Pascal 24 | - `CHAR(1)` in PL/I 25 | - `CHARACTER` in Simula 26 | 27 | Since the maximal user memory available in MVS 3.8J is about 9 MByte the 28 | jobs target the primes up to 1.E7, resulting in a 5 MByte sieve array size. 29 | 30 | The number of primes `pi(x)` up to a given limit `x` is well known, see for 31 | example [this page](https://primes.utm.edu/howmany.html): 32 | 33 | x pi(x) 34 | 10 4 35 | 100 25 36 | 1,000 168 37 | 10,000 1,229 38 | 100,000 9,592 39 | 1,000,000 78,498 40 | 10,000,000 664,579 41 | 100,000,000 5,761,455 42 | 43 | ### Algorithm 44 | The basic algorithm for the determinion of all prime numbers up to a 45 | limit `nmax` can be summarized as 46 | - **init**: initialize an array `prime` of dimension `[1,nmax]` with `TRUE` 47 | - **outer loop**: check for all numbers p whether `prime[p]` is `TRUE` 48 | - **inner loop**: if yes, set `prime[n*p]` to `FALSE` for n=2,.. 49 | - **scan**: at the end scan `prime`, each entry still being `TRUE` marks a prime 50 | 51 | This basic form can be refined by 52 | - represent only odd numbers in `prime` 53 | - run the outer loop only up to sqrt(nmax) 54 | - start the inner loop at n=p (rather than n=2) 55 | 56 | The core of the algorithm is just 4 lines in C (with nmsqrt = sqrt(nmax)): 57 | ``` c 58 | for (n=3; n<=nmsqrt; n+=2) { 59 | if (prime[n/2] == 0) continue; 60 | for (p=&prime[(n*n)/2]; p<=pmax; p+=n) *p = 0; 61 | } 62 | ``` 63 | 64 | ### Input File 65 | The codes are controlled by an input file with a single line in `2I10` format 66 | ``` 67 | NMAX PRNT 68 | ``` 69 | 70 | where `NMAX` gives the range of the prime search and `PRNT` enables (1) 71 | or disables (0) printing of all found primes. The summary is always 72 | printed. 73 | See typical [test run](soep_ctst.dat) or 74 | [algorithm benchmark run](soep_cnat.dat) or 75 | [print benchmark run](soep_cprt.dat) input files. 76 | 77 | ### Language and Compiler Notes 78 | The sieve array is dynamically allocated whenever feasible. 79 | 80 | #### PL/I - [soep_pli.pli](soep_pli.pli) 81 | This PL/I version uses intentionally `CHAR(1)` as base type for the sieve array. 82 | For a version using `BIT(1)` see [soeq_pli.pli](soeq_pli.pli) 83 | in the [soeq](README_soeq.md) section. 84 | The PL/I compiler available with MVS3.8J restricts array bounds to 85 | 16 bit integer values. To avoid this 64k storage limitation the `PRIME` 86 | array is two-dimensional. In addition, the compiler restricts the size of 87 | global statict aggregates to 2 MByte, larger allocations result in a 88 | ``` 89 | IEM1088I THE SIZE OF AGGREGATE PRIME IS GREATER THAN 2,097,151 BYTES. 90 | STORAGE ALLOCATION WILL BE UNSUCCESSFUL. 91 | ``` 92 | 93 | Local aggregates have no size limit, the sieve algorithm is therefore 94 | implemented in a separate `PROC` where the `PRIME` array is a local object. 95 | The dimensions are chosen such that the index calculation can be efficiently 96 | done (`MOD` is inlined by the compiler): 97 | ``` 98 | DCL PRIME(0:JMAX,0:1023) CHAR(1); 99 | ... 100 | DO I=IMIN TO IMAX BY N; 101 | PRIME(I/1024,MOD(I,1024)) = '0'; 102 | END; 103 | ``` 104 | 105 | Of course it costs CPU cycles to first split up the index into two 106 | components, just combine them a few instructions later to calculate 107 | the effective address. As result the `seop` PL/I code is rather slow. 108 | 109 | #### Simula - [soep_sim.sim](soep_sim.sim) 110 | Due to compiler bug in SIMULA 67 (VERS 12.00) the obvious implementation 111 | of the inner loop as 112 | ``` 113 | FOR i:= n2 // 2 STEP n UNTIL imax DO prime(i) := FALSE; 114 | ``` 115 | 116 | crashes with a `FIXED POINT OVFL` run time error. Closer investigation show 117 | that this happens in the initialization of the `FOR` loop. Replacing the 118 | `FOR` loop with the equivalent `WHILE` loop 119 | ``` 120 | i := n2 // 2; 121 | WHILE i <= imax DO BEGIN 122 | prime(i) := FALSE; 123 | i:= i + n; 124 | END; 125 | ``` 126 | 127 | works around this issue. 128 | 129 | ### Jobs 130 | The [jobs](../jobs) directory contains three types of jobs for `soep` named 131 | 132 | soep_*_t.JES --> print primes up to 100k (or implementation limit) 133 | soep_*_f.JES --> print number of primes up to 10M 134 | soep_*_p.JES --> print primes up to 10M (print speed test) 135 | 136 | Usually `soep_*_t.JES` is used for a verification check. 137 | 138 | `soep_*_f.JES` should in general output the equivalent of 139 | 140 | pi( 10): 4 141 | pi( 100): 25 142 | pi( 1000): 168 143 | pi( 10000): 1229 144 | pi( 100000): 9592 145 | pi( 1000000): 78498 146 | pi( 10000000): 664579 147 | 148 | `soep_*_p.JES` prints 664579 numbers, which generates about 66000 lines 149 | or 53 to 85 MByte of output. The CPU time will be dominated by the print 150 | part, this is therefore essentially a _formatted output_ benchmark. 151 | 152 | ### Benchmarks 153 | An round of benchmark tests was done in July 2018 154 | - on an Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz (Quad-Core with HT) 155 | - using [tk4-](http://wotho.ethz.ch/tk4-/) update 08 156 | - staring hercules with `NUMCPU=2 MAXCPU=2 ./mvs` 157 | - using `CLASS=C` jobs, thus only one test job running at a time 158 | 159 | The key result is the GO-step time of the `soep_*_f` type jobs for different 160 | compilers. The table is sorted from fastest to slowest results and shows 161 | in the last column the time normalized to the fastest case (asm): 162 | 163 | | [Compiler ID](../README_comp.md) | 10M search | */asm | 164 | | :--: | ----: | ----: | 165 | | asm | 0.45 | 1.00 | 166 | | forh | 0.66 | 1.47 | 167 | | gcc | 0.76 | 1.67 | 168 | | jcc | 1.02 | 2.27 | 169 | | pas | 2.12 | 4.71 | 170 | | forg | 2.29 | 5.09 | 171 | | pli | 3.00 | 6.67 | 172 | | sim | 3.43 | 7.62 | 173 | | a60 | 4.57 | 10.15 | 174 | | forw | 9.57 | 21.27 | 175 | 176 | See also the [benchmark summary](../README_bench.md) for an overview 177 | table and a compiler ranking. 178 | 179 | A nice by-product is a measurement of the formatted output provided by 180 | the run-time systems. Simply done by subtracting from the `soep_*_p` 181 | job times the `soep_*_f` job times, again sort from fastest to slowest 182 | _'print an integer'_ performance: 183 | 184 | | [Compiler ID](../README_comp.md) | nmax | #prime | `_f` job time | `_p` job time | dt | time/int | 185 | | :--: | --: | -----: | ----: | ----: | -------: | -------: | 186 | | asm | 10M | 664579 | 0.45 | 1.38 | 0.93 s | 1.40 us | 187 | | pas | 10M | 664579 | 2.12 | 4.18 | 2.06 s | 3.01 us | 188 | | forh | 10M | 664579 | 0.66 | 3.04 | 2.38 s | 3.58 us | 189 | | sim | 10M | 664579 | 3.43 | 6.23 | 2.80 s | 4.21 us | 190 | | forg | 10M | 664579 | 2.29 | 5.11 | 2.82 s | 4.24 us | 191 | | forw | 10M | 664579 | 9.57 | 13.09 | 3.52 s | 5.30 us | 192 | | a60 | 10M | 664579 | 4.57 | 9.42 | 4.85 s | 7.30 us | 193 | | pli | 10M | 664579 | 3.00 | 11.22 | 8.22 s | 12.36 us | 194 | | jcc | 10M | 664579 | 1.02 | 13.43 | 12.41 s | 18.67 us | 195 | | gcc | 10M | 664579 | 0.76 | 18.36 | 17.60 s | 26.48 us | 196 | 197 | ### Author's Note 198 | Having prime search as test case was inspired by the collection of such 199 | codes in [tk4-](http://wotho.ethz.ch/tk4-/) under `SYS2.JCLLIB(PRIM*)`. 200 | These examples were **extremely helpful** to refresh my memory on some 201 | of the languages and on how to setup the jobs. So 202 | **kudos to Juergen Winkelmann** who collected these codes. 203 | 204 | To get a more orthogonal set of tests I 205 | - separated byte (seop) and bit ([seoq](README_soeq.md)) implementations 206 | - added an enable for the prime number print out. This allows to benchmark 207 | integer performance and formatted output performance separately. 208 | -------------------------------------------------------------------------------- /codes/README_soeq.md: -------------------------------------------------------------------------------- 1 | ## soeq - Sieve of Eratosthenes prime search (bit) 2 | 3 | ### Table of content 4 | 5 | - [Description](#user-content-description) 6 | - [Algorithm](#user-content-algorithm) 7 | - [Input File](#user-content-ifile) 8 | - [Language and Compiler Notes](#user-content-langcomp) 9 | - [Jobs](#user-content-jobs) 10 | - [Benchmarks](#user-content-benchmarks) 11 | - [Author's Note](#user-content-anote) 12 | 13 | ### Description 14 | Same prime number search as [soep](README_soep.md), but now the sieve is 15 | implemented using one bit per odd number. This allows the jobs to target 16 | the primes up to 1.E8, resulting in a 6.25 MByte sieve array size. 17 | 18 | ### Algorithm 19 | The basic algorithm is as described under 20 | [soep](README.md#user-content-algorithm). 21 | Only the special considerations for a _'one bit per sieve array element'_ 22 | implementation are covered in the 23 | [Language and Compiler Notes](#user-content-langcomp). 24 | 25 | ### Input File 26 | Same input file format as [soep](README_soep.md#user-content-ifile). 27 | 28 | ### Language and Compiler Notes 29 | This can be only be implemented efficiently in languages which directly 30 | support bit handling. 31 | 32 | #### C - [soeq_cc.c](soeq_cc.c) 33 | The bit handling is done by logical operations on data types like 34 | `unsigned char` in C. 35 | The most straight forward implementation uses bit masks for testing and 36 | clearing a bit in the sieve array. 37 | Mapping the numbers to bits from right (LSB) to left (MSB) gives for 38 | example an algorithm core in C like 39 | ``` c 40 | const unsigned char tstmask[] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; 41 | const unsigned char clrmask[] = {0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; 42 | ... 43 | for (n=3; n<=nmsqrt; n+=2) { 44 | i = n/2; 45 | if ((prime[i>>3] & tstmsk[i&0x7]) == 0) continue; 46 | for (i=(n*n)/2; i<=bimax ; i+=n) prime[i>>3] &= clrmsk[i&0x7]; 47 | } 48 | ``` 49 | 50 | The bit masks can be implemented as short lookup tables, like `tstmsk` and 51 | `clrmsk` in the example above, or calculated on the fly like 52 | 53 | tstmsk[ind] --> (1<<(ind)) 54 | clrmsk[int] --> ~(1<<(ind)) 55 | 56 | It depends on compiler and the hardware whether a memory lookup or a 57 | few integer instructions are faster. 58 | 59 | The code supports both lookup and in-line style for the bit masks. This 60 | controlled by the `LOOKUP` preprocessor symbol. Default is using in-line. 61 | 62 | #### Assembler - [soeq_asm.asm](soeq_asm.asm) 63 | The code uses on-the-fly calculation of the bits masks, conceptually 64 | similar to the C implementation described above. 65 | 66 | Here a right (MSB) to left (MSB) mapping is used, this reversal of bit 67 | order allows to generate the `clrmsk` by right shifting `X'FF7F'` in a 68 | register which is 32 bit wide. 69 | This leads to a very compact inner loop 70 | ``` 71 | SIEVI LR R2,R3 i 72 | NR R2,R10 i&0x7 73 | LR R1,R11 0xff7f 74 | SRL R1,0(R2) 0xff7f>>(i&0x7) 75 | LR R2,R3 i 76 | SRL R2,3 i>>3 77 | IC R0,0(R2,R9) prime[i>>3] 78 | NR R0,R1 & 0xff7f>>(i&0x7) 79 | STC R0,0(R2,R9) prime[i>>3] &= 0xff7f>>(i&0x7) 80 | BXLE R3,R6,SIEVI 81 | ``` 82 | 83 | See also [Author's Note](#user-content-anote). 84 | 85 | #### Pascal - [soeq_pas.pas](soeq_pas.pas) 86 | Pascal offers handling of sets. Because the sieve algorithm works on the set 87 | of natural numbers it's tempting to use Pascal sets. The book 88 | _'Pascal User Manual and Report, 2nd Edition'_, published in 1975 by Springer, 89 | has indeed on page 53 a prime search algorithm only based on sets. 90 | 91 | Early Pascal implementations often used a fixed size bit pattern to 92 | represent sets, with some natural word size. The CDC6600 compiler used 93 | 60 bits, the Stanford compiler for MVS a double word with 64 bits. 94 | 95 | That makes it natural to implement the sieve as an array of sets. There 96 | is even an example of this variant in the 2nd Edition book. 97 | 98 | Some benchmarking revealed that set operations are relatively expensive, 99 | despite their apparent simplicity with fixed underlying set size. 100 | Further benchmarking showed that for sets operators 101 | - `<=` is faster than `in` 102 | - `*` is faster than `-` 103 | 104 | The actual 105 | [Pascal implementation](soeq_pas.pas) differs therefore from the sketch given 106 | in the 2nd Edition book, and is in fact in spirit quite similar to the 107 | [C implementation](soeq_cc.c). 108 | 109 | #### PL/I - [soeq_pli.pli](soeq_pli.pli) 110 | PL/I offers, as only language available on [tk4-](http://wotho.ethz.ch/tk4-/), 111 | direct handling of bits. An array of `BIT(1)` is implemented as a packed 112 | bit array. 113 | Therefore the byte version [soep_pli.pli](soep_pli.pli) and the bit version 114 | [soeq_pli.pli](soeq_pli.pli) just differ by the base type of the sieve 115 | array and minor adoptions due to this type change. 116 | 117 | The PL/I compiler available with MVS3.8J restricts array bounds to 118 | 16 bit integer values. To avoid this 64k storage limitation the `PRIME` 119 | array is two-dimensional. In addition, the compiler restricts the size of 120 | global statict aggregates to 2 MByte, larger allocations result in a 121 | ``` 122 | IEM1088I THE SIZE OF AGGREGATE PRIME IS GREATER THAN 2,097,151 BYTES. 123 | STORAGE ALLOCATION WILL BE UNSUCCESSFUL. 124 | ``` 125 | 126 | Local aggregates have no size limit, the sieve algorithm is therefore 127 | implemented in a separate `PROC` where the `PRIME` array is a local object. 128 | The dimensions are chosen such that the index calculation can be efficiently 129 | done (`MOD` is inlined by the compiler): 130 | ``` 131 | DCL PRIME(0:JMAX,0:8191) BIT(1); 132 | ... 133 | DO I=IMIN TO IMAX BY N; 134 | PRIME(I/8192,MOD(I,8192)) = '0'B; 135 | END; 136 | ``` 137 | 138 | The access the `BIT(1)` array is implemented via run-time library 139 | function calls, inspection of the generated assembler code shows 140 | ``` 141 | PRIME(...) = '1'B; --> IHEIOAT 142 | PRIME(...) = '0'B; --> IHEBSKA 143 | IF (PRIME(...)) --> IHEBSD0 144 | ``` 145 | 146 | The extra code for index splitting and the rather indirect way the 147 | `BIT(1)` is accessed cost a lot of CPU cycles. 148 | As result the `seoq` PL/I code is rather slow. 149 | 150 | 151 | ### Jobs 152 | The [jobs](../jobs) directory contains four types of jobs for `soeq` named 153 | 154 | soeq_*_t.JES --> print primes up to 100k (or implementation limit) 155 | soeq_*_f_10.JES --> print number of primes up to 10M 156 | soeq_*_f.JES --> print number of primes up to 100M 157 | soeq_*_p.JES --> print primes up to 10M (print speed test) 158 | 159 | The `_t` and `_p` jobs serve the same purpose as described for 160 | [soep](README_soep.md). 161 | 162 | The `soeq_*_f.JES` should in output the equivalent of 163 | 164 | pi( 10): 4 165 | pi( 100): 25 166 | pi( 1000): 168 167 | pi( 10000): 1229 168 | pi( 100000): 9592 169 | pi( 1000000): 78498 170 | pi( 10000000): 664579 171 | pi( 100000000): 5761455 172 | 173 | ### Benchmarks 174 | An initial round of benchmark tests was done in July 2018 175 | - on an Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz (Quad-Core with HT) 176 | - using [tk4-](http://wotho.ethz.ch/tk4-/) update 08 177 | - staring hercules with `NUMCPU=2 MAXCPU=2 ./mvs` 178 | - using `CLASS=C` jobs, thus only one test job running at a time 179 | 180 | The key result is the GO-step time of the `soeq_*_f` type jobs, as packaged 181 | for a 100M search, for different compilers. 182 | The table is sorted from fastest to slowest results and shows 183 | in the last column the time normalized to the fastest case (asm): 184 | 185 | | [Compiler ID](../README_comp.md) | 100M search | */asm | 186 | | :--: | -----: | ----: | 187 | | asm | 8.12 | 1.00 | 188 | | gcc | 13.87 | 1.70 | 189 | | jcc | 20.77 | 2.55 | 190 | | pas | 42.00 | 5.17 | 191 | | pli | 159.35 | 19.62 | 192 | 193 | See also the [benchmark summary](../README_bench.md) for an overview 194 | table and a compiler ranking. 195 | 196 | It's interesting to compare for the 10M searches the times with 197 | the simpler [soep](README_soep.md#user-content-benchmarks) algorithm 198 | 199 | | [Compiler ID](../README_comp.md) | 10M soeq | 10M soep | seoq/soep | 200 | | :--: | ----: | ----: | ---: | 201 | | asm | 0.83 | 0.45 | 1.84 | 202 | | gcc | 1.19 | 0.76 | 1.57 | 203 | | jcc | 1.67 | 1.02 | 1.64 | 204 | | pas | 4.19 | 2.12 | 1.98 | 205 | | pli | 15.05 | 3.00 | 5.02 | 206 | 207 | ### Author's Note 208 | The assembler code [soeq_asm.asm](soeq_asm.asm) was much inspired by 209 | `SYS2.JCLLIB(PRIMASM)` in [tk4-](http://wotho.ethz.ch/tk4-/). 210 | This code is **very compact and very elegant**, and was for me the single 211 | **most important help** to get me back to writing System/370 assembler code 212 | after several decades. 213 | So again **kudos to Juergen Winkelmann**, the author of this code. 214 | 215 | Nevertheless I wondered whether the speed of this highly tuned assembler 216 | implementation could be still improved. 217 | My suspicion was that the `EX` instruction is expensive, and that inline 218 | calculation of the bit masks is faster than a table look-up. 219 | To have a quantitative basis I wrote an instruction benchmark, which after 220 | a lot of work grew into 221 | [s370_perf](https://github.com/wfjm/s370-perf/blob/master/codes/s370_perf.asm), 222 | which is now a GitHub project of its 223 | own under [wfjm/s370-perf](https://github.com/wfjm/s370-perf). 224 | With the instruction timings at hand it turned out that my suspicion was correct. 225 | So in the end my code likely beats Juergens code in speed, but it is by far 226 | not as elegant and compact. 227 | --------------------------------------------------------------------------------