Machine Instructions
Part Three - Challenge #10

Background:

Software program execution requires hardware. Computing hardware consist of complex electronics. Electronic transistors can be either 0V (Volt) or greater than 0V. The 0V is represented by a binary 0 and the greater than 0V is represented by a binary 1. Therefore, computers process binary bits (0V or +V) at the lowest level.

Hardware architectures differ. Every processor or processor family has its own machine code instruction set. Instructions are patterns of bits that by physical design correspond to different commands to the machine.

It is not practical to write a software program using machine code instructions just like it is not practical to enter data as binary strings. Each hardware architectue includes an Assembler with Assembler Language instruction mnemonics that translate into architecture dependent binary strings. Assembler mnemonics generate machine code. Most software programs are written in High-Level Languages which are compiled into assembler mnemonics which in turn generate the hardware dependent machine code.

Java is an exception. Java is compiled into byte code. A Java Virtual Machine, JVM, exists to execute the byte code. Each hardware architecture has a machine dependent JVM available to process the Java byte code. This is why Java executable code can be considered portable between hardware architectures without the need to compile into native machine code. However, the translation abstraction level adds some significant overhead.

Very large enterprises and software development companies write applications in Assembler because processing speed is paramount. Also, understanding assembler provides deep machine insight that can prove valuable to clearly identify root cause of complex problems.

Your challenge:

ASMPGM assembler program from challenge #07 will be used in this challenge to explore Assembler mnemonics, machine code instructions, and CPU registers role in processing the machine code instructions

Take the following actions to familiarize yourself with TSO TEST environment.

  • Exit ISPF to TSO Ready prompt, =x
  • If interim screen diplayed, enter 2 to delete log
  • Use the TSO TEST facility to load ASMPGM executable - TEST 'CC#####.LOAD(ASMPGM)'
  • List Program Status Word before executing program - listpsw
  • List registers before executing program - list 0r:15r
  • Set breakpoint at displacement offset +14 at +14 (list 0r:15r ; go)
  • Set breakpoint at displacement offset +56 at +56 (list 0r:15r ; go)
  • Set breakpoint at displacement offset +60 at +60 (list 0r:15r ; go)
  • Set breakpoint at displacement offset +A2 at +A2 (list 0r:15r ; go)
  • Start the executiongo then enter to continue at each breakpoint stop
  • Terminate TEST end , then return to ISPF ispf

ZOS.PUBLIC.ASMPGM.LISTING is the ASMPGM compile listing with nmemonics and respective machine code instruction. This same listing has the output of the TSO TEST environment you just explored following the compile listing.

Note: Please DO NOT Edit ZOS.PUBLIC.ASMPGM.LISTING. It cannot be changed and it could prohibit others from viewing it which would require your session to be cancelled to free the listing for others to view.

View (v) ZOS.PUBLIC.ASMPGM.LISTING to observe the following:

  • Listing line #2 and #3 - note the Address which is the ASMPGM Base Address and Length of program
  • Listing line #7 - column heading. The challenge instructions will reference these column headings.
  • Stmt column - decimal - "+" indicates statement inserted as a result of assembler MACRO or system symbol
  • LOC column - relative program location in hexadecimal
  • Object code column - machine code instructions in hexadecimal
  • Addr1 Addr2 columns - relative program locations in hexadecimal used by machine instruction
  • Listing line #154 to #174 - Program Literals used, when (stmt in decimal), and how.
  • Listing line #177 to #193 - Registers used, when (stmt in decimal, and how.
  • And yes, this listing has the challenge 7 code correction. Challenge 7 enable you to study this code in preparation for this challenge.
  • Starting at line 195 is the same TSO TEST results you manually explored

Following these questions with multiple choice answers, you will be instructed to execute a routine to collect your answers.

****************************************************
* Question #1                                      *
*                                                  *
* What is ASMPGM first machine operation code      *
* instruction?                                     *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) 00028DC0                                      *
* 2) USING                                         *
* 3) 47                                            *
* 4) CSECT                                         *
* 5) F0                                            *
* 6) B                                             *
*                                                  *
****************************************************
* Question #2                                      *
*                                                  *
* What is ASMPGM Assembler Mnemonic at +56?        *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) 00DA2618                                      *
* 2) 1B                                            *
* 3) 22                                            *
* 4) None                                          *
* 5) SR                                            *
* 6) R2                                            *
*                                                  *
****************************************************
* Question #3                                      *
*                                                  *
* What is ASMPGM machine operation code            *
* instruction +60?                                 *
*                                                  *
* Enter the number of the best answer              *
*                                                  *
* 1) 4E                                            *
* 2) CVD                                           *
* 3) LOOP                                          *
* 4) DS                                            *
* 5) 0H                                            *
* 6) 00DA2618                                      *
*                                                  *
****************************************************
* Question #4                                      *
*                                                  *
* What is ASMPGM Assembler Mnemonic at +A2?        *
*                                                  *
* Enter the number of the best answer              *
*                                                  *
* 1) 00028E4A                                      *
* 2) 0H                                            *
* 3) DS                                            *
* 4) EXIT                                          *
* 5) 58                                            *
* 6) L                                             *
*                                                  *
****************************************************
* Question #5                                      *
*                                                  *
* What is the first ASMPGM machine code            *
* instruction to be executed by ASMPGM?            *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) B       SETUP                                 *
* 2) CSECT                                         *
* 3) RO	     EQU 0                                 *
* 4) STM     RETREG,BASEREG,12(SAVEREG)            *
* 5) USING   ASMPGM,ENTRYREG                       *
* 6) 47F0F014                                      *
*                                                  *
****************************************************
* Question #6                                      *
*                                                  *
* Which ASMPGM register contains the result of     *
* the add instruction?                             *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) 1                                             *
* 2) 2                                             *
* 3) 3                                             *
* 4) 7                                             *
* 5) 15                                             *
* 6) 6                                             *
*                                                  *
****************************************************
* Question #7                                      *
*                                                  *
* What ASMPGM displacement offset is used to       *
* reference the character literal 'abc             *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) +14                                           *
* 2) +4E                                           *
* 3) +151                                          *
* 4) +228                                          *
* 5) +53                                           *
* 6) +60                                           *
*                                                  *
****************************************************
* Question #8                                      *
*                                                  *
* What ASMPGM displacement offset has the program  *
* compile date?                                    *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) +4                                            *
* 2) +20                                           *
* 3) +C                                            *
* 4) +21                                           *
* 5) +0                                            *
* 6) +14                                           *
*                                                  *
****************************************************
* Question #9                                      *
*                                                  *
* What is the ASMPGM hex displacement offset of    *
* the source code SETUP label containing STM       *
* assembler mnemonic?                              *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) +0                                            *
* 2) +C                                            *
* 3) +F                                            *
* 4) +14                                           *
* 5) +18                                           *
* 6) +32                                           *
*                                                  *
****************************************************
* Question #10                                     *
*                                                  *
* What Assembler Mnemonic places x'A' in register 9*
* as displayed at breakpoint +A2                   *
*                                                  *
* Enter the number of your answer                  *
*                                                  *
* 1) ST                                            *
* 2) 58                                            *
* 3) L                                             *
* 4) DS                                            *
* 5) LA                                            *
* 6) 41                                            *
*                                                  *
****************************************************

Enter =6 , then enter asmquiz from the ISPF Command Shell panel

Each execution of asmquiz will replace previous answers.

Next: Challenge #11