Skip to content

Commit

Permalink
f0001
Browse files Browse the repository at this point in the history
  • Loading branch information
adesutherland committed Feb 22, 2020
1 parent a74233d commit 1310521
Show file tree
Hide file tree
Showing 21 changed files with 463 additions and 28 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build GCCLIB

on: [push]

jobs:

#**************************************************#
build-cms:
name: Build for CMS
runs-on: [ubuntu-latest]
container: adriansutherland/vm370:1.4.1

steps:

- name: Checkout
uses: actions/checkout@v2

- name: Move Source
run: |
mkdir /opt/hercules/vm370/io
mv * /opt/hercules/vm370/io
shell: bash

- name: Build
working-directory: /opt/hercules/vm370
run: |
chmod -R ugo+rw *
hercules -f hercules.conf -d >/dev/null 2>/dev/null &
cd io
chmod +x cmsbuild.sh
echo "Running CMSBUILD"
./cmsbuild.sh
shell: bash

- name: Get Executable
run: |
mkdir -p exe
cp /opt/hercules/vm370/io/brexxbin.aws exe
cp /opt/hercules/vm370/io/LICENSE exe
cp /opt/hercules/vm370/io/README.md exe
cp /opt/hercules/vm370/io/cmsinstall.sh exe
cp /opt/hercules/vm370/io/changelog.txt exe
chmod -R ugo+r exe
shell: bash

- name: Upload Executable
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v1
with:
name: BREXX
path: ./exe

#**************************************************#
release:
if: startsWith(github.ref, 'refs/tags/')
name: Release
needs: [build-cms]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v1

- name: Get CMS binary
uses: actions/download-artifact@v1
with:
name: BREXX

- name: ZIP CMS binary
run:
zip -r BREXX.zip BREXX

- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true

- name: Upload Release Asset - CMS
id: upload-release-asset-CMS
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./BREXX.zip
asset_name: BREXX.zip
asset_content_type: application/zip
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions bitxor.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ Lbitxor( const PLstr to, const PLstr s1, const PLstr s2,
if (LLEN(*s1) < LLEN(*s2)) {
Lstrcpy(to,s2);
for (i=0; i<LLEN(*s1); i++)
LSTR(*to)[i] = LSTR(*s1)[i] ? LSTR(*s2)[i];
LSTR(*to)[i] = LSTR(*s1)[i] ^ LSTR(*s2)[i];

if (usepad)
for (; i<LLEN(*s2); i++)
LSTR(*to)[i] = LSTR(*s2)[i] ? pad;
LSTR(*to)[i] = LSTR(*s2)[i] ^ pad;
} else {
Lstrcpy(to,s1);

for (i=0; i<LLEN(*s2); i++)
LSTR(*to)[i] = LSTR(*s1)[i] ? LSTR(*s2)[i];
LSTR(*to)[i] = LSTR(*s1)[i] ^ LSTR(*s2)[i];

if (usepad)
for (; i<LLEN(*s1); i++)
LSTR(*to)[i] = LSTR(*s1)[i] ? pad;
LSTR(*to)[i] = LSTR(*s1)[i] ^ pad;
}
} /* Lbitxor */
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BREXX CMS Change LOG
====================

2.1.9 - 22 Feb 2020
F0001 - Automated Build and Install

<=2.1.8 - Prehistory Versions
68 changes: 68 additions & 0 deletions cmsbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh
# Make BREXX on CMS

# Exit if there is an error
set -e

# IPL
herccontrol -v
herccontrol "ipl 141" -w "USER DSC LOGOFF AS AUTOLOG1"
herccontrol "/cp start c" -w "RDR"

# LOGON CMSUSER
herccontrol "/cp disc" -w "^VM/370 Online"
herccontrol "/logon cmsuser cmsuser" -w "^CMS VERSION"
herccontrol "/" -w "^Ready;"

# Read/Send TATA TXT
yata -c
herccontrol -m >tmp; read mark <tmp; rm tmp
echo "USERID CMSUSER\n:READ YATA TXT " > tmp
cat yata.txt >> tmp
netcat -q 0 localhost 3505 < tmp
rm tmp
herccontrol -w "HHCRD012I" -f $mark
herccontrol "/" -w "RDR FILE"
herccontrol "/read *" -w "^Ready;"

