How to Use the ECN Mainframe to do IBM Assembler Work.

This  unit tells you how to log in to the IBM Mainframe,  how  to
edit  files  containing ASSEMBLER programs, how to assemble  your
program,  and  finally  how  to  debug  it  and  demonstrate  its
correctness.

This  procedure  tells you how to use the  mainframe  to  do  IBM
Assembler   work  including  logging  in,  editing   the   files,
assembling them and then debugging them.

Most  of the time, you will probably be using the PC's in  Stipes
304.   You  will  be using a program on the PC called  TELNET  to
connect  to the IBM mainframe.  That IBM mainframe is in  Chicago
maintained by the Educational Computing Network. and you will  be
commuicating over a leased telephone line to that computer.

Later,  I  will let tell you alternate procedures to  connect  to
this  mainframe.   They will provide alternatives  to  the  first
steps.   These  procedures  will  allow  you  to  connect   using
alternate procedures.

                         Procedure One

1)   If you see the prompt "F>" type the command
      "LOGIN CS/GUEST"

2)   You may see a menu that begins "Computer Science Server"
     If you do press the "X" key.

3)   Now you should see a prompt like "(CS) A:\>"
     Type "telnet vm"

4)   A   whole  bunch  of  junk  will  display  on  your  screen.
     Ultimately,  it will display the ECN banner and  the  cursor
     will  appear  next  to the field, "USERID  ===>"  Type  your
     USERID.

     This  will  be four letters followed by four numbers,  e.g.,
     MCCS0107

     Move  the cursor down to where it says "PASSWORD ===>"  Type
     that  as  well.   Note that the password  you  type  is  not
     echoed.   This  is  to  prevent someone  looking  over  your
     shoulder from seeing it.

     (This  will  be  four  letters  and  four  numbers--it   was
     generated randomly.)

     Both  your user id and password will be given to you  on  an
     individual piece of paper.

     (If  you mistyped your login id or password, you will see  a
     request  to  "ENTER  one  of the following  commands:  LOGIN
     userid..."   Type "L XXXX" and press return (where  XXXX  is
     the user id).
     The machine will now say,
     "VMXACI104R Enter login password:"
     Enter your login password.  It won't echo.)

     (Note:   You  can get to this point described in parentheses
     above  by  simply pressing the ENTER key on  the  ECN  login
     banner screen.)

     (You  may  have  to press control-C, Control and  C  pressed
     simultaneously, at various points in your  use  of  the  IBM
     mainframe to get a new screen.)

5)     The  mainframe  will  now ask you to "Please  select  your
     default printer for this terminal session."  The choices are
     "WIU1", "WIU2" and "WIU3".  Type "WIU2" and press return.

     (If you selected "WIU1", then any printout you request later
     will  appear in the Academic Computer Center offices in  the
     first  floor of Stipes.  For WIU2, the printout will  appear
     in Morgan 107.  WIU3 is the printer in STIPES 307.)
     (There  may be some additional printers available  for  your
     use by the time you are reading this.)

6)   You are now ready to edit an old ASSEMBLER program or create
     a  new one.  Type "XEDIT $nn ASSEMBLE".  "nn" is the name of
     the assembler program you are creating or editing.

     On  the  top of the screen should be "nn ASSEMBLE"  and  the
     cursor  should  be next to the arrow on the  bottom  of  the
     screen.

     (You  can  use  any  name  of up to eight  characters.   The
     characters must be numbers or alphabetic.  )

7)   To  load up a template, type "GET nn ASSEMBLE" where "nn" is
     the  name  of an assembly program that contains the  desired
     information.   I  will try and put a "$1 ASSEMBLE"  file  in
     each  of your accounts.  This contains the first program  in
     Unit  2.1.   A template can be found in TEMPLATE  ASSEMBLE--
     this doesn't contain any instructions.


8)   You can now change this file as needed.  If the change needs
     to  be  made  on the current screen, simply use  the  normal
     cursor  keys  to move to the appropriate location  and  then
     type  the  correct  characters.   They  will  overwrite  the
     current text.

          a)    to  move the cursor to the previous screen, i.e.,
          move up, press the F7 key.
          b)    to move to the next screen i.e., move down, press
          the F8 key.
          c)    to  create a blank line in which to insert  text,
          move the cursor to the "=====" on the beginning of  the
          line  before  the  line you wish to insert.   Type  App
          where "pp" is the number of lines to be added.  You may
          have  to  press the F8 key to see these  lines  (see  b
          above).   Put the text in the lines just created.   (If
          you  type  "a"  without a "pp" one blank line  will  be
          created.)
          d)    To delete text, move the cursor to the "=====" on
          the  first  line to be deleted and type DD.  Then  move
          the  cursor  to  the "=====" on the  last  line  to  be
          deleted  and  type another DD.  (Between  entering  the
          first  "DD" and the second "DD," you may use  the  "F7"
          and  "F8" keys as described in parts "a" and "b"  above
          to page through the text.)
          (You may delete a single line by simply typing a "d" in
     the "=====" area before the line.)

     (If  you are using the ZENITH terminals in Morgan 107, press
     the  "ESC" key and then press 7 for the "F7" key.  Press the
     "ESC"  key  and then press 8 for the "F8" key.  In  general,
     press the "ESC" key and then press the "n" key for Fn.)

