USB on Power 7 and IBM i 7.3

I’ve connected a 32 GB USB Flash Drive to the front USB connector of this Power 7 IBM i V7.3 server.  With the System value for Auto-start config previously set to 1, the server sets this device in the QOPT (optical) subsystem with name RMS01.  The USB was previously initialized with UDF file system, which is a requirement for the Power 7 system.  A command such as  “CPY OBJ(‘/home/pstjean/readme’) TODIR(‘/QOPT/USB_P1-T3-L1/tmp’)” results in the 1 object being copy from the IFS to the USB drive.

The USB can subsequently be read on a Windows 10 or Linux Ubuntu 18.04 system for example. 

This IBM Link was used as a basis to validate this capability, and therefore some naming, ie. volume label, may be similar.  For example, the initialize USB to UDF command was copied from the linked URL and pasted onto a QCMD command line screen and executed.

The command DSPMSG QSYSOPR was run to validate that the device was connected, which shows the USB device with volume USB_P1-T3-L1 was added.

With this capability set up and validated, this provides for another alternate means by which to move/copy objects from one system or another, and even provide a means of a short term backup of sorts.  IBM does not recommend that the USB drive be used for system and permanent type backups due to the “inconsistent” performance of USB flash drives across manufacturers.

CS269 – IBM 360 Assembler – Program 5

Well, just to continue with the brain dump from yesteryear, here is program number 5 for the USM CS269 Intro to IBM Assembly Language Class.  Unlike program 2 posted here, program #5 will run unmodified in the PC DOS version of ASSIST.  I bet you’re thinking “Why would I even want to do this?”  I’m probably think the same thing.  Putting it here though at least might give me the opportunity to throw out the paper version.

 t
00001 $JOB ASSIST IPF269 PHIL ST.JEAN
00002 *PROGRAM 5 DUE 3/19/81 CS269
00003 * THIS PROGRAM SIMULATES MULTIPLICATION AND DIVISION AS DESCRIBED
00004 * IN THE TEXT FOR CS269 SPR81 BY STRUBLE; ON PAGES
00005 * 70-71 AND 74-75.  THESE SIMULATIONS DEAL WITH
00006 * POSITIVE OPERANDS, AND IF ONE IS NEGATIVE, COMPLEMENT IT SO
00007 * THAT IT IS POSITIVE.
00008 * DIVISION IS ROUNDED ( IE INTEGER DIVISION )
00009 *
00010 * INPUT : AN ALGEBRAIC EXPRESSION WITH ONLY MULTIPLICATION AND
00011 *         DIVISION; NO PARENTHESIS.
00012 *
00013 * OUTPUT: THE EXPRESSION AND THE EVALUATED RESULT.
00014 *
00015 * REGISTERS: 1 - INDEX THROUGH CARD
00016 *            2,3 - REGISTERS FOR MULT. AND DIV.
00017 *            4 - LOOP COUNTER FOR SIMULATION OF MULT. AND DIV.
00018 *            5 - TEMP. TO TEST IF RIGHT BIT IS ZERO OR ONE
00019 *            8 - USED TO PUT THE DIVISOR IN CORRECT RELATION
00020 *            9 - STORES RESULT AFTER EACH OPERATION
00021 *           11 - COUNTS THE NUMBER OF NEGATIVES
00022 *
00100 PROG5    CSECT
00110          BALR  12,0
00120          USING *,12
00130 LOOP1    LA    11,0
00150          XREAD CARD,80
00160          BCR   4,14
00170          MVC   LINE+1(80),CARD
00180          LA    1,CARD
00190          XDECI 9,0(1)
00200          C     9,=F'0'
00210          BNL   LOOP2
00220          X     9,=X'FFFFFFFF'
00230          AL    9,=X'00000001'
00235          LA    11,1(11)
00240 LOOP2    MVC   OP(1),0(1)
00244          CLI   OP,C' '
00246          BE    DONE
00250          XDECI 3,1(1)
00260          C     3,=F'0'
00270          BNL   SKIP
00280          X     3,=X'FFFFFFFF'
00290          AL    3,=X'00000001'
00295          LA    11,1(11)
00300 SKIP     CLI   OP,C'/'
00310          BE    DIVIDE
00311          CLI   OP,C'*'
00312          BE    MULT
00313          XPRNT ERROR,18
00314          B     LOOP2
00320 *
00330 * MULTIPLICATION
00340 *
00350 MULT     LA    4,32
00360          LA    2,0
00370 LMULT1   LR    5,3
00380          N     5,=X'00000001'
00390          BC    8,LMULT2
00400          ALR   2,9
00410 LMULT2   SRDL  2,1
00420          BCT   4,LMULT1
00430          LR    9,3
00440          B     LOOP2
00450 *
00455 * DIVISION
00456 *
00460 DIVIDE   LA    2,0
00470          LA    4,32
00480          LR    8,3
00490          LR    3,9
00500 LDIV1    SLDL  2,1
00510          SLR   2,8
00520          CLR   2,8
00530          BNH   LDIV2
00540          ALR   2,8
00550          B     LDIV3
00560 LDIV2    AL    3,=X'00000001'
00570 LDIV3    BCT   4,LDIV1
00580          LR    9,3
00590          B     LOOP2
00600 *
00610 *
00620 DONE    N   11,=X'00000001'
00625         BC   8,NOCOMPL
00650          X     9,=X'FFFFFFFF'
00660          AL    9,=X'00000001'
00670 NOCOMPL  MVI   82(1),C'='
00680          XDECO 9,83(1)
00690          XPRNT LINE,81
00700          MVC   LINE+1(131),BLANK
00710          B     LOOP1
00715 *
00720 CARD     DS    CL80
00730 LINE     DC    CL1'0'
00740          DS    CL131
00750 BLANK    DC    131CL1' '
00755 OP       DS   1F
00756 ERROR    DC   CL18'0ILLEGAL OPERATION'
00760          END   PROG5
00770 $ENTRY
00780 4*3
00790 16/2
00800 2*3*4/10
00810 -5*4/-2
00820 -10/3
00830 84/2/3
.rdymsg on
R; T=0.01/0.12 18:53:08
.assist