# Build
herccontrol "/yata -x -d f" -w "^Ready;"
herccontrol "/erase yata txt a" -w "^Ready;"
herccontrol "/mkbrexx" -w "^Ready;"
herccontrol "/rename * * e = = e2" -w "^Ready;"

# Sanity test
herccontrol "/copy * * e = = a" -w "^Ready;"
herccontrol "/copy sysprof exec s = = a" -w "^Ready;"
herccontrol "/ipl cms" -w "^CMS VERSION"
herccontrol "/" -w "^Ready;"
herccontrol "/rexxtry" -w "^Rexxtry;"
herccontrol "/parse version myver" -w "^Rexxtry;"
herccontrol "/say myver" -w "^Rexxtry;"
herccontrol "/exit" -w "^Ready;"

# Make and load Tape
herccontrol "/cp disc" -w "^VM/370 Online"
herccontrol "/logon operator operator" -w "RECONNECTED AT"
hetinit -n -d brexxbin.aws
herccontrol "devinit 480 io/brexxbin.aws" -w "^HHCPN098I"
herccontrol "/attach 480 to cmsuser as 181" -w "TAPE 480 ATTACH TO CMSUSER"
herccontrol "/cp disc" -w "^VM/370 Online"

# Write to tape
herccontrol "/logon cmsuser cmsuser" -w "RECONNECTED AT"
herccontrol "/begin"
herccontrol "/tape dump * * e" -w "^Ready;"
herccontrol "/detach 181" -w "^Ready;"

# Clean Up
herccontrol "/erase brexx * a" -w "^Ready;"
herccontrol "/erase rexxtry exec a" -w "^Ready;"
herccontrol "/erase sysprof exec a" -w "^Ready;"

# LOGOFF
herccontrol "/logoff" -w "^VM/370 Online"

# SHUTDOWN
herccontrol "/logon operator operator" -w "RECONNECTED AT"
herccontrol "/shutdown" -w "^HHCCP011I"
70 changes: 70 additions & 0 deletions cmsinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/sh
# Install BREXX on CMS

# Exit if there is an error
set -e

# IPL
herccontrol -v
herccontrol "ipl 141" -w "USER DSC LOGOFF AS AUTOLOG1"

# LOGON MAINT AND READ TAPE
herccontrol "/cp disc" -w "^VM/370 Online"
herccontrol "/logon maint cpcms" -w "^CMS VERSION"
herccontrol "/" -w "^Ready;"
herccontrol "devinit 480 io/brexxbin.aws" -w "^HHCPN098I"
herccontrol "/attach 480 to maint as 181" -w "TAPE 480 ATTACH"

# MAINT 19D DISK
herccontrol "/access 19D z" -w "^Ready;"
herccontrol "/tape load * helpcmd z" -w "^Ready;"
herccontrol "/tape rew" -w "^Ready;"
herccontrol "/tape load * helpcmd2 z" -w "^Ready;"
herccontrol "/tape rew" -w "^Ready;"
herccontrol "/release z" -w "^Ready;"

# MAINT 19E DISK
herccontrol "/access 19E z" -w "^Ready;"
herccontrol "/tape load rexxtry exec z" -w "^Ready;"
herccontrol "/tape rew" -w "^Ready;"
herccontrol "/release z" -w "^Ready;"

# MAINT 190 CMS SYSTEM DISK
herccontrol "/access 190 z" -w "^Ready;"
herccontrol "/tape load brexx module z" -w "^Ready;"
herccontrol "/tape rew" -w "^Ready;"
herccontrol "/tape load brexx text z" -w "^Ready;"
herccontrol "/tape rew" -w "^Ready;"
herccontrol "/release z" -w "^Ready;"

# Done with tape
herccontrol "/detach 181" -w "^Ready;"

# Regenerate System
herccontrol "/define storage 16m" -w "^CP ENTERED"
herccontrol "/ipl 190" -w "^CMS VERSION"
herccontrol "/access ( noprof" -w "^Ready;"
herccontrol "/access 093 b" -w "^Ready;"
herccontrol "/access 193 c" -w "^Ready;"
herccontrol "/cmsxgen f00000 cmsseg" -w "^Ready;"
herccontrol "/ipl 190" -w "^CMS VERSION"
herccontrol "/savesys cms" -w "^CMS VERSION"
herccontrol "/" -w "^Ready;"
herccontrol "/logoff" -w "^VM/370 Online"

