IUP Computer Science
CO 300 Assembly Language
Spring 1998

Program #4 (Due 1 April 1998)

Write an assembly language program that can translate an arbitrary logical name into its equivalence string, determine how long the translation takes (in terms of CPU time used) and measure the amount of buffered I/O associated with the resulting displays.

To write this program you will have to use two system services: one that can determine how much CPU time your process has used and how much buffered I/O has occurred and one that can translate a logical name. The first task includes two of the many things that the GETJPIW system service can do. The second task can be done with the TRNLNM system service. Use of these system services is described in the handouts and use of the $GETJPIW_S macro was illustrated in class ($TRNLNM_S is similar). Specific requirements for your program and its execution follow.

  1. The program should repeated read in logical names to be translated and act on them until an empty line is entered.
  2. Prompt for a logical name. After it is read in, get the CPU time. Then translate the logical name 1000 times; and get the CPU time again, as well as the buffered I/O count. The reason for doing 1000 translations is that it takes so little time to do one translation (usually about 0.00007 sec) that your program cannot detect the CPU time used on a single translation.
  3. After translating one logical name, the program must display the equivalence string, the name of the table in which the logical name was found, the time in ticks (hundredth of a second) for 1000 translations, and the total buffered I/O count. This display should have a consistent form and be readable for each translation.
  4. Because many logical names are defined in terms of other logical names, you should attempt to translate either the entire equivalence string or the beginning part of it up to the first colon into another logical name. Do this by extracting all or part of the equivalence string and doing steps #2 and #3 over again. Repeat these actions until the equivalence string no longer contains a logical name.
  5. You should test your program by trying logical names from several different logical name tables. If the entered logical name is NOT found in any logical name table, the program should display an error message and prompt again.

Handin a .LIS listing of the program and the output from the program's execution, captured with CARBON.

Notes:

You must use LNM$FILE_DEV as the starting table for $TRNLNM_S.

Some logical names (such as DISK$LOGIN) translate to two or more equivalence strings. Don't worry about such situations. You are only required to display one equivalence string for each logical name. Also, just use the first equivalence string to look for subsequent logical names.

You should expect the number of buffered I/O actions to be different each time you run the program. This is because you are counting total buffered I/O actions since logging in.

Do not count the buffered I/O 1000 times. Only logical names are to be translated 1000 times each.

Here are some logical names that you might try:
    BOTH:
    SYS$LIBRARY
    LDIR$CO
    JIM_WOLFE
    X11
    PROJECT


Difficult Extra Credit: Add an element to the display that shows how long you have been logged in (measured in minutes) at the time you display the results of the logical name translation. This is not an easy number to deal with. I would settle for an approximation of the number of minutes (correct to within one minute). You will need to use the GETTIM system service to do this extra credit - ask for a GETTIM handout if you want to try this.

Easy Extra Credit: Display the member portion of your user identification code (UIC) at the time you display the results of the logical name translation. The member portion of your UIC is what determines what your username is! The member portion is the first two bytes of the UIC.