8)   Move  the cursor to the "====>" at the bottom of the screen.
     Type  "FILE"  and  press return to go back  to  the  "Ready"
     prompt to "ASSEMBLE" your program.

9)   Type "HASM nn" where "nn" is the name used above.

     (It  is  possible to enter the HASM command from the "====>"
     of  the editor.  In other words, it is possible to skip step
     8.   However,  this  causes no end  to  confusion  as  other
     commands  and  XEDIT's  get hopelessly  nested.   Therefore,
     please   ensure  that  you  exit  from  the  editor   before
     proceeding to the next phase.)

10)  Assuming there are no errors, you should get another "READY"
     prompt.    Otherwise, the offending lines and error messages
     will be put on your screen.

     (If  you  do  have error messages, go back to  step  ten  to
     correct  lines.   ASSEMBLER  has a  straightforward  syntax.
     Thus,  syntax errors are much less of a problem  than  in  a
     higher level language like PASCAL.)

11)  It  is  now  necessary to identify some  addresses  in  your
     program.   These addresses will be used to set  breakpoints.
     You  also  can display memory locations inside your program.
     Breakpoints  allow you to stop the program  at  intermediate
     locations.   Then,  you  can  display  registers  or  memory
     locations.

     You  need  to  inspect  the listing  file  produced  by  the
     ASSEMBLER.   Remember that HASM creates two files  when  you
     type HASM nn.  The first is $nn TEXT.  This is what will  be
     put  into the computer when you type "LOAD"  The file we are
     concerned  with is the $nn LISTING file.  This includes  the
     text  of  the  program--what was in the $nn  ASSEMBLE  file,
     AND,  more  importantly,  it includes  the  addresses  where
     instructions are and where your data values (DC's) are.

     You can inspect this file in one of two ways:

          a.   Type "PRINT nn LISTING"
                This generates a listing on the printer.  If  you
          are  doing serious debugging, you need to get and  take
          the time to wait for a listing.

          b.    If  you  need one or two addresses you  can  type
          "XEDIT  $nn LISTING" and page through with  F7  or  F8.
          (Remember to leave the editor by pressing F3.)

     The  address  can be found in the left hand  corner  of  the
     listing under the heading "LOC".

     Note that these addresses are in hexadecimal.

     When you enter these numbers into the computer, you must add
     20000 (hex) to them.

     Example:

     Look  at  the listing of the first program.  (See  Unit  5's
     program that adds A and B.)
 The locations of some instructions are:
     000002  L 1,A  (after executing this, register one is loaded
with A.)
     000006  A 1,B  (after this is executed, you can see register
one contains the sum of A and B)
      00000E   BR 14  (this is the last instruction executed;  it
will return us to the operating system
      000018   C  DC F (we need this address to find out  if  A+B
really ended up in C)

12)  Type  "LOAD  nn" where "nn" is the name of the program  used
     above.  You will get the "READY" prompt.

13)  Now  enter your breakpoints.  For each address at which  you
     would like to stop, enter:

     PER INSTRUCT RANGE 20nnn

     where "nnn" are the last three digits of the number found in
step 11 from the listing.

     (This  means,  after each time the instruction  at  location
     "nnn"  is  executed, the computer will display the  address,
     the instruction, and the condition code.)

14)  Type the word, "START"

15)  For  each breakpoint that the program hits, the machine will
     stop.

     You  can then enter DISPLAY commands to inspect the contents
     of the registers or the memory locations.

     DISPLAY G
     will display all the registers.

     DISPLAY 20nnn
     will display the contents of memory location "nnn"

     (You  could add a breakpoint by issuing the appropriate  "CP
     PER" instruction.)

16)  Type "BEGIN" to go to the next breakpoint (or reach the  end
     of the program).

     SHOULD  YOUR  PROGRAM ENCOUNTER AN INFINITE  LOOP  (COMPUTER
     DOESN'T SAY ANYTHING AFTER TYPING "BEGIN" OR "START"),  TYPE
     HX  TO  GET  OUT OF THIS.  YOU MAY HAVE TO DO  THIS  SEVERAL
     TIMES  AND/OR  PRESS CTRL-C TO GET THE MACHINE'S  ATTENTION.
     AT  THIS  POINT,  YOU  CAN  RELOAD THE  PROGRAM  AND  INSERT
     ADDITIONAL   BREAKPOINTS  IN  AN  ATTEMPT  TO  RESOLVE   THE
     DIFFICULTY.

17)  When your program has gone through all the breakpoints,  the
     program will give a "READY" prompt.