# LOGON CMSUSER
herccontrol "/logon cmsuser cmsuser" -w "^CMS VERSION"
herccontrol "/" -w "^Ready;"

# Sanity test
herccontrol "/rexxtry" -w "^Rexxtry;"
herccontrol "/parse version myver" -w "^Rexxtry;"
herccontrol "/say myver" -w "^Rexxtry;"
herccontrol "/exit" -w "^Ready;"

# LOGOFF
herccontrol "/logoff" -w "^VM/370 Online"

# SHUTDOWN
herccontrol "/logon operator operator" -w "RECONNECTED AT"
herccontrol "/shutdown" -w "^HHCCP011I"
6 changes: 3 additions & 3 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@
#define PACKAGE_NAME "VM/370 SixPack bREXX Interpreter"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "bREXX 2.1.8"
#define PACKAGE_STRING "bREXX 2.1.9"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "bREXX"

/* Define to the version of this package. */
#define PACKAGE_VERSION "2.1.8"
#define PACKAGE_VERSION "2.1.9"

/* Remove the trailing CR from system commands */
#define RMLAST 1
Expand All @@ -155,7 +155,7 @@
/* #undef TM_IN_SYS_TIME */

/* Version number of package */
#define VERSION "2.1.8"
#define VERSION "2.1.9"

/* Enable debuging information */
/* #undef __DEBUG__ */
Expand Down
16 changes: 16 additions & 0 deletions cp2vm370.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
REM Copy and build source files to VM370
yata -c -f tmp.txt
echo USERID CMSUSER > yata.txt
echo :READ YATA TXT >> yata.txt
type tmp.txt >> yata.txt
docker cp yata.txt vm370:/opt/hercules/vm370/io
erase yata.txt
erase tmp.txt
docker exec vm370 bash -c "cd /opt/hercules/vm370/io && yata -x"
docker exec vm370 bash -c "rm /opt/hercules/vm370/io/yata.txt"

docker cp cmsbuild.sh vm370:/opt/hercules/vm370/io
docker exec vm370 bash -c "cd /opt/hercules/vm370/io && ./cmsbuild.sh"

docker cp cmsinstall.sh vm370:/opt/hercules/vm370/io
docker exec vm370 bash -c "cd /opt/hercules/vm370/io && ./cmsinstall.sh"
4 changes: 2 additions & 2 deletions d2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ Ld2c( const PLstr to, const PLstr from, long n )
for (i=0; num && i<n2; i++) {
LSTR(*to)[i] = (char)(num & 0xFF);
if (negative)
LSTR(*to)[i] ?= 0xFF;
LSTR(*to)[i] ^= 0xFF;
num >>= 8;
}
if (i==0) {
LSTR(*to)[i] = 0x00;
if (negative)
LSTR(*to)[i] ?= 0xFF;
LSTR(*to)[i] ^= 0xFF;
i++;
}

Expand Down
2 changes: 1 addition & 1 deletion hashvalu.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Lhashvalue( const PLstr str )
value = 31*value + LSTR(*str)[i];
/* for (i=0; i<l; i+=4) {
for (j=0; j<4 && i+j<l; j++)
value ?= LSTR(*str)[i+j] << (8*j);
value ^= LSTR(*str)[i+j] << (8*j);
value = (value>>3) | (value<<29);
}
*/
Expand Down
2 changes: 1 addition & 1 deletion interpre.c
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ RxInterpret( void )
case OP_XOR:
DEBUGDISPLAY2("XOR");
a = STACKP(2);
LICPY(*a, Lbool(STACKP(1)) ? Lbool(STACKTOP));
LICPY(*a, Lbool(STACKP(1)) ^ Lbool(STACKTOP));
RxStckTop -= 2;
goto chk4trace;

Expand Down
2 changes: 1 addition & 1 deletion ldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ typedef int bool;
#endif
#define CTL(a) (('a') & 0x1F)

#define SWAP(a,b) a ?= b ?= a ?= b;
#define SWAP(a,b) a ^= b ^= a ^= b;

#define DIMENSION(p) (sizeof(p) / sizeof(p[0]))
#define ABS(a) (((a)<0)?-(a):(a))
Expand Down
Loading

0 comments on commit 1310521

Please sign in to comment.