***  NO   STATEMENTS FLAGGED -  NO   WARNINGS,  NO   ERRORS

4*3 =          12

16/2 =           8

2*3*4/10 =           2

-5*4/-2 =          10

-10/3 =          -3

84/2/3 =          14

*** EXECUTION:    2241 INSTRUCTIONS EXECUTED ***

*** AM004 - NORMAL USER TERMINATION BY RETURN ***
R; T=1.29/3.15 18:53:43
.logoff
CONNECT= 01:29:49 VIRTCPU= 000:30.30 TOTCPU= 001:53.24
LOGOFF AT 18:54:07 EDT THURSDAY 03/19/81

 CAPS ONLINE

CS269 – IBM360 Assembler Program #2

While cleaning my stuff, which my wife calls junk, I came across a box of computer printouts from my college days at USM, which I attended and eventually graduated from about 40 years ago.  If someone else needs to review a similar answer to program#2 for the CS269 class, then here it is!  Steve R. was the instructor 1981.  You’d think this must still be relevant today – just look at those beautiful opcodes/mnemonics.

* AUTHOR....:  PHILIP ST.JEAN
* CLASS.....:  CS269 - IBM360 ASSEMBLY LANGUAGE PROGRAMMING
* INSTRUCTOR:  STEVE RAND
* CAMPUS....:  UNIVERSITY OF SOUTHERN MAINE
*
*
* PROGRAM #2, DUE FEB. 10, 1981
*
* THIS PROGRAM CALCULATES THE MEAN OF SEVERAL LIST OF INTEGERS
* TO THE NEAREST INTEGER.  ALSO CALCULATED ARE THE SUM AND
* NUMBER OF ELEMENTS.
*
* INPUT: DATA INPUT IS FREE-FORMAT, A SLASH(/) IS FOUND AFTER
*        THE LAST VALUE ON A CARD.  ANOTHER SLASH DIRECTLY
*        AFTER THE FIRST SLASH ( AND THUS //), INDICATES
*        END OF THE LIST TO BE AVERAGED.  AND ''END'' INDICATES
*        THE END OF ALL SUCH LISTS.  IF THERE ARE OTHER SPECIAL
*        SYMBOLS OTHER THAN THESE, THE PROGRAM WILL END AND AN
*        ERROR MESSAGE IS PRINTED OUT(IF THE SYMBOL IS WITHIN A
*        LIST, THAT LIST AND SUBSEQUENT LISTS WILL NOT BE
*        AVERAGED - THE PROGRAM WILL END.)
*
*          INPUT FOR THIS PROGRAM:
*             1   2   3   4   5//
*            -3  1      16/
*           20       24  -1 10  5 -3      8//
*                3/
*                   4/
*                   5/
*                   6/
*                0//
*                10//
*              END
*
* OUTPUT:OUTPUT CONSISTS OF THE NUMBER OF VALUES IN THE LIST
*        THE SUM OF THE LIST, AND THE MEAN OF THE LIST -  ALL
*        IN A TABLE-LIKE OUTPUT.( OR ANY ERROR MESSAGES AS
*        STATED IN THE INPUT SECTION.
*
PROG2    CSECT
         BALR  12,0
	 USING *,12
	 XPRNT TITLE,61
LOOP1    LA    10,0
         LA    7,0
LOOP2    XREAD CARD,80
         LA    1,CARD
LOOP3    XDECI 4,0(1)
         BO    NONUM
	 AR    7,4
	 LA   10,1(10)
	 B    LOOP3
*
* THE NEXT FEW STATEMENTS WILL DETERMINE WHETHER A SINGLE
* SLASH, A DOUBLE SLASH, AN END, OR SOME OTHER CHARACTER.
* IF IT IS / THEN READ THE NEXT CARD AND PROCESS IT;IF IT
* IS // THE END THE PROCESSING OF THE CURRENT LIST AND FIND
* THE MEAN AND THEN PRINT THE NUMBER OF VALUES,SUM AND MEAN
* OF THAT LIST.  IF IT IS SOMETHING OTHER THAN THESE TWO, GO
* TO THE STATEMENT LABELED END.
*
NONUM    CLI   O(1),C'/'
         BNE   END
	 LA    1,1(1)
	 CLI   0(1),C'/'
	 BNE   LOOP2
	 C     10,=F'0'
	 BE    LOOP2
	 XDECO 10,LINE+1
	 XDECO 7,LINE+16
*
* FIND THE MEAN -- IF IT IS POSITIVE, ROUND UP TO THE NEAREST
* INTEGER; IF IT IS NEGATIVE, CONVERT IT TO POSITIVE AND USE
* THE SAME STEPS AS IF IT WERE A POSITIVE SUM - SIGNAL THAT
* THAT THIS IS SO FOR LATER RECONVERSION- AND ROUND DOWN TO
* THE NEAREST INTEGER.
*
         A     7,=F'0'
	 BNM   SKIP
	 MVI   SIGNAL,C'N'
SKIP     LA    6,0
         DR    6,10
	 LA    8,0
	 LR    9,6
	 M     8,=F'2'
	 SR    10,9
	 BP    NOADD
	 A     7,=F'1'
NOADD    CLI   SIGNAL,C'N'
         BNE   POSITIV
	 LNR   7,7
POSITIV  XDECO 7,LINE+31
*
*
         XPRNT LINE,80
	 B     LOOP1
*
* IF THE CHARACTERS ARE 'END' THEN END NORMALLY; ELSE PRINT AN
* ERROR MESSAGE THAT SAYS THAT IT IS AN ILLEGAL CHARACTER
* AND COULD COME FROM A MISTYPED NUMBER IN THE DATA, AND
* INDICATE THAT THE PROGRAM IS ENDING ANYWAY.
*
END      CLC   0(3,1),=C'END'
         BER   14
	 XPRNT ERROR,128
	 BR    14
*
SIGNAL   DC    CL1'*'
CARD     DS    CL81
         DC    CL1'*'
LINE     DC    CL1'0'
         DC    132CL1' '
TITLE    DC    CL61'-    # OF ELEMENTS       SUM:          MEAN:     ,O*
               F THE LIST'
ERROR    DC    CL128'-''END'' WAS NOT USED TO TERMINATE DATA; PROGRAM E*
               NDING(PROBABLE CAUSE-ILLEGAL SYMBOL WITHIN BOUNDARIES OF*
			    LIST; SEE DATA CARDS)'
	END   PROG2
$ENTRY
             1   2   3   4   5//
            -3  1      16/
           20       24  -1 10  5 -3      8//
                3/
                   4/
                   5/
                   6/
                0//
                10//
              END

BTW, this program would run under the ASSIST 4.0/A of 04/25/75 version on the IBM 370/3031 mainframe.  At some point after the IBM PC was introduced in August of 1981, someone ported a version of ASSIST to the IBM DOS environment.  This program will run there with some slight modifications – the line with BER 14 will need to be replaced by the equivalent BCR 8, 14 instruction.  The DOS version is finicky/sensitive with tabs and lines with labels and lines without labels, and that impacts the section where line continuation is used and might have to be adjusted accordingly.

The Instructor graded these program homework assignments from 0 to 4.  This one got a 4.  Oh, some programs counted double, so 0 to 8.  Don’t ever think about getting a 5 or a 9 respectively, as he just doesn’t do that, not even if you invented the Internet, like I did in the 1970s while in high school.  I did not inhale, until after calculus.

Well that was quite the flashback memory of the day.  To think I have more junk, I mean stuff, to go through.

Update:  Click here to view the PDF scan of the actual completed computer listing – yes that’s real paper, recycled as it was.  File is about 6MB.

Hello World! MS-DOS and Oracle VirtualBox.

A typical “Hello World!” assembler program for MS-DOS 6.22.  Simple and nothing magical going on here.

.model small        ; One data segment and one code segment
.stack
.data
     msgText db "Hello World!","$"
.code
.STARTUP
   main1 proc
     mov ax, @data
     mov ds, ax      ; DS now at Data segment
     lea dx, msgText ; DS:DX now has location of msgTEXT
     mov ah, 09      ; 09=Display string at DS:DX to STDOUT
     int 21h         ; Display the string on DOS interrupt

     mov ax, 4c00h   ; 4C=Exit Program function
     int 21h         ; Exit program on this DOS interrupt
   main1 endp
end

Don’t have MS-DOS anymore?  You can setup Oracle’s VirtualBox application and create an MS-DOS virtual environment on any modern computer.  I’ve done this with Linux and Windows variants.   Seen below is Windows 10 running a DOS virtual machine, aka VM, within the Oracle VirtualBox product.  The above source code is located in the DOS VM directory c:\test.  This example here uses the Borland assembler and linker, tasm/tlink, that I previously installed in this DOS VM.  Finally running the executable code, hello.exe, the expected results are seen.

Hello World running in DOS 6.22 VM on Oracle’s VirtualBox.

 

The Olivetti P603 sparked a Future Career?

The first computer that I recall seeing in person was an Olivetti P603 at my Dad’s office.  I was about 12, early senventies.  Seen here is a stock photo from Olivetti.  My dad’s version didn’t have the drawer storage cabinet seen on the left that I recall.  An electric typewriter console occupied the central operator position.  On the right was a calculator type console which also served as the programming unit.  On this same programming unit was a calculator size paper printer and also a magnetic strip reader/writer.  Not seen in this stock photo, but below the desk level and to the right of the operator was a tape cabinet unit.  One would place a tape cartridge into the unit positioning it onto the keyed motor spindle and then operate a hand lever to engage the tape into the electronics of the tape unit.  Each tape contained it’s own read/write head.  The tape itself was a single length endless loop configuration as pictured here.  The tape cartridge dimensions were about 7″ by 6″ by 2″.  The usable tape is visible in through the smoke gray plastic with the exception of a length that ran from this oval area to the read/write head seen at the top through the “dimpled” portion.  The tape ran through a few capstans and a tensioner around the perimeter.  The tape itself had 4 tracks.  I have since forgotten the density of the tape, but I don’t believe each track was more than 4k roughly, for a total of approximately 16k.  For a bit of fun, one could take the cartridge by itself, hand-rotate the keyed receptor on the back, and watch the tape “slowly” move through its path.  As a 12 year old, I thought it was magic that the tape didn’t end up in knots.  So what could you do with this whole thing?  Well, it could be used as a typewriter.  You could also use it for it’s calculator though I never saw it used that way myself.  Then with the magnetic cards (about 2.5″ by 8 or so inches, double sided) and/or with the tape unit, one could read/write/run programs.  The programs could output onto the typewriter.  There was no screen.  And before I forget, it weighed a “ton”.  In 1979 he still had this boat anchor running parts of his office.  And that year, being a computer science major and believing I could do anything with a computer, I wrote a structural heat-loss program for him on this unit.  It was worse than coding in APL.  Well, not really.  Just to wrap up the nostalgia a bit, in summary, if one used enough of the calculator paper, one could wind it back up tightly and then pull it from its center, making a real neat paper sword for that child still in oneself –  fun and no worries.

Remembering the PDP-8

The PDP-8 was a mini-computer manufactured by Digital Equipment Corporation eons ago and introduced in its earliest configuration on March 22, 1965.  I was about to turn 5, and I likely had no clue what a computer was.

I was introduced to the PDP-8 in 1974 as a junior high student and wrote a few programs for a class that year.  This is also about the time I noticed girls more.  I wanted one, a computer, the girlfriends would have to wait another year.  

Move forward 6 years to my 3rd year of college and somehow that old PDP-8 from 1974 had made its way to the local university I was attending.  It was a chance encounter on my part as I took a different route through one of the campus buildings to kill some time.  In some isolated room, miles from the campus computer center, it continued to hum it’s merry way.  I never did find out what they were using it for, or when they got it.  I still wanted one.

After college, I did not expect to see a PDP-8 machine at all.  I went to work for a local software company, and, well, as luck would have it, I did have a chance to install our fuel oil billing software on a PDP-8 at an oil delivery company in 1985.  I would have still wanted one – all those lights flashing and panel switches.

 Move forward about 30+ years and one can procure a PDP-8 emulator and mini-replica based on the Raspberry Pi for example.  I’m wondering what I will do!!