z390 Portable Mainframe Assembler and Emulator

z390 Mainframe Assembler
Coding Contest for Programmers

Automated Software Tools Corporation
Welcome to the z390 Mainframe Assembler Coding Contest.  The primary objective of this contest is to have some fun and learn more about mainframe assembler.  This contest is open to anyone interested in learning about mainframe assembler and/or sharing their knowledge about mainframe assembler.  You can submit new problems or solutions to problems already posted that you think are better.  The top ranked solutions are posted on this site along with the author's name.  Below you will find links to all the coding problems posted to date, plus the top ranked solutions submitted with source code and generated output.  Solutions can be submitted using a shared macro ZMFACC which is portable across z390, Hercules MVS 3.8, z/OS, z/VM CMS, and VSE.  More.    

Reference Links

The z390 open source Portable Mainframe Assembler project encourages all developers working with IBM  mainframe systems to learn High Level mainframe assembler (HLASM for short).  To that end the z390 project is sponsoring the z390 Mainframe Assembler Coding Contest open to everyone.  For a limited time volunteers are being solicited to serve as members of a 3 member judges panel to rank submitted solutions  The top three ranked solutions for each posted problem will be listed here along with the name of the programmer and their institution of choice.  Rankings will be based on the specific requirements such as speed, storage, or best practices.  New problems and new rankings will be updated as soon as judges have reviewed current pending submittals. 

Hope you enjoy the contest!  All questions and suggestions welcome.

Don Higgins, President
Automated Software Tools
don@higgins.net
don-higgins.net