18)  Type
     PER END ALL

     (The breakpoints you set with the PER INSTRUCT... stuff will
     last  until  you  type this.  If you don't  remove  them  by
     typing  PER  END ALL, they will interfere with your  running
     such  programs  as HASM or the editor.  The machine  doesn't
     realize  that  the  program to which they applied  has  left
     memory and a new one has been put in its place.)

19)  You  can  return to step 8 to edit the program as needed  to
     correct any errors.

20)  You can logout by simply typing "logout"

Below  is  a printout of a console session of steps 15 to  21  as
applied to the first program we did in class (Unit 5's program).
Comments are in parentheses.

                               Procedure Two

The following instructions the procedures you need to follow when you use the
terminals  in Morgan Hall.  They are located in Morgan 102 and  Morgan
107.   Morgan 102 contains ACT5A terminals, while Morgan 107  contains
Zenith terminals.

1)   Press carriage return until the machine says "ECNet>"
(A whole bunch of junk will be printed befor this.)
Type "VM" and press carriage return.

2)   Keep pressing the carriage return key.  Eventually, you will get a list
of many terminal types and be prompted:
SELECT:

3)   If you are in Morgan 102,
Press the "T" key

If you are in Morgan 107,
Press the "v" key.

5)   You will see a banner page saying "HYDRA II" and "Educational Computing
Network."   Press  the carriage return key once  to  get  another  ECN
banner which will have "USERID" and "PASSWORD" towards the bottom.

You should now see the place where you log in.  Please go to step 4 in the
previous procedure to login and do you work.
                               Procedure Three

When you log into the mainframe from the micro lab, most of the time you will
use  "telnet"  You can also do this using "kermit."  "Kermit" was what
we  used to use for this purpose.   However, we now use "telnet" as it
is  a  little faster and usually more reliable.  However, you may wish
to use the old procedure from time to time.

Some of you may have PC's at home.  It won't be possible for you to run the
IBM  mainframe  assembler on that PC.  The PC has it's  own  assembler
which  is  different  from  this one.  More importantly,  one  of  the
objectives  of this course is that you gain experience  with  the  IBM
mainframe.  Most, if not all, of the companies that hire our graduates
want our students to learn this particular machine (the IBM mainframe)
as they use it for their business applications.

However, if you purchase a device called a modem, you can dial into the
mainframe.  Go to Academic computing with a formatted diskette  (of  a
type that fits your computer).  They will put software on it that will
call the IBM mainframe and make sure all that nasty stuff like parity,
speed, etc. is OK.

The software they will give you is kermit--so if you are dialing into the
computer, these procedures will be helpful.

(If you are in Thompson or HIggins, you may be able to arrange for a LAN card
for your computer.  Then you can use telnet and other applications  on
the PC's.)

1) Get to that familiar menu on the Stipes Hall Computer.  When it says
"Computer Science Server", move the cursor down to the line that says:
L) Languages and Academic

2) Now press "0" for Kermit


3) the computer will say Logging onto Mainframes, please wait....."

Some time later, it will say, "KERMIT" some options and then the cursor will
be  next  to  the comment that says "Enter your selection:"   At  this
time, press "2."  The machine will proceed to take you to the IBM.

4) Go to step 4 in Procedure One.

5) When you logout out of the mainframe (step 20 of the Procedure One), press
the Ctrl key and the right bracket key simultaneously.  Now, press the
shift key and the C simultaneously (capital C).

6) Type "exit" and press carriage return in response to the "Kermit-MS>"
prompt.

The machine will give you some message about not getting mainframe access,
and a request to "Strike a key when ready ..."  Press a key.
                                Procedure Four

  How to Print Files from the Mainframe Using Stipes Hall When Using Kermit

This procedure assumes you have logged in via the Procedure Three.   If you
are logging in at home with kermit, the procedure is pretty similar.

If using kermit, you can usually print by the simple expedient of typing
   TPRINT filename
to print the file you want.  You may need to download a file to print,
especially if you work at home.  The following will help you.

