Application Development Using Assembler
Part Three - Challenge #07

Background:

Assembler = Speed.

There are a number of cases in large enterprises where speed is paramount over ease of programming. There may not be many assembler programs. However, any assembler program supporting large enterprise business applications are most likely extremely critical to the enterprise.

Learning assembler language programming is not easy and requires lots of practice. However, if you like the technical details of how computers really work and you want a technical skill that can separate you from other computer technicians, then developing assembler skills provides both.

The challenge will expose you to assembler language in the IBM Z environment. A subsequent challenge will provide a bit more detail about assembler in the IBM Z environment.

Challenge:

Upon successful execution, assembler code compile and execution prints "Hi! I can count fast", then will loop 10 times adding 1 to a total and printing each new total value.

  1. Edit hlq.SOURCE
  2. Select member asmpgm - s asmpgm
  3. copy 'zos.mtm2017.public.source(asmpgm)'
  4. sub; =sd; st

Review of JCL job output shows reason for compile failure and subsequent execution failure.

The compile fails with a minor syntax problem. You do not need to be an experienced assembler language programmer to correct the compile problem. Correction requires review of the source code pattern to identify a mismatch where the issue is a matter of a misspelling. The compiler output error message, ASMA044E, will provide a big hint. Focus on the assembler label associated with "Hi! I can count fast" near the bottom of the source on a DC (Define Constant) instruction. Then look for an MVC, Move Character, instruction which moves those characters to an area that is printed using an assembler PUT statement.

What is an "assembler program label"?

An assembler program label is a programmer selected name starting in column 1. When the program is compiled the label is translated into an address referencing that location in the code, also known as the program "offset" from the beginning of the program instructions.

Once the minor assembler code problem is fixed, then P3.OUTPUT(#07) will write:
Hi! I can count very fast.
00000001 
00000002 
00000003 
00000004 
00000005 
00000006 
00000007 
00000008 
00000009 
00000010 			

edit source(asmpgm) and modify the in-stream source code to successfully compile and execute.
  enter hilite asm to hilite assembler reserved words

submit and review JCL job output and P3.OUTPUT(#07) for success.

Next: Challenge #08