Current z390 Mainframe Assembler Coding Contest Problems and Solutions:

  1. Swap two 20 byte fields optimized for speed.
    Submitted by Don Higgins University of South Florida
    1. P1RAFA1.MLC/LOG by Rafa Pereira - swaps 2 fields with 2 MVC's
    2. P1C1.MLC/LOG by Chris - 3 XC instructions
    3. P1DSH1.MLC/LOG by Don Higgins University of South Florida - 3 MVC's
    4. P1DSH1A.MLC/LOG by Don Higgins University of South Florida - LM, STM
  2. Swap general purpose register 0 and 1 without using any other register or storage areas.
    Submitted by Don Higgins for University of South Florida
    1. P2MD1.MLC/LOG by Mark Dixon University of Western Australia - 3 XR'S (could also be XGR)
  3. Convert memory bytes to hex display bytes.
    Submitted by Melvyn Maltz
    1. P3MM1.MLC/LOG by Melvyn Maltz - single TROT (CC3 retry added per Michael Poil)
    2. P3LKM1.MLC/LOG by Lindy Mayfield - loop to convert byte at a time with no table
    3. P3DW1.MLC/LOG by David Wilkinson - unpack and TR using 16 byte table for 4 byte parm
  4. Sort array of full word integers using fastest execution method.
    Submitted by Don Higgins University of South Florida
    1. P4RJ1.MLC/LOG by Mats Broberg, Roland Johansson, and Seb Sweden - improved version of Quicksort using 685 instructions.
    2. P4APN2.MLC/LOG by Alfred Nykolya - counts sort using 854 instructions
    3. P4DW1.MLC/LOG by David Wilkinson - improved Quicksort using 1057 instructions
    4. P4RAFA2.MLC/LOG by Rafa Pereira - improved Quicksort using 1380 instructions
    5. P4AN1.MLC/LOG by Alfred Nykolyn -shell sort sorts 20 elements using 1532 instr.
    6. P4DSH1.MLC/LOG by Don Higgins University of South Florida - bubble sort using 2610 instr.
  5. Convert display hex characters to binary bytes.
    Submitted by Mark Dixon University of Western Australia
    1. P5DW1.MLC/LOG by David Wilkinson - using single TROT with truncated table to save memory
    2. P5MM1.MLC/LOG by Melvyn Maltz - using TR and PACK
  6. Given a byte, create 8 EBCDIC zero and one characters displaying the individual bits in the byte.
    Submitted by John R. Erhman University of Illinois
    1. P6RW1.MLC/LOG by Ray Wong - exactly  5 instructions to convert up to 32 bytes
    2. P6BR1.MLC/LOG by Bob Rutledge - 6 register instruction loop and single store
    3. P6PJF1.MLC/LOG by Peter J. Farley - 5 instruction loop
    4. P6PL1.MLC/LOG by Philippe Leite - first solution with 9 instruction loop
  7. Calculate the result of 311/99 using single precision hexadecimal floating point and display the result in decimal scientific notation with the correct number of significant digits without using CTD conversion macro. Submitted by Don Higgins University of South Florida
    1. P7EH1.MLC/LOG by John Erhman - using AW un-normalized add to align bits
    2. ?
    3. ?
  8. Calculate and display as many significant digits of PI as possible using extended floating point instructions and display the result in decimal scientific notation using the CTD and SNAP macro services.
    Submitted by Don Higgins University of South Florida
    1. P8MM1.MLC/LOG by Melvyn Maltz - using Gregory/Leibniz/Machin arctan series
    2. P8LM1.MLC/LOG by Lindy Mayfield - using Rexx solution series with all positive terms
    3. ?
  9. Convert DC PL8'-1234567.90" to DC C"  ($1,234,567.90)'.
    Submitted by Mark Dixon University of Western Australia
    1. P9MM2.MLC/LOG by Melvyn Maltz - EDMK with $() improved per Benyamin Dissen
  10. Code instructions required to convert any unsigned 128 bit integer value in even/odd 64 bit general purpose register pair generated by MLG or MLGR to EBCDIC decimal display character format using as few basic instructions as possible and no library services such as z390 CTD.  Note 2**127 has 39 significant digits, extended floating point only supports 34 significant digits, and packed decimal only supports 31 significant digits.  Please submit solutions using the ZMFACC macro for portability across platforms.
    Submitted by Don Higgins University of South Florida
    1. P10MB1.MLC/LOG by Mats Broberg at SEB using fewer instr. and single ED (Note execution of this solution on z390 requires latest z390 v1.3.08h PTF to fix overflow bug)
    2. P10DSH1.MLC/LOG by Don Higgins - using about 27 instructions and no loops
    3. ?
    4. ?.
  11. Code two routines: one to add 8 byte opcode mnemonic key and table entry address to a hash table and another routine to retrieve the address of opcode table entry given the 8 byte mnemonic as key.  To test the efficiency of the two routines a table of the 856 z390 mnemonic machine instructions and their hex opcodes is provided in a copybook here, and a model program using the ZMFACC macro to build the table and then fetch all the opcodes 100 times is provided here.  You can run the model program without change to verify it works in your environment before adding your code.  It executes 689,307 instructions in the z390 environment doing nothing in the add routine and simply returning the input key address via LR in the find routine.  See the resulting log file here.   The fastest 3 solutions supporting random access will be posted.

    1. P11DW1.MLC/LOG by David Wilkinson using TR to convert first byte to 0-26 and hash table size of 35,393.  952,200 total instructions.

    2. P11WR1.MLC/LOG by Werner Rams using linked list to handle duplicates requiring approximately only 12 * total entries for hash tables.  1876139 total instr.

    3. P11DSH1.MLC/LOG by Don Higgins using P11FIND1.MLC/LOG to find hash table with no dup keys (table size found 48011 which has density of < 2% for 856 given keys). 1041979 total instr.

    4. P11DSH2.MLC/LOG by Don Higgins using P11FIND2.MLC/LOG to find hash table with max of 2 duplicate key searches per entry (table size found 3473 which has density of  25% for 856 given keys).  This solution saves 180k storage for 10% increase in instruction count.).  1181713 total instr.

  12. Calculate the mean and standard deviation for a set of 500000 response times using a precision of .001. Assume each value may not exceed 1000 seconds- by Tony Matharu.

    1. P12DSH1.MLC/LOG by Don Higgins using BFP  to calc standard. deviation for (1, 2, 3, 6) = 1,87

    2. P12DSH2.MLC/LOG by Don Higgins using HFP to calc standard. deviation for (1, 2, 3, 6) = 1,87

    3. P12DSH3.MLC/LOG by Don Higgins using DFP to calc standard. deviation for (1, 2, 3, 6) = 1,87 Note this solution uses new z390 proto-type millicode for missing SQXTR instruction.

  13. Given a decimal number with 2 decimal places representing the total cost of one or more items and another decimal number representing the quantify, calculate the unit price with 2 decimal places rounded half up?  Problem was derived from question posted on IBM Mainframe Assembler-List by Ludmila Koganer.

    1. P13SC1.MLC/LOG by Steve Comstock - using 5 packed decimal instructions

    2. P13DSH1.MLC/LOG by Don Higgins - using 7 DFP decimal floating point instructions

    3. ?

  14. Code a macro assembler program to calculate the value of the Ackerman function a(4,1) = 65533.  The Ackerman function a(m,n) is  a recursively defined function.  If m = 0, then a(m, n) = n+1.  If m > 0 and n = 0, then a(m, n) = a(m-1,1).  If m> 0 and n > 0, then a(m,n) = a(m-1,a(m,n-1)).  Submitted by Don Higgins:

    1. P14MW1.MLC/LOG by Martin Ward - using PD instructions to calculate solutions up to 31digits

    2. P14DSH1.MLC/LOG by Don Higgins - using recursive macro code only (limited to 32 bit integers)

    3. ?

  15. Given a number of the form 12345678.1234567, divide it by another number of the same format, rounding to 7 digits after decimal point using packed decimal.  Submitted by Ludmila Koganer,

    1. P15WR1.MLC/LOG by Werner Rams using DP and SRP

    2. P15DSH1.MLC/LOG by Don Higgins using DP, AP, and CP

    3. ?

  16. Given an input number 1 to x.  Given a bit array of x bits where x is multiple of 8. (1) Code a routine to convert the input number into a bit setting in the bit array.  (2) Code a routine to display the "one" bits as clrresponding decimal numbers.  Submitted by Jim Connelley.

    1. P16WR1.MLC/LOG by Werner Rams using simpler faster bit table for primes from 3 to 97

    2. P16DSH1.MLC/LOG by Don Higgins using SETBIT and TESTBIT macro for primes 3 to 97

    3. ?

    4. ?

  17. Given the source character string DC CL80'LABEL     OPCODE PARMS' code a transparent space compression routine to create compressed string and a decompression routine to expand the compressed string back to original.  The wining solution will optimize speed and size.

    1. P17DW1.MLC/LOG by David Wilkinson compress and decompress using TRT and CRB for total of 628 instructions.

    2. P17WR1.MLC/LOG by Werner Rams compresses and decompresses 3 records using CLCL to find end of duplicate spaces for total of 827 instructions.

    3. ?

  18. Write a benchmark program to calculate the percent  performance improvement to 2 decimal places when replacing the following loop code:

    LOOP DS 0H
                BCTR      R1,0
    *** APPLICATION CODE COMMENTED OUT FOR TEST ***
                LTR         R1,R1
                JNE         LOOP

    with the following optimized loop code using the new z10 compare and branch opcode code CIJNE:

    LOOP DS 0H
                BCTR    R1,0
    *** APPLICATION CODE COMMENTED OUT FOR TEST ***
                CIJNE  R1,0,LOOP

    The performance improvement in this case comes from replacing 2 instruction cycles fetching a total of 6 bytes with a single instruction cycle fetching 6 bytes.  You can use whatever interval timing method is available on your system such as TIME BIN (requires running standalone).  The initial values in R1 must be set to perform enough iterations to reduce the timing error due to interval timer precision etc.  To code and unit test solution on z390 you will need the latest version v1.4.01+ with the new z10 opcode support.  To run the real test, you will need an IBM z10 mainframe and updated HLASM. 

    1. P18DSH1.MLC/LOG - solution using new DAT.MLC interval timer display showing time of day JDBC time-stamp format down to nano-seconds, total instruction counts, and MIPS.  Running z390 v1.4.01a on Intel 2.1 Duo Core chip, the MIP rates were 8.7 and 7.3 for 15% reduction in MIP rate but there was also an 8% reduction in elapsed time in nano-seconds using the z10 compare and branch loop with BCTR, CIJNE versus the BCTR, LTR, JNZ loop.  The 2 instruction loop has lower MIP rate but faster execution time than the 3 instruction loop.

    2.  

    3.  

  19. Write code to find the last non-blank character in an 80 byte line of text with the fewest instructions.

    1.  P19WR1.MLC/LOG - by Werner Rams using TRTR executing 28 instructions.  Honorable mention also goes to Steve (S.R.K  www.mysrk.com/) for email suggesting TRTR before Werner submitted complete program the same day.

    2.  

    3.  

  20.  Write integer random number generator and test program to determine the longest sequence without duplication that it produces for a given seed number.  The longest sequence of non-repeating pseudo-random numbers wins.

    1.  P20WR1 - by Werner Rams using published random number reference (runs for hours)

    2.  

  21. Code a binary search and test it, by searching in turn, for all of the elements in a 20 entry sorted integer array containing the values (1, 3, 7, 9, 13, 18, 19, 20, 25, 27, 30, 31, 32, 40, 41, 45, 47, 50, 65, 80) plus the following values not in the array: 0, 28, and 99.  Submitted by David Wilkinson.

    1. P21DW1.MLC/LOG - by David Wilkinson using 1649 instructions

    2. ?

    3. ?

  22. Code fastest instruction sequence to count bits in an arbitrary string of bytes using currently available z/Architecture instructions prior to new instruction coming with z196 which is estimated to be 5 times faster.

    1. P22FS1.MLC/LOG - by Fritz Schneider using 120 byte block loop with MVC, TR, AL, and BXLE for total of 194 instructions for 208 character string.

    2. P22GH1.MLC/LOG - by Glen Herrmannsfeldt using loop with LG, SRLG, NGR, AGR, and BXLE for total of 630 instructions for 208 character string.

    3. P22MM1.MLC/LOG - by Melvyn Maltz using single TROO followed by loop with MVC, ASI, and BXLE for total of 897 instructions for 208 character string.

    4. P22DSH1.MLC/LOG - by Don Higgins using loop with IC, IC, AR, and BXLE for total of 904 instructions for 208 character string.

    Many thanks to David Bond for running these 4 solutions on a real z10-EC machine with the following results:

    1) Glen Herrmannsfeldt 0.127 microseconds
    2) Fritz Schneider 0.254 microseconds
    3) Don Higgins 0.452 microseconds
    4) Melvyn Maltz 8.102 microseconds

    This just proves that pipelining and register versus main memory instruction and data accesses really do matter for maximum performance on machines with caches etc.

    On 08/06/10 a test version of z390.jar with new POPCNT instruction was added based on SHARE Presentation on 08/04/10 by Don Greiner here:

    http://share.confex.com/share/115/webprogram/Session7034.html

    Included with this z390 test version are 3 test programs:

    1.  TESTINS1.MLC - test assembly of all opcodes including POPCNT

    2.  TESTINS4.MLC - regression test POPCNT instruction (first of z196 opcodes)

    3.  P22DSH2.MLC/LOG - solution to problem #22 using POPCNT which executes 282 instructions including support for odd bytes at start and end.  The test files including updated java sources are here:

    http://www.z390.org/test/z390_popcnt_test.zip

 

 

 