This note explains how to download a file from the IBM mainframe to the
micro.  You will then print it on the IBM Proprinter here.

Note that you will need to have a lab card in order to use this feature.

The procedure will involve starting up kermit on the mainframe and telling
that  kermit to send the file.  You then temporarily break out of  the
IBM  to  receive the file from the microcomputer's kermit.  Next,  you
break  into DOS to print the file.  Then you return to KERMIT  on  the
micro, and finally, return to KERMIT on the mainframe.  (See the below
steps.)

Log in to the IBM mainframe as explained earlier.  When you have a "LISTING"
file  in your directory, proceed with the following steps to print  it
out.


1.   Type "KERMIT" to the mainframe and hit return.

2.   Type "SEND nn LISTING" where "nn" is the program name.

3.   The machine will type "Ready to send."
"Please escape to local Kermit not to RECEIVE the file(s)"

4.   Press the control key and the right bracket key simultaneously.

5.   Press the shift key and the c key simultaneously.  (Capital C)

6.   You will get the prompt, "Kermit-MS>".  Type "receive" and press return.

8.   A menu will display that will show you the bytes transferred, the name
of  the file being transferred, and how it will appear on the PC.  For
example, it might say,
"60.LISTING as 60.LIS"  Remember the name after the "as".  (I'm going to
refer to this name as "xxxx".)

(If the first choice exists, the machine will choose a new name so as to
avoid overwriting something that might be important -- something  like
60.LIS0001.  This will be displayed at the bottom of the screen.   Use
it instead, if it is displayed.)

9.   When finished, you will get the prompt, "Kermit-MS>"

10.  Type "push" and press return to go temporarily to "DOS"

11.  Issue command
type xxxx > lpt2:
and press return.

(Note that "xxxx" is the name of the file on the IBM PC        created in
step 8 above.)

12.  When the file finishes transferring to the printer, you will get the
familiar DOS prompt.  Something like "F:\users\guest\61>"

The file will print on the printer associated with the computer, often a
laser  printer.   Note that since the listing is 132 columns  and  the
printers are eighty columns, the output will not be as nice as on  the
IBM mainframe printers.

13.  Type "EXIT" and press return to get back to kermit on the PC.

14.  You will get a prompt that says, "Kermit-MS>"

15.  Type "connect" and press return to get back to kermit on the mainframe.

16.  Type "exit" in the command area and press return.

17.  You are now in the normal CMS mode and can logout or do other IBM
activities as normal.

                                Procedure Five

Most of the time, you will prepare your ASSEMBLE files with XEDIT on the IBM
mainframe.  There may be times that you may wish to use some editor on
the IBM PC to prepare these files.  For example, you might wish to use
the  Turbo  Pascal  Editor  or even WordPerfect.   You  then  have  to
"upload"the file to the IBM mainframe so you can HASM it and debug it.

However, please keep in mind that you should make it your business to learn
XEDIT.  You will have to make small changes in your program.  It would
be possible to download the file to the PC, change it and send it back
up for minor changes.  However, it would be mighty inconvenient.  More
importantly, you wouldn't learn XEDIT.  You may very well have to  use
this  on  the  job.   So learn it now!!  (Note--do  NOT  use  the  TAB
character when you prepare your file.)

The procedure will involve starting up kermit on the mainframe and telling
that kermit to receove a file.  You then temporarily break out of  the
IBM to initiate the sending process on the IBM PC.  Then you return to
the mainfarme

Log in to the IBM mainframe as explained in procedure three.  When you have a
"LISTING" file in your directory, proceed with the following steps  to
print it out.

1.   Type "KERMIT" to the mainframe and hit return.

2.   Type the command "RECEIVE" and hit return.

3.   Wait for the message that says:
Kermit-CMS ready to receive.
Please escape to local Kermit now to SEND the file(s).

4.   Press the CTRL key and the right bracket key simultaneously.

5.   Press the SHIFT key and the C key simultaneously.

You should now see a prompt that says "MS-Kermit>"

6.   Type
send xxxx.yyy nn.assemble

where xxxx is the name of the file on the IBM PC and yyy is the extension on
the IBM PC.

nn is the name you want for your file on the mainframe

7.   You will see a prompt tht will report the file is being sent as
     nn.assemble and allow you to observe the progress of file transmission.

Soon, you will see a message that says "Sending: Completed"

and you will have the "MS-Kermit>" prompt.

8.   Type "connect" to the Kermit on the PC.

9.   You will see the "Kermit-CMS>" prompt from the mainframe.
Type "EXIT" to get out of this.

10.  Type "convert nn" where nn is the name you gave the CMS file in step
six.