Current Problem Category Index

  • Benchmark Timing - 18
  • Boolean logic
  • Branch logic
  • Comparisons
  • Compression and de-compression - 17
  • Converting Data
    • Conversion to display characters - 3, 6, 9, 10
    • Conversion of display characters to binary - 5
  • Encryption and decryption
  • File access methods
  • Floating point calculations
    • Binary Floating Point (BFP)
    • Calculate constants - 12  (pi, e, golden ratio, etc.)
    • Decimal Floating Point (DFP) -13
    • Extreme precision arithmetic
    • Hexadecimal Floating Point (HFP)- 7
    • Rounding - 13
    • Statistics - 8 (Variance, Standard Deviation, Present Value, Interest rate, etc.)
    • Trig functions
  • Heuristics
  • Integers (32, 64, 128 bit)
    • Calculate series: Prime numbers, Harmonic numbers, Bernoulli Numbers, Fibonacci, Perfect Numbers
    • Combinations
    • Date math
    • Factoring
  • Manipulating data structures (add, delete, change, and find entries in lists, tables, stacks, queues, etc.)
    • Merging
    • Searching - 11
    • Sorting - 4
    • String functions - 19
    • Swapping - 1, 2
  • Packed Decimal - 13, 15
  • Random numbers
  • Recursive functions - 14
  • Totally useless just for fun

  How to submit a new problem

To submit a new problem for the contest, send a brief description of the problem along with your name and alma mater to ZMFACC Submit Problem.  Remember the problem must be solvable using less than 100 problem state mainframe assembler instructions.

How to submit a solution to a problem

To submit a solution for a problem attach the program code in an ASCII text file format and send it along with your name and optional alma mater to ZMFACC Submit Solution.  All problems must be solvable using 100 or less mainframe problem state instructions.   Solutions must be submitted in the form of a single ASCII  text type source program file which can be assembled, linked, and executed using the latest version of z390 on Windows or Linux for evaluation by contest judges.  Any z/Architecture problem state instruction omissions or bugs should be reported via the z390 RPI Request Form.  The 4 best solutions in the opinion of the judges (currently me) will be posted on this contest web page.  All solutions submitted will be posted on the contest group email for discussion by the members.  Originality and timing count!  The first 4 different solutions submitted will be the winners unless different solutions submitted later are deemed by the judges to warrant ranking in the top 4.  Unless otherwise states, problem goals in order of importance are execution speed, minimum memory requirements, and best coding practices.

Download ZMFACC macro for your OS environment

Each solution must use ZMFACC macro calls to define the start and end of the code, input, and output sections.   Click on the link for any of the ranked solutions already submitted for examples such as P6RW1.MLC.  The ZMFACC macro is used to isolate the solution code from the specific operating environment used to assemble, link, and execute it.  The default target operating system environment for the ZMFACC macro is z390.  The macro now supports the following additional operating system environments by setting RUNSYS on the first call to ZMFACC as follows:

  • Download ZMFACC macro source generalized version supporting the following environments:
    • RUNSYS=390        - default z390 generates ASCII output on log file via WTO and SNAP.
    • RUNSYS=MVS - generates EBCDIC output on SYSPRINT via WTO and SNAP.
    • RUNSYS=ZOS  - generates EBCDIC output on SYSPRINT via WTO and SNAP.
    • RUNSYS=CMS - generates EBCDIC output via WRTERM and LINEDIT.
    • RUNSYS=VSE  - generate EBCDIC output via WTO and PDUMP.
      If the RUNSYS= keyword is not specified on the first ZMFACC macro call, then the target operating system can be specified by externally setting global &SYSPARM value via execution options.  For example, using z390 assembler, you can add options "SYSPARM(RUNSYS=MVS)" and SYSMAC(mvs\maclib) to override the default 390 option and generate code for execution on Hercules MVS 3.8 using the MVS 3.8 macro library.
  • For more information on the different operating system environments for assembler see the following links:
    • z390 - open source Java emulator running under J2SE for Windows and Linux
    • Hercules - open source C emulator for Windows and Linux
    • z/OS - IBM licensed OS for System z (Use RUNSYS=ZOS uses same code as MVS)
    • zVM - IBM licensed OS to run other guest OS's and CMS (use RUNSYS=CMS)
    • VSE - IBM licensed Virtual Storage Extended OS (use RUNSYS=VSE - not tested yet)
    • z/Linux - IBM licensed Linux OS for System z (Since J2SE and z390 run on Ubuntu Linux  for Intel PC's, I assume z390 could be run on z/Linux mainframe but no testing started yet?  Note z390 Java code is aware of Windows versus Linux environment and makes some changes such as file separator, system utilities, and system commands, etc.)

Participants should use the ZMFACC macro to assemble, link, and execute solutions in their own environment before submitting them.  Submitted solutions should then be portable to all the other environments with the exception of solutions using newer problem state instructions or addressing modes not currently supported in some hardware and software environments.  If there is not a customized ZMFACC macro yet for your environment, please download the current ZMFACC macro, customize it to detect and run in your environment, and submit it to ZMFACC Submit Macro along with your name and the target environment it has been tested on for use by other participants.  Thanks!

Join the contest email group for discussion of problems and solutions

http://tech.groups.yahoo.com/group/z390-assembler-contest/

This email group is for the use of participants who wish to discuss problems and solutions.  All email posted to this group is reviewed by moderators to verify it is related to the contest and is no spam. 

Volunteer to help part time as a moderator or judge

Send an email to ZMFACC Volunteer with your name and what you would like to volunteer for.  Several backup moderators for the email group would be helpful to check for pending posts and keep the mail flowing.  A few contest solution judges willing to evaluate the relative merits of submitted solutions would also be helpful. 

What's New Update Log

  • 08/06/10

    08/02/10

    • P22FS1.MLC/LOG - by Fritz Schneider using 120 byte block loop with MVC, TR, AL, and BXLE for total of 194 instructions for 208 character string.

    • P22GH1.MLC/LOG - by Glen Herrmannsfeldt using loop with LG, SRLG, NGR, AGR, and BXLE for total of 630 instructions for 208 character string.

    • P22MM1.MLC/LOG - by Melvyn Maltz using single TROO followed by loop with MVC, ASI, and BXLE for total of 897 instructions for 208 haracter string.

    • P22DSH1.MLC/LOG - by Don Higgins using loop with IC, IC, AR, and BXLE for total of 904 instructions for 208 character string.

  • 07/30/10
    • New problem #22 Code fastest instruction sequence to count bits in an arbitrary string of bytes using currently available z/Architecture instructions prior to new instruction coming with z196 which is estimated to be 5 times faster.
  • 09/21/08
    • P11DW1.MLC/LOG by David Wilkinson using TR to convert first byte to 0-26 and hash table size of 35,393.  952,200 total instructions.
  • 08/27/08
    • P5DW1.MLC/LOG by David Wilkinson - using single TROT with truncated table to save memory
  • 08/14/08
  • 08/11/08
    • P17DW1.MLC/LOG by David Wilkinson compress and decompress using TRT and CRB for total of 628 instructions (1st place)
    • Problem #21 binary search submitted by David Wilkinson.
  • 08/08/08
    • P3DW1.MLC/LOG by David Wilkinson - unpack and TR using 16 byte table for 4 byte parm
    • P4DW1.MLC/LOG by David Wilkinson - improved Quicksort using 1057 instructions (2nd place)
  • 06/09/08
    • P7EH1.MLC/LOG by John Erhman - has been updated to remove work-around for AW since the latsest z390 PTF v1.4.01f now has support for AW and all the HFP unnormalized floating point instructions.
    • An email quiz question was posted about the most efficient way to test if the left most bit in any mask is on.  The solution is to shift the mask 1 bit right and compare it to the selected bits AND'd with mask.  If the selected bits are high then the high bit must be on.
  • 04/11/08
    • P20WR1 - by Werner Rams using published random number reference (runs for hours)
  • 03/28/08
    •  P19WR1.MLC/LOG - by Werner Rams using TRTR executing 28 instructions.  Note honorable mention goes to Steve (S.R.K  www.mysrk.com/) for email suggesting TRTR before Werner submitted complete program the same day.

    • New problem #20 - Write integer random number generator and test program to determine the longest sequence without duplication that it produces for a given seed number.  The longest sequence of non-repeating pseudo-random numbers wins.

  • 03/21/08
    • P18DSH1.MLC/LOG - solution using new DAT.MLC interval timer display showing time of day JDBC time-stamp format down to nano-seconds, total instruction counts, and MIPS.  Running z390 v1.4.01a on Intel 2.1 Duo Core chip, the MIP rates were 8.7 and 7.3 for 15% reduction in MIP rate but there was also an 8% reduction in elapsed time in nano-seconds using the z10 compare and branch loop with BCTR, CIJNE versus the BCTR, LTR, JNZ loop.  The 2 instruction loop has lower MIP rate but faster execution time than the 3 instruction loop.
    • Add new problem #19 to find last non-blank character in a line of text with fewest instructions.
  • 03/09/08
    • Correct my error on the number of instructions executed for solution to problem 17 by Werner Rams.  The correct number is 827. 
  • 03/07/08
    • P17WR1.MLC/LOG by Werner Rams compresses and decompresses 3 records using CLCL to find end of duplicate characters for total of 827 instructions.
    • Add new problem #18 to calculate performance gain using new z10 compare and branch instructions.
  • 02/23/08
    • P16WR1.MLC/LOG by Werner Rams using simpler faster bit table for primes from 3 to 97
  • 02/22/08
  • 02/05/08
    • P11WR1.MLC/LOG by Werner Rams using linked list to handle duplicates requiring approximately only 12 * number of table entries for hash tables. 1876139 total instr.
  • 01/31/08
    • Correct comments on problem #14 solution by Martin Ward.  The solution supports up to 31 digits.
    • Add Current Problem Category Index thanks to suggestions from several participants.
  • 01/29/08
    • Add new problem #15 to calculate 15 digit packed decimal rounded to 7 decimal places.
    • Post question about potential usefulness of problem techniques and suggested categories for additional problems.
    • Add new problem #16 to store and fetch numbers from bit array by Jim Connelley.
    • P14MW1.MLC/LOG by Martin Ward - using PD instructions to calculate solutions up to 15 digits

    • P14DSH1.MLC/LOG by Don Higgins - using recursive macro code only (limited to 32 bit integers)

  • 01/27/08
    • Add new problem #14 to calculate the Ackerman recursive function a(4,1) = 65533.
  • 01/26/08
    • Correct problem #13 statement to clarify total cost is for one or more items and quantify is the total number of items to be divided into total cost to calculate unit price.
    • P13DSH1.MLC/LOG by Don Higgins - using 7 DFP decimal floating point instructions
  • 01/25/08
  • 01/24/08
    • New problem 13 - Given a decimal number with 2 decimal places representing the total cost of an item and another decimal number representing the quantify, calculate the unit price with 2 decimal places rounded half up?  Problem was derived from question posted on IBM Mainframe Assembler-List by Ludmila Koganer.  I believe that using Decimal Floating Point may be the most straight forward using the fewest instructions, but may not be the most efficient.
    • P11DSH2.MLC/LOG by Don Higgins using P11FIND2.MLC/LOG to find hash table with max of 2 duplicate key searches per entry (table size found 3473 which has density of  25% for 856 given keys).  This solution saves 180k storage for 10% increase in instruction count.)
  • 01/18/08
  • 01/14/08
  • 01/06/08
    • P4APN2.MLC/LOG by Alfred Nykolya - counts sort using 853 instructions
  • 01/01/08
    • P10DSH1.MLC/LOG -by Don Higgins - using about 27 instructions and no loops
    • New problem #11 - Code hash table add and find routines for fast access by Don Higgins.
    • New problem #12 - Calculate the mean and standard deviation for a set of 500000 response times using a precision of .001. Assume each value may not exceed 1000 seconds- by Tony Matharu.
  • 12/30/07
    • P3LKM1.MLC/LOG by Lindy Mayfield - uses loop to convert 4 bytes at a time to hex
  • 12/27/07
    • P8LM1.MLC/LOG by Lindy Mayfield - using Rexx model solution series with all positive terms which converges to 33 significant digits in 49 iterations.  This solution modified for z390 using CTD library services to display trial values of Pi and the error from known value.  This solution also uses inline macros LX and STX to simplify loading and storing extended floating point values.
    • New problem #10 - Code instructions required to convert any unsigned 128 bit integer value in even/odd 64 bit general purpose register pair generated by MLG or MLGR instruction to EBCDIC decimal display character format using as few basic instructions as possible and no library services such as z390 CTD.  Note 2**127 has 39 significant digits, extended floating point only supports 34 significant digits, and packed decimal only supports 31 significant digits.  Please submit solutions using the ZMFACC macro for portability across platforms.  Submitted by Don Higgins University of South Florida
    • P4RJ1.MLC/LOG by Mats Broberg, Roland Johansson, and SEB Sweden - improved version of Quicksort using 685 instructions.
  • 12/23/07
    • P8MM1.MLC/LOG by Melvyn Maltz - using Gregory/Leibniz/Machin arctan series with alternating signs which converges to 33 significant digits in 7  iterations.  This solution modified for z390 using CTD library services to display trail values of Pi and the error from known value.
    • Update ZMFACC macro to include all 16 floating point register EQU's indicating pairs
    • P4RAFA2.MLC/LOG by Rafa Pereira - improved qucksort using 1380 instructions
  • 12/21/07
    • Update ZMFACC macro at 8 :00 EST to also display RUNSYS=??? at execution
    • P7EH1.MLC/LOG by John Erhman - using AW un-normalized add to align bits (See addition of alternate path  work around for z390 AW instruction bug (RPI 767) by DSH plus display of intermediate EH and DH calculated values via CTD for verification.)
  • 12/19/07
    • Update ZMFACC macro at 14:00 EST for Chris Langford and Rafa Pereira changes to correct MVS/ZOS SNAP headings and areas to be dumped, and truncate text lines to 72.
  • 12/18/07
    • New generalized version of ZMFACC for z390, MVS, z/OS, CMS, and VSE
      Thanks to Chris Langford for CMS version and Rafa Pereira for MVS version
      Updated again at 5 PM EST as follows:
      • Fixes for restrictions using IFOX00 per Rafa Pereira
      • Fixes to re-enable SYSPARM override to set environment externally, fixes for VSE to set base and save area and exit via EOJ macro call, and change target system keyword name to RUNSYS= per Chris Langford
  • 12/17/07
    • P4RAFA1.MLC/LOG by Rafa Pereira - quicksort of 20 elements using 1659 instr.
  • 12/16/07
  • 12/15/07
    • P9MM1.MLC/LOG by Melvyn Maltz - EDMK followed by MVI's for $ and ()
    • P4AN1.MLC/LOG by Alfred Nykolyn -shell sort sorts 20 elements using 1532 instr.
    • P1RAFA1.MLC/LOG by Rafa Pereira - swap 2 fields with 2 MVC's
  • 12/14/07
    • P6BR1.MLC/LOG by Bob Rutledge - 6 register instruction loop and single store
    • Mark Dixon added #9 - convert packed decimal to display characters with $ and credit
  • 12/12/07
  • 12/11/07
  • 12/10/07
    • P1C1.MLC/LOG by Chris - 3 XC instructions
    • P3MM1.MLC/LOG by Melvyn Maltz - single TROT (CC3 retry added per Michael Poil)

IBM, CICS, HLASM, MVS, OS/390, VSAM, z9, z10, and z/OS
 are registered trademarks  of International Business Machines Corporation

 
This page last updated Saturday August 07, 2010.   Webmaster 
Copyright 2008 Automated Software Tools